[GRASS-user] Strange Build Error Needs Other Eyes

   I've reorganized everything on my new hard drive and am rebuilding grass
versions in preparation for a project that should start next week. Trying to
build 6.5-svn I run into a configuration problem for which I'm not seeing
the solution. Your clue sticks will help.

   Here's what fails:

checking whether to use SQLite... yes
checking for location of SQLite includes... checking for sqlite3.h... yes
checking for location of SQLite library... /usr/lib/
checking for sqlite3_open in -lsqlite3... no
configure: error: *** Unable to locate SQLite library.

   I passed /usr/lib as the location in the option
'--with-sqlite-libs=/usr/lib' because that's where they are:

/usr/lib/libsqlite3.la
/usr/lib/libsqlite3.so
/usr/lib/pkgconfig/sqlite3.pc
/usr/lib/libsqlite3.so.0
/usr/lib/libsqlite3.so.0.8.6

   So, why isn't GRASS finding them?

Rich

On Wed, 29 Dec 2010, Rich Shepard wrote:

checking for sqlite3_open in -lsqlite3... no
configure: error: *** Unable to locate SQLite library.

   Is the library name incorrect in the configure file? There is no sqlite3
library, but there is libsqlite3.

/usr/lib/libsqlite3.la
/usr/lib/libsqlite3.so
/usr/lib/pkgconfig/sqlite3.pc
/usr/lib/libsqlite3.so.0
/usr/lib/libsqlite3.so.0.8.6

   This affects building both 6.4svn and 6.5svn. I need to build these today,
and I've not hit this problem of not finding postgres or sqlite
includes/libs in all the previous builds I've done.

Help appreciated,

Rich

On Wed, Dec 29, 2010 at 8:39 PM, Rich Shepard <rshepard@appl-ecosys.com> wrote:

I've reorganized everything on my new hard drive and am rebuilding grass
versions in preparation for a project that should start next week. Trying to
build 6.5-svn I run into a configuration problem for which I'm not seeing
the solution. Your clue sticks will help.

Here's what fails:

checking whether to use SQLite... yes
checking for location of SQLite includes... checking for sqlite3.h... yes
checking for location of SQLite library... /usr/lib/
checking for sqlite3_open in -lsqlite3... no
checking for sqlite3_open in -lsqlite3... no
configure: error: *** Unable to locate SQLite library.

I passed /usr/lib as the location in the option
'--with-sqlite-libs=/usr/lib' because that's where they are:

/usr/lib/libsqlite3.la
/usr/lib/libsqlite3.so
/usr/lib/pkgconfig/sqlite3.pc
/usr/lib/libsqlite3.so.0
/usr/lib/libsqlite3.so.0.8.6

So, why isn't GRASS finding them?

You need to look close to the end of the file config.log which
will contain the error related to sqlite3.

Markus

On Thu, 30 Dec 2010, Markus Neteler wrote:

You need to look close to the end of the file config.log which
will contain the error related to sqlite3.

Markus,

configure:10149: checking for sqlite3_open in -lsqlite3
configure:10166: gcc -o conftest -g -O2 -L/usr/lib/ -Wl,--export-dynamic
conftest.c -lsqlite3 -lm 1>&5
/usr/lib//libsqlite3.so: undefined reference to `dlsym'
/usr/lib//libsqlite3.so: undefined reference to `dlerror'
/usr/lib//libsqlite3.so: undefined reference to `dlopen'
/usr/lib//libsqlite3.so: undefined reference to `dlclose'
collect2: ld returned 1 exit status
configure: failed program was:
#line 10155 "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 sqlite3_open();

   I can invoke sqlite3 from the command line so I assume there are no
problems with the libraries. The softlinks have 777 permissions and
libsqlite3.so.0.8.6 has 755 permissions.

Thanks,

Rich

On Thu, Dec 30, 2010 at 10:23 PM, Rich Shepard <rshepard@appl-ecosys.com> wrote:

On Thu, 30 Dec 2010, Markus Neteler wrote:

You need to look close to the end of the file config.log which
will contain the error related to sqlite3.

Markus,

configure:10149: checking for sqlite3_open in -lsqlite3
configure:10166: gcc -o conftest -g -O2 -L/usr/lib/ -Wl,--export-dynamic
conftest.c -lsqlite3 -lm 1>&5
/usr/lib//libsqlite3.so: undefined reference to `dlsym'
/usr/lib//libsqlite3.so: undefined reference to `dlerror'
/usr/lib//libsqlite3.so: undefined reference to `dlopen'
/usr/lib//libsqlite3.so: undefined reference to `dlclose'
collect2: ld returned 1 exit status
configure: failed program was:
#line 10155 "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 sqlite3_open();

Which Linux do you use? I see this bug report for Debian:
http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=478980

The answer there is
"Please specify -ldl in your LDFLAGS for the linker."

AFAIK that would mean:

LDFLAGS="-ldl" ./configure ... (more flags as before)

Markus

On Thu, 30 Dec 2010, Markus Neteler wrote:

Which Linux do you use? I see this bug report for Debian:
http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=478980

The answer there is
"Please specify -ldl in your LDFLAGS for the linker."

AFAIK that would mean:

LDFLAGS="-ldl" ./configure ... (more flags as before)

Markus,

   Slackware-13.1 (and -current on my laptop).

   The last line tells me what I could not find looking at the configure
file. I'll report back ...

   Yep. That did it. Now it cannot find wxWidgets. Sigh.

Many thanks and Happy New Year,

Rich

(back to list)

On Fri, Dec 31, 2010 at 12:04 AM, Rich Shepard <rshepard@appl-ecosys.com> wrote:

On Thu, 30 Dec 2010, Markus Neteler wrote:

Now it cannot find wxWidgets. Sigh.

Same game: config.log :slight_smile:

Actually, it was because I had not re-built wxGTK and wxPython with the
new python version in Slackware-13.1. I just did this, upgraded both
packages, and GRASS-6.5 builds. I assume that -6.4 will, too.

Glad you solved it.

Can the "-ldl" be added to the linux portion of configure so it does not
need to be prepended to the ./configure ... command line?

I don't have much idea about -ldl, perhaps someone else in the list does.

Happy New Year,
Markus

Markus Neteler wrote:

> Can the "-ldl" be added to the linux portion of configure so it does not
> need to be prepended to the ./configure ... command line?

I don't have much idea about -ldl, perhaps someone else in the list does.

-LOC_CHECK_LIBS(sqlite3,sqlite3_open,SQLite,$SQLITELIBPATH,SQLITELIB,$MATHLIB)
+LOC_CHECK_LIBS(sqlite3,sqlite3_open,SQLite,$SQLITELIBPATH,SQLITELIB,$MATHLIB,$DLLIB)

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

On Fri, 31 Dec 2010, Glynn Clements wrote:

-LOC_CHECK_LIBS(sqlite3,sqlite3_open,SQLite,$SQLITELIBPATH,SQLITELIB,$MATHLIB)
+LOC_CHECK_LIBS(sqlite3,sqlite3_open,SQLite,$SQLITELIBPATH,SQLITELIB,$MATHLIB,$DLLIB)

   Thanks, Glynn. Has this change been made to the code or is the above a
suggestion?

Happy New Year,

Rich

On Fri, Dec 31, 2010 at 2:36 PM, Rich Shepard <rshepard@appl-ecosys.com> wrote:

On Fri, 31 Dec 2010, Glynn Clements wrote:

-LOC_CHECK_LIBS(sqlite3,sqlite3_open,SQLite,$SQLITELIBPATH,SQLITELIB,$MATHLIB)

+LOC_CHECK_LIBS(sqlite3,sqlite3_open,SQLite,$SQLITELIBPATH,SQLITELIB,$MATHLIB,$DLLIB)

Thanks, Glynn. Has this change been made to the code or is the above a
suggestion?

It was a suggestion. Now updated in SVN for 6.4, 6.5 and 7.

Markus

On Fri, 31 Dec 2010, Markus Neteler wrote:

It was a suggestion. Now updated in SVN for 6.4, 6.5 and 7.

Markus,

   Many thanks!

Best,

Rich