[CMake] Eclipse project and MKL libraries

Eric Noulard eric.noulard at gmail.com
Fri Apr 27 16:44:09 EDT 2012


2012/4/27 Giovanni Azua <bravegag at gmail.com>:
> Hello,
>
> I generate an Eclipse project from cmake using the command (I made the build directory sibling of my code directory):
> cmake -G "Eclipse CDT4 - Unix Makefiles" ../code
>
> I'm unable to run or debug the different targets from Eclipse. I get the following linking error, even though it compiles and executes just fine from command line:

What do you mean "executes just fine from the command line"?

> Linking CXX executable benchmark
> /usr/bin/cmake -E cmake_link_script CMakeFiles/benchmark.dir/link.txt --verbose=1
> /usr/bin/c++    -Wall -Wextra -Wshadow -Woverloaded-virtual  -g3 -ggdb3    CMakeFiles/benchmark.dir/test/benchmark.cc.o  -o benchmark -rdynamic libxxxxx.a libxxx_func_fw.a libqr_updates.a -lrt -lmkl_rt -liomp5 -limf -lgfortran -lquadmath
> /usr/bin/ld: cannot find -lmkl_rt
> /usr/bin/ld: cannot find -liomp5
> /usr/bin/ld: cannot find -limf
> collect2: ld returned 1 exit status
> make[2]: Leaving directory `/home/bravegag/code/fastcode_project/build'
> make[1]: Leaving directory `/home/bravegag/code/fastcode_project/build'
> make[2]: *** [benchmark] Error 1
> make[1]: *** [CMakeFiles/benchmark.dir/all] Error 2
> make: *** [all] Error 2
>
> I'm using the latest Eclipse C++ Indigo from the download page and working
> on Ubuntu 12.04 though I have the same problem in Mac OS X.

Looks like you are using
target_link_library in your CMakeLists.txt without using corresponding
find module
Could you give us an excerpt of your CMakeLists.txt?
Ij particular the CMake script corresponding to your "benchmark" executable.



-- 
Erk
Le gouvernement représentatif n'est pas la démocratie --
http://www.le-message.org


More information about the CMake mailing list