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:
/scratch/opt/pythonbrew/pythons/Python-2.7.2/lib/python2.7/site-packages

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:

    CPPFLAGS="-I/scratch/usr/include"
    LDFLAGS="-L/scratch/usr/lib"

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
errors.

Cheers,
Tiago

Hi,

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"
CPPFLAGS="-I/usr/local/include/python2.7"
LDFLAGS="-L/usr/local/lib/python2.7"

And I receive this message:

Hi,

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...

Hi,

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:

bootstrap.sh --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:

/usr/local/include/boost/
/usr/local/lib

However, none of the boost libraries starts with boost_python; instead, I
think the relevant ones are: libboost_python.a, libboost_python.so,
and libboost_python.so.1.52.0. 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

    /usr/local/include/boost/
    /usr/local/lib

Therefore, your variables should be

  CPPFLAGS="-I/usr/local/include"
  LDFLAGS="-L/usr/local/lib"

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

Cheers,
Tiago

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.

config.log
<http://main-discussion-list-for-the-graph-tool-project.982480.n3.nabble.com/file/n4024953/config.log&gt;

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

It is:

/usr/local/lib/libboost_python.a
/usr/local/lib/libboost_python.so.1.52.0
/usr/local/lib/libboost_python.so

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/libboost_python.so: undefined reference to `PyList_Insert'
/usr/local/lib/libboost_python.so: 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/libpython2.7.so?

Cheers,
Tiago

Python is not compiled by me, and I cannot find libpython2.7.so.

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

Thanks,
Arash

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
version.

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?

Thanks,
Arash

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
great.

Thanks,
Arash

attachment.html (1.34 KB)