[CMake] [CMake BUG] CMake (2.8.12.2) adding extraneous libraries at the end of the link command

Zaak Beekman zbeekman at gmail.com
Mon Apr 14 17:30:24 EDT 2014


I have a mixed language project, most of which is in Fortran, but some of
it is in C. I have disabled C++ and enabled C and Fortran explicitly. I am
using the 32 bit Intel composer XE 13.1.0 2013 compilers (on a Linux x86_64
RHEL 5 Linux machine) and I am building static executables so that they can
be redistributed in binary form.

The problem is that the link step adds spurious (intel) libraries when
linking the executable. NONE of these libraries need to be linked against,
at least not when invoking the linker through ifort after properly
initializing the development environment through the compilervars.sh script
provided by Intel. Even worse, one of the libraries (lcilkrts) is not even
provided by intel as a static library causing the link step to fail. The
output of the makefile in VERBOSE mode for the link step is:

Linking Fortran executable passmap
cd /somedir/passmap/builds/intel32/src &&
/someotherdir/usr/cmake-2.8.12.2-Linux-i386/bin/cmake -E cmake_link_script
CMakeFiles/passmap.dir/link.txt --verbose=1
/opt/.opt.nfs/intel/composer_xe_2013.2.146/bin/ia32/ifort      -warn
-traceback -stand f08 -static-intel -static -O3
CMakeFiles/passmap.dir/passmap.f90.o
CMakeFiles/passmap.dir/fortran_pass.f90.o
CMakeFiles/passmap.dir/wrapgetch.f90.o CMakeFiles/passmap.dir/hashmod.f90.o
CMakeFiles/passmap.dir/mygetch.c.o  -o passmap   -lirng -ldecimal -lcilkrts
-lstdc++ -lirc
ld: cannot find -lcilkrts
make[2]: *** [src/passmap] Error 1
make[2]: Leaving directory `/somedir/passmap/builds/intel32'
make[1]: *** [src/CMakeFiles/passmap.dir/all] Error 2
make[1]: Leaving directory `/somedir/passmap/builds/intel32'
make: *** [all] Error 2

ABSOLUTELY NONE of the libraries need to be explicitly mentioned on the
link line. The executable will link with NONE of the -l flags present.

Where do I report this bug?

Is there a variable or property somewhere that I can set to prevent these
libraries from being passed to the linker? Any other work arounds?

Thanks,
Zaak

Izaak Beekman
===================================
(301)244-9367
Princeton University Doctoral Candidate
Mechanical and Aerospace Engineering
ibeekman at princeton.edu

UMD-CP Visiting Graduate Student
Aerospace Engineering
ibeekman at umiacs.umd.edu
ibeekman at umd.edu
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.cmake.org/pipermail/cmake/attachments/20140414/a2120d5d/attachment.html>


More information about the CMake mailing list