[GRASS5] configure checks, fortran, static libraries

Markus Neteler neteler at itc.it
Mon Aug 6 04:16:04 EDT 2001


On Sat, Aug 04, 2001 at 06:45:44AM +0100, Glynn Clements wrote:
> 
> Markus Neteler wrote:
> 
> > congrats! The configure is working now on both Linux (SuSe and RH)
> > and Solaris/SUN, even with different locations of the libs.
> 
> I'd forgotten about one test which wasn't working, namely LAPACK. When
> linking against a C test program, I had a number of undefined
> references. I have found that linking with libg2c solves this, but I'm
> guessing that libg2c is a GNU-ism. Is there an equivalent libf2c on
> other platforms?
> 
> BTW, a side effect of the experimentation surrounding this test has
> pointed out another possible flaw in the existing configure.in. When
> additional libraries are used by adding them to LDFLAGS, they are
> listed at the beginning of the link command, before the test program
> and the library being checked.
> 
> This is fine for dynamic libraries, but static libaries usually have
> to appear *after* the object files which require them (basically, the
> linker only inserts the code which is necessary to satisfy any
> outstanding references).
> 
> This suggests that many of the AC_CHECK_LIB tests will fail if one of
> the required libraries is a static library. So, I'll be re-writing
> those tests. I would be interested in test results using static
> libraries, e.g. by using:
> 
> 	CC="gcc -static" ./configure ...

Here we are... It is not yet consistent:

CC="gcc -static" ./configure

...
checking for location of Tcl/Tk includes...
checking for tcl.h... yes
checking for tk.h... yes
checking for location of Tcl/Tk libraries...
checking for Tcl_Init in -ltcl... no
checking for Tcl_Init in -ltcl... no
checking for Tcl_Init in -ltcl8.3... no
checking for Tcl_Init in -ltcl8.3... no
configure: warning: *** Unable to locate Tcl library.
checking for Tk_MainWindow in -ltk... no
checking for Tk_MainWindow in -ltk... no
checking for Tk_MainWindow in -ltk8.3... no
checking for Tk_MainWindow in -ltk8.3... no
configure: warning: *** Unable to locate Tk library.

config.log:
configure:4701: gcc -static -o conftest -g -O2    conftest.c -ltcl -lm  1>&5
/usr/bin/ld: cannot find -ltcl
collect2: ld returned 1 exit status
...
configure:4762: checking for Tcl_Init in -ltcl8.3
configure:4781: gcc -static -o conftest -g -O2    conftest.c -ltcl8.3 -lm
1>&5
/usr/bin/ld: cannot find -ltcl8.3
collect2: ld returned 1 exit status
...
configure:4854: checking for Tk_MainWindow in -ltk
configure:4873: gcc -static -o conftest -g -O2    conftest.c -ltk   1>&5
/usr/bin/ld: cannot find -ltk

Note: Here "libblas" is found.

checking for location of BLAS library...
checking for dnrm2_ in -lblas... yes
checking for location of LAPACK library...
checking for dgesv_ in -llapack... no
checking for dgesv_ in -llapack... yes

---------------------------------------------------------------------
With standard "configure" (no static option), the BLAS check fails:

checking for location of BLAS library...
checking for dnrm2_ in -lblas... no
configure: warning: *** Unable to locate BLAS library.
checking for location of LAPACK library...
checking for dgesv_ in -llapack... no
checking for dgesv_ in -llapack... yes


config.log:
configure:5850: checking for dnrm2_ in -lblas
configure:5869: gcc -o conftest -g -O2    conftest.c -lblas -lm  1>&5
/usr/lib/gcc-lib/i386-redhat-linux/2.96/../../../libblas.so: undefined
referenc 'e_wsfe' 
/usr/lib/gcc-lib/i386-redhat-linux/2.96/../../../libblas.so: undefined
referenc 'z_abs'
/usr/lib/gcc-lib/i386-redhat-linux/2.96/../../../libblas.so: undefined
referenc 'do_fio'
/usr/lib/gcc-lib/i386-redhat-linux/2.96/../../../libblas.so: undefined
referenc 's_stop'
/usr/lib/gcc-lib/i386-redhat-linux/2.96/../../../libblas.so: undefined
referenc 'c_abs'
/usr/lib/gcc-lib/i386-redhat-linux/2.96/../../../libblas.so: undefined
referenc 's_wsfe'
collect2: ld returned 1 exit status
configure: failed program was:

Note: Here the tcl/tk is working.


Glynn, hopefully you can fix that.

Thanks!

 Markus



More information about the grass-dev mailing list