[CMake] Error detecting sun studio compiler under linux

Brad King brad.king at kitware.com
Mon Oct 23 15:14:39 EDT 2006


Doug Henry wrote:
> 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:
[snip]
> -- Check for working CXX compiler: /opt/sun/sunstudiomars/bin/CC -- broken
[snip]
> /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

AFAIK no one has tried CMake with this compiler before.

CMake is invoking the compiler assuming that it accepts the flags other
Linux compilers (such as GNU and Intel) accept.  Nothing has told it
otherwise.  You'll have to setup a platform file to configure this
compiler.  Look in share/CMake/Modules/Platform for similar files.  For
this case there should be a file called Linux-CC.cmake that overrides
some of the settings in Linux.cmake.  Some of the settings in
Modules/CMakeCXXInformation.cmake may need to be overridden also.

If you get this working we'll include the files in upstream CMake to
make support for the compiler permanent.

FYI, supported platforms all have nightly testing:

http://public.kitware.com/dashboard.php?name=cmake

If a platform isn't here it probably doesn't work.

-Brad


More information about the CMake mailing list