[CMake] Where to change default link line on Cmake

Brad King brad.king at kitware.com
Tue May 4 17:09:42 EDT 2010


Rene Salmon wrote:
> cmake version 2.8.1
[snip]
> Yes. It is xlc on Linux.

Prior to 2.8.1 CMake had a bug that led to use of -rdynamic with xlc
on Linux.  Are you sure that the "ccmake" that you're running is 2.8.1?

> I am doing and out of source build.  Something like this.
> hpci6001t(salmr0)54:mkdir build
> hpci6001t(salmr0)55:cd build/

Just to confirm, the source tree was pristine at this point, right?
There was no previous in-source build?

> hpci6001t(salmr0)56:ccmake ../CMakeLists.txt

FYI, this can simply be "cmake .." in your case.  You don't need to specify
the CMakeLists.txt file, just the directory containing it.

> xlc_r  -O3 -qhot   CMakeFiles/fd3ptr.dir/fd3ptr.c.o  -o fd3ptr -rdynamic
> xlc_r: 1501-216 (W) command option -dynamic is not recognized - passed to ld

The only occurrences "-rdynamic" in the CMake 2.8.1 source tree are:

Modules/Platform/Linux-GNU.cmake:  set(CMAKE_SHARED_LIBRARY_LINK_${lang}_FLAGS "-rdynamic")
Modules/Platform/Linux-Intel.cmake:  set(CMAKE_SHARED_LIBRARY_LINK_${lang}_FLAGS "-rdynamic")

These files should be loaded only for GNU and Intel compilers.
Did the initial run of CMake report the compiler id?  It may
not have been visible for long if you used the curses dialog.
Try running the command-line cmake:

 $ rm -rf build
 $ mkdir build
 $ cd build
 $ cmake ..

to see if it reports the compiler id.

-Brad


More information about the CMake mailing list