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

Boris Kolpackov boris at codesynthesis.com
Thu Sep 20 16:08:31 EDT 2012


Hi Sean,

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

> I am trying to install ODB 2.1.0 into my home directory instead 
> of /usr/local/ (since I don't have root privilege), but am getting
> an error.  Here are the commands I am using
> 
> % 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 --with-libodb=/home/ststrou/ODB2.1/libodb-2.1.0
> % make
> % make install
> 
> The problem occurs with the very last command ("make install").  The
> error is:
> 
> /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

I think you get this error because you install libodb in one place
(~/ODB2.1/local) but tell configure (with the --with-libodb option)
that it is in another. The --with-libodb option should really only
be used when you want to use non-installed build of this library.

In your case, instead of using --with-libodb, you should add
~/ODB2.1/local/include to CPPFLAGS and ~/ODB2.1/local/lib to LDFLAGS.
Also adding ~/ODB2.1/local/lib to LD_LIBRARY_PATH is a good idea
(you may want to add it in your .bashrc). Here is how I would build
things in your situation:

% 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/libodb-2.1.0/include \
LDFLAGS=-L/home/ststrou/ODB2.1/libodb-2.1.0/lib
% make
% make install

Boris



More information about the odb-users mailing list