Changes in the current g95 mingw (gcc-4.1.2) build re: LIBRARY_PATH

15 views
Skip to first unread message

Doug

unread,
Sep 18, 2007, 7:33:52 PM9/18/07
to gg95
In response to a request by François-Xavier Coudert, that was sent to
Andy and myself and posted on the gfortran mailing list, I have built
the current g95-MinGW-41.exe package for Windows so that it uses a new
environment variable, G95_LIBRARY_PATH, in place of LIBRARY_PATH used
in previous builds. This allows the current build of g95 to work on
systems where gfortran is installed, or where other versions of g95
are installed.

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.

Reply all
Reply to author
Forward
0 new messages