0

I am trying to compile graph-tool from source on Ubuntu 16.04 but have the problem that it fails to pick up the correct boost libraries. I am trying to compile it against anaconda python so have to provide additional flags to ./configure. I try to run the following:

./configure CXX="g++-5" CXXFLAGS="-std=gnu++14 -Wno-unused-local-typedefs" CPPFLAGS="-I/home/pmj27/anaconda2/lib" PYTHON="/home/pmj27/anaconda2/bin/python2.7" CAIROMM_LIBS="-L/home/pmj27/anaconda2/include/cairomm-1.0/cairomm" --enable-openmp

This however fails with the following error message being displayed in the terminal window

checking for boostlib >= 1.54.0... configure: We could not detect the boost libraries (version 1.54 or higher). If you have a staged boost library (still not installed) please specify $BOOST_ROOT in your environment and do not give a PATH to --with-boost option.  If you are sure you have boost installed, then check your version number looking in <boost/version.hpp>. See http://randspringer.de/boost for more documentation.
checking whether the Boost::Python library is available... no
configure: error: No usable boost::python found

despite the fact that libboost_python.so resides in /home/pmj27/anaconda2/lib.

Looking at config.log the error message seems to be:

configure:19187: g++-5 -c -fopenmp -O3 -fvisibility=default -fvisibility-inlines-hidden -Wno-deprecated -ftemplate-depth-250  -DNDEBUG -Wall -Wextra -ftemplate-backtrace-limit=0 -std=gnu++14 -Wno-unused-local-typedefs -I/home/pmj27/anaconda2/lib -I/usr/include conftest.cpp >&5
conftest.cpp:35:33: fatal error: /usr/local/include/boost/version.hpp: Permission denied
compilation terminated.

So what seems to be happening is that it first looks in /usr/local/include/boost, which is the wrong location, and then fails. How do I stop it from doing that? (I presume this is the reason why graph-tool won't compile.)

I have also tried

./configure CXX="g++-5" CXXFLAGS="-std=gnu++14 -Wno-unused-local-typedefs -I/home/pmj27/anaconda2/lib" PYTHON="/home/pmj27/anaconda2/bin/python2.7" CAIROMM_LIBS="-L/home/pmj27/anaconda2/include/cairomm-1.0/cairomm" --enable-openmp

But that still fails with the same error message though now /home/pmj27/anaconda2/lib seems to appear before /usr/local/include/boost:

configure:19104: checking for boostlib >= 1.54.0
configure:19187: g++-5 -c -fopenmp -O3 -fvisibility=default -fvisibility-inlines-hidden -Wno-deprecated -ftemplate-depth-250  -DNDEBUG -Wall -Wextra -ftemplate-backtrace-limit=0 -std=gnu++14 -Wno-unused-local-typedefs -I/home/pmj27/anaconda2/lib  -I/usr/include conftest.cpp >&5
conftest.cpp:35:33: fatal error: /usr/local/include/boost/version.hpp: Permission denied
compilation terminated.
P-M
  • 1,279
  • 2
  • 21
  • 35
  • The fact that you get "permission denied" when reading something in /usr/local means you have installed it with the wrong permissions. – Tiago Peixoto Feb 24 '17 at 10:19
  • True, and I can overcome that with using `sudo`. I was trying to prevent using those boost libraries as I need to use the anaconda ones in order to prevent c++ signature mismatches when running `graph-tool`. – P-M Feb 24 '17 at 16:54
  • You are not overcoming it, you are probably causing the problem in the first place by using sudo (e.g. running as root) when you should not have to. Using sudo like this is bad form, and a bad idea. Part of the problems you are experiencing is a consequence of this. – Tiago Peixoto Feb 24 '17 at 16:57

1 Answers1

0

First of all: "We could not detect the boost libraries" does not mean that it fails to find a shared library of Boost::Python. It means that it fails to find the boost itself, that is: all its header files.

In view of this I have to question this:

-I/home/pmj27/anaconda2/lib

Does it contain boost header files in there? Because you are describing that an .so file resides there instead.

Once you deal with the boost include issue, you might need a different set of flags pointing to the .so library. It may depend on how you want to deploy it, but something along this line:

-L/home/pmj27/anaconda2/lib -lboost_python -Wl,-rpath=/home/pmj27/anaconda2/lib

but that is future. Focus on getting the proper header files of boost first!

CygnusX1
  • 20,968
  • 5
  • 65
  • 109
  • The header files seem to reside in `/home/pmj27/anaconda2/include/boost` as far as I can tell (it containts a bunch of `.hpp` files). – P-M Feb 24 '17 at 17:10
  • Then you need `-I/home/pmj27/anaconda2/include` instead. – CygnusX1 Feb 24 '17 at 21:36