Benne, Kyle wrote:
Hello All,

I have been experimenting with CMake to compile a large Fortran
project with the Intel Fortran compiler ifort. I am having trouble
getting the executable to link with the static intel libraries, because
CMake is adding the linker flag "i_dynamic" and it is overriding my
--static-intel option.

I believe the i_dynamic flag is coming from
SET(CMAKE_SHARED_LIBRARY_LINK_Fortran_FLAGS "-i_dynamic") in the
Linux-Intel-Fortran module. In fact when I set
CMAKE_SHARED_LIBRARY_LINK_Fortran_FLAGS to an empty string in my
CMakeLists file, everything works as I expect. I have one ADD_EXECUTABLE
statement in my project. There are no libraries so why am I getting the
i_dynamic flag?

I think that flag is used so that the executable can link to shared libraries. It maybe the wrong flag. What is missing is a feature in CMake to ask for a static executable. Right now, you have to do hacks like what you are doing to create static only executables. Feel free to create a feature request for static linked executables.

-Bill
_______________________________________________
Powered by www.kitware.com

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Follow this link to subscribe/unsubscribe:
http://www.cmake.org/mailman/listinfo/cmake

Reply via email to