[CMake] Error detecting sun studio compiler under linux

Doug Henry develop at brilligent.com
Mon Oct 23 14:47:37 EDT 2006


I am trying to use the sun studio compiler under linux and I am having a
terrible time getting past the cmake compiler tests.  I'm not sure what the
error messages are telling me, but it looks like some incorrect flags are
being passed in.  I extracted the short test program from
CMakeTestCXXCompiler.cmake and it of course compiles/links just fine with
CC.  Output follows:

CC=cc CXX=CC /mnt/tools/bin/cmake --version
cmake version 2.4-patch 3
dhenry at beast:/tmp/cmake/build$ CC=cc CXX=CC /mnt/tools/bin/cmake ..
-- Check for working C compiler: /opt/sun/sunstudiomars/bin/cc
-- Check for working C compiler: /opt/sun/sunstudiomars/bin/cc -- works
-- Check size of void*
-- Check size of void* - done
-- Check for working CXX compiler: /opt/sun/sunstudiomars/bin/CC
-- Check for working CXX compiler: /opt/sun/sunstudiomars/bin/CC -- broken
CMake Error: Error in cmake code at
/mnt/tools/share/CMake/Modules/CMakeTestCXXCompiler.cmake:25:
MESSAGE The C++ compiler "/opt/sun/sunstudiomars/bin/CC" is not able to
compile a simple test program.
It fails with the following output:
 /usr/bin/make -f CMakeFiles/cmTryCompileExec.dir/build.make
CMakeFiles/cmTryCompileExec.dir/build
make[1]: Entering directory `/tmp/cmake/build/CMakeFiles/CMakeTmp'
/mnt/tools/bin/cmake -E cmake_progress_report
/tmp/cmake/build/CMakeFiles/CMakeTmp/CMakeFiles 1
Building CXX object CMakeFiles/cmTryCompileExec.dir/testCXXCompiler.o
/opt/sun/sunstudiomars/bin/CC    -o
CMakeFiles/cmTryCompileExec.dir/testCXXCompiler.o -c
/tmp/cmake/build/CMakeFiles/CMakeTmp/testCXXCompiler.cxx
Linking CXX executable cmTryCompileExec
/mnt/tools/bin/cmake -P
CMakeFiles/cmTryCompileExec.dir/cmake_clean_target.cmake
/opt/sun/sunstudiomars/bin/CC         -fPIC
"CMakeFiles/cmTryCompileExec.dir/testCXXCompiler.o"   -o cmTryCompileExec
-rdynamic
CC: Warning: Option -fPIC passed to ld, if ld is invoked, ignored otherwise
CC: Warning: Option -rdynamic passed to ld, if ld is invoked, ignored
otherwise
/usr/bin/ld: bad -rpath option
make[1]: *** [cmTryCompileExec] Error 1
make[1]: Leaving directory `/tmp/cmake/build/CMakeFiles/CMakeTmp'
make: *** [cmTryCompileExec/fast] Error 2


CMake will not be able to correctly generate this project.
Current CMake stack:
/tmp/cmake/CMakeLists.txt;/mnt/tools/share/CMake/Modules/CMakeCInformation.cmake;/mnt/tools/share/CMake/Modules/CMakeCXXInformation.cmake;/mnt/tools/share/CMake/Modules/CMakeTestCXXCompiler.cmake--
Configuring done
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://public.kitware.com/pipermail/cmake/attachments/20061023/86557bcf/attachment.htm


More information about the CMake mailing list