Doug
Original message follows:
g95 mingw installer sets LIBRARY_PATH?
* From: "François-Xavier Coudert" <fxcoudert at gmail dot com>
* To: tcc at sentex dot net, andyv at firstinter dot net
* Cc: "fortran at gcc dot gnu dot org" <fortran at gcc dot gnu dot
org>
* Date: Tue, 11 Sep 2007 19:15:18 +0100
* Subject: g95 mingw installer sets LIBRARY_PATH?
Hi Doug, hi Andy,
Following on a bug-report by a user, I have looked at the Windows
installer for g95 and discovered that it prompts the user about
setting the LIBRARY_PATH to the g95 library directory. Setting this
environment variable impacts the behaviour of the GCC driver (by
passing -L$LIBRARY_PATH to the linker), both in g95 and gfortran. In
particular, it means that any other GCC (and gfortran) installation
will start linking to libraries in the g95 lib directory.
In my case, this causes a problem because the mingw runtime we
currently distribute is more recent than yours, but the one that comes
with g95 is still prefered because it's in LIBRARY_PATH. I'm not sure
exactly why setting LIBRARY_PATH is an advantage in your case (the GCC
driver finds its own libraries without doing it, but there might be
another use that I'm not aware of), but it currently means that two
different installs of g95 and gcc cannot coexist, which is a bit
unfortunate for users. Among the possible solutions I see, could you
either inform users of this consequence of setting LIBRARY_PATH, not
set it at all, or use a different environment variable name, like
G95_LIBRARY_PATH. [1]
Thanks for considering this issue,
FX
[1] This last option is probably as simple as changing a
#define LIBRARY_PATH_ENV "LIBRARY_PATH"
into a
#define LIBRARY_PATH_ENV "G95_LIBRARY_PATH"
in gcc/collect2.c and gcc/gcc.c.