[GRASS-dev] configure fails

Trying to compile under mingw, I get the following error during configure:

"checking whether the Fortran 77 compiler (gfortran
-Wl,--export-dynamic,--enable-runtime-pseudo-reloc) works... no
configure: error: installation or configuration problem: Fortran 77
compiler cannot create executables"

I see that this is related to Brad's and Markus' changes of today. Does
this mean that the fortran compiler in mingw is not sufficient ? Or is
this an error in the configure file ? Also, do I absolutely need a fortran
complier ?
For what ?

Reverting to the previous versions of configure.in and configure it runs
without a problem.

Moritz

Moritz Lennert-2 wrote:

Trying to compile under mingw, I get the following error during configure:

"checking whether the Fortran 77 compiler (gfortran
-Wl,--export-dynamic,--enable-runtime-pseudo-reloc) works... no
configure: error: installation or configuration problem: Fortran 77
compiler cannot create executables"

I see that this is related to Brad's and Markus' changes of today. Does
this mean that the fortran compiler in mingw is not sufficient ? Or is
this an error in the configure file ? Also, do I absolutely need a fortran
complier ?
For what ?

Reverting to the previous versions of configure.in and configure it runs
without a problem.

Moritz

Can you post the config.log somewhere? Otherwise we (Brad)
cannot figure out the problem.
It should certainly also work without Fortran compiler (did
you activate it?).

The changes are needed for the upcoming GPDE and gmath
consolidation.

Markus
--
View this message in context: http://www.nabble.com/configure-fails-tf4505468.html#a12850014
Sent from the Grass - Dev mailing list archive at Nabble.com.

On Sun, 2007-09-23 at 20:59 +0200, Moritz Lennert wrote:

Trying to compile under mingw, I get the following error during configure:

"checking whether the Fortran 77 compiler (gfortran
-Wl,--export-dynamic,--enable-runtime-pseudo-reloc) works... no
configure: error: installation or configuration problem: Fortran 77
compiler cannot create executables"

Please send me your config.log. It looks like you may have specified
'--with-g77' and it detected 'gfortran'. Try using '--with-gfortran'
instead?

I see that this is related to Brad's and Markus' changes of today. Does
this mean that the fortran compiler in mingw is not sufficient ? Or is
this an error in the configure file ? Also, do I absolutely need a fortran
complier ?
For what ?

For now, no, you don't need a working Fortran compiler.

Fortran is required for certain versions of BLAS/LAPACK. There are
other equivalents that may be more forgiving like ATLAS, PhiPACK,
CBLAS/CLAPACK.

My changes were meant to expand BLAS/LAPACK detection. It should detect
traditional BLAS/LAPACK, CBLAS/CLAPACK, ATLAS, PhiPACK, and Apple's
compatible vector library.

Parts of lib/gmath and modules may eventually rely on some form of
BLAS/LAPACK being installed. This is an effort to consolidate linear
algebra code spread throughout GRASS, remove Numerical Recipies code,
provide a better API, and deliver performance enhancements.

Code not requiring BLAS/LAPACK is also being investigated, but may not
support all functions.

--
Brad Douglas <rez touchofmadness com> KB8UYR/6
Address: 37.493,-121.924 / WGS84 National Map Corps #TNMC-3785

Brad Douglas wrote:

> I see that this is related to Brad's and Markus' changes of today. Does
> this mean that the fortran compiler in mingw is not sufficient ? Or is
> this an error in the configure file ? Also, do I absolutely need a fortran
> complier ?
> For what ?

For now, no, you don't need a working Fortran compiler.

Fortran is required for certain versions of BLAS/LAPACK. There are
other equivalents that may be more forgiving like ATLAS, PhiPACK,
CBLAS/CLAPACK.

My changes were meant to expand BLAS/LAPACK detection. It should detect
traditional BLAS/LAPACK, CBLAS/CLAPACK, ATLAS, PhiPACK, and Apple's
compatible vector library.

Unfortunately, it reduces detection rather than expanding it.

The following changes need to be made:

1. --with-gfortran should default to "no". The only things which
should default to yes are those which most users will have and want.

We adopted this behaviour because, otherwise, users would fail to
notice the warning about e.g. libpng not being found and then posted
to the list asking "where is the PNG driver?"

Features that most users won't care about don't need this treatment.
It just means that the user has to go back and re-run configure with
an extra --without-* switch.

2. Failure to locate cblas.h and/or clapack.h must not cause a fatal
configure error.

I don't have these files, but --with-blas and --with-lapack worked
fine until the latest changes.

LOC_CHECK_INCLUDES() can take a fourth argument comprising code to be
executed if the check fails. If no such argument is given, a fatal
error is generated.

3. --with-g77 should not be required to detect g2c.h/f2c.h or -lg2c.

Again, I never needed this before.

I'm not actually compiling any Fortran code, just C code which uses a
library written in Fortran; this doesn't require a Fortran compiler.

It may require some support files (header, library) which are normally
installed with the Fortran compiler, but those can (and should) be
detected as with any header or library. There's no need to check for a
Fortran compiler unless you're actually going to be compiling Fortran
code.

For now, I've reverted my local configure[.in] to the previous version
to eliminate the regressions. Unless some other fix is found, I intend
to commit the reversions.

--
Glynn Clements <glynn@gclements.plus.com>

On Thu, 2007-09-27 at 15:26 +0100, Glynn Clements wrote:

Brad Douglas wrote:

> > I see that this is related to Brad's and Markus' changes of today. Does
> > this mean that the fortran compiler in mingw is not sufficient ? Or is
> > this an error in the configure file ? Also, do I absolutely need a fortran
> > complier ?
> > For what ?
>
> For now, no, you don't need a working Fortran compiler.
>
> Fortran is required for certain versions of BLAS/LAPACK. There are
> other equivalents that may be more forgiving like ATLAS, PhiPACK,
> CBLAS/CLAPACK.
>
> My changes were meant to expand BLAS/LAPACK detection. It should detect
> traditional BLAS/LAPACK, CBLAS/CLAPACK, ATLAS, PhiPACK, and Apple's
> compatible vector library.

Unfortunately, it reduces detection rather than expanding it.

Aside from the issues you mention, it actually does expand detection.

The following changes need to be made:

1. --with-gfortran should default to "no". The only things which
should default to yes are those which most users will have and want.

I'm under the impression that most users have upgraded to GCC >= 4.x.
The reason that the option exists at all is because of autoconf-2.13
limitations.

Suggestions are welcome.

We adopted this behaviour because, otherwise, users would fail to
notice the warning about e.g. libpng not being found and then posted
to the list asking "where is the PNG driver?"

Features that most users won't care about don't need this treatment.
It just means that the user has to go back and re-run configure with
an extra --without-* switch.

2. Failure to locate cblas.h and/or clapack.h must not cause a fatal
configure error.

I don't have these files, but --with-blas and --with-lapack worked
fine until the latest changes.

This is why I wanted people to test. That's easily fixed.

LOC_CHECK_INCLUDES() can take a fourth argument comprising code to be
executed if the check fails. If no such argument is given, a fatal
error is generated.

Okay. That helps. I didn't trace through all of the substitutions of
the LOC_() macros and there is almost no documentation.

3. --with-g77 should not be required to detect g2c.h/f2c.h or -lg2c.

Why bother detecting if there's no Fortran compiler? Nevermind. I see
what you're getting at. You don't need a working Fortran compiler to
use the above.

Again, I never needed this before.

I'm not actually compiling any Fortran code, just C code which uses a
library written in Fortran; this doesn't require a Fortran compiler.

It may require some support files (header, library) which are normally
installed with the Fortran compiler, but those can (and should) be
detected as with any header or library. There's no need to check for a
Fortran compiler unless you're actually going to be compiling Fortran
code.

I wanted to leave the possibility open, but no, it is not specifically
needed at the present time.

For now, I've reverted my local configure[.in] to the previous version
to eliminate the regressions. Unless some other fix is found, I intend
to commit the reversions.

That's a bit of a radical move for relatively minor issues, isn't it?
If you can hold out until tomorrow, I will commit fixes.

--
73, de Brad KB8UYR/6 <rez touchofmadness com>

Brad Douglas wrote:

> 1. --with-gfortran should default to "no". The only things which
> should default to yes are those which most users will have and want.

I'm under the impression that most users have upgraded to GCC >= 4.x.
The reason that the option exists at all is because of autoconf-2.13
limitations.

Suggestions are welcome.

Regardless of which GCC version people are using (I'm using 3.4.6),
there's no need for either --with-g77 or --with-gfortran to be enabled
by default.

And unless there's some Fortran code still in GRASS (I can't see any),
I don't see any need for those options to exist. The AC_CHECK_PROGS
for g77/f77 was commented out when we no longer included any Fortran
code. 5.3 has some, but 6.x doesn't (AFAICT).

> LOC_CHECK_INCLUDES() can take a fourth argument comprising code to be
> executed if the check fails. If no such argument is given, a fatal
> error is generated.

Okay. That helps. I didn't trace through all of the substitutions of
the LOC_() macros and there is almost no documentation.

If you only need to set a HAVE_FOO_H macro in config.h, use
AC_CHECK_HEADERS instead.

LOC_CHECK_INCLUDES is designed for the situation where a header is
mandatory. The fourth argument is designed so that you can nest checks
for alternate headers (see the FFTW and GLw checks for examples), with
a fatal error if none of the alternatives are found.

> Again, I never needed this before.
>
> I'm not actually compiling any Fortran code, just C code which uses a
> library written in Fortran; this doesn't require a Fortran compiler.
>
> It may require some support files (header, library) which are normally
> installed with the Fortran compiler, but those can (and should) be
> detected as with any header or library. There's no need to check for a
> Fortran compiler unless you're actually going to be compiling Fortran
> code.

I wanted to leave the possibility open, but no, it is not specifically
needed at the present time.

Right. If we do ever find a use for a Fortran compiler, the checks
should be orthogonal to those required to use Fortran-based libraries
(e.g. LAPACK).

> For now, I've reverted my local configure[.in] to the previous version
> to eliminate the regressions. Unless some other fix is found, I intend
> to commit the reversions.

That's a bit of a radical move for relatively minor issues, isn't it?

Well, from my perspective, the changes were entirely negative.
Compiling with BLAS/LAPACK support was impossible regardless of
configure options, and even without --with-{blas,lapack}, configure
would simply fail if you don't have a Fortran compiler (many users
probably don't) and you didn't specifically use --without-gfortran.

Given the relative complexity of the tests, it looked like it would
have been safer to just revert everything until a second attempt was
made (you can always recover the first attempt from CVS).

If you can hold out until tomorrow, I will commit fixes.

I can wait that long. The problems with the --with-{blas,lapack} case
aren't critical, but eliminating the need to use --without-gfortran
needs to be done sooner rather than later. Running configure with no
arguments should normally work for anyone who has the "standard"
dependencies (i.e. the mandatory dependencies plus JPEG, TIFF, PNG,
Tcl/Tk, PostgreSQL, OpenGL and FFTW).

[Actually, I'm not sure that PostgreSQL really belongs on that list.
When we adopted a policy of generating fatal errors if important
dependencies were missing, PostgreSQL was the only supported database,
and it resulted in a bunch of additional pg.* modules as well as
adding PostgreSQL support to NVIZ.

Now that other databases can be used, and the option only affects
compilation of the actual database driver, it could probably be turned
off by default. OTOH, maybe that should wait for 7.x.]

--
Glynn Clements <glynn@gclements.plus.com>

On Fri, 2007-09-28 at 09:51 +0100, Glynn Clements wrote:

Brad Douglas wrote:

> > 1. --with-gfortran should default to "no". The only things which
> > should default to yes are those which most users will have and want.
>
> I'm under the impression that most users have upgraded to GCC >= 4.x.
> The reason that the option exists at all is because of autoconf-2.13
> limitations.
>
> Suggestions are welcome.

Regardless of which GCC version people are using (I'm using 3.4.6),
there's no need for either --with-g77 or --with-gfortran to be enabled
by default.

And unless there's some Fortran code still in GRASS (I can't see any),
I don't see any need for those options to exist. The AC_CHECK_PROGS
for g77/f77 was commented out when we no longer included any Fortran
code. 5.3 has some, but 6.x doesn't (AFAICT).

There is not Fortran code in the tree (but I was keeping the option open
as previously noted). Change committed.

> > LOC_CHECK_INCLUDES() can take a fourth argument comprising code to be
> > executed if the check fails. If no such argument is given, a fatal
> > error is generated.
>
> Okay. That helps. I didn't trace through all of the substitutions of
> the LOC_() macros and there is almost no documentation.

If you only need to set a HAVE_FOO_H macro in config.h, use
AC_CHECK_HEADERS instead.

LOC_CHECK_INCLUDES is designed for the situation where a header is
mandatory. The fourth argument is designed so that you can nest checks
for alternate headers (see the FFTW and GLw checks for examples), with
a fatal error if none of the alternatives are found.

I do need to set macros in config.h if certain headers are found, but
without fatalities if they are not. I'll work around it.

I'll add your notes to aclocal.m4 where applicable.

> > Again, I never needed this before.
> >
> > I'm not actually compiling any Fortran code, just C code which uses a
> > library written in Fortran; this doesn't require a Fortran compiler.
> >
> > It may require some support files (header, library) which are normally
> > installed with the Fortran compiler, but those can (and should) be
> > detected as with any header or library. There's no need to check for a
> > Fortran compiler unless you're actually going to be compiling Fortran
> > code.
>
> I wanted to leave the possibility open, but no, it is not specifically
> needed at the present time.

Right. If we do ever find a use for a Fortran compiler, the checks
should be orthogonal to those required to use Fortran-based libraries
(e.g. LAPACK).

Trying to make gfortran work with autoconf-2.13 is a kludge at best.
Maybe I should remove Fortran entirely? I don't see much possibility
for using it in the future.

> > For now, I've reverted my local configure[.in] to the previous version
> > to eliminate the regressions. Unless some other fix is found, I intend
> > to commit the reversions.
>
> That's a bit of a radical move for relatively minor issues, isn't it?

Well, from my perspective, the changes were entirely negative.
Compiling with BLAS/LAPACK support was impossible regardless of
configure options, and even without --with-{blas,lapack}, configure
would simply fail if you don't have a Fortran compiler (many users
probably don't) and you didn't specifically use --without-gfortran.

Given the relative complexity of the tests, it looked like it would
have been safer to just revert everything until a second attempt was
made (you can always recover the first attempt from CVS).

If you'd still like to revert, go ahead. I can easily recommit a
corrected version, which may be more desirable than applying fix after
fix and "polluting" the CVS history.

> If you can hold out until tomorrow, I will commit fixes.

I can wait that long. The problems with the --with-{blas,lapack} case
aren't critical, but eliminating the need to use --without-gfortran
needs to be done sooner rather than later. Running configure with no
arguments should normally work for anyone who has the "standard"
dependencies (i.e. the mandatory dependencies plus JPEG, TIFF, PNG,
Tcl/Tk, PostgreSQL, OpenGL and FFTW).

[Actually, I'm not sure that PostgreSQL really belongs on that list.
When we adopted a policy of generating fatal errors if important
dependencies were missing, PostgreSQL was the only supported database,
and it resulted in a bunch of additional pg.* modules as well as
adding PostgreSQL support to NVIZ.

You are correct that PostgreSQL does not need to belong there anymore.

Now that other databases can be used, and the option only affects
compilation of the actual database driver, it could probably be turned
off by default. OTOH, maybe that should wait for 7.x.]

Simply switching the default in configure.in doesn't need to wait for
7.x.

--
73, de Brad KB8UYR/6 <rez touchofmadness com>

Brad Douglas wrote:

> > > 1. --with-gfortran should default to "no". The only things which
> > > should default to yes are those which most users will have and want.
> >
> > I'm under the impression that most users have upgraded to GCC >= 4.x.
> > The reason that the option exists at all is because of autoconf-2.13
> > limitations.
> >
> > Suggestions are welcome.
>
> Regardless of which GCC version people are using (I'm using 3.4.6),
> there's no need for either --with-g77 or --with-gfortran to be enabled
> by default.
>
> And unless there's some Fortran code still in GRASS (I can't see any),
> I don't see any need for those options to exist. The AC_CHECK_PROGS
> for g77/f77 was commented out when we no longer included any Fortran
> code. 5.3 has some, but 6.x doesn't (AFAICT).

There is not Fortran code in the tree (but I was keeping the option open
as previously noted). Change committed.

FWIW, the committed configure and configure.in scripts didn't match
(configure.in had --with-gfortran default to "no", but the actual
configure script still defaulted to "yes"). I have regenerated
configure and committed it (just in case you were wondering what the
change was).

> > > LOC_CHECK_INCLUDES() can take a fourth argument comprising code to be
> > > executed if the check fails. If no such argument is given, a fatal
> > > error is generated.
> >
> > Okay. That helps. I didn't trace through all of the substitutions of
> > the LOC_() macros and there is almost no documentation.
>
> If you only need to set a HAVE_FOO_H macro in config.h, use
> AC_CHECK_HEADERS instead.
>
> LOC_CHECK_INCLUDES is designed for the situation where a header is
> mandatory. The fourth argument is designed so that you can nest checks
> for alternate headers (see the FFTW and GLw checks for examples), with
> a fatal error if none of the alternatives are found.

I do need to set macros in config.h if certain headers are found, but
without fatalities if they are not.

Right; AC_CHECK_HEADERS is most suitable for that.

> > I wanted to leave the possibility open, but no, it is not specifically
> > needed at the present time.
>
> Right. If we do ever find a use for a Fortran compiler, the checks
> should be orthogonal to those required to use Fortran-based libraries
> (e.g. LAPACK).

Trying to make gfortran work with autoconf-2.13 is a kludge at best.
Maybe I should remove Fortran entirely? I don't see much possibility
for using it in the future.

I wouldn't complicate configure.in with checks for something we aren't
actually using.

Given our relatively low level of manpower compared to the size of the
code base, we should be more agressive about getting rid of "dead
wood", IMHO. In the event that some old code turns out to be useful to
someone, they can always dig it out of CVS.

> > > For now, I've reverted my local configure[.in] to the previous version
> > > to eliminate the regressions. Unless some other fix is found, I intend
> > > to commit the reversions.
> >
> > That's a bit of a radical move for relatively minor issues, isn't it?
>
> Well, from my perspective, the changes were entirely negative.
> Compiling with BLAS/LAPACK support was impossible regardless of
> configure options, and even without --with-{blas,lapack}, configure
> would simply fail if you don't have a Fortran compiler (many users
> probably don't) and you didn't specifically use --without-gfortran.
>
> Given the relative complexity of the tests, it looked like it would
> have been safer to just revert everything until a second attempt was
> made (you can always recover the first attempt from CVS).

If you'd still like to revert, go ahead. I can easily recommit a
corrected version, which may be more desirable than applying fix after
fix and "polluting" the CVS history.

configure.in is already up to revision 1.130; a few more won't harm.

So long as it doesn't get forgotten, I can just build --without-blas
and --without-lapack for the time being (i.e. until the lack of
cblas.h and clapack.h is no longer fatal).

> [Actually, I'm not sure that PostgreSQL really belongs on that list.
> When we adopted a policy of generating fatal errors if important
> dependencies were missing, PostgreSQL was the only supported database,
> and it resulted in a bunch of additional pg.* modules as well as
> adding PostgreSQL support to NVIZ.

You are correct that PostgreSQL does not need to belong there anymore.

> Now that other databases can be used, and the option only affects
> compilation of the actual database driver, it could probably be turned
> off by default. OTOH, maybe that should wait for 7.x.]

Simply switching the default in configure.in doesn't need to wait for
7.x.

My main concern is that people won't notice that they have suddenly
stopped getting PostgreSQL support until they actually need to use it
and find that it isn't there.

--
Glynn Clements <glynn@gclements.plus.com>

Glynn Clements wrote:

[Actually, I'm not sure that PostgreSQL really belongs on that list.
When we adopted a policy of generating fatal errors if important
dependencies were missing, PostgreSQL was the only supported database,
and it resulted in a bunch of additional pg.* modules as well as
adding PostgreSQL support to NVIZ.

Now that other databases can be used, and the option only affects
compilation of the actual database driver, it could probably be turned
off by default. OTOH, maybe that should wait for 7.x.]

my vote is for setting the default to --without-postgres now (6.3+).

Hamish

On Fri, 2007-09-28 at 16:05 +0100, Glynn Clements wrote:

Brad Douglas wrote:

> > > > 1. --with-gfortran should default to "no". The only things which
> > > > should default to yes are those which most users will have and want.
> > >
> > > I'm under the impression that most users have upgraded to GCC >= 4.x.
> > > The reason that the option exists at all is because of autoconf-2.13
> > > limitations.
> > >
> > > Suggestions are welcome.
> >
> > Regardless of which GCC version people are using (I'm using 3.4.6),
> > there's no need for either --with-g77 or --with-gfortran to be enabled
> > by default.
> >
> > And unless there's some Fortran code still in GRASS (I can't see any),
> > I don't see any need for those options to exist. The AC_CHECK_PROGS
> > for g77/f77 was commented out when we no longer included any Fortran
> > code. 5.3 has some, but 6.x doesn't (AFAICT).
>
> There is not Fortran code in the tree (but I was keeping the option open
> as previously noted). Change committed.

FWIW, the committed configure and configure.in scripts didn't match
(configure.in had --with-gfortran default to "no", but the actual
configure script still defaulted to "yes"). I have regenerated
configure and committed it (just in case you were wondering what the
change was).

FYI, I've been letting others (Markus) commit changes to 'configure'. I
don't trust autoconf enough on x86_64 to commit it myself. I should
really do a comparison to see if my concerns are without merit.

> > > > LOC_CHECK_INCLUDES() can take a fourth argument comprising code to be
> > > > executed if the check fails. If no such argument is given, a fatal
> > > > error is generated.
> > >
> > > Okay. That helps. I didn't trace through all of the substitutions of
> > > the LOC_() macros and there is almost no documentation.
> >
> > If you only need to set a HAVE_FOO_H macro in config.h, use
> > AC_CHECK_HEADERS instead.
> >
> > LOC_CHECK_INCLUDES is designed for the situation where a header is
> > mandatory. The fourth argument is designed so that you can nest checks
> > for alternate headers (see the FFTW and GLw checks for examples), with
> > a fatal error if none of the alternatives are found.
>
> I do need to set macros in config.h if certain headers are found, but
> without fatalities if they are not.

Right; AC_CHECK_HEADERS is most suitable for that.

For the public record, it is being discussed offline.

> > > I wanted to leave the possibility open, but no, it is not specifically
> > > needed at the present time.
> >
> > Right. If we do ever find a use for a Fortran compiler, the checks
> > should be orthogonal to those required to use Fortran-based libraries
> > (e.g. LAPACK).
>
> Trying to make gfortran work with autoconf-2.13 is a kludge at best.
> Maybe I should remove Fortran entirely? I don't see much possibility
> for using it in the future.

I wouldn't complicate configure.in with checks for something we aren't
actually using.

Given our relatively low level of manpower compared to the size of the
code base, we should be more agressive about getting rid of "dead
wood", IMHO. In the event that some old code turns out to be useful to
someone, they can always dig it out of CVS.

Noted. I've removed all "might get used in the future" code.

> > Now that other databases can be used, and the option only affects
> > compilation of the actual database driver, it could probably be turned
> > off by default. OTOH, maybe that should wait for 7.x.]
>
> Simply switching the default in configure.in doesn't need to wait for
> 7.x.

My main concern is that people won't notice that they have suddenly
stopped getting PostgreSQL support until they actually need to use it
and find that it isn't there.

In 6.2.x, keep status quo, but I would prefer to turn it off for >= 6.3.
PostgreSQL is completely optional.

--
73, de Brad KB8UYR/6 <rez touchofmadness com>