View Issue Details [ Jump to Notes ] | [ Print ] | ||||||||
ID | Project | Category | View Status | Date Submitted | Last Update | ||||
0005638 | CMake | CMake | public | 2007-08-31 08:27 | 2008-09-11 14:43 | ||||
Reporter | pandaemonium | ||||||||
Assigned To | Bill Hoffman | ||||||||
Priority | normal | Severity | major | Reproducibility | always | ||||
Status | closed | Resolution | fixed | ||||||
Platform | OS | OS Version | |||||||
Product Version | |||||||||
Target Version | Fixed in Version | ||||||||
Summary | 0005638: cmake 2.4.7 package for SunOS Sparc has issues with CMAKE_INSTALL_PREFIX | ||||||||
Description | short story: I just wanted to report that http://www.cmake.org/files/v2.4/cmake-2.4.7-SunOS-sparc.tar.gz [^] seems to be broken. The package seems to have issues with propagating CMAKE_INSTALL_PREFIX beyond the first CMakeCache.txt entry. After bootstrapping and installing cmake 2.4.7 from source myself everything was working like a charm. long story: the command issued: cmake -D CMAKE_INSTALL_PREFIX=/my/target/path/ .. the results: - CMAKE_INSTALL_PREFIX being properly set in CMakeCache.txt - cmake_install.cmake unfortunatly only defines this: IF(NOT DEFINED CMAKE_INSTALL_PREFIX) SET(CMAKE_INSTALL_PREFIX "") ENDIF(NOT DEFINED CMAKE_INSTALL_PREFIX) - all other variables in CMakeCache.txt that are dependant upon CMAKE_INSTALL_PREFIX only recognize an empty string is the value of the variable. Solution: using the provided backage I were able to bootstrap, compile and install (even in the correct defined prefix) cmake 2.4.7 myself - and were surprised to realise the forementioned bug has disappeared... | ||||||||
Additional Information | uname -a SunOS 5.10 Generic_125100-10 sun4u sparc SUNW,Sun-Fire-880 | ||||||||
Tags | No tags attached. | ||||||||
Attached Files | cmake-issue-5638.tar.gz [^] (8,590 bytes) 2007-12-15 03:24 | ||||||||
Relationships | |
Relationships |
Notes | |
(0008794) Bill Hoffman (manager) 2007-08-31 13:51 |
What source did you build from? |
(0008795) pandaemonium (reporter) 2007-08-31 15:24 |
I built the functional 2.4.7 version from those sources: http://www.cmake.org/files/v2.4/cmake-2.4.7.tar.gz. [^] |
(0009778) Eddy Pronk (reporter) 2007-11-28 16:19 |
I'm running 2.4.7 on Solaris 10 and I get the following -bash-3.00$ cmake . ../src -DCMAKE_INSTALL_PREFIX="stage" -- Check for working C compiler: /opt/SUNWspro/bin/cc -- Check for working C compiler: /opt/SUNWspro/bin/cc -- works -- Check size of void* -- Check size of void* - done -- Check for working CXX compiler: /opt/SUNWspro/bin/CC -- Check for working CXX compiler: /opt/SUNWspro/bin/CC -- works -- Configuring done -- Generating done -- Build files have been written to: /home/ejp/cmake/build -bash-3.00$ make install Scanning dependencies of target hello [100%] Building CXX object CMakeFiles/hello.dir/hello.o Linking CXX executable hello [100%] Built target hello Install the project... -- Install configuration: "" -- Installing CMAKE_INSTALL_PREFIX/bin/hello -- Installing CMAKE_INSTALL_PREFIX/bin/start_hello.sh Installing creates a directory called CMAKE_INSTALL_PATH -bash-3.00$ find CMAKE_INSTALL_PREFIX CMAKE_INSTALL_PREFIX CMAKE_INSTALL_PREFIX/bin CMAKE_INSTALL_PREFIX/bin/hello CMAKE_INSTALL_PREFIX/bin/start_hello.sh -bash-3.00$ cat ../src/CMakeLists.txt INCLUDE(CPack) ADD_EXECUTABLE(hello hello.cpp) INSTALL(TARGETS hello DESTINATION bin) INSTALL(PROGRAMS start_hello.sh DESTINATION bin) # end |
(0009871) Bill Hoffman (manager) 2007-12-13 16:03 |
Can one/both of you try this version and see if it works: http://www.cmake.org/files/v2.4/cmake-2.4.8-RC-4-SunOS-sparc.tar.gz [^] Thanks. |
(0009873) Eddy Pronk (reporter) 2007-12-14 06:34 |
I tried your binary. Can reproduce the problem. Gives identical output. Files get installed in directory called CMAKE_INSTALL_PATH. |
(0009874) Bill Hoffman (manager) 2007-12-14 09:00 |
Well, it must be something to do with the run time libraries I am building with on the sun we have here... It of course works on the machine I build it on. You say that if you build from source it works right? What is the value for CMAKE_INSTALL_PATH in your CMakeCache.txt? |
(0009914) Eddy Pronk (reporter) 2007-12-14 17:10 |
I build the RC4 from source. Same result. cmake_install.cmake on Solaris: # Set the install prefix IF(NOT DEFINED CMAKE_INSTALL_PREFIX) SET(CMAKE_INSTALL_PREFIX "CMAKE_INSTALL_PREFIX") <= wrong value! ENDIF(NOT DEFINED CMAKE_INSTALL_PREFIX) STRING(REGEX REPLACE "/$" "" CMAKE_INSTALL_PREFIX "${CMAKE_INSTALL_PREFIX}") CMakeCache.txt : //Install path prefix, prepended onto install directories. CMAKE_INSTALL_PREFIX:PATH=/home/ejp/cmake/build/stage cmake_install.cmake on Linux: # Set the install prefix IF(NOT DEFINED CMAKE_INSTALL_PREFIX) SET(CMAKE_INSTALL_PREFIX "/home/epronk/src/cmake-2.4.8-RC-4/bug/build/stage") ENDIF(NOT DEFINED CMAKE_INSTALL_PREFIX) STRING(REGEX REPLACE "/$" "" CMAKE_INSTALL_PREFIX "${CMAKE_INSTALL_PREFIX}") CMakeCache.txt : //Install path prefix, prepended onto install directories. CMAKE_INSTALL_PREFIX:PATH=/home/epronk/src/cmake-2.4.8-RC-4/bug/build/stage |
(0009915) Bill Hoffman (manager) 2007-12-14 20:20 |
Now I am confused... This whole thread started with: "After bootstrapping and installing cmake 2.4.7 from source myself everything was working like a charm." Now you are saying that when you build from source it fails? What works and what does not work? |
(0009920) Eddy Pronk (reporter) 2007-12-15 03:25 |
I added a file with a test script reproducing the problem. |
(0009922) pandaemonium (reporter) 2007-12-15 05:04 |
Hello Bill, I finally found the time to test the release candidate and unfortunatly I exposes the same behaviour as the previous version. The pre-built binary fails to set values in cmake_install.cmake, grabing the release candidate source tarball from the obvious URL and building a binary myself produces a flawlessly working binary. precompiled RC4: # Set the install prefix IF(NOT DEFINED CMAKE_INSTALL_PREFIX) SET(CMAKE_INSTALL_PREFIX "") ENDIF(NOT DEFINED CMAKE_INSTALL_PREFIX) STRING(REGEX REPLACE "/$" "" CMAKE_INSTALL_PREFIX "${CMAKE_INSTALL_PREFIX}") self-built RC4: # Set the install prefix IF(NOT DEFINED CMAKE_INSTALL_PREFIX) SET(CMAKE_INSTALL_PREFIX "/my/target/path") ENDIF(NOT DEFINED CMAKE_INSTALL_PREFIX) STRING(REGEX REPLACE "/$" "" CMAKE_INSTALL_PREFIX "${CMAKE_INSTALL_PREFIX}") (the trailing slash seems to have been trunkated from the target path I entered but I'M currently unsure if this is intentional or not) Does the build process at any stage rely upon sed to replace values or is everything done with cmake internals |
(0009923) Eddy Pronk (reporter) 2007-12-15 07:55 |
This is what the stack looks like at the moment it sets CMAKE_INSTALL_PREFIX to the value HELPSTRING: [5] cmMakefile::AddDefinition(this = 0x42c330, name = 0x4539d8 "CMAKE_INSTALL_PREFIX", value = 0x451238 "HELPSTRING"), lin\ e 1212 in "cmMakefile.cxx" =>[6] cmMakefile::AddCacheDefinition(this = 0x42c330, name = 0x4539d8 "CMAKE_INSTALL_PREFIX", value = 0x453a98 "/usr/local",\ doc = 0x454080 "Install path prefix, prepended onto install directories.", type = PATH), line 1265 in "cmMakefile.cxx" [7] cmSetCommand::InitialPass(this = 0x449bc0, args = CLASS), line 153 in "cmSetCommand.cxx" [8] cmCommand::InvokeInitialPass(this = 0x449bc0, args = CLASS), line 66 in "cmCommand.h" [9] cmMakefile::ExecuteCommand(this = 0x42c330, lff = STRUCT), line 337 in "cmMakefile.cxx" |
(0009925) Bill Hoffman (manager) 2007-12-15 10:05 |
OK, pandaemonium what compiler are you using to build? Since when epronk builds it, it has the same problem as when I build it. epronk, can you try changing the code to this: std::string saveValue;// add this if(!it.IsAtEnd() && (it.GetType() == cmCacheManager::UNINITIALIZED) && it.Initialized()) { .... this->GetCacheManager()->AddCacheEntry(name, nvalue.c_str(), doc, type); val = it.GetValue(); saveValue = val; // add this } } this->GetCacheManager()->AddCacheEntry(name, val, doc, type); this->AddDefinition(name, saveValue.c_str()); // change here |
(0009939) Eddy Pronk (reporter) 2007-12-16 01:12 |
With your change I get: CMake Error: CMake was unable to find a build program corresponding to "Unix Makefiles". CMAKE_MAKE_PROGRAM is not set. Yo\ u probably need to select a different build tool. CMake Error: Error required internal CMake variable not set, cmake may be not be built correctly. Missing variable is: CMAKE_C_COMPILER_ENV_VAR ..... |
(0009940) Eddy Pronk (reporter) 2007-12-16 07:38 |
I added some logging here : void cmMakefile::AddCacheDefinition(const char* name, const char* value, const char* doc, cmCacheManager::CacheEntryType type) .... info << __FILE__ << ":" << __LINE__ << " " << (void*) val << " " << val << std::endl; this->GetCacheManager()->AddCacheEntry(name, val, doc, type); assert(std::string(val) != std::string("HELPSTRING")); this->AddDefinition(name, val); /home/ejp/dev/cmake-2.4.8-RC-4/Source/cmMakefile.cxx:1294 452e78 NO /home/ejp/dev/cmake-2.4.8-RC-4/Source/cmMakefile.cxx:1294 454f58 FALSE /home/ejp/dev/cmake-2.4.8-RC-4/Source/cmMakefile.cxx:1294 456568 ON /home/ejp/dev/cmake-2.4.8-RC-4/Source/cmMakefile.cxx:1294 4559d0 /home/ejp/cmake-issue-5638/build/stage [3] abort(0xffbfcc88, 0x1, 0xff069288, 0xa8390, 0xff06b298, 0x0), at 0xfefbfff8 [4] __assert(0x3adea1, 0x3adeee, 0x4d4, 0x4559d0, 0xa80ac, 0x3f930c), at 0xfefc0234 =>[5] cmMakefile::AddDefinition(this = 0x430998, name = 0x458160 "CMAKE_INSTALL_PREFIX", value = 0x4559d0 "HELPSTRING"), lin\ e 1236 in "cmMakefile.cxx" [6] cmMakefile::AddCacheDefinition(this = 0x430998, name = 0x458160 "CMAKE_INSTALL_PREFIX", value = 0x458220 "/usr/local",\ doc = 0x458808 "Install path prefix, prepended onto install directories.", type = PATH), line 1300 in "cmMakefile.cxx" [7] cmSetCommand::InitialPass(this = 0x44e340, args = CLASS), line 156 in "cmSetCommand.cxx" The address 4559d0 appears in the log and in the stack trace. So, one moment it has the right value, and then it gets overwritten, which doesn't make sense because if supposed to be 'const'. It looks like something on the stack gets overwritten. If I add logging to cmMakefile::AddDefinition this changes the behaviour. (can't find matching addresses in the stack trace) This could be another Sun C++ compiler bug, but they are hard to prove. |
(0009941) pandaemonium (reporter) 2007-12-16 08:33 |
Hi Bill. I just checked what bootstrap picks up: CMake 2.4-8, Copyright (c) 2006 Kitware, Inc., Insight Consortium C compiler on this system is: cc C++ compiler on this system is: g++ Makefile processor on this system is: gmake g++ is GNU compiler pandaemonium: (~/cmake-2.4.8-RC-4): cc -V cc: Sun C 5.9 SunOS_sparc 2007/05/03 pandaemonium (~/cmake-2.4.8-RC-4): g++ -v Thread model: posix gcc version 3.4.3 (csl-sol210-3_4-branch+sol_rpath) So it seems like I'm using Solaris C compiler for classic C code and the GNU C++ compiler (aka gcc+) for C++ stuff. Sounds like a weird mixture to me - but it seems to work. |
(0009943) Bill Hoffman (manager) 2007-12-16 09:41 |
OK, I think I know what is going on here. The sun compiler is doing something a bit different than g++. This should fix it: } std::string savevalue = val; this->GetCacheManager()->AddCacheEntry(name, val, doc, type); this->AddDefinition(name, savevalue.c_str()); val points to the contents of a cache iterator. The iterator must get invalidated by the AddCacheEntry call. So, if we copy it before the call it should be good. |
(0009945) Eddy Pronk (reporter) 2007-12-16 16:17 |
Well done. This fix works. |
Notes |
Issue History | |||
Date Modified | Username | Field | Change |
2007-08-31 08:27 | pandaemonium | New Issue | |
2007-08-31 13:51 | Bill Hoffman | Note Added: 0008794 | |
2007-08-31 15:24 | pandaemonium | Note Added: 0008795 | |
2007-10-12 11:01 | Bill Hoffman | Status | new => assigned |
2007-10-12 11:01 | Bill Hoffman | Assigned To | => Bill Hoffman |
2007-11-28 16:19 | Eddy Pronk | Note Added: 0009778 | |
2007-12-13 16:03 | Bill Hoffman | Note Added: 0009871 | |
2007-12-14 06:34 | Eddy Pronk | Note Added: 0009873 | |
2007-12-14 09:00 | Bill Hoffman | Note Added: 0009874 | |
2007-12-14 17:10 | Eddy Pronk | Note Added: 0009914 | |
2007-12-14 20:20 | Bill Hoffman | Note Added: 0009915 | |
2007-12-15 03:24 | Eddy Pronk | File Added: cmake-issue-5638.tar.gz | |
2007-12-15 03:25 | Eddy Pronk | Note Added: 0009920 | |
2007-12-15 05:04 | pandaemonium | Note Added: 0009922 | |
2007-12-15 07:55 | Eddy Pronk | Note Added: 0009923 | |
2007-12-15 10:05 | Bill Hoffman | Note Added: 0009925 | |
2007-12-16 01:12 | Eddy Pronk | Note Added: 0009939 | |
2007-12-16 07:38 | Eddy Pronk | Note Added: 0009940 | |
2007-12-16 08:33 | pandaemonium | Note Added: 0009941 | |
2007-12-16 09:41 | Bill Hoffman | Note Added: 0009943 | |
2007-12-16 16:17 | Eddy Pronk | Note Added: 0009945 | |
2008-09-11 14:43 | Bill Hoffman | Status | assigned => closed |
2008-09-11 14:43 | Bill Hoffman | Resolution | open => fixed |
Issue History |
Copyright © 2000 - 2018 MantisBT Team |