Notes |
|
(0034228)
|
Brad King
|
2013-10-23 15:24
(edited on: 2013-10-23 15:25) |
|
Is this patch sufficient?
diff --git a/Modules/Platform/Linux-Intel-Fortran.cmake b/Modules/Platform/Linux-Intel-Fortran.cmake
index bb671ee..0c9523c 100644
--- a/Modules/Platform/Linux-Intel-Fortran.cmake
+++ b/Modules/Platform/Linux-Intel-Fortran.cmake
@@ -1,4 +1,4 @@
include(Platform/Linux-Intel)
__linux_compiler_intel(Fortran)
-set(CMAKE_SHARED_LIBRARY_CREATE_Fortran_FLAGS "${CMAKE_SHARED_LIBRARY_CREATE_Fortran_FLAGS} -i_dynamic -nofor_main")
-set(CMAKE_SHARED_LIBRARY_LINK_Fortran_FLAGS "-i_dynamic")
+set(CMAKE_SHARED_LIBRARY_CREATE_Fortran_FLAGS "${CMAKE_SHARED_LIBRARY_CREATE_Fortran_FLAGS} -nofor_main")
+set(CMAKE_SHARED_LIBRARY_LINK_Fortran_FLAGS "")
|
|
|
(0034229)
|
Brad King
|
2013-10-23 15:27
|
|
|
|
(0034230)
|
Izaak Beekman
|
2013-10-23 18:52
|
|
I'm going to look into setting up a Linux Intel compiler dashboard submission.
As far as your first comment is concerned: Where are the fortran compile and link rules built up? Why is CMAKE_SHARED_LIBRARY_LINK_Fortran_FLAGS added when linking a Fortran executable? (I also seem to get some other spurious, although harmless -L flags).
I am trying to build a redistributable Linux binary, so static linking is crucial, but -i_dynamic prevents this. |
|
|
(0034233)
|
Brad King
|
2013-10-24 09:27
|
|
Re 0014507:0034230: It would be great to have nightly testing for this compiler, thanks.
The CMAKE_SHARED_LIBRARY_LINK_<LANG>_FLAGS are used when creating a target that might link *to* a shared library. This is needed on some platforms to link executables to the shared runtime library, for example. CMake always passes this flag when linking an executable because it does not know if a -lfoo might find a shared library. This is historical.
Currently there is no first-class support for linking an executable statically. However, I know many people have gotten it working for local builds creating redistributable packages. |
|
|
(0034234)
|
Brad King
|
2013-10-24 09:37
|
|
|
|
(0034244)
|
Izaak Beekman
|
2013-10-25 13:18
|
|
From digging around, it seems like -i_dynamic is equivalent to -shared-intel. I'm going to double check this on the Intel Forums. AFAIK, there is no need to request dynamic linking against the Intel runtime fortran library, even when compiling an executable binary that links against other dynamic libraries. It might make sense to do so for a MinSizeRel build, but I don't think this should be the default. I'm going to double check all of this with the folks at Intel and report back. |
|
|
(0034246)
|
Brad King
|
2013-10-25 14:58
|
|
Re 0014507:0034244: Thanks. If it isn't needed for a basic build to work then we probably shouldn't add it by default at all. We have plenty of interfaces for users and project code to add flags when they want them. |
|
|
(0034289)
|
Izaak Beekman
|
2013-10-29 15:48
|
|
Removing -i_dynamic is definitely the correct thing to do. Deprecated AND completely unnecessary.
Also noteworthy is that the compiler gives precedent to the rightmost options. I'm somewhat surprised that the options setup by CMake are added to the right of the user's options. This might be worth changing. |
|
|
(0035302)
|
Robert Maynard
|
2014-03-05 09:58
|
|
Closing resolved issues that have not been updated in more than 4 months |
|