← Back to team overview

dolfin team mailing list archive

Re: compile error

 

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/release
> >>>>/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/release
> >>>>/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_length'
> >>>>>> 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