[CMake] Eclipse project and MKL libraries

Eric Noulard eric.noulard at gmail.com
Thu May 3 01:54:04 EDT 2012


2012/5/3 Giovanni Azua <bravegag at gmail.com>:
> Hi Eric,
>
> Thank you, it is solved now. I got working Eclipse project in Mac OS X and
> Ubuntu 12.04.
>
> On Apr 30, 2012, at 3:30 PM, Eric Noulard wrote:
>
> Did you try starting eclipse from the same command line (in order to
> make eclipse inherit the environment setup you have in that command
> line) and compiling in eclipse?
>
>
> I did and it works, very nice! thank you.

Then this means that in some way you (or the system) do play with

LD_LIBRARY_PATH (Linux)
DYLD_LIBRARY_PATH (MacOS) -- not sure for this one because I'm not a Mac S user.


> I checked and there are no differences in the output of FindMKL.cmake for
> Linux & Mac OS X. I send the script attached.

Right, but the script gives you bad (or unexplained) advice

# Usage example:
#   set(MKL_USE_STATIC_LIBS ON)
#   find_package(MKL)
#   if (MKL_FOUND)
#      include_directories(${MKL_INCLUDE_DIRS})
#      link_directories(${MKL_LIBRARY_DIRS})
#      add_executable(foo foo.cc)
#      target_link_libraries(foo ${MKL_LIBRARIES})
#   endif()

you should be:

# Usage example:
#   set(MKL_USE_STATIC_LIBS ON)
#   find_package(MKL)
#   if (MKL_FOUND)
#      include_directories(${MKL_INCLUDE_DIRS})
#      add_executable(foo foo.cc)
#      target_link_libraries(foo ${MKL_LIBRARIES})
#   endif()

Like I said before using link_directories is usually an error.
If you get link error without it then MKL_LIBRARIES may not have been
built correctly.

That said if it works for you all is well but be aware that you can
get unwanted (or unexpected)
behavior when using link_directories.


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


More information about the CMake mailing list