[EXTERNAL] Re: [odb-users] Problem installing ODB 2.1.0 somewhere other than /usr/local/

Stroud, Sean T ststrou at sandia.gov
Fri Sep 21 10:17:17 EDT 2012


Hi Boris,

Thanks for all your patience with this.  Unfortunately I am still getting errors, even with the latest command you provided.  Here is the script I use to build/install all the ODB libs:

#!/bin/ksh -v
pwd
ls
rm -rf local
mkdir local
export LD_LIBRARY_PATH=/home/ststrou/ODB2.1/local/lib:$LD_LIBRARY_PATH
cd libodb-2.1.0
./configure --prefix=/home/ststrou/ODB2.1/local
make
make install
cd ../libodb-mysql-2.1.0
./configure --prefix=/home/ststrou/ODB2.1/local CPPFLAGS=-I/home/ststrou/ODB2.1/local/include LDFLAGS=-L/home/ststrou/ODB2.1/local/lib
make
make install

I invoke the above script from the /home/ststrou/ODB2.1/ directory.  The last "make install" command fails with " /usr/bin/ld: cannot find -lodb ".  Below is the full output from running the script:

#!/bin/ksh -v

pwd
/home/ststrou/ODB2.1
ls
buildit
download
libodb-2.1.0
libodb-mysql-2.1.0
libodb-pgsql-2.1.0
local
odb-2.1.0-x86_64-linux-gnu
odb-examples-2.1.0
out
rm -rf local
mkdir local
export LD_LIBRARY_PATH=/home/ststrou/ODB2.1/local/lib:$LD_LIBRARY_PATH
cd libodb-2.1.0
./configure --prefix=/home/ststrou/ODB2.1/local
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for a thread-safe mkdir -p... /bin/mkdir -p
checking for gawk... gawk
checking whether make sets $(MAKE)... yes
checking how to create a ustar tar archive... gnutar
checking build system type... x86_64-unknown-linux-gnu
checking host system type... x86_64-unknown-linux-gnu
checking for style of include used by make... GNU
checking for gcc... gcc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables... 
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking for gcc option to accept ISO C89... none needed
checking dependency style of gcc... gcc3
checking for a sed that does not truncate output... /bin/sed
checking for grep that handles long lines and -e... /bin/grep
checking for egrep... /bin/grep -E
checking for fgrep... /bin/grep -F
checking for ld used by gcc... /usr/bin/ld
checking if the linker (/usr/bin/ld) is GNU ld... yes
checking for BSD- or MS-compatible name lister (nm)... /usr/bin/nm -B
checking the name lister (/usr/bin/nm -B) interface... BSD nm
checking whether ln -s works... yes
checking the maximum length of command line arguments... 98304
checking whether the shell understands some XSI constructs... yes
checking whether the shell understands "+="... yes
checking for /usr/bin/ld option to reload object files... -r
checking for objdump... objdump
checking how to recognize dependent libraries... pass_all
checking for ar... ar
checking for strip... strip
checking for ranlib... ranlib
checking command to parse /usr/bin/nm -B output from gcc object... ok
checking how to run the C preprocessor... gcc -E
checking for ANSI C header files... yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking for dlfcn.h... yes
checking for objdir... .libs
checking if gcc supports -fno-rtti -fno-exceptions... no
checking for gcc option to produce PIC... -fPIC -DPIC
checking if gcc PIC flag -fPIC -DPIC works... yes
checking if gcc static flag -static works... yes
checking if gcc supports -c -o file.o... yes
checking if gcc supports -c -o file.o... (cached) yes
checking whether the gcc linker (/usr/bin/ld -m elf_x86_64) supports shared libraries... yes
checking whether -lc should be explicitly linked in... no
checking dynamic linker characteristics... GNU/Linux ld.so
checking how to hardcode library paths into programs... immediate
checking whether stripping libraries is possible... yes
checking if libtool supports shared libraries... yes
checking whether to build shared libraries... yes
checking whether to build static libraries... yes
checking for g++... g++
checking whether we are using the GNU C++ compiler... yes
checking whether g++ accepts -g... yes
checking dependency style of g++... gcc3
checking whether we are using the GNU C++ compiler... (cached) yes
checking whether g++ accepts -g... (cached) yes
checking dependency style of g++... (cached) gcc3
checking how to run the C++ preprocessor... g++ -E
checking for ld used by g++... /usr/bin/ld -m elf_x86_64
checking if the linker (/usr/bin/ld -m elf_x86_64) is GNU ld... yes
checking whether the g++ linker (/usr/bin/ld -m elf_x86_64) supports shared libraries... yes
checking for g++ option to produce PIC... -fPIC -DPIC
checking if g++ PIC flag -fPIC -DPIC works... yes
checking if g++ static flag -static works... yes
checking if g++ supports -c -o file.o... yes
checking if g++ supports -c -o file.o... (cached) yes
checking whether the g++ linker (/usr/bin/ld -m elf_x86_64) supports shared libraries... yes
checking dynamic linker characteristics... GNU/Linux ld.so
checking how to hardcode library paths into programs... immediate
configure: creating ./config.lt
config.lt: creating libtool
checking for the pthreads library -lpthreads... no
checking for the pthreads library -lpthread... yes
checking if more special flags are required for pthreads... -D_REENTRANT
checking for __thread keyword... yes
checking whether to use rpath... yes
configure: creating ./config.status
config.status: creating libodb.pc
config.status: creating Makefile
config.status: creating odb/Makefile
config.status: creating odb/config.h
config.status: odb/config.h is unchanged
config.status: creating odb/details/config.h
config.status: odb/details/config.h is unchanged
config.status: executing depfiles commands
config.status: executing libtool commands
config.status: executing libtool-rpath-patch commands
make
Making all in odb
make[1]: Entering directory `/home/ststrou/ODB2.1/libodb-2.1.0/odb'
make  all-am
make[2]: Entering directory `/home/ststrou/ODB2.1/libodb-2.1.0/odb'
make[2]: Leaving directory `/home/ststrou/ODB2.1/libodb-2.1.0/odb'
make[1]: Leaving directory `/home/ststrou/ODB2.1/libodb-2.1.0/odb'
make[1]: Entering directory `/home/ststrou/ODB2.1/libodb-2.1.0'
make[1]: Nothing to be done for `all-am'.
make[1]: Leaving directory `/home/ststrou/ODB2.1/libodb-2.1.0'
make install
Making install in odb
make[1]: Entering directory `/home/ststrou/ODB2.1/libodb-2.1.0/odb'
make[2]: Entering directory `/home/ststrou/ODB2.1/libodb-2.1.0/odb'
test -z "/home/ststrou/ODB2.1/local/lib" || /bin/mkdir -p "/home/ststrou/ODB2.1/local/lib"
 /bin/sh ../libtool   --mode=install /usr/bin/install -c   libodb.la '/home/ststrou/ODB2.1/local/lib'
libtool: install: /usr/bin/install -c .libs/libodb-2.1.so /home/ststrou/ODB2.1/local/lib/libodb-2.1.so
libtool: install: (cd /home/ststrou/ODB2.1/local/lib && { ln -s -f libodb-2.1.so libodb.so || { rm -f libodb.so && ln -s libodb-2.1.so libodb.so; }; })
libtool: install: /usr/bin/install -c .libs/libodb.lai /home/ststrou/ODB2.1/local/lib/libodb.la
libtool: install: /usr/bin/install -c .libs/libodb.a /home/ststrou/ODB2.1/local/lib/libodb.a
libtool: install: chmod 644 /home/ststrou/ODB2.1/local/lib/libodb.a
libtool: install: ranlib /home/ststrou/ODB2.1/local/lib/libodb.a
libtool: install: warning: remember to run `libtool --finish /usr/local/lib'
test -z "/home/ststrou/ODB2.1/local/include/odb" || /bin/mkdir -p "/home/ststrou/ODB2.1/local/include/odb"
/bin/mkdir -p '/home/ststrou/ODB2.1/local/include/odb/details'
 /usr/bin/install -c -m 644  details/config.h '/home/ststrou/ODB2.1/local/include/odb/details'
test -z "/home/ststrou/ODB2.1/local/include/odb" || /bin/mkdir -p "/home/ststrou/ODB2.1/local/include/odb"
 /usr/bin/install -c -m 644  std-map-traits.hxx std-set-traits.hxx no-id-object-result.txx lazy-ptr-impl.txx post.hxx session.txx no-op-cache-traits.hxx transaction.ixx view-result.hxx cache-traits.hxx std-array-traits.hxx std-unordered-set-traits.hxx lazy-ptr.txx database.txx traits.hxx tracer.hxx result.hxx session.hxx object-result.hxx lazy-ptr.hxx exception.hxx transaction.hxx connection.hxx polymorphic-map.hxx connection.ixx session.ixx core.hxx simple-object-result.hxx pointer-traits.hxx pre.hxx statement.hxx database.hxx database.ixx simple-object-result.txx view-result.txx lazy-ptr-impl.ixx lazy-ptr.ixx forward.hxx schema-catalog.hxx std-vector-traits.hxx '/home/ststrou/ODB2.1/local/include/odb/.'
/bin/mkdir -p '/home/ststrou/ODB2.1/local/include/odb/details/meta'
 /usr/bin/install -c -m 644  details/meta/remove-const.hxx details/meta/polymorphic-p.hxx details/meta/remove-volatile.hxx details/meta/answer.hxx details/meta/remove-pointer.hxx details/meta/remove-const-volatile.hxx details/meta/class-p.hxx '/home/ststrou/ODB2.1/local/include/odb/details/meta'
/bin/mkdir -p '/home/ststrou/ODB2.1/local/include/odb/details'
 /usr/bin/install -c -m 644  details/type-info.hxx details/shared-ptr.hxx details/exception.hxx details/mutex.hxx details/shared-ptr-fwd.hxx details/condition.hxx details/thread.hxx details/tls.hxx details/wrapper-p.hxx details/unused.hxx details/export.hxx details/lock.hxx details/transfer-ptr.hxx details/buffer.hxx details/unique-ptr.hxx details/config.hxx '/home/ststrou/ODB2.1/local/include/odb/details'
/bin/mkdir -p '/home/ststrou/ODB2.1/local/include/odb/tr1'
 /usr/bin/install -c -m 644  tr1/lazy-ptr.txx tr1/memory.hxx tr1/lazy-ptr.hxx tr1/pointer-traits.hxx tr1/lazy-ptr.ixx tr1/wrapper-traits.hxx tr1/lazy-pointer-traits.hxx '/home/ststrou/ODB2.1/local/include/odb/tr1'
/bin/mkdir -p '/home/ststrou/ODB2.1/local/include/odb/compilers/vc'
 /usr/bin/install -c -m 644  compilers/vc/post.hxx compilers/vc/pre.hxx '/home/ststrou/ODB2.1/local/include/odb/compilers/vc'
 /usr/bin/install -c -m 644  lazy-ptr-impl.hxx polymorphic-object-result.hxx exceptions.hxx wrapper-traits.hxx polymorphic-info.hxx polymorphic-map.ixx container-traits.hxx query.hxx no-id-object-result.hxx polymorphic-object-result.txx std-unordered-map-traits.hxx lazy-pointer-traits.hxx schema-catalog-impl.hxx callback.hxx nullable.hxx std-forward-list-traits.hxx version.hxx std-list-traits.hxx polymorphic-map.txx '/home/ststrou/ODB2.1/local/include/odb/.'
/bin/mkdir -p '/home/ststrou/ODB2.1/local/include/odb/details/posix'
 /usr/bin/install -c -m 644  details/posix/mutex.hxx details/posix/thread.ixx details/posix/condition.hxx details/posix/thread.hxx details/posix/tls.ixx details/posix/mutex.ixx details/posix/tls.txx details/posix/tls.hxx details/posix/exceptions.hxx details/posix/condition.ixx '/home/ststrou/ODB2.1/local/include/odb/details/posix'
/bin/mkdir -p '/home/ststrou/ODB2.1/local/include/odb/details/shared-ptr'
 /usr/bin/install -c -m 644  details/shared-ptr/base.txx details/shared-ptr/counter-type.hxx details/shared-ptr/base.ixx details/shared-ptr/base.hxx '/home/ststrou/ODB2.1/local/include/odb/details/shared-ptr'
make[2]: Leaving directory `/home/ststrou/ODB2.1/libodb-2.1.0/odb'
make[1]: Leaving directory `/home/ststrou/ODB2.1/libodb-2.1.0/odb'
make[1]: Entering directory `/home/ststrou/ODB2.1/libodb-2.1.0'
make[2]: Entering directory `/home/ststrou/ODB2.1/libodb-2.1.0'
make[2]: Nothing to be done for `install-exec-am'.
test -z "/home/ststrou/ODB2.1/local/share/doc/libodb" || /bin/mkdir -p "/home/ststrou/ODB2.1/local/share/doc/libodb"
 /usr/bin/install -c -m 644 GPLv2 LICENSE README NEWS version '/home/ststrou/ODB2.1/local/share/doc/libodb'
test -z "/home/ststrou/ODB2.1/local/lib/pkgconfig" || /bin/mkdir -p "/home/ststrou/ODB2.1/local/lib/pkgconfig"
 /usr/bin/install -c -m 644 libodb.pc '/home/ststrou/ODB2.1/local/lib/pkgconfig'
make[2]: Leaving directory `/home/ststrou/ODB2.1/libodb-2.1.0'
make[1]: Leaving directory `/home/ststrou/ODB2.1/libodb-2.1.0'
cd ../libodb-mysql-2.1.0
./configure --prefix=/home/ststrou/ODB2.1/local CPPFLAGS=-I/home/ststrou/ODB2.1/local/include LDFLAGS=-L/home/ststrou/ODB2.1/local/lib
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for a thread-safe mkdir -p... /bin/mkdir -p
checking for gawk... gawk
checking whether make sets $(MAKE)... yes
checking how to create a ustar tar archive... gnutar
checking build system type... x86_64-unknown-linux-gnu
checking host system type... x86_64-unknown-linux-gnu
checking for style of include used by make... GNU
checking for gcc... gcc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables... 
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking for gcc option to accept ISO C89... none needed
checking dependency style of gcc... gcc3
checking for a sed that does not truncate output... /bin/sed
checking for grep that handles long lines and -e... /bin/grep
checking for egrep... /bin/grep -E
checking for fgrep... /bin/grep -F
checking for ld used by gcc... /usr/bin/ld
checking if the linker (/usr/bin/ld) is GNU ld... yes
checking for BSD- or MS-compatible name lister (nm)... /usr/bin/nm -B
checking the name lister (/usr/bin/nm -B) interface... BSD nm
checking whether ln -s works... yes
checking the maximum length of command line arguments... 98304
checking whether the shell understands some XSI constructs... yes
checking whether the shell understands "+="... yes
checking for /usr/bin/ld option to reload object files... -r
checking for objdump... objdump
checking how to recognize dependent libraries... pass_all
checking for ar... ar
checking for strip... strip
checking for ranlib... ranlib
checking command to parse /usr/bin/nm -B output from gcc object... ok
checking how to run the C preprocessor... gcc -E
checking for ANSI C header files... yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking for dlfcn.h... yes
checking for objdir... .libs
checking if gcc supports -fno-rtti -fno-exceptions... no
checking for gcc option to produce PIC... -fPIC -DPIC
checking if gcc PIC flag -fPIC -DPIC works... yes
checking if gcc static flag -static works... yes
checking if gcc supports -c -o file.o... yes
checking if gcc supports -c -o file.o... (cached) yes
checking whether the gcc linker (/usr/bin/ld -m elf_x86_64) supports shared libraries... yes
checking whether -lc should be explicitly linked in... no
checking dynamic linker characteristics... GNU/Linux ld.so
checking how to hardcode library paths into programs... immediate
checking whether stripping libraries is possible... yes
checking if libtool supports shared libraries... yes
checking whether to build shared libraries... yes
checking whether to build static libraries... yes
checking for g++... g++
checking whether we are using the GNU C++ compiler... yes
checking whether g++ accepts -g... yes
checking dependency style of g++... gcc3
checking whether we are using the GNU C++ compiler... (cached) yes
checking whether g++ accepts -g... (cached) yes
checking dependency style of g++... (cached) gcc3
checking how to run the C++ preprocessor... g++ -E
checking for ld used by g++... /usr/bin/ld -m elf_x86_64
checking if the linker (/usr/bin/ld -m elf_x86_64) is GNU ld... yes
checking whether the g++ linker (/usr/bin/ld -m elf_x86_64) supports shared libraries... yes
checking for g++ option to produce PIC... -fPIC -DPIC
checking if g++ PIC flag -fPIC -DPIC works... yes
checking if g++ static flag -static works... yes
checking if g++ supports -c -o file.o... yes
checking if g++ supports -c -o file.o... (cached) yes
checking whether the g++ linker (/usr/bin/ld -m elf_x86_64) supports shared libraries... yes
checking dynamic linker characteristics... GNU/Linux ld.so
checking how to hardcode library paths into programs... immediate
configure: creating ./config.lt
config.lt: creating libtool
checking for the pthreads library -lpthreads... no
checking for the pthreads library -lpthread... yes
checking if more special flags are required for pthreads... -D_REENTRANT
checking for __thread keyword... yes
checking for libmysqlclient_r... yes
checking for libodb... yes
checking whether to use rpath... yes
configure: creating ./config.status
config.status: creating libodb-mysql.pc
config.status: creating Makefile
config.status: creating odb/mysql/Makefile
config.status: creating odb/mysql/config.h
config.status: odb/mysql/config.h is unchanged
config.status: creating odb/mysql/details/config.h
config.status: odb/mysql/details/config.h is unchanged
config.status: executing depfiles commands
config.status: executing libtool commands
config.status: executing libtool-rpath-patch commands
make
Making all in odb/mysql
make[1]: Entering directory `/home/ststrou/ODB2.1/libodb-mysql-2.1.0/odb/mysql'
make  all-am
make[2]: Entering directory `/home/ststrou/ODB2.1/libodb-mysql-2.1.0/odb/mysql'
make[2]: Leaving directory `/home/ststrou/ODB2.1/libodb-mysql-2.1.0/odb/mysql'
make[1]: Leaving directory `/home/ststrou/ODB2.1/libodb-mysql-2.1.0/odb/mysql'
make[1]: Entering directory `/home/ststrou/ODB2.1/libodb-mysql-2.1.0'
make[1]: Nothing to be done for `all-am'.
make[1]: Leaving directory `/home/ststrou/ODB2.1/libodb-mysql-2.1.0'
make install
Making install in odb/mysql
make[1]: Entering directory `/home/ststrou/ODB2.1/libodb-mysql-2.1.0/odb/mysql'
make[2]: Entering directory `/home/ststrou/ODB2.1/libodb-mysql-2.1.0/odb/mysql'
test -z "/home/ststrou/ODB2.1/local/lib" || /bin/mkdir -p "/home/ststrou/ODB2.1/local/lib"
 /bin/sh ../../libtool   --mode=install /usr/bin/install -c   libodb-mysql.la '/home/ststrou/ODB2.1/local/lib'
libtool: install: warning: relinking `libodb-mysql.la'
libtool: install: (cd /home/ststrou/ODB2.1/libodb-mysql-2.1.0/odb/mysql; /bin/sh /home/ststrou/ODB2.1/libodb-mysql-2.1.0/libtool  --tag CXX --mode=relink g++ -g -O2 -D_REENTRANT -release 2.1 -no-undefined -L/usr/lib/mysql -L/home/ststrou/ODB2.1/libodb-2.1.0//odb -o libodb-mysql.la -rpath /home/ststrou/ODB2.1/local/lib connection.lo connection-factory.lo database.lo enum.lo error.lo exceptions.lo query.lo query-const-expr.lo simple-object-statements.lo statement.lo statements-base.lo tracer.lo traits.lo transaction.lo transaction-impl.lo details/options.lo -lodb -lmysqlclient_r -lpthread )
libtool: relink: g++ -shared -nostdlib /usr/lib/gcc/x86_64-redhat-linux/4.1.2/../../../../lib64/crti.o /usr/lib/gcc/x86_64-redhat-linux/4.1.2/crtbeginS.o  .libs/connection.o .libs/connection-factory.o .libs/database.o .libs/enum.o .libs/error.o .libs/exceptions.o .libs/query.o .libs/query-const-expr.o .libs/simple-object-statements.o .libs/statement.o .libs/statements-base.o .libs/tracer.o .libs/traits.o .libs/transaction.o .libs/transaction-impl.o details/.libs/options.o   -Wl,-rpath -Wl,/usr/local/lib -L/usr/lib/mysql -L/home/ststrou/ODB2.1/libodb-2.1.0//odb -L/usr/local/lib -lodb -lmysqlclient_r -lpthread -L/usr/lib/gcc/x86_64-redhat-linux/4.1.2 -L/usr/lib/gcc/x86_64-redhat-linux/4.1.2/../../../../lib64 -L/lib/../lib64 -L/usr/lib/../lib64 -lstdc++ -lm -lc -lgcc_s /usr/lib/gcc/x86_64-redhat-linux/4.1.2/crtendS.o /usr/lib/gcc/x86_64-redhat-linux/4.1.2/../../../../lib64/crtn.o    -Wl,-soname -Wl,libodb-mysql-2.1.so -o .libs/libodb-mysql-2.1.so
/usr/bin/ld: cannot find -lodb
collect2: ld returned 1 exit status
libtool: install: error: relink `libodb-mysql.la' with the above command before installing it
make[2]: *** [install-libLTLIBRARIES] Error 1
make[2]: Leaving directory `/home/ststrou/ODB2.1/libodb-mysql-2.1.0/odb/mysql'
make[1]: *** [install-am] Error 2
make[1]: Leaving directory `/home/ststrou/ODB2.1/libodb-mysql-2.1.0/odb/mysql'
make: *** [install-recursive] Error 1


-----Original Message-----
From: Boris Kolpackov [mailto:boris at codesynthesis.com] 
Sent: Friday, September 21, 2012 2:00 AM
To: Stroud, Sean T
Cc: odb-users at codesynthesis.com
Subject: Re: [EXTERNAL] Re: [odb-users] Problem installing ODB 2.1.0 somewhere other than /usr/local/

Hi Sean,

Stroud, Sean T <ststrou at sandia.gov> writes:

> Seems like the --with-libodb option ought to work, since I am pointing 
> at the directory where I build libodb (not the directory where I 
> installed it).

It works for *building* libodb-mysql but not for *installing* it since an installed library should not reference a non-installed one.


> Nevertheless, I tried the ./configure command you gave below, but got 
> the following error:

Sorry, I made a mistake in the command. Instead of ~/ODB2.1/libodb-2.1.0 in CPPFLAGS and LDFLAGS it should have been ~/ODB2.1/local:

./configure --prefix=/home/ststrou/ODB2.1/local CPPFLAGS=-I/home/ststrou/ODB2.1/local/include LDFLAGS=-L/home/ststrou/ODB2.1/local/lib


> - I notice in your examples you have a backslash in the command
>   before the CPPFLAGS and before the LDFLAGS. Is that important?

Backslashes are used to break a long command into multiple lines, for better readability.


> - Also, your suggestion about setting LD_LIBRARY_FLAGS env var should 
> not be necessary for building these libs, correct?  My understanding 
> is that is only to help when linking a client program against the odb 
> libraries.

Modern linkers are quite tricky in this regard and may require a shared library to be loadable just to link it to another library.
See the -rpath-link ld option for details. So it is safer to just add /home/ststrou/ODB2.1/local/lib to LD_LIBRARY_PATH before building.

Note also that it is LD_LIBRARY_PATH, not LD_LIBRARY_FLAGS.

Boris





More information about the odb-users mailing list