PDA

View Full Version : boost + barry + Ubuntu/Feisty = ?


yigalweinstein
06-06-2007, 03:43 PM
I am trying to configure barry 0.8 CVS with boost. What path do I give for boost?

That is configuring for my install I am trying to:

./configure --prefix=/usr --with-boost=$BOOST

and I need and don't know $BOOST?

I used $BOOST=/usr/include/boost

as I used "locate boost" and this seemed to be the root location of "boost" but it doesn't work.

I also used $BOOST=/usr

but the output with both configurations using btool and the -f option, for example "btool -f text.txt -t" is always:

-f option not supported - no Boost serialization support available

rivviepop
06-06-2007, 11:10 PM
Not an Ubuntu guy, but I'll try. Do you have the -devel equivalent installed on your machine for the Boost libraries? I'm assuming you do since you have /usr/include/boost, but you also have /usr/lib/libboost_* there as well?

On Fedora the --with-boost=/usr is what you have to do for 0.7 (which is actually a bug, see here (http://sourceforge.net/tracker/index.php?func=detail&aid=1673614&group_id=153722&atid=788904)). When you run the ./configure --with-boot=/usr, what does the config.status and config.log have to say when it tests a boost compile?

yigalweinstein
06-07-2007, 11:05 AM
I attempted to post this at 1:20AM PST but the server seemed to be down.

1st) As a test for whether boost is working I used,

$sudo btool -f phone_logs.txt -d "Phone Call Logs"

for which the output indicates a negative indicator that boost was compiled into the make, with the following output,
-f option not supported - no Boost serialization support available
as stated previously.

Is this a proper test for whether I have boost enabled?

2nd) As to whether I installed what was required for boost to work correctly I am not sure. For Debian (and therefore and I am assuming Ubuntu) these consist of:
pkg-config
libusb-dev
libssl-dev
libboost-serialization-dev

which comes from the Barry main "README" file. I am not sure if I have to compile a package "boost" as there is none in the official repository or if the development package is good enough.

3rd) Here are some initial tests of what you asked:
config.status
$grep -in boost config.status
(Output)
338: with options \"'--prefix=/usr' '--with-boost=/usr'\"
413: echo "running CONFIG_SHELL=/bin/bash /bin/bash ./configure " '--prefix=/usr' '--with-boost=/usr' $ac_configure_extra_args " --no-create --no-recursion" >&6
416: exec /bin/bash "./configure" '--prefix=/usr' '--with-boost=/usr' $ac_configure_extra_args --no-create --no-recursion
613:s,@<hidden>@<hidden>,|#_!!_#|/usr/lib,g
614:s,@<hidden>@<hidden>,|#_!!_#|/usr/include,g
615:s,@<hidden>@<hidden>,|#_!!_#|,g
616:s,@<hidden>@<hidden>,|#_!!_#|#,g

config.log
$grep -in boost config.log
(Output)
7: $ ./configure --prefix=/usr --with-boost=/usr
1146:BOOST_INC_PATH='/usr/include'
1147:BOOST_LIB_PATH='/usr/lib'
1198:WITH_BOOST_FALSE='#'
1199:WITH_BOOST_TRUE=''

4th) Thanks for looking :)

rivviepop
06-07-2007, 12:41 PM
Let's do this the easy way - using ldd. :)

Run this (assuming the right path on Ubuntu):


ldd /usr/bin/btool | grep boost


The output should look similar to:


libboost_serialization.so.2 => /usr/lib/libboost_serialization.so.2 (0x00269000)


It'll probably differ on Ubuntu slightly, but the idea here is that we're looking for the classic "is it plugged in and turned on?" aspect; is your btool binary dynamically linked to the boost serialization lib(s).

yigalweinstein
06-07-2007, 12:50 PM
No :( I do not have boost by the test you mentioned. There is no output.

rivviepop
06-07-2007, 12:57 PM
No :( I do not have boost by the test you mentioned. There is no output.

Hey that's a good result at least, it's indicating that ./configure and/or make is not building in the needed hootenanny. Instead of using grep look at your config.log (and maybe others, but start with this) for the section where ./configure is trying to run a test compile to see if your Boost is usable. There's probably a little line in there that indicates the test compile and it's return status as fail, which might help point to the 'why' of the situation.

yigalweinstein
06-07-2007, 02:58 PM
It seems that I have the static libraries only and not the shared libraries, most specifically, I have no way of knowing if this has anything to do with no boost support.

I tested the library using a simple c++ code another Ubuntu user had created when they thought they had a problem with libboost-serialization-dev, the Ubuntu package in question.

#include <string>
#include <fstream>
#include <iostream>
#include <boost/archive/text_oarchive.hpp>
#include <boost/archive/text_iarchive.hpp>
#include <boost/serialization/string.hpp>
#include <boost/serialization/utility.hpp>
#include <boost/serialization/serialization.hpp>

int main(int argv, char** argc) {
std::ofstream s("./test.txt", std::ios::out|std::ios::binary);
boost::archive::text_oarchive oa(s);

//oa << 5;

return 0;
}


and compiled with,

g++ -o Test main.cpp -lboost_serialization

as -lboost_serialization seems to be the only use of boost when I issue

make
for barry.

rivviepop could you by any chance tell me what your config.log is for the successful build of barry with boost for my equivalent failed lines?

In my config.log they are lines 1175-6


WITH_BOOST_FALSE='#'
WITH_BOOST_TRUE=''

thanks

yigalweinstein
06-07-2007, 05:47 PM
This is beginning to be a gigantic post. I decided what the heck it is really low level stuff we are adding so I used Gutsy (Feisty+1) repositories and installed the serialization boost dev package. The new version, I checked before installing, has the shared libraries, but to no avail I compiled, make, make install again and still

ldd /usr/bin/btool | grep -i boost is empty.

What a drag, maybe I don't even need boost but I think it will be helpful in the future.

rivviepop
06-07-2007, 06:02 PM
It seems that I have the static libraries only and not the shared libraries, most specifically, I have no way of knowing if this has anything to do with no boost support.

Yes, I think it would -- btool is linked to a ton of shared libs, it would stand to reason that if you don't have the shared libs then it won't work that well. Did you try './configure --with-boost=/usr --enable-static --disable-shared' ? Not that you *want* to do it this way, but it's a test...

rivviepop could you by any chance tell me what your config.log is for the successful build of barry with boost for my equivalent failed lines?

In my config.log they are lines 1175-6


WITH_BOOST_FALSE='#'
WITH_BOOST_TRUE=''



OK here's the rub -- in the actual ./configure file it never tests for boost, it just assumes that if you said you have it, all your bits are good! Ugh. Take a look, just grep for 'boost' in configure and you'll see it.

So, I think you'll need to figure out how to get the boost shared libraries installed on Ubuntu; check out this URL that has a snippet:


boost (1.33.1+1.34.0-cvs20070326-1) experimental; urgency=low
.
* New upstream snapshot version.
* Added missing shared library packages of Boost.Serialization and
Boost.Wave. Closes: #410157.
* No unqualified .so symlinks are now provided, only -st.so/-mt.so
are available. Closes: #356705.


Accepted boost 1.34.0-1ubuntu1 (source) (http://www.mail-archive.com/gutsy-changes@<hidden>/msg01489.html)

Dig around your Ubuntu packages, it might be a bug in the specific one you have installed, missing the shared libraries. doh! :)

yigalweinstein
06-07-2007, 11:31 PM
I added the newest Ubuntu libboost-serialization-dev and libboost-serialization1.34.0. Now when I try to make I finally get an error - this is better than the make working and boost not.

The error is it thinks I don't have a boost_serialization library,

g++ -D__BARRY_BOOST_MODE__ -D_REENTRANT -I/usr/include -ansi -Wall -g -g -O2 -o .libs/btool btool-btool.o -L/usr/lib ../src/.libs/libbarry.so /usr/lib/libusb.so -lboost_serialization -lpthread
/usr/bin/ld: cannot find -lboost_serialization
collect2: ld returned 1 exit status
make[2]: *** [btool] Error 1

rivviepop
06-08-2007, 11:53 AM
/usr/bin/ld: cannot find -lboost_serialization


One step closer! OK, run this for me and paste the output:


ls -l /usr/lib/libboost_serialization.*


On my end, it looks like this:


-rwxr-xr-x 1 root root 860768 Jan 23 04:06 /usr/lib/libboost_serialization.a
lrwxrwxrwx 1 root root 32 Mar 19 16:37 /usr/lib/libboost_serialization.so -> libboost_serialization.so.1.33.1
-rwxr-xr-x 1 root root 382400 Jan 23 04:06 /usr/lib/libboost_serialization.so.1.33.1
lrwxrwxrwx 1 root root 32 Mar 19 16:28 /usr/lib/libboost_serialization.so.2 -> libboost_serialization.so.1.33.1


The .a is the static import file, unused. The .so.X.X stuff are the real libraries, and the symlinks (->) are what the linker will actually be looking for; in the case of btool, I think it'll be looking for the .so.2 symlink but you should have both, regardless.

yigalweinstein
06-12-2007, 12:17 AM
thank you rivvie for all of your help. I got it working by using gutsy's packages.