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

Stroud, Sean T ststrou at sandia.gov
Thu Sep 20 16:36:10 EDT 2012


Hi Boris,

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).  Nevertheless, I tried the ./configure command you gave below, but got the following error:

    % ./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
    ...
    configure: error: libodb is not found; consider using --with-libodb=DIR

In fact, I had tried this before and that is the reason I began trying the --with-libodb option in the first place.  
Looking more closely at the "-I" and "-L" options in the above command, I see that they refer to directories that do not exist.  So perhaps you meant this instead?

    % ./configure --prefix=/home/ststrou/ODB2.1/local CPPFLAGS=-I/home/ststrou/ODB2.1/libodb-2.1.0 LDFLAGS=-L/home/ststrou/ODB2.1/libodb-2.1.0

Unfortunately that fails with the same error " libodb not found".
Hmm. I see that those directories exist, but the libodb.la file is actually located in the "odb" subdirectory.  So next I tried this:

    % ./configure --prefix=/home/ststrou/ODB2.1/local CPPFLAGS=-I/home/ststrou/ODB2.1/libodb-2.1.0/odb LDFLAGS=-L/home/ststrou/ODB2.1/libodb-2.1.0/odb

Dang, still fails with "libodb not found", even though the library is clearly in there, as shown below:

   -rw-rw-r-- 1 ststrou ststrou 940 Sep 20 10:14 /home/ststrou/ODB2.1/libodb-2.1.0/odb/libodb.la

Perhaps I should point it to the installed libodb include/libs dirs instead, i.e. like this?

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

Nope, that fails as well, this time with the original error ("cannot find -lodb").

Well I'm almost out of ideas, but here are two thoughts:
- I notice in your examples you have a backslash in the command before the CPPFLAGS and before the LDFLAGS.  Is that important?  The examples in the INSTALL file don't have it.  I tried with and without it (but not very rigorously) and didn't seem to make a difference.
- 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.  I tried with and without it (but not very rigorously) and didn't seem to make a difference.

Sean


-----Original Message-----
From: Boris Kolpackov [mailto:boris at codesynthesis.com] 
Sent: Thursday, September 20, 2012 2:09 PM
To: Stroud, Sean T
Cc: odb-users at codesynthesis.com
Subject: [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:

> 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