← Back to team overview

dolfin team mailing list archive

Re: compile error

 


On Fri, 15 May 2009, Johan Hake wrote:

On Friday 15 May 2009 14:55:25 Shawn Walker wrote:
On Fri, 15 May 2009, Johan Hake wrote:
On Thursday 14 May 2009 21:03:47 Shawn Walker wrote:
ok, almost there.

I included the boost library directory into my LD_LIBRARY_PATH.  I also
made those symbolic links.  pkgconfig was able to find it just fine and
create the boost.pc file.

pkg-config does not find anything. It just reads and parse pkg-config
files, for example boost.pc. However the pkg-config file generators that
comes with dolfin tries to find the dependencies for the difference
packages that dolfin depends on. If found a pkg-config files for the
package is created.

The generators resides in

 scons/simula-scons/simula_scons/pkgconfiggenerators

and creates pkg-config files locally in

 scons/pkgconfig

when scons is called. These files are then installed in

 $PREFIX/lib/pkgconfig

This directory needs to be in your PKG_CONFIG_PATH, so you also need to
set this in your .bashrc or something.

I already have this in my PKG_CONFIG_PATH.

Ok.

Everything compiled (all demos too).  But, when
I try to do `scons install' I get:

Found optional package: umfpack
Found optional package: gts
Found optional package: cholmod
Disabling compilation of Python wrappers
scons: done reading SConscript files.
scons: Building targets ...
scons: *** [install]
/home/walker/build/include/boost-1_38/boost/algorithm: Is a directory
scons: building terminated because of errors.
install failed: Is a directory

Now what?

Beats me :(

Did you just type scons install? Where are you in the directory hierarchy
when you compile dolfin? Whats in scons/option.cache and
scons/simula_scons.log?

I typed:  'scons install prefix=$INSTALL_PATH'
where:  $INSTALL_PATH = ~/build

I compiled it under the '~/FENICS/dolfin' directory.  isn't this where it
should be compiled?

Yes, you can compile dolfin where you have your source.

Do you have any sym links in ~/FENICS/dolfin pointing at
your /home/walker/build direcory or something?

no...

I cannot figure out why you get:

 scons: *** [install]
 /home/walker/build/include/boost-1_38/boost/algorithm: Is a directory
 scons: building terminated because of errors.
 install failed: Is a directory

what does this error mean?

I am still using Scons 0.98.5.   Do I need to upgrade this?

- Shawn

I would actually suggest that you install boost somewhere else than as a sub
directory of ~/build. Then you either localy sym-link the libraries to the
new names, as before and give scons the new dirctory, or you sym-link the
files from the boost installation to ~/build{lib/include}, and let this be
your boost dir. Remember to remove old boost.pc files aafter you have changed
any directories.

This last suggestion is just a gut fealing. Do not know if it will work, but
something gets confused of boost/algorithm laying where it is, so moving it
might help ;)

Here are the contents of those files:

walker@box227 ~/FENICS/dolfin/scons
$ more options.cache
prefix = '/home/walker/build'
enableDemos = True
enableMpi = False
enableScotch = False
enableTrilinos = False
enableMtl4 = False
enableParmetis = False
enablePython = False
withPetscDir = '/home/walker/src/petsc-2.3.3-p13'
withSlepcDir = '/home/walker/src/slepc-2.3.3'
withUmfpackDir = '/usr/include/suitesparse'
withBoostDir = '/home/walker/build/include/boost-1_38'

walker@box227 ~/FENICS/dolfin/scons
$ more simula_scons.log
=================== dolfin log ===================
2009-05-14 15:00:23.369578
Using simula_scons from:
/home/walker/FENICS/dolfin/scons/simula-scons/simula_scons/__init__.pyc
resolveCompiler: No pkg-config generator for package 'ufc-1'. Assuming Ok.
resolveCompiler: No pkg-config generator for package 'gts'. Assuming Ok.

Nothing wrong here.

Johan
- Shawn

On Thu, 14 May 2009, Johan Hake wrote:
On Thursday 14 May 2009 15:37:14 Shawn Walker wrote:
On Thu, 14 May 2009, Johan Hake wrote:
On Wednesday 13 May 2009 23:48:33 Shawn Walker wrote:
On Wed, 13 May 2009, Johan Hake wrote:
On Wednesday 13 May 2009 21:34:57 Shawn Walker wrote:
ok, here it is.  Maybe it is a problem with the name.

walker@box227 ~
$ find -name 'libboost_program_options*'
./build/lib/libboost_program_options-gcc41-mt.so
./build/lib/libboost_program_options-gcc41-mt-1_38.so.1.38.0
./build/lib/libboost_program_options-gcc41-mt-1_38.so
./build/lib/libboost_program_options-gcc41-mt-1_38.a
./build/lib/libboost_program_options-gcc41-mt.a
./src/boost_1_38_0/bin.v2/libs/program_options/build/gcc-4.1.2/rel
ea se /t hre
ading-multi/libboost_program_options-gcc41-mt-1_38.so.1.38.0
./src/boost_1_38_0/bin.v2/libs/program_options/build/gcc-4.1.2/rel
ea se /l ink
-static/threading-multi/libboost_program_options-gcc41-mt-1_38.a

Have you installed the library? Typically make install or
something.

It looks like the library only lives in the build directory. None
of the above mentioned directories corresponds to any of the ones
given from

 pkg-config --libs dolfin

Following the output from pkg-config --libs dolfin I would expect
it to be in

 ./src/boost_1_38_0/libs

However I cannot figure out why you mannage to compile and install
dolfin in the first place...

Are you saying I don't know what I am doing?  :)  Well, you would be
right!  Only recently have I started compiling things; most of what
I did in the past (and still do) is in MATLAB.

He, he, you never know! Even if you would have compiled your own
stuff for a while we all do simple mistakes all the time, that goes
for all of us!

Yes, I installed the boost stuff with `make install'.  But boost put
it into those other dirs.  It also has a weird filename:
libboost_program_options-gcc41-mt-1_38 (not the one dolfin looks for
I think).  Isn't that the problem?  If it is, why didn't pkgconfig
auto-config the boost.pc file to look for this file?

Ok, I downloaded the latests boost and looked into the documentation
and boost has its owns naming convention for the installed libraries.

First of all whats in your,

 /home/walker/build/include/boost-1_38/lib

directory.

walker@box227 ~/build/include/boost-1_38/lib
$ ll
total 1.3M
-rw-------+ 1 walker walker 795K May 13 18:44
libboost_program_options-gcc41-mt-1_38.a
lrwxrwxrwx  1 walker walker   48 May 13 18:44
libboost_program_options-gcc41-mt-1_38.so ->
libboost_program_options-gcc41-mt-1_38.so.1.38.0*
-rwx------+ 1 walker walker 290K May 13 18:44
libboost_program_options-gcc41-mt-1_38.so.1.38.0*
lrwxrwxrwx  1 walker walker   40 May 13 18:44
libboost_program_options-gcc41-mt.a ->
libboost_program_options-gcc41-mt-1_38.a
lrwxrwxrwx  1 walker walker   48 May 13 18:44
libboost_program_options-gcc41-mt.so ->
libboost_program_options-gcc41-mt-1_38.so.1.38.0*

Ok, this tells us that the libraries are where they should be.

Second what does

 pkg-config --libs boost

give you? Hopefully it will include:

 -L/home/walker/build/include/boost-1_38/lib

meaning that the dolfin configuration system has picked up boost.

It gives me:

walker@box227 ~
$ pkg-config --libs boost
-L/home/walker/build/include/boost-1_38/lib -lboost_program_options

Seems to be right.

Third why has dolfin manage to do that? Have you set any
environmental variables like BOOST_DIR, pointing to that directory,
or called scons with
withBoostDir=/home/walker/build/include/boost-1_38?

Yes, I set BOOST_DIR to:

BOOST_DIR=/home/walker/build/include/boost-1_38

BTW: my current LD_LIBRARY_PATH is:

LD_LIBRARY_PATH=/home/walker/build/lib/vtk-5.3:/home/walker/build/lib:

To be able to run any dolfin applications you need to include the boost
path too. I would recomend that you make yourself a local directory
where you install your compiled libraries.

Fourth, (and here comes the suggestion to fix this ;) ), go
into /home/walker/build/include/boost-1_38/lib, or another directory
that is included in your LD_LIBRARY_PATH, and which you can pass to
dolfin via the withBoostDir= option. I have installed all my locally
compiled libraries under

 ~/local

including all the FEhiCS packages. Then you create a link to the
newly compiled boost libraries in this directory. Make sure you
change name of the libraries when you link. For example:

 ln -fs ~/build/lib/libboost_program_options-gcc41-mt.so \
         libboost_program_options.so
 ln -fs ~/build/lib/libboost_program_options-gcc41-mt.a \
         libboost_program_options.a

ok, I had thought about doing something like this, but it seemed kind
of hacky...  Shouldn't pkg-config figure this out when it creates the
boost.pc file?

Well, by naming the libraries like boost do boot gives the user the
responsability to link to them in what ever way he likes to. By making
symbolic links to these files is one way. Another way is to hard code
the library file name into a boost pkg-config file which can be used by
scons and dolfin.

And voila! It should just work (cross fingers ;) )

I will try it.

I see that it didn't work out. What does scons/scons.log tell you?

My thought was to keep the boost.pc file which then would have pointed
to the right library. But you told me that you erased the boost.pc file
and simula-scons did not pick it up again? Right?

I also see that we do not link any thing in our test script (boost.py),
whould we do that too, as Shawns trouble comes in the linking?

Johan

- Shawn

You might include the above lines in your .bashrc file, and you
should probably try to avoid link to a build directory as these tends
to have a limited life.

Johan

I also changed something in between.  Here is a re-run of
pkg-config:

walker@box227 ~
$ pkg-config --libs dolfin
-pthread -Wl,--export-dynamic
-Wl,-rpath,/home/walker/src/slepc-2.3.3/lib/linux-gnu-cxx-debug
-Wl,-rpath,/home/walker/src/petsc-2.3.3-p13/lib/linux-gnu-cxx-debug
-L/home/walker/build/include/boost-1_38/lib -L/usr/lib -L/lib
-L/home/walker/build/lib
-L/home/walker/src/slepc-2.3.3/lib/linux-gnu-cxx-debug
-L/usr/lib/atlas
-L/home/walker/src/petsc-2.3.3-p13/lib/linux-gnu-cxx-debug -L/usr
-ldolfin -lslepc -lumfpack -lgts -llapack -lblas -lcholmod -lamd
-lcolamd -lboost_program_options -lxml2 -lz -lm -lpetscts
-lpetscsnes -lpetscksp -lpetscdm -lpetscmat -lpetscvec -lpetsc
-lgthread-2.0 -lgmodule-2.0 -ldl -lglib-2.0

Though, I don't think this makes a difference.

- Shawn

On Wed, 13 May 2009, Johan Hake wrote:
On Wednesday 13 May 2009 20:24:10 Shawn Walker wrote:
I am still getting this error.  I'm pretty sure boost is being
included. Does anyone have any suggestions?

I see from the output from your pkg-config command that you have
a boost installation in

 /home/walker/src/boost_1_38_0

Do you have several boost installations? The undefined symols you
refere to here are all defined in libboost_program_options, so it
should work. What does

 locate libboost_program_options

give you?

Johan

/usr/bin/ld: skipping incompatible /usr/lib/libc.so when
searching for -lc /usr/bin/ld: skipping incompatible
/usr/lib/libc.a when searching for -lc dolfin/libdolfin.so:
undefined reference to
`boost::program_options::options_description::m_default_line_len
gt h' dolfin/libdolfin.so: undefined reference to

`boost::program_options::detail::cmdline::set_additional_parser(boost:
:f unc tion1<std::pair<std::basic_string<char,
: std::char_traits<char>,

std::allocator<char> >, std::basic_string<char,
std::char_traits<char>, std::allocator<char> > >,
std::basic_string<char,
std::char_traits<char>, std::allocator<char> > const&>)'
collect2: ld returned 1 exit status
scons: *** [demo/quadrature/cpp/demo] Error 1
scons: building terminated because of errors.
demo/quadrature/cpp/demo failed: Error 1

- Shawn
_______________________________________________
DOLFIN-dev mailing list
DOLFIN-dev@xxxxxxxxxx
http://www.fenics.org/mailman/listinfo/dolfin-dev





Follow ups

References