0

I downloaded boost 1.61 and extracted it at /usr/local/boost_1_61_0 and while installing i set the prefix path to /usr/local/ where all the boost libraries are installed. I am trying to install FRESCO tool for DNA data compression which is built using Boost c++ libraries (Downloaded from https://github.com/hubsw/FRESCO). They have given make utility to install FRESCO tool.

But when I try to run make, I get errors regarding BOOST:FILESYSTEM and BOOST:IOSTREAM libraries as follows

    undefined reference to `boost::iostreams::detail::gzip_header::reset()'
    undefined reference to boost::iostreams::detail::zlib_base::~zlib_base()'
 undefined reference to `boost::filesystem::detail::create_directories(boost::filesystem::path const&, boost::system::error_code*)'

and many more related to boost iostream and filesystem.

In FRESCO they mentioned they require BOOST 1.51(later), boost filesystem,boost iostream, boost threading-mt.

Can someone please suggest me where I am going wrong? How to link the boost filesystem/iostream if i am using make utility of ubuntu to install FRESCO tool?

Sumit
  • 27
  • 8
  • 1
    Try adding `-L/path/to/boost/libs -lboost_filesystem -lboost_system -lboost-iostreams` to the compile flags. Related: http://stackoverflow.com/q/17950840/3093378 – vsoftco May 20 '16 at 03:40
  • I tried with command "make -I/usr/local/boost_1_61_0/libs -lboost_filesystem -lboost_system -lboost-iostreams", but getting the same error. Path/to/boost/libs is path where we have extracted Boost or path mentioned in prefix while installing boost using "./b2 install prefix=" – Sumit May 20 '16 at 06:45
  • When i used -L i got "invalid option" as error. I think -L is used for latest mtime betn symlink and target. So i tried with -I option. – Sumit May 20 '16 at 06:50
  • @Sumit you cannot add the flags to the `make` command line like that. You'll have to modify the [Makefile](https://github.com/hubsw/FRESCO/blob/master/build/Makefile). – mindriot May 20 '16 at 21:02
  • Ok. I was confused as I saw man page of make with option. I tried modifying makefile and added "-L/path/to/boost/libs -lboost_filesystem -lboost_system -lboost-iostreams" where i found commands to compile main file in makefile , but i am still getting the same error. Can u plz suggest me whats wrong with my boost installlation and linking @mindriot ? – Sumit May 22 '16 at 04:12
  • @Sumit you'll need to provide some more information. What exactly does your makefile look like now? Where is `libboost_iostreams.so` located on your system? And please post the full output from your `make` call. – mindriot May 22 '16 at 11:27

1 Answers1

1

I'm trying to compile boost as dependency for my project and I get similar errors.

I see two issues for your case:

  • I don't use FRESCO, but from its makefile I see -lboost_system -lboost_filesystem -lboost_iostreams, so it expects a global Boost installation. You don't need to compile Boost for that, you can use the packaged versions of your system. In ubuntu they can be installed with sudo apt-get install libboost-dev libboost-filesystem-dev libboost-iostreams-dev.

  • If you really want to compile Boost, that error message is about a part of boost that needs extra configuration for compiling it (compression filters). It tries to link to an object with some definitions that are not compiled by default (It would probably link correctly if FRESCO didn't use compression filters). Assuming that you are compiling with Boost.Build, for Boost.Iostreams this issue is explained (not very well IMO) in https://www.boost.org/doc/libs/1_61_0/libs/iostreams/doc/installation.html :

To build with Boost.Build, run bjam from the directory libs/iostreams/build, or from the Boost root directory. If you want to use the compression filters, you may need to set several Boost.Build variables indicating where the source files or pre-built binaries are located.

EDIT

There are other alternatives to compile Boost.Iostreams:

If you have installed bzip and zlib in the system, Boost.Build autoconfigures the compilation of those compression filters. In ubuntu, do sudo apt-get install libbz2-dev zlib1g-dev (in xenial, I haven't checked if the names are different in other versions).

If you can't install zlib and libbgzip in the system, and you compiled them yourself, put this in a file tools/build/src/user-config.jam inside the downloaded folder of boost:

using zlib : 1.2.11 : <include>/path-to-your-compilation/zlib-1.2.11 <search>/path-to-your-compilation/zlib-1.2.11 ;
using bzip2 : 1.0.6 : <include>/path-to-your-compilation/bzip2-1.0.6 <search>/path-to-your-compilation/bzip2-1.0.6 ;

Just replace path-to-your-compilation.

Then, do ./bootstrap.sh --with-libraries=filesystem,iostreams and ./b2.

Documentation for this (notice I'm using Boost 1.65):

jmmut
  • 884
  • 9
  • 19