Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.
29276 Discussions

Linker changes from version 8.1 to 9.1 ?

reubendb1
Beginner
715 Views
Hello,
I recently updated my compiler from IFC 8.1 to IFC 9.1, and found out that when compiling my code I get a lot of "underfined reference ... " errors during linking. My code depends on other libraries such as HDF5, etc. I finally resolved the problem after re-arranging the linking ordering in my makefiles.
So is there changes in the linker behaviour from 8.1 to 9.1 that caused this ? Is this documented anywhere (I quickly scanned the release note for 9.1 but couldn't see it) ?

Thanks.
RDB
0 Kudos
3 Replies
Steven_L_Intel1
Employee
715 Views
On Linux, the linker is part of the OS/gcc and not the compiler, so I don't know how to explain what you saw. In general, linkers process libraries sequentially, and once all known references have been found in a library, it is closed and not revisited. If you have inter-library dependences, this can cause problems such as you saw depending on the order in which the linker saw things.
0 Kudos
reubendb
Beginner
715 Views
That is strange then. I've seen this on two machines now, both happened when I changed the IFC from 8.1 to 9.1, while the OS/gcc remains the same.
0 Kudos
Lorri_M_Intel
Employee
715 Views

While it is true that the linker stays the same, the compiler-driver (the utility that interprets the users commands, invokes the compiler then invokes the linker and anything else requested by the user, aka "ifort") certainly may have changed the list and/or order of libraries that it links against.

In other words, check to see if the order of the libraries is different between ifort v8.1 and ifort v9.1. You can do this with the undocumented (but useful) switch "-#x". That will echo to syserror the commands being passed to the compiler and linker. That may give you an idea of what changed.

- Lorri

0 Kudos
Reply