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

Library search order

Dan_S_3
Beginner
470 Views
How do I specify the order in which libraries are searched at link time for an unsatisfied external (subroutine)?

Using Microsoft Visual Studio 2005 version 8 and Intel Fortran 10.2.x

Specifically, we have a program requiring two large libraries. Since some of these subroutines in these libraries have the same name we need to choose which library we want to search first.

0 Kudos
2 Replies
TimP
Honored Contributor III
470 Views

we have a program requiring two large libraries. Since some of these subroutines in these libraries have the same name we need to choose which library we want to search first.

I expect you would have to make an edited library copy to eliminate duplicates.
0 Kudos
Steven_L_Intel1
Employee
470 Views

Well, there's no way to guarantee the order. The linker will search libraries specified in the "Additional dependencies" property on the Linker page in that order, but it may revisit them as needed. What you can't do is tell the linker to get only routine X from library A and ignore routine Y also in library A.

What you might do is have a pre-build step that extracts the desired objects from the libraries and builds a special library with just the combination you want.
0 Kudos
Reply