Problem with ./configure and Boost::Python

Hi, I'm trying to install graph_tool on Centos 5.8 in a custom Python 2.7.2
environment. I have boost installed under /scratch/usr

Running the following: ./configure --with-boost=/scratch/usr

I get the error messages:

graph-tool will be installed at:

attachment.html (1.13 KB)

If you run ./configure --help, you will see at list of environment
variables at the end, which need to be properly set when using a
non-standard environment. In your case, you need to set:


so that the compiler can find the installed libraries.

Whenever running across configure errors, it is always useful to inspect
the config.log file, which contains more detailed information about



I have a very similar situation and I have faced exactly the same error, but
the mentioned solution doesn't work for me. I have installed Python 2.7.3 on
CentOS 6.3. I run this command:

./configure --enable-openmp PYTHON="/usr/local/bin/python2.7"

And I receive this message:


I have a very similar situation and I have faced exactly the same error, but
the mentioned solution doesn't work for me. I have installed Python 2.7.3 on

Have you installed Boost::Python compiled against that python?
The configure script is complaining that it can't find Boost::Python library...


Thanks for your reply. Yes, I compiled and installed boost libraries. I
forgot to mention that I have not removed the default version of CentOS
which is Python2.6 (because the system has also some other users); hence, I
used these commands to configure and install boost: --with-python=python2.7
sudo ./b2 install

As the result, I can see that the header files and libraries of boost have
become available in the following folders:


However, none of the boost libraries starts with boost_python; instead, I
think the relevant ones are: libboost_python.a,,
and Therefore, I also tried the following
command to configure graph-tool, but it is still unsuccessful. The error
message is as follows:

attachment.html (5.2 KB)

In your other email, you said you had installed the boost libraries in


Therefore, your variables should be


Also, whenever encountering ./configure problems, please _always_
attach the file config.log, which contains more detailed information on
any failures.


Thanks Tiago for your comment. I followed your suggestion and tried to
configure it using the following command:

./configure --enable-openmp PYTHON="/usr/local/bin/python2.7"
CPPFLAGS="-I/usr/local/include" LDFLAGS="-L/usr/local/lib"

It is still unsuccessful; I receive the same error message. Please also find
attached the config.log file.

Thanks for your help.


How is your boost-python library called? I.e. what is the output of the
command 'ls /usr/local/lib/libboost_python*' ?

It is:


Ok, so according to the config.log some expected symbols from the python
library are not being found:

configure:17474: g++ -o conftest -Wall -ftemplate-depth-150 -Wno-deprecated -Wno-unknown-pragmas -O3 -fvisibility=default -fvisibility-inlines-hidden -fopenmp -I/usr/local/include -I/usr/local/include/python2.7 -L/usr/local/lib -L/usr/local/lib/python2.7/config -lpython2.7 conftest.cpp -lboost_python -lexpat -lbz2 -lm >&5
/usr/local/lib/ undefined reference to `PyList_Insert'
/usr/local/lib/ undefined reference to `PyExc_ImportError'

Did you compile Python yourself? Did you configure it with --enable-shared?
Is there a file named /usr/local/lib/


Python is not compiled by me, and I cannot find

Do I need to compile Python again? In this case do I need to recompile all
other libraries as well?


attachment.html (2.09 KB)

You need to compile Python with support to shared libraries. You do not
need to recompile other libraries, as long as you use the same Python

Great, it worked. I do appreciate. Now, it complains about not finding
"cairomm-1.0". I just need to synthesize some graphs, and I don't need
graphical representation. Can you please advise me how I can avoid
installing the optional packages?


attachment.html (1.6 KB)

Just run configure with the --disable-cairo option.

Hi Tiago,

I managed to install Graph-Tool. I really I appreciate your help; it was


attachment.html (1.34 KB)