Discussion:
[Pyublas] static linking to boost.python
Fredrik Orderud
2008-12-27 22:11:14 UTC
Permalink
Does pyublas support static linking to the boost.python library?

I'm experiencing problems with pyublas when compiling pyublas._internal and
pyublas example code for static linking to boots.python (by defining
BOOST_PYTHON_STATIC_LIB).

Error message ("simple sample extension" from webpage):
--
ArgumentError: Python argument types in
sample_ext.doublify(numpy.ndarray)
did not match C++ signature:
doublify(class pyublas::numpy_vector<double>)
--

The same code runs without problems when linking dynamically against
boost.python. Other boost python code I've got unrelated to pyublas works
without problems regardless of doing static or dynamic linking to
boost.python.

My configuration:
* Windows XP SP3
* MS Visual C++ 2008
* Boost 1.37.0 with statically linked libraries (to avoid DLL dependencies)
* Python 1.5.2
* Newest PyUblas revision from GIT respository

Thanks in advance.
Fredrik Orderud
PhD student, Norwegian university of science and technology
Andreas Klöckner
2008-12-28 11:44:45 UTC
Permalink
Hi Fredrik,

Since you're linking statically, I'm guessing that you're embedding Python. In
that case, read this here and see if it helps:

http://docs.python.org/c-api/import.html#PyImport_AppendInittab

Andreas
Post by Fredrik Orderud
Does pyublas support static linking to the boost.python library?
I'm experiencing problems with pyublas when compiling pyublas._internal and
pyublas example code for static linking to boots.python (by defining
BOOST_PYTHON_STATIC_LIB).
--
ArgumentError: Python argument types in
sample_ext.doublify(numpy.ndarray)
doublify(class pyublas::numpy_vector<double>)
--
The same code runs without problems when linking dynamically against
boost.python. Other boost python code I've got unrelated to pyublas works
without problems regardless of doing static or dynamic linking to
boost.python.
* Windows XP SP3
* MS Visual C++ 2008
* Boost 1.37.0 with statically linked libraries (to avoid DLL dependencies)
* Python 1.5.2
* Newest PyUblas revision from GIT respository
Thanks in advance.
Fredrik Orderud
PhD student, Norwegian university of science and technology
_______________________________________________
Pyublas mailing list
Pyublas at tiker.net
http://tiker.net/mailman/listinfo/pyublas_tiker.net
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: This is a digitally signed message part.
URL: <http://lists.tiker.net/pipermail/pyublas/attachments/20081228/6ca06823/attachment.pgp>
Loading...