[GRASS5] Re: [GRASS-CVS] CVS update: grass

On Sat, Jul 28, 2001 at 07:33:06AM +0200, grass@intevation.de wrote:

Date: Saturday July 28, 2001 @ 5:33
Author: glynn

Update of /grassrepository/grass
In directory doto:/tmp/cvs-serv30406

Modified Files:
      Tag: releasebranch_11_april_2001_5_0_0
  configure configure.in
Log Message:
Simplified configure script.

Doesn't go wandering around the filesystem looking for headers and
libraries; if they're not in standard locations, you have to tell it.

Doesn't currently support cross-compiling (unable to reliably
determine the Tcl/Tk version without running a test program).

Hi Glynn,

I tried the updated configure and ran into a few troubles:

My new system is Redhad 7.1 with tcl/tk 8.3 present. However, configure
doesn't detect it:

ls /usr/include/tk.h
/usr/include/tk.h
ls /usr/include/tcl.h
/usr/include/tcl.h
(version 8.3)

The libs are also there:
ls /usr/lib/libtcl
libtcl8.3.so libtclstub8.3.a libtclx8.2.so
libtcl.so libtclx8.2.a libtclx.so
ls /usr/lib/libtk
libtk8.3.so libtkstub8.3.a libtkx8.2.so
libtk.so libtkx8.2.a libtkx.so

If running simply
configure
on the same machine:
checking for location of Tcl/Tk libraries...
checking for Tcl_Init in -ltcl... yes
checking for Tk_MainWindow in -ltk... no
checking for Tk_MainWindow in -ltk8.3... no
checking for Tk_MainWindow in -ltk... (cached) no
checking for Tk_MainWindow in -ltk8.3... (cached) no
checking for Tk_MainWindow in -ltk... (cached) no
checking for Tk_MainWindow in -ltk8.3... (cached) no
configure: warning: *** Unable to locate Tk library.

If running
configure --with-tcltk-includes=/usr/include

checking for location of Tcl/Tk includes... /usr/include
configure: warning: *** Tcl/Tk includes directory /usr/include does not
exist.
checking for tcl.h... yes
checking for tk.h... yes
checking for location of Tcl/Tk libraries...

-> huh?

-> the head file doesn't contain entries for TCLINCDIR, TKINCDIR and
TCLTKLIBPATH.

Generally I think the 5.0.0 should be released these days, but
above (new) bug should be fixed as 5.1 won't be available for some
time.

Testing on SUN I get:
checking for location of Tcl/Tk includes... /usr/local/include
configure: warning: *** Tcl/Tk includes directory /usr/local/include does
not exist.
checking for tcl.h... yes
checking for tk.h... yes
checking for location of Tcl/Tk libraries... /usr/lib
checking for Tcl_Init in -ltcl... no
checking for Tcl_Init in -ltcl8.0... yes
checking for Tk_MainWindow in -ltk... no
checking for Tk_MainWindow in -ltk8.0... yes

Looks better but not perfect as the SUN head file finally contains:
#tcl/tk stuff
TCLINCDIR =
TKINCDIR =
TCLTKLIBPATH = -L/usr/lib
TCLTKLIBS = -ltcl8.0 -ltk8.0

Any help is welcome,

Markus

I can confirm that it does not work under Windows / cygwin either.
Headers and libs are not found even if specified on command line.

Fix is urgently needed, as i'd like to build a new winGRASS test build.

cu,

Andreas

Markus Neteler wrote:

On Sat, Jul 28, 2001 at 07:33:06AM +0200, grass@intevation.de wrote:
>
> Date: Saturday July 28, 2001 @ 5:33
> Author: glynn
>
> Update of /grassrepository/grass
> In directory doto:/tmp/cvs-serv30406
>
> Modified Files:
> Tag: releasebranch_11_april_2001_5_0_0
> configure configure.in
> Log Message:
> Simplified configure script.
>
> Doesn't go wandering around the filesystem looking for headers and
> libraries; if they're not in standard locations, you have to tell it.
>
> Doesn't currently support cross-compiling (unable to reliably
> determine the Tcl/Tk version without running a test program).

Hi Glynn,

I tried the updated configure and ran into a few troubles:

My new system is Redhad 7.1 with tcl/tk 8.3 present. However, configure
doesn't detect it:

ls /usr/include/tk.h
/usr/include/tk.h
ls /usr/include/tcl.h
/usr/include/tcl.h
(version 8.3)

The libs are also there:
ls /usr/lib/libtcl
libtcl8.3.so libtclstub8.3.a libtclx8.2.so
libtcl.so libtclx8.2.a libtclx.so
ls /usr/lib/libtk
libtk8.3.so libtkstub8.3.a libtkx8.2.so
libtk.so libtkx8.2.a libtkx.so

If running simply
configure
on the same machine:
checking for location of Tcl/Tk libraries...
checking for Tcl_Init in -ltcl... yes
checking for Tk_MainWindow in -ltk... no
checking for Tk_MainWindow in -ltk8.3... no
checking for Tk_MainWindow in -ltk... (cached) no
checking for Tk_MainWindow in -ltk8.3... (cached) no
checking for Tk_MainWindow in -ltk... (cached) no
checking for Tk_MainWindow in -ltk8.3... (cached) no
configure: warning: *** Unable to locate Tk library.

If running
configure --with-tcltk-includes=/usr/include

checking for location of Tcl/Tk includes... /usr/include
configure: warning: *** Tcl/Tk includes directory /usr/include does not
exist.
checking for tcl.h... yes
checking for tk.h... yes
checking for location of Tcl/Tk libraries...

-> huh?

-> the head file doesn't contain entries for TCLINCDIR, TKINCDIR and
TCLTKLIBPATH.

Generally I think the 5.0.0 should be released these days, but
above (new) bug should be fixed as 5.1 won't be available for some
time.

Testing on SUN I get:
checking for location of Tcl/Tk includes... /usr/local/include
configure: warning: *** Tcl/Tk includes directory /usr/local/include does
not exist.
checking for tcl.h... yes
checking for tk.h... yes
checking for location of Tcl/Tk libraries... /usr/lib
checking for Tcl_Init in -ltcl... no
checking for Tcl_Init in -ltcl8.0... yes
checking for Tk_MainWindow in -ltk... no
checking for Tk_MainWindow in -ltk8.0... yes

Looks better but not perfect as the SUN head file finally contains:
#tcl/tk stuff
TCLINCDIR =
TKINCDIR =
TCLTKLIBPATH = -L/usr/lib
TCLTKLIBS = -ltcl8.0 -ltk8.0

Any help is welcome,

Markus
_______________________________________________
grass5 mailing list
grass5@geog.uni-hannover.de
http://www.geog.uni-hannover.de/mailman/listinfo/grass5

--
Andreas Lange, 65187 Wiesbaden, Germany, Tel. +49 611 807850
url: http://mitglied.tripod.de/AndreasLange
mail: Andreas.Lange_at_Rhein-Main.de - A.C.Lange_at_GMX.net

From: Markus Neteler <neteler@itc.it>
Subject: [GRASS5] Re: [GRASS-CVS] CVS update: grass
Date: Thu, 2 Aug 2001 16:20:45 +0200

On Sat, Jul 28, 2001 at 07:33:06AM +0200, grass@intevation.de wrote:
>
> Date: Saturday July 28, 2001 @ 5:33
> Author: glynn
>
> Update of /grassrepository/grass
> In directory doto:/tmp/cvs-serv30406
>
> Modified Files:
> Tag: releasebranch_11_april_2001_5_0_0
> configure configure.in
> Log Message:
> Simplified configure script.
>
> Doesn't go wandering around the filesystem looking for headers and
> libraries; if they're not in standard locations, you have to tell it.
>
> Doesn't currently support cross-compiling (unable to reliably
> determine the Tcl/Tk version without running a test program).

Hi Glynn,

I tried the updated configure and ran into a few troubles:

My new system is Redhad 7.1 with tcl/tk 8.3 present. However, configure
doesn't detect it:

ls /usr/include/tk.h
/usr/include/tk.h
ls /usr/include/tcl.h
/usr/include/tcl.h
(version 8.3)

The libs are also there:
ls /usr/lib/libtcl
libtcl8.3.so libtclstub8.3.a libtclx8.2.so
libtcl.so libtclx8.2.a libtclx.so
ls /usr/lib/libtk
libtk8.3.so libtkstub8.3.a libtkx8.2.so
libtk.so libtkx8.2.a libtkx.so

If running simply
configure
on the same machine:
checking for location of Tcl/Tk libraries...
checking for Tcl_Init in -ltcl... yes
checking for Tk_MainWindow in -ltk... no
checking for Tk_MainWindow in -ltk8.3... no
checking for Tk_MainWindow in -ltk... (cached) no
checking for Tk_MainWindow in -ltk8.3... (cached) no
checking for Tk_MainWindow in -ltk... (cached) no
checking for Tk_MainWindow in -ltk8.3... (cached) no
configure: warning: *** Unable to locate Tk library.

If running
configure --with-tcltk-includes=/usr/include

checking for location of Tcl/Tk includes... /usr/include
configure: warning: *** Tcl/Tk includes directory /usr/include does not
exist.
checking for tcl.h... yes
checking for tk.h... yes
checking for location of Tcl/Tk libraries...

-> huh?

-> the head file doesn't contain entries for TCLINCDIR, TKINCDIR and
TCLTKLIBPATH.

Generally I think the 5.0.0 should be released these days, but
above (new) bug should be fixed as 5.1 won't be available for some
time.

Testing on SUN I get:
checking for location of Tcl/Tk includes... /usr/local/include
configure: warning: *** Tcl/Tk includes directory /usr/local/include does
not exist.
checking for tcl.h... yes
checking for tk.h... yes
checking for location of Tcl/Tk libraries... /usr/lib
checking for Tcl_Init in -ltcl... no
checking for Tcl_Init in -ltcl8.0... yes
checking for Tk_MainWindow in -ltk... no
checking for Tk_MainWindow in -ltk8.0... yes

Looks better but not perfect as the SUN head file finally contains:
#tcl/tk stuff
TCLINCDIR =
TKINCDIR =
TCLTKLIBPATH = -L/usr/lib
TCLTKLIBS = -ltcl8.0 -ltk8.0

Any help is welcome,

Markus
_______________________________________________
grass5 mailing list
grass5@geog.uni-hannover.de
http://www.geog.uni-hannover.de/mailman/listinfo/grass5

Hmm,

I have much trouble with new configure too. With this one, I can not find many
headers and libs without options though I didn't have any problem finding
them before. Of course those files are in a standard directory(?). Anyway,
what's the standard directory?

  /usr/include, /usr/X11R6/include, /usr/local/include?

And there is a typo in configure*.

I don't know why wandering for required files is not good. It's more convenient
and more simple(not for programmers but for USERS). I think we'd better focus on
users' convenience. Am I wrong?

Yours,
Huidae Cho

Markus Neteler wrote:

I tried the updated configure and ran into a few troubles:

My new system is Redhad 7.1 with tcl/tk 8.3 present. However, configure
doesn't detect it:

ls /usr/include/tk.h
/usr/include/tk.h
ls /usr/include/tcl.h
/usr/include/tcl.h
(version 8.3)

The libs are also there:
ls /usr/lib/libtcl
libtcl8.3.so libtclstub8.3.a libtclx8.2.so
libtcl.so libtclx8.2.a libtclx.so
ls /usr/lib/libtk
libtk8.3.so libtkstub8.3.a libtkx8.2.so
libtk.so libtkx8.2.a libtkx.so

If running simply
configure
on the same machine:
checking for location of Tcl/Tk libraries...
checking for Tcl_Init in -ltcl... yes
checking for Tk_MainWindow in -ltk... no
checking for Tk_MainWindow in -ltk8.3... no
checking for Tk_MainWindow in -ltk... (cached) no
checking for Tk_MainWindow in -ltk8.3... (cached) no
checking for Tk_MainWindow in -ltk... (cached) no
checking for Tk_MainWindow in -ltk8.3... (cached) no
configure: warning: *** Unable to locate Tk library.

What does config.log say?

The appearance of "(cached)" seems suspicious. The checks in question
are:

AC_CHECK_LIB(tk, Tk_MainWindow, TCLTKLIBS="$TCLTKLIBS -ltk", [
AC_CHECK_LIB(tk$tcltk_ver, Tk_MainWindow, TCLTKLIBS="$TCLTKLIBS -ltk$tcltk_ver", [
LDFLAGS="$LDFLAGS $X_LIBS"
AC_CHECK_LIB(tk, Tk_MainWindow, TCLTKLIBS="$TCLTKLIBS -ltk", [
AC_CHECK_LIB(tk$tcltk_ver, Tk_MainWindow, TCLTKLIBS="$TCLTKLIBS -ltk$tcltk_ver", [
LDFLAGS="$LDFLAGS $DLLIB"
AC_CHECK_LIB(tk, Tk_MainWindow, TCLTKLIBS="$TCLTKLIBS -ltk", [
AC_CHECK_LIB(tk$tcltk_ver, Tk_MainWindow, TCLTKLIBS="$TCLTKLIBS -ltk$tcltk_ver", [
    AC_MSG_WARN([*** Unable to locate Tk library.])
])])])])])])

It tries each of -ltk and -ltk<version> three times; once with no
additional libraries, once with the X libraries, and once with X
libraries and libdl.

However, it appears to be caching the fact that both -ltk and
-ltk<version> failed the first time, and not actually performing the
last two sets of checks.

I'll see if I can disable caching altogether (it seems that defining
AC_CACHE_{LOAD,SAVE} to null only prevents results from being cached
between configure runs, but not within a run).

If not, this can be worked around by only using the third case, but
this may complicate the link command unnecessarily.

If running
configure --with-tcltk-includes=/usr/include

checking for location of Tcl/Tk includes... /usr/include
configure: warning: *** Tcl/Tk includes directory /usr/include does not exist.
checking for tcl.h... yes
checking for tk.h... yes

OK, so configure appears to be finding tk.h without being told (which
it should, as it's in the compiler's default include path).

checking for location of Tcl/Tk libraries...

-> huh?

Bug in configure.in, line 496. A fix should have been committed by the
time you receive this message.

-> the head file doesn't contain entries for TCLINCDIR, TKINCDIR and
TCLTKLIBPATH.

Do you mean that the variables are set to an empty string? They should
be; the headers are in the compiler's default include path, so no -I
switch is required, and the libraries are in the linker's default
library path, so no -L switch is required.

Generally I think the 5.0.0 should be released these days, but
above (new) bug should be fixed as 5.1 won't be available for some
time.

Testing on SUN I get:
checking for location of Tcl/Tk includes... /usr/local/include
configure: warning: *** Tcl/Tk includes directory /usr/local/include does
not exist.

Same bug as mentioned above.

checking for tcl.h... yes
checking for tk.h... yes
checking for location of Tcl/Tk libraries... /usr/lib
checking for Tcl_Init in -ltcl... no
checking for Tcl_Init in -ltcl8.0... yes
checking for Tk_MainWindow in -ltk... no
checking for Tk_MainWindow in -ltk8.0... yes

OK; this indicates that libtk doesn't need any -L switch or for any
additional libraries to be specified explicitly.

Looks better but not perfect as the SUN head file finally contains:
#tcl/tk stuff
TCLINCDIR =
TKINCDIR =
TCLTKLIBPATH = -L/usr/lib
TCLTKLIBS = -ltcl8.0 -ltk8.0

Note: a "perfect" result would be something like:

TCLINCDIR =
TKINCDIR =
TCLTKLIBPATH =
TCLTKLIBS = -ltcl8.0 -ltk8.0

The presence of "-L/usr/lib" suggests you added an explicit
--with-tcltk-libs switch, which shouldn't be necessary.

If the compiler and/or linker searches a particular directory
automatically, that directory shouldn't appear in any -I or -L
switches.

On my RH6.2 system, everything except the PostgreSQL headers are in
the default search paths, so my configure command is:

./configure --prefix=/opt --bindir=/usr/local/bin --with-postgres-includes=/usr/include/pgsql

--
Glynn Clements <glynn.clements@virgin.net>

Andreas Lange wrote:

I can confirm that it does not work under Windows / cygwin either.
Headers and libs are not found even if specified on command line.

Details (e.g. config.log) would be appreciated (actually, details are
necessary; I can't fix anything until I know what's wrong).

Fix is urgently needed, as i'd like to build a new winGRASS test build.

Cygwin might take longer to get right than actual Unix systems; in the
meantime, you can just check out the previous version.

--
Glynn Clements <glynn.clements@virgin.net>

GRASS wrote:

I have much trouble with new configure too. With this one, I can not find many
headers and libs without options though I didn't have any problem finding
them before. Of course those files are in a standard directory(?). Anyway,
what's the standard directory?

  /usr/include, /usr/X11R6/include, /usr/local/include?

It depends upon the compiler and/or linker.

For the X headers and libraries, configure will attempt to determine
the necessary parameters using Imake if the user didn't specify
--x-includes and --x-libraries.

And there is a typo in configure*.

Yep; I know. Thanks for fixing it.

I don't know why wandering for required files is not good.

Because configure simply doesn't have enough information to make that
kind of decision.

The main reason for not allowing configure to add directories of its
own accord is, if any of those directories contain a header file which
conflicts with a required header, the entire build process falls
apart, and the only solution is to manually edit files.

A specific example is the case where configure was adding
-I/usr/include, resulting in an incompatible version of stdarg.h (I
think) being used instead of the (correct) version from
/usr/lib/gcc-lib/<platform>/<version>/include.

It's more convenient and more simple(not for programmers but for
USERS). I think we'd better focus on users' convenience. Am I wrong?

Having to explicitly specify directories is a minor inconvenience.
Having to debug the build procedure because configure decided to break
it by adding bogus -I or -L switches is a major inconvenience.

Basically, it's trivial to extend the list of directories which are
searched, but impossible (by normal means) to reduce it. Consequently,
the more directories which are searched automatically, the more likely
that the build will fail regardless of what configure switches are
used.

--
Glynn Clements <glynn.clements@virgin.net>

On Fri, Aug 03, 2001 at 02:43:20AM +0100, Glynn Clements wrote:
[snip]

The appearance of "(cached)" seems suspicious. The checks in question
are:

AC_CHECK_LIB(tk, Tk_MainWindow, TCLTKLIBS="$TCLTKLIBS -ltk", [
AC_CHECK_LIB(tk$tcltk_ver, Tk_MainWindow, TCLTKLIBS="$TCLTKLIBS -ltk$tcltk_ver", [
LDFLAGS="$LDFLAGS $X_LIBS"
AC_CHECK_LIB(tk, Tk_MainWindow, TCLTKLIBS="$TCLTKLIBS -ltk", [
AC_CHECK_LIB(tk$tcltk_ver, Tk_MainWindow, TCLTKLIBS="$TCLTKLIBS -ltk$tcltk_ver", [
LDFLAGS="$LDFLAGS $DLLIB"
AC_CHECK_LIB(tk, Tk_MainWindow, TCLTKLIBS="$TCLTKLIBS -ltk", [
AC_CHECK_LIB(tk$tcltk_ver, Tk_MainWindow, TCLTKLIBS="$TCLTKLIBS -ltk$tcltk_ver", [
    AC_MSG_WARN([*** Unable to locate Tk library.])
])])])])])])

It tries each of -ltk and -ltk<version> three times; once with no
additional libraries, once with the X libraries, and once with X
libraries and libdl.

However, it appears to be caching the fact that both -ltk and
-ltk<version> failed the first time, and not actually performing the
last two sets of checks.

That caching seems to be the normal behavior, hence all the file tests,
prior to the AC_CHECK_LIB() tests in the previous versions...
Unfortunately, the Tcl/Tk libs are named in various manners on various
platforms... (libtk8.0, libtk80, libtk, etc... ).

--
Eric G. Miller <egm2@jps.net>

Eric G. Miller wrote:

> It tries each of -ltk and -ltk<version> three times; once with no
> additional libraries, once with the X libraries, and once with X
> libraries and libdl.
>
> However, it appears to be caching the fact that both -ltk and
> -ltk<version> failed the first time, and not actually performing the
> last two sets of checks.

That caching seems to be the normal behavior, hence all the file tests,
prior to the AC_CHECK_LIB() tests in the previous versions...
Unfortunately, the Tcl/Tk libs are named in various manners on various
platforms... (libtk8.0, libtk80, libtk, etc... ).

Checking for multiple library names isn't problematic; a cached result
from AC_CHECK_LIB(tk, ...) won't affect AC_CHECK_LIB(tk8.0, ...) and
so on.

The problem comes when performing multiple AC_CHECK_LIB operations
with identical library names, but with different settings for LDFLAGS.

Anyway, I think that I can "undo" the caching by unsetting the
appropriate ac_cv_lib_* variable.

--
Glynn Clements <glynn.clements@virgin.net>

Hi,

thanks for (partly) fixing the configure[.in].

The current status is:

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... yes
checking for Tk_MainWindow in -ltk... no
checking for Tk_MainWindow in -ltk8.3... no
checking for Tk_MainWindow in -ltk... no
checking for Tk_MainWindow in -ltk8.3... no
checking for Tk_MainWindow in -ltk... no
checking for Tk_MainWindow in -ltk8.3... no
configure: warning: *** Unable to locate Tk library.c

the head file looks like this (Linux, RH7.1):
#tcl/tk stuff
TCLINCDIR =
TKINCDIR =
TCLTKLIBPATH =
TCLTKLIBS = -ltcl

Thanks for clarification, Glynn, concerning the empty fields.

So the only bug remaining is that "-ltk" is not added in the head
file. And above warning is a bit strange...

Best regards

Markus

Markus Neteler wrote:

thanks for (partly) fixing the configure[.in].

The current status is:

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... yes
checking for Tk_MainWindow in -ltk... no
checking for Tk_MainWindow in -ltk8.3... no
checking for Tk_MainWindow in -ltk... no
checking for Tk_MainWindow in -ltk8.3... no
checking for Tk_MainWindow in -ltk... no
checking for Tk_MainWindow in -ltk8.3... no
configure: warning: *** Unable to locate Tk library.c

I need to see config.log in order to figure out what else is required
for the link to succeed.

the head file looks like this (Linux, RH7.1):
#tcl/tk stuff
TCLINCDIR =
TKINCDIR =
TCLTKLIBPATH =
TCLTKLIBS = -ltcl

Thanks for clarification, Glynn, concerning the empty fields.

So the only bug remaining is that "-ltk" is not added in the head
file. And above warning is a bit strange...

I don't know where the trailing "c" comes from.

--
Glynn Clements <glynn.clements@virgin.net>

On Fri, Aug 03, 2001 at 10:29:11AM +0100, Glynn Clements wrote:

Markus Neteler wrote:

> thanks for (partly) fixing the configure[.in].
>
> The current status is:
>
> 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... yes
> checking for Tk_MainWindow in -ltk... no
> checking for Tk_MainWindow in -ltk8.3... no
> checking for Tk_MainWindow in -ltk... no
> checking for Tk_MainWindow in -ltk8.3... no
> checking for Tk_MainWindow in -ltk... no
> checking for Tk_MainWindow in -ltk8.3... no
> configure: warning: *** Unable to locate Tk library.c

I need to see config.log in order to figure out what else is required
for the link to succeed.

Sorry, I missed that. Here we are:

configure:4235: checking for location of Tcl/Tk includes
configure:4273: checking for tcl.h
configure:4283: gcc -E conftest.c >/dev/null 2>conftest.out
configure:4319: gcc -o conftest -g -O2 conftest.c 1>&5
configure:4348: checking for tk.h
configure:4358: gcc -E conftest.c >/dev/null 2>conftest.out
configure:4394: gcc -o conftest -g -O2 conftest.c 1>&5
configure:4433: checking for location of Tcl/Tk libraries
configure:4463: checking for Tcl_Init in -ltcl
configure:4482: gcc -o conftest -g -O2 -lm conftest.c -ltcl 1>&5
configure:4547: checking for Tk_MainWindow in -ltk
configure:4566: gcc -o conftest -g -O2 -lm conftest.c -ltk 1>&5
/usr/lib/gcc-lib/i386-redhat-linux/2.96/../../../libtk.so: undefined
reference
/usr/lib/gcc-lib/i386-redhat-linux/2.96/../../../libtk.so: undefined
reference to ...
[... some xxx times]
/usr/lib/gcc-lib/i386-redhat-linux/2.96/../../../libtk.so: undefined
reference
collect2: ld returned 1 exit status
configure: failed program was:
#line 4555 "configure"
[...skipped...]
/usr/lib/gcc-lib/i386-redhat-linux/2.96/../../../libtk8.3.so: undefined
reference to 'Tcl_CreateChannelHandler'
collect2: ld returned 1 exit status
configure: failed program was:
#line 4756 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
    builtin and then its argument prototype would still apply. */
char Tk_MainWindow();

int main() {
Tk_MainWindow()
; return 0; }
configure:4808: checking whether to use PostgreSQL

Does this help?

> the head file looks like this (Linux, RH7.1):
> #tcl/tk stuff
> TCLINCDIR =
> TKINCDIR =
> TCLTKLIBPATH =
> TCLTKLIBS = -ltcl
>
> Thanks for clarification, Glynn, concerning the empty fields.
>
> So the only bug remaining is that "-ltk" is not added in the head
> file. And above warning is a bit strange...

I don't know where the trailing "c" comes from.

MY FAULT. It is:
checking for Tk_MainWindow in -ltk8.3... no
configure: warning: *** Unable to locate Tk library.
checking whether to use PostgreSQL... no

However, if libtcl is found, the libtk should be found as well.

Thanks for your help,

Markus

GRASS wrote:

I think that I've found something wrong.
Assuming the following case:

./configure --with-includes=/usr/local/include --with-libs=/usr/local/lib

and some libraries and header files are in /usr/local/lib and
/usr/local/include respectively; in example, odbc library.

The newly created head file has an empty ODBCINC though ./configure said
"yes" for sql.h.

Each include directory specified using --with-includes should result
in a corresponding "-I<directory>" switch being added to COMPILE_FLAGS
in the file src/CMD/head/head.<platform>.

Similarly, each library directory specified using --with-libs should
result in a corresponding "-L<directory>" switch being added to
LDFLAGS in the file src/CMD/head/head.<platform>.

In turn, each OBJ.<platform>/make.rules file (generated by "gmake5")
should have all of the relevant switches in CFLAGS and LDFLAGS, which
should result in them being passed to the compiler and linker
respectively.

As a result, odbc driver compilation failed.

If ODBC failed to compile, it wasn't due to the reason which you
suggest. It may have been related to the configure changes, but I
would need to see the error messages to be able to tell.

--
Glynn Clements <glynn.clements@virgin.net>

Markus Neteler wrote:

> I need to see config.log in order to figure out what else is required
> for the link to succeed.

Sorry, I missed that. Here we are:

configure:4235: checking for location of Tcl/Tk includes
configure:4273: checking for tcl.h
configure:4283: gcc -E conftest.c >/dev/null 2>conftest.out
configure:4319: gcc -o conftest -g -O2 conftest.c 1>&5
configure:4348: checking for tk.h
configure:4358: gcc -E conftest.c >/dev/null 2>conftest.out
configure:4394: gcc -o conftest -g -O2 conftest.c 1>&5
configure:4433: checking for location of Tcl/Tk libraries
configure:4463: checking for Tcl_Init in -ltcl
configure:4482: gcc -o conftest -g -O2 -lm conftest.c -ltcl 1>&5
configure:4547: checking for Tk_MainWindow in -ltk
configure:4566: gcc -o conftest -g -O2 -lm conftest.c -ltk 1>&5
/usr/lib/gcc-lib/i386-redhat-linux/2.96/../../../libtk.so: undefined
reference
/usr/lib/gcc-lib/i386-redhat-linux/2.96/../../../libtk.so: undefined
reference to ...
[... some xxx times]
/usr/lib/gcc-lib/i386-redhat-linux/2.96/../../../libtk.so: undefined
reference

Undefined reference to what? Didn't it say?

collect2: ld returned 1 exit status
configure: failed program was:
#line 4555 "configure"
[...skipped...]
/usr/lib/gcc-lib/i386-redhat-linux/2.96/../../../libtk8.3.so: undefined
reference to 'Tcl_CreateChannelHandler'

Ah; that makes sense. Obviously libtk requires libtcl, regardless of
what else it might need. I'll commit a fix shortly.

I take it that your libtk8.3.so doesn't have dependency information.

Does this help?

Yes.

--
Glynn Clements <glynn.clements@virgin.net>

Glynn,

congrats! The configure is working now on both Linux (SuSe and RH)
and Solaris/SUN, even with different locations of the libs.

Andreas, I hope you have success as well on winGRASS?!

Thanks again,

Markus

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 ...

--
Glynn Clements <glynn.clements@virgin.net>

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

Markus Neteler wrote:

> 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.

This is to be expected if you don't actually have static Tcl/Tk
libraries.

I'm not expecting anyone to be able to successfuly build GRASS using
"gcc -static" (that would require static versions of *all* required
libraries). I'm primarily looking for information regarding which
libraries depend upon which other libraries.

Shared libraries typically contain dependency information, so any
required libraries will be linked automatically. Static libraries
don't, so you have to explicitly specify any dependencies.

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:

These symbols are all defined in libg2c, so it appears that I need to
try adding -lg2c, as is done for LAPACK. I only have a static BLAS
library, which (unlike LAPACK) doesn't need -lg2c.

--
Glynn Clements <glynn.clements@virgin.net>

On Mon, Aug 06, 2001 at 10:15:33AM +0100, Glynn Clements wrote:

Markus Neteler wrote:

[...]

This is to be expected if you don't actually have static Tcl/Tk
libraries.

Ah, yes - I didn't think of that.

[...]

These symbols are all defined in libg2c, so it appears that I need to
try adding -lg2c, as is done for LAPACK. I only have a static BLAS
library, which (unlike LAPACK) doesn't need -lg2c.

checking for location of BLAS library...
checking for dnrm2_ in -lblas... no
checking for dnrm2_ in -lblas... (cached) no
configure: warning: *** Unable to locate BLAS library.
checking for location of LAPACK library...

I just tested your latest change, right now it it didn't fix it
(again undefined stuff).

Sorry for no better news,

Markus

Markus Neteler wrote:

> Markus Neteler wrote:

[...]
> This is to be expected if you don't actually have static Tcl/Tk
> libraries.

Ah, yes - I didn't think of that.

[...]
> These symbols are all defined in libg2c, so it appears that I need to
> try adding -lg2c, as is done for LAPACK. I only have a static BLAS
> library, which (unlike LAPACK) doesn't need -lg2c.

checking for location of BLAS library...
checking for dnrm2_ in -lblas... no
checking for dnrm2_ in -lblas... (cached) no

Duh; caching strikes again. Fixed (I hope).

--
Glynn Clements <glynn.clements@virgin.net>