[CMake] Linking with intel (icc/icpc) VTK libraries using gnu (g++/ar)

jmerkow jmerkow at gmail.com
Mon Jan 27 17:25:11 EST 2014


Hello,

I am working on migrating from for an established project make to cmake, and
I have an interesting problem. 

Some of the precompiled libraries are compiled using intel compilers and
some are compiled using g++. Since icc is licensed and harder to get we have
been using g++ and linking with the intel libraries (build using makefiles).

Now, we are moving to CMake I am trying to accomplish the same thing. To
test this, I am trying to compile the project using the an intel compiled
VTK library (i.e. VTK was compiled with icc/icpc) and while linking and
compiling the rest of the application using gnu, (ar, g++, etc). The intel
libraries need for this are libirc, libimf, libsvml.  I have these
libraries, but they do not seem to be linking properly, or I am missing a
step in this process.

I am doing this with a loop which finds the path for each of the libraries,
adds them and concatenates them to the libraries list.  This what a single
iteration looks like (I pulled it out of the loop for readability)

set(lib "irc") #(this is actually set by a loop)
set(IntelCompilerLibrary_LIBRARY "/full/path/to/libirc.so") #(this is
actually set by a loop)

add_library(${lib} UNKNOWN IMPORTED)
set_property(TARGET ${lib} PROPERTY IMPORTED_LOCATION
"${IntelCompilerLibrary_LIBRARY}")

SET(IntelCompilerLibrary_LIBRARIES ${IntelCompilerLibrary_LIBRARIES}
"${lib}")

I believe that I am adding the precompiled libraries correctly according to
the wiki
(http://www.cmake.org/Wiki/CMake/Tutorials/Exporting_and_Importing_Targets),
but I continue to get undefined references to the intel methods.

Any help is much appreciated!!






--
View this message in context: http://cmake.3232098.n2.nabble.com/Linking-with-intel-icc-icpc-VTK-libraries-using-gnu-g-ar-tp7586614.html
Sent from the CMake mailing list archive at Nabble.com.


More information about the CMake mailing list