Notes |
|
(0008794)
|
Bill Hoffman
|
2007-08-31 13:51
|
|
What source did you build from? |
|
|
(0008795)
|
pandaemonium
|
2007-08-31 15:24
|
|
|
|
(0009778)
|
Eddy Pronk
|
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
|
2007-12-13 16:03
|
|
|
|
(0009873)
|
Eddy Pronk
|
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
|
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
|
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
|
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
|
2007-12-15 03:25
|
|
I added a file with a test script reproducing the problem. |
|
|
(0009922)
|
pandaemonium
|
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
|
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
|
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
|
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
|
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
|
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
|
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
|
2007-12-16 16:17
|
|
Well done. This fix works. |
|