With the Intel compiler on Linux, prefer ifort for the final link step
authorMartin Kroeker <martin@ruby.chemie.uni-freiburg.de>
Thu, 14 Feb 2019 21:57:30 +0000 (22:57 +0100)
committerGitHub <noreply@github.com>
Thu, 14 Feb 2019 21:57:30 +0000 (22:57 +0100)
icc has known problems with mixed-language builds that ifort can handle just fine. Fixes #1956

exports/Makefile

index 3a5f77d..b1348bd 100644 (file)
@@ -141,6 +141,14 @@ else
        $(OBJCOPY) --redefine-syms objcopy.def ../$(LIBNAME) ../$(LIBNAME).renamed
 ../$(LIBSONAME) : ../$(LIBNAME).renamed linktest.c
 endif
+
+ifeq ($(F_COMPILER), INTEL)
+       $(FC) $(FFLAGS) $(LDFLAGS) -shared -o ../$(LIBSONAME) \
+       -Wl,--whole-archive $< -Wl,--no-whole-archive \
+       -Wl,-soname,$(INTERNALNAME) $(EXTRALIB)
+       $(CC) $(CFLAGS) $(LDFLAGS) -w -o linktest linktest.c ../$(LIBSONAME) $(FEXTRALIB) && echo OK.
+else
+
 ifneq ($(C_COMPILER), LSB)
        $(CC) $(CFLAGS) $(LDFLAGS) -shared -o ../$(LIBSONAME) \
        -Wl,--whole-archive $< -Wl,--no-whole-archive \
@@ -153,6 +161,7 @@ else
        -Wl,-soname,$(INTERNALNAME) $(EXTRALIB)
        $(FC) $(CFLAGS) $(LDFLAGS) -w -o linktest linktest.c ../$(LIBSONAME) $(FEXTRALIB) && echo OK.
 endif
+endif
        rm -f linktest
 
 endif