Discussion:
[Pyublas] Running example with
Tambet Matiisen
2015-01-05 14:57:52 UTC
Permalink
Hi everyone!

I'm having trouble running Pyblas in "Scientific Linux CERN SLC release
6.6 (Carbon)" (specific Linux version our cluster uses). Compiling and
tests went well, but when running the sample from homepage I get:

Traceback (most recent call last):
File "sample.py", line 7, in <module>
print sample_ext.doublify(pyublas.why_not(vec))
Boost.Python.ArgumentError: Python argument types in
sample_ext.doublify(numpy.ndarray)
did not match C++ signature:
doublify(pyublas::numpy_vector<double>)

I haven't changed anything in the sample, other than adding
pyublas.why_not() call, but that doesn't report anything. The
commandline for compiling the extension was as follows:

gcc -I/usr/include/python2.7 -I../pyublas/include -fPIC -g -fpic -shared
-Wl,-soname,sample_ext.so sample_ext.cpp -lboost_python-mt -lpython2.7
-o sample_ext.so

What could be the problem? Could it be, that I'm using libboost compiled
for Python 2.6, but my virtualenv contains Python 2.7?

Tambet
Andreas Kloeckner
2015-01-05 23:31:54 UTC
Permalink
Post by Tambet Matiisen
Hi everyone!
I'm having trouble running Pyblas in "Scientific Linux CERN SLC release
6.6 (Carbon)" (specific Linux version our cluster uses). Compiling and
File "sample.py", line 7, in <module>
print sample_ext.doublify(pyublas.why_not(vec))
Boost.Python.ArgumentError: Python argument types in
sample_ext.doublify(numpy.ndarray)
doublify(pyublas::numpy_vector<double>)
I haven't changed anything in the sample, other than adding
pyublas.why_not() call, but that doesn't report anything. The
gcc -I/usr/include/python2.7 -I../pyublas/include -fPIC -g -fpic -shared
-Wl,-soname,sample_ext.so sample_ext.cpp -lboost_python-mt -lpython2.7
-o sample_ext.so
What could be the problem? Could it be, that I'm using libboost compiled
for Python 2.6, but my virtualenv contains Python 2.7?
That would definitely be a problem--I'm not sure how you even got that
to run. One thing that would help would be figuring out which Boost
library is actually being used. You can do so by using 'ldd' on the .so
file compiled by PyUblas.

HTH,
Andreas

Loading...