[CMake] enviroment variables (ice cream builds)

Miller Henry MillerHenry at JohnDeere.com
Wed Jun 19 12:32:31 EDT 2013


I'm experimenting with using a compiler other than my system compiler (gcc 4.4.3) on my linux system.  I've built gcc 4.7.2, and installed it. Everything works when I build only on my local system, but I have a large cluster of computers available on an ice cream (icecc) network that I can use to speed up compiles.  I am able to build a simple hello world on the command line with ice cream.  However cmake does something strange which means it thinks the compiler is broke.

I have found a work around, which means settings environment variables ICECC_CC, ICECC_CXX and ICECC_VERSION, and then use /usr/bin/icecc as the compiler.   However I want to set these once at cmake time and have them persists.  Tests show that this is not happening, while they are set I can build as expected.  However when I log out and return cmake/ice cream will use the system compiler the next time unless I remember to set these variables.  This is okay for tests, but I'm getting ready to spread this process to others and I know someone will forget to set the right environment variables and thus not use the compiler they want to use.  My question is how can I have cmake look at these variables and make sure they are set in my make/ninja files every time I build.

Note that while we can possibly consider it a bug in my system setup that I need to set ICECC_CC and ICECC_CXX; but ICECC_VERSION is something the user needs to set.  Thus I really want cmake to make sure this variable is set the same as the first run of cmake.

I'm using cmake 2.8.11




cmake -DCMAKE_C_COMPILER=/usr/lib/icecc/bin/gcc-4.8 -DCMAKE_CXX_COMPILER=/usr/lib/icecc/bin/g++-4.8 ../GSD
-- The C compiler identification is unknown
-- The CXX compiler identification is unknown
-- Check for working C compiler: /usr/lib/icecc/bin/gcc-4.8
CMake Error: your C compiler: "/usr/lib/icecc/bin/gcc-4.8" was not found.   Please set CMAKE_C_COMPILER to a valid compiler path or name.
CMake Error: Internal CMake error, TryCompile configure of cmake failed
-- Check for working C compiler: /usr/lib/icecc/bin/gcc-4.8 -- broken
CMake Error at /usr/share/cmake-2.8/Modules/CMakeTestCCompiler.cmake:61 (message):
  The C compiler "/usr/lib/icecc/bin/gcc-4.8" is not able to compile a simple
  test program.

  It fails with the following output:





  CMake will not be able to correctly generate this project.
Call Stack (most recent call first):
  CMakeLists.txt:19 (PROJECT)


CMake Error: your C compiler: "/usr/lib/icecc/bin/gcc-4.8" was not found.   Please set CMAKE_C_COMPILER to a valid compiler path or name.
CMake Error: your CXX compiler: "/usr/lib/icecc/bin/g++-4.8" was not found.   Please set CMAKE_CXX_COMPILER to a valid compiler path or name.
-- Configuring incomplete, errors occurred!




  CMake will not be able to correctly generate this project.
Call Stack (most recent call first):
  CMakeLists.txt:19 (PROJECT)


-- Configuring incomplete, errors occurred!



-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.cmake.org/pipermail/cmake/attachments/20130619/d2637349/attachment.htm>


More information about the CMake mailing list