#566 -L/path/to/library should go into library_LIBS
Metadata
Property | Value |
---|---|
Reported by | Jö Fahlke (jorrit@jorrit.de) |
Reported at | Jun 20, 2009 11:57 |
Type | Feature Request |
Version | Git (pre2.4) [autotools] |
Operating System | Unspecified / All |
Last edited by | Jö Fahlke (jorrit@jorrit.de) |
Last edited at | Nov 21, 2013 15:11 |
Closed by | Jö Fahlke (jorrit@jorrit.de) |
Closed at | Nov 21, 2013 15:11 |
Closed in version | 2.3 |
Resolution | Fixed |
Comment |
Description
The -L flag specifying library search paths should go into the SUPERLU_LIBS make variable, right before the -l flag(s) it sets the search path for. It should definitely not go into the SUPERLU_LDFLAGS variable.
Having the -L flags in LDFLAGS makes different third party libraries fight for control over the linker path, which may result in the wrong version of a library being linked (as happened to me). Adding $(SUPERLU_LDFLAGS) to program_LDADD is error prone (since you need to add $(SUPERLU_LIBS) anyway) and confusing (since there is a variable progname_LDFLAGS and other third party libraries might have a library_LDFLAGS variable which must be added to LDFLAGS instead of LDADD).
I picked SuperLU just as an example here, at least Alberta also does this wrong.
If nobody sees any drawback to this I will make the necessary changes to the autoconf macros and Makefile.am's (The changes in the Makefile.am's should only be cleanup, it should work without them as well, as long as nobody uses the LDFLAGS for their real purpose).