compiling bdb

A

Ara.T.Howard

shouldn't this pick up 4.2?

jib:/dmsp/reference/build/bdb-0.5.1 > ls /dmsp/reference/lib/libdb-4.2.*
/dmsp/reference/lib/libdb-4.2.a /dmsp/reference/lib/libdb-4.2.la /dmsp/reference/lib/libdb-4.2.so


jib:/dmsp/reference/build/bdb-0.5.1 > strings /dmsp/reference/lib/libdb-4.2.so |grep db_version
db_version


jib:/dmsp/reference/build/bdb-0.5.1 > ruby extconf.rb --with-db-dir=/dmsp/reference/
extconf.rb: Entering directory `src'
checking for db_version() in -ldb-4.2... no
checking for db_version_4002() in -ldb-4.2... no
checking for db_version() in -ldb42... no
checking for db_version_4002() in -ldb42... no
checking for db_version() in -ldb-4.1... yes
creating Makefile
extconf.rb: Leaving directory `src'


jib:/dmsp/reference/build/bdb-0.5.1 > make
make[1]: Entering directory `/dmsp/moby-1-1/reference/build/bdb-0.5.1/src'
gcc -fPIC -g -O2 -I. -I/dmsp/reference/ruby-1.8.1/lib/ruby/1.8/i686-linux -I/dmsp/reference/ruby-1.8.1/lib/ruby/1.8/i686-linux -I. -I/dmsp/reference//include -c common.c
gcc -fPIC -g -O2 -I. -I/dmsp/reference/ruby-1.8.1/lib/ruby/1.8/i686-linux -I/dmsp/reference/ruby-1.8.1/lib/ruby/1.8/i686-linux -I. -I/dmsp/reference//include -c bdb.c
gcc -fPIC -g -O2 -I. -I/dmsp/reference/ruby-1.8.1/lib/ruby/1.8/i686-linux -I/dmsp/reference/ruby-1.8.1/lib/ruby/1.8/i686-linux -I. -I/dmsp/reference//include -c lock.c
gcc -fPIC -g -O2 -I. -I/dmsp/reference/ruby-1.8.1/lib/ruby/1.8/i686-linux -I/dmsp/reference/ruby-1.8.1/lib/ruby/1.8/i686-linux -I. -I/dmsp/reference//include -c env.c
gcc -fPIC -g -O2 -I. -I/dmsp/reference/ruby-1.8.1/lib/ruby/1.8/i686-linux -I/dmsp/reference/ruby-1.8.1/lib/ruby/1.8/i686-linux -I. -I/dmsp/reference//include -c cursor.c
gcc -fPIC -g -O2 -I. -I/dmsp/reference/ruby-1.8.1/lib/ruby/1.8/i686-linux -I/dmsp/reference/ruby-1.8.1/lib/ruby/1.8/i686-linux -I. -I/dmsp/reference//include -c delegator.c
gcc -fPIC -g -O2 -I. -I/dmsp/reference/ruby-1.8.1/lib/ruby/1.8/i686-linux -I/dmsp/reference/ruby-1.8.1/lib/ruby/1.8/i686-linux -I. -I/dmsp/reference//include -c log.c
gcc -fPIC -g -O2 -I. -I/dmsp/reference/ruby-1.8.1/lib/ruby/1.8/i686-linux -I/dmsp/reference/ruby-1.8.1/lib/ruby/1.8/i686-linux -I. -I/dmsp/reference//include -c transaction.c
gcc -fPIC -g -O2 -I. -I/dmsp/reference/ruby-1.8.1/lib/ruby/1.8/i686-linux -I/dmsp/reference/ruby-1.8.1/lib/ruby/1.8/i686-linux -I. -I/dmsp/reference//include -c recnum.c
gcc -shared -L"/dmsp/reference/ruby-1.8.1/lib" -L"/dmsp/reference//lib" -o bdb.so common.o bdb.o lock.o env.o cursor.o delegator.o log.o transaction.o recnum.o -ldb-4.1 -ldl -lcrypt -lm -lc
make[1]: Leaving directory `/dmsp/moby-1-1/reference/build/bdb-0.5.1/src'


jib:/dmsp/reference/build/bdb-0.5.1 > ldd src/bdb.so
libdb-4.1.so => /lib/libdb-4.1.so (0xb750b000)
libdl.so.2 => /lib/libdl.so.2 (0xb7508000)
libcrypt.so.1 => /lib/libcrypt.so.1 (0xb74db000)
libm.so.6 => /lib/tls/libm.so.6 (0xb74b8000)
libc.so.6 => /lib/tls/libc.so.6 (0xb7380000)
libpthread.so.0 => /lib/tls/libpthread.so.0 (0xb7370000)
/lib/ld-linux.so.2 => /lib/ld-linux.so.2 (0x80000000)



what am i missing - why does this not link against 4.2?

ps. guy - those are some __crazy__ extconf.rb files! ;-)

-a
--
===============================================================================
| EMAIL :: Ara [dot] T [dot] Howard [at] noaa [dot] gov
| PHONE :: 303.497.6469
| A flower falls, even though we love it;
| and a weed grows, even though we do not love it.
| --Dogen
===============================================================================
 
A

Ara.T.Howard

A> shouldn't this pick up 4.2?

What is the content of src/mkmf.log ?

looks like all the conftest.c files testing for bdb features need to be
compiled with '-lpthread'... how to affect this for have_library? $LDFLAGS
doesn't seem to do it...

regards.

-a


have_library: checking for db_version() in -ldb-4.2... -------------------- no

"gcc -o conftest -I/dmsp/reference/ruby-1.8.1/lib/ruby/1.8/i686-linux -I/dmsp/reference/ruby-1.8.1/lib/ruby/1.8/i686-linux -I/usr/include -g -O2 conftest.c -L"/dmsp/reference/ruby-1.8.1/lib" -L"/dmsp/reference/lib/" -lruby-static -ldb-4.2 -ldl -lcrypt -lm -lc"
/dmsp/reference/lib//libdb-4.2.so: undefined reference to `pthread_condattr_setpshared'
/dmsp/reference/lib//libdb-4.2.so: undefined reference to `pthread_mutexattr_destroy'
/dmsp/reference/lib//libdb-4.2.so: undefined reference to `pthread_mutexattr_setpshared'
/dmsp/reference/lib//libdb-4.2.so: undefined reference to `pthread_mutexattr_init'
/dmsp/reference/lib//libdb-4.2.so: undefined reference to `pthread_mutex_trylock'
collect2: ld returned 1 exit status
checked program was:
/* begin */

/*top*/
int main() { return 0; }
int t() { db_version(); return 0; }
/* end */

"gcc -o conftest -I/dmsp/reference/ruby-1.8.1/lib/ruby/1.8/i686-linux -I/dmsp/reference/ruby-1.8.1/lib/ruby/1.8/i686-linux -I/usr/include -g -O2 conftest.c -L"/dmsp/reference/ruby-1.8.1/lib" -L"/dmsp/reference/lib/" -lruby-static -ldb-4.2 -ldl -lcrypt -lm -lc"
conftest.c: In function `t':
conftest.c:5: `db_version' undeclared (first use in this function)
conftest.c:5: (Each undeclared identifier is reported only once
conftest.c:5: for each function it appears in.)
checked program was:
/* begin */


/*top*/
int main() { return 0; }
int t() { void ((*volatile p)()); p = (void ((*)()))db_version; return 0; }
/* end */

--------------------

have_library: checking for db_version_4002() in -ldb-4.2... -------------------- no

"gcc -o conftest -I/dmsp/reference/ruby-1.8.1/lib/ruby/1.8/i686-linux -I/dmsp/reference/ruby-1.8.1/lib/ruby/1.8/i686-linux -I/usr/include -g -O2 conftest.c -L"/dmsp/reference/ruby-1.8.1/lib" -L"/dmsp/reference/lib/" -lruby-static -ldb-4.2 -ldl -lcrypt -lm -lc"
/tmp/ccwhD9Hw.o(.text+0x17): In function `t':
/dmsp/moby-1-1/reference/build/bdb-0.5.1/src/conftest.c:4: undefined reference to `db_version_4002'
/dmsp/reference/lib//libdb-4.2.so: undefined reference to `pthread_condattr_setpshared'
/dmsp/reference/lib//libdb-4.2.so: undefined reference to `pthread_mutexattr_destroy'
/dmsp/reference/lib//libdb-4.2.so: undefined reference to `pthread_mutexattr_setpshared'
/dmsp/reference/lib//libdb-4.2.so: undefined reference to `pthread_mutexattr_init'
/dmsp/reference/lib//libdb-4.2.so: undefined reference to `pthread_mutex_trylock'
collect2: ld returned 1 exit status
checked program was:
/* begin */

/*top*/
int main() { return 0; }
int t() { db_version_4002(); return 0; }
/* end */

"gcc -o conftest -I/dmsp/reference/ruby-1.8.1/lib/ruby/1.8/i686-linux -I/dmsp/reference/ruby-1.8.1/lib/ruby/1.8/i686-linux -I/usr/include -g -O2 conftest.c -L"/dmsp/reference/ruby-1.8.1/lib" -L"/dmsp/reference/lib/" -lruby-static -ldb-4.2 -ldl -lcrypt -lm -lc"
conftest.c: In function `t':
conftest.c:5: `db_version_4002' undeclared (first use in this function)
conftest.c:5: (Each undeclared identifier is reported only once
conftest.c:5: for each function it appears in.)
checked program was:
/* begin */


/*top*/
int main() { return 0; }
int t() { void ((*volatile p)()); p = (void ((*)()))db_version_4002; return 0; }
/* end */

--------------------

have_library: checking for db_version() in -ldb42... -------------------- no

"gcc -o conftest -I/dmsp/reference/ruby-1.8.1/lib/ruby/1.8/i686-linux -I/dmsp/reference/ruby-1.8.1/lib/ruby/1.8/i686-linux -I/usr/include -g -O2 conftest.c -L"/dmsp/reference/ruby-1.8.1/lib" -L"/dmsp/reference/lib/" -lruby-static -ldb42 -ldl -lcrypt -lm -lc"
/usr/bin/ld: cannot find -ldb42
collect2: ld returned 1 exit status
checked program was:
/* begin */

/*top*/
int main() { return 0; }
int t() { db_version(); return 0; }
/* end */

"gcc -o conftest -I/dmsp/reference/ruby-1.8.1/lib/ruby/1.8/i686-linux -I/dmsp/reference/ruby-1.8.1/lib/ruby/1.8/i686-linux -I/usr/include -g -O2 conftest.c -L"/dmsp/reference/ruby-1.8.1/lib" -L"/dmsp/reference/lib/" -lruby-static -ldb42 -ldl -lcrypt -lm -lc"
conftest.c: In function `t':
conftest.c:5: `db_version' undeclared (first use in this function)
conftest.c:5: (Each undeclared identifier is reported only once
conftest.c:5: for each function it appears in.)
checked program was:
/* begin */


/*top*/
int main() { return 0; }
int t() { void ((*volatile p)()); p = (void ((*)()))db_version; return 0; }
/* end */

--------------------

have_library: checking for db_version_4002() in -ldb42... -------------------- no

"gcc -o conftest -I/dmsp/reference/ruby-1.8.1/lib/ruby/1.8/i686-linux -I/dmsp/reference/ruby-1.8.1/lib/ruby/1.8/i686-linux -I/usr/include -g -O2 conftest.c -L"/dmsp/reference/ruby-1.8.1/lib" -L"/dmsp/reference/lib/" -lruby-static -ldb42 -ldl -lcrypt -lm -lc"
/usr/bin/ld: cannot find -ldb42
collect2: ld returned 1 exit status
checked program was:
/* begin */

/*top*/
int main() { return 0; }
int t() { db_version_4002(); return 0; }
/* end */

"gcc -o conftest -I/dmsp/reference/ruby-1.8.1/lib/ruby/1.8/i686-linux -I/dmsp/reference/ruby-1.8.1/lib/ruby/1.8/i686-linux -I/usr/include -g -O2 conftest.c -L"/dmsp/reference/ruby-1.8.1/lib" -L"/dmsp/reference/lib/" -lruby-static -ldb42 -ldl -lcrypt -lm -lc"
conftest.c: In function `t':
conftest.c:5: `db_version_4002' undeclared (first use in this function)
conftest.c:5: (Each undeclared identifier is reported only once
conftest.c:5: for each function it appears in.)
checked program was:
/* begin */


/*top*/
int main() { return 0; }
int t() { void ((*volatile p)()); p = (void ((*)()))db_version_4002; return 0; }
/* end */

--------------------

have_library: checking for db_version() in -ldb-4.1... -------------------- yes

"gcc -o conftest -I/dmsp/reference/ruby-1.8.1/lib/ruby/1.8/i686-linux -I/dmsp/reference/ruby-1.8.1/lib/ruby/1.8/i686-linux -I/usr/include -g -O2 conftest.c -L"/dmsp/reference/ruby-1.8.1/lib" -L"/dmsp/reference/lib/" -lruby-static -ldb-4.1 -ldl -lcrypt -lm -lc"
checked program was:
/* begin */

/*top*/
int main() { return 0; }
int t() { db_version(); return 0; }
/* end */

--------------------


-a
--
===============================================================================
| EMAIL :: Ara [dot] T [dot] Howard [at] noaa [dot] gov
| PHONE :: 303.497.6469
| A flower falls, even though we love it;
| and a weed grows, even though we do not love it.
| --Dogen
===============================================================================
 
T

ts

A> "gcc -o conftest -I/dmsp/reference/ruby-1.8.1/lib/ruby/1.8/i686-linux -I/dmsp/reference/ruby-1.8.1/lib/ruby/1.8/i686-linux -I/usr/include -g -O2 conftest.c -L"/dmsp/reference/ruby-1.8.1/lib" -L"/dmsp/reference/lib/" -lruby-static -ldb-4.2 -ldl -lcrypt -lm -lc"
A> /dmsp/reference/lib//libdb-4.2.so: undefined reference to `pthread_condattr_setpshared'


A> "gcc -o conftest -I/dmsp/reference/ruby-1.8.1/lib/ruby/1.8/i686-linux -I/dmsp/reference/ruby-1.8.1/lib/ruby/1.8/i686-linux -I/usr/include -g -O2 conftest.c -L"/dmsp/reference/ruby-1.8.1/lib" -L"/dmsp/reference/lib/" -lruby-static -ldb-4.1 -ldl -lcrypt -lm -lc"

If I'm right this mean that db-4.2 was compiled with pthread and not
db-4.1.

In this case, ruby must be compiled with pthread


Guy Decoux
 
A

Ara.T.Howard

A> "gcc -o conftest -I/dmsp/reference/ruby-1.8.1/lib/ruby/1.8/i686-linux -I/dmsp/reference/ruby-1.8.1/lib/ruby/1.8/i686-linux -I/usr/include -g -O2 conftest.c -L"/dmsp/reference/ruby-1.8.1/lib" -L"/dmsp/reference/lib/" -lruby-static -ldb-4.2 -ldl -lcrypt -lm -lc"
A> /dmsp/reference/lib//libdb-4.2.so: undefined reference to `pthread_condattr_setpshared'


A> "gcc -o conftest -I/dmsp/reference/ruby-1.8.1/lib/ruby/1.8/i686-linux -I/dmsp/reference/ruby-1.8.1/lib/ruby/1.8/i686-linux -I/usr/include -g -O2 conftest.c -L"/dmsp/reference/ruby-1.8.1/lib" -L"/dmsp/reference/lib/" -lruby-static -ldb-4.1 -ldl -lcrypt -lm -lc"

If I'm right this mean that db-4.2 was compiled with pthread and not
db-4.1.

In this case, ruby must be compiled with pthread


Guy Decoux

i don't like the sound of that - i think i should compile bdb without pthread
(i compiled 4.2). hopefully that isn't too hard to figure out...

regards.

-a
--
===============================================================================
| EMAIL :: Ara [dot] T [dot] Howard [at] noaa [dot] gov
| PHONE :: 303.497.6469
| A flower falls, even though we love it;
| and a weed grows, even though we do not love it.
| --Dogen
===============================================================================
 
T

ts

A> i don't like the sound of that - i think i should compile bdb without pthread
A> (i compiled 4.2). hopefully that isn't too hard to figure out...

I don't understand : do you have compiled db-4.2 with pthread ?

1) yes : ruby must be compiled with pthread and you'll have the right
flag

here an example with an old 1.8.1

svg% ruby -rrbconfig -e 'p Config::CONFIG["LIBS"]'
"-lpthread -ldl -lcrypt -lm "
svg%

svg% cat src/mkmf.log
have_library: checking for db_version() in -ldb-4.2... -------------------- yes

"gcc -o conftest -I/home/ts/local/rp/lib/ruby/1.8/i686-linux -I/home/ts/local/rp/lib/ruby/1.8/i686-linux -I/home/ts/local/db4.2.52/include -g -O2 conftest.c -L"/home/ts/local/rp/lib" -L"/home/ts/local/db4.2.52/lib" -lruby-static -ldb-4.2 -lpthread -ldl -lcrypt -lm -lc"
checked program was:
/* begin */

/*top*/
int main() { return 0; }
int t() { db_version(); return 0; }
/* end */

--------------------

svg%

2) no : you don't need to do nothing

svg% ruby -rrbconfig -e 'p Config::CONFIG["LIBS"]'
"-ldl -lcrypt -lm "
svg%

svg% cat src/mkmf.log
have_library: checking for db_version() in -ldb-4.2... -------------------- yes

"gcc -o conftest -I/home/ts/ruby/db/bdb-0.5.1/src -I/home/ts/local/r182/lib/ruby/1.8/i686-linux -I/home/ts/local/db4.2.52/include -g -O2 conftest.c -L"/home/ts/local/db4.2.52/lib" -L"/home/ts/local/r182/lib" -lruby-static -ldb-4.2 -ldl -lcrypt -lm -lc"
checked program was:
/* begin */

/*top*/
int main() { return 0; }
int t() { db_version(); return 0; }
/* end */

--------------------

svg%



Guy Decoux
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,981
Messages
2,570,188
Members
46,731
Latest member
MarcyGipso

Latest Threads

Top