general "did not match C++ signature" error

Hi,

Graph-tool was manually compiled on a local cluster (based on RedHat) by a
network admin. The python command
import graph_tool
works fine, but almost every other command results in an error related to
"did not match C++ signature":
For example,
gtGraph=graph_tool.load_graph("yeast.graphml")
(attached) results in:
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/local/epd/lib/python2.7/site-packages/graph_tool/__init__.py",
line 2702, in load_graph
    g.load(file_name, fmt, ignore_vp, ignore_ep, ignore_gp)
  File "/usr/local/epd/lib/python2.7/site-packages/graph_tool/__init__.py",
line 2320, in load
    ignore_ep, ignore_gp)
Boost.Python.ArgumentError: Python argument types in
    GraphInterface.read_from_file(GraphInterface, str, NoneType, str, list,
list, list)
did not match C++ signature:
    read_from_file(graph_tool::GraphInterface {lvalue},
std::__cxx11::basic_string<char, std::char_traits&lt;char>,
std::allocator<char> >, boost::python::api::object,
std::__cxx11::basic_string<char, std::char_traits&lt;char>,
std::allocator<char> >, boost::python::list, boost::python::list,
boost::python::list)

Following some other posts in the mailing list, I've applied the ldd command
and:
ldd
/usr/local/epd/lib/python2.7/site-packages/graph_tool/libgraph_tool_core.so
linux-vdso.so.1 => (0x00007ffff7ffe000)
  libboost_iostreams.so.1.59.0 => /usr/lib64/libboost_iostreams.so.1.59.0
(0x00007ffff5c46000)
  libboost_python.so.5 => /usr/lib64/libboost_python.so.5
(0x00007ffff59f5000)
  libboost_regex.so.1.59.0 => /usr/lib64/libboost_regex.so.1.59.0
(0x00007ffff56df000)
  libboost_coroutine.so.1.59.0 => /usr/lib64/libboost_coroutine.so.1.59.0
(0x00007ffff54d4000)
  libCGAL.so.12 =>
/usr/local/cgal-releases-CGAL-4.9/build/release/lib/libCGAL.so.12
(0x00007ffff52af000)
  libexpat.so.1 => /lib64/libexpat.so.1 (0x00007ffff5087000)
  libstdc++.so.6 =>
/usr/local/gcc5.3/bin/../lib/gcc/x86_64-unknown-linux-gnu/5.3.0/../../../../lib64/libstdc++.so.6
(0x00007ffff4cf8000)
  libm.so.6 => /lib64/libm.so.6 (0x00007ffff4a74000)
  libc.so.6 => /lib64/libc.so.6 (0x00007ffff46e0000)
  libgcc_s.so.1 =>
/usr/local/gcc5.3/bin/../lib/gcc/x86_64-unknown-linux-gnu/5.3.0/../../../../lib64/libgcc_s.so.1
(0x00007ffff44c9000)
  libbz2.so.1 => /lib64/libbz2.so.1 (0x00007ffff42b8000)
  libz.so.1 => /usr/local/epd/lib/libz.so.1 (0x00007ffff409a000)
  librt.so.1 => /lib64/librt.so.1 (0x00007ffff3e91000)
  libpthread.so.0 => /lib64/libpthread.so.0 (0x00007ffff3c74000)
  libpython2.6.so.1.0 => /usr/lib64/libpython2.6.so.1.0 (0x00007ffff38ce000)
  libicudata.so.42 => /usr/lib64/libicudata.so.42 (0x00007ffff2788000)
  libicui18n.so.42 => /usr/lib64/libicui18n.so.42 (0x00007ffff23f2000)
  libicuuc.so.42 => /usr/lib64/libicuuc.so.42 (0x00007ffff20a0000)
  libboost_context.so.1.59.0 => /usr/lib64/libboost_context.so.1.59.0
(0x00007ffff1e96000)
  libboost_thread.so.1.59.0 => /usr/lib64/libboost_thread.so.1.59.0
(0x00007ffff1c74000)
  libboost_chrono.so.1.59.0 => /usr/lib64/libboost_chrono.so.1.59.0
(0x00007ffff1a6d000)
  libboost_system.so.1.59.0 => /usr/lib64/libboost_system.so.1.59.0
(0x00007ffff1869000)
  libmpfr.so.1 => /usr/lib64/libmpfr.so.1 (0x00007ffff161c000)
  libgmp.so.3 => /usr/lib64/libgmp.so.3 (0x00007ffff13c1000)
  /lib64/ld-linux-x86-64.so.2 (0x0000003f14800000)
  libdl.so.2 => /lib64/libdl.so.2 (0x00007ffff11bc000)
  libutil.so.1 => /lib64/libutil.so.1 (0x00007ffff0fb9000)

yeast.graphml
<http://main-discussion-list-for-the-graph-tool-project.982480.n3.nabble.com/file/n4026983/yeast.graphml&gt;

Ni !

The import working means that Python can find the Python component of graph
tool.

The error you get has to do with boost Python not finding, for a call
internal to the Python component, a corresponding function in the C++
component that matches it's argument types.

Thus, this happens if any of the pieces involved do not match. A common
cause is version mismatch.

Ldd is useful to check some of those: the versions of libraries linked to
the C++ component.

In your led output I see

libpython2.6.so.1.0 => /usr/lib64/libpython2.6.so.1.0 (0x00007ffff38ce000)

Thus it seems to be the case that the package got compiled against Python
2.6, yet got installed for Python 2.7 .

Cheers

ale

attachment.html (6.42 KB)

Short of a solution there are two posts with similar problems online:

http://main-discussion-list-for-the-graph-tool-project.982480.n3.nabble.com/Boost-Python-ArgumentError-Python-argument-types-Error-td4026769.html

https://git.skewed.de/count0/graph-tool/issues/277

The issue seems to normally revolve around using different versions of Python or packages when compiling. Maybe ask your network admin to recompile paying particular attention to that and see if it fixes it?

Best wishes,

Philipp

attachment.html (11.5 KB)

Thanks!

This is indeed strange, as the library is installed to
/usr/local/epd/lib/python2.7/site-packages/graph_tool/libgraph_tool_core.so

but compiled against:
libpython2.6.so.1.0 => /usr/lib64/libpython2.6.so.1.0 (0x00007ffff38ce000)

How do I specify which libpython to use?

This should be detected automatically when ./configure is run. The specific
python interpreter can be overridden by setting the PYTHON environment
variable to ./configure.

But your symptom can also be caused by your custom python library (which
seems to be installed in the nonstandard path /usr/local/epd) not being set
in the linker's path. This could be fixed by doing something like: export
LD_LIBRARY_PATH=/usr/local/epd/lib/

But these are just some guesses, since you gave us very little information.
Ideally, you would give us all parameters you passed to ./configure during
compilation, as well as the contents to config.log.

Best,
Tiago

Dear Tiago,

Thanks for the tip.
Please see the attached log file. As far as I know, there were no flags
added, but perhaps the epd setup script (setup.csh) was first initialized.
The EPD python is the python interpreter I would like to use.

Best,
Eli

attachment.html (5.92 KB)

Try passing

  LDFLAGS="-L/usr/local/epd/lib/"

to configure while compiling. Also, do not forget to set LD_LIBRARY_PATH as
I said, before trying to import the library.

Hi,

It seems there is no LDFLAGS option in the configure. I'm using graph-tool
2.20.

Best,
Eli

attachment.html (12.3 KB)

It is not an option, it is an environment variable. What you should do is

    ./configure LDFLAGS="-L/usr/local/epd/lib/"

Please take a look at the installation instructions at:

    https://git.skewed.de/count0/graph-tool/wikis/installation-instructions#manual-compilation

(This is WIP and will substitute the current instructions in the website)

Best,
Tiago