[pypy-dev] Problems in connecting C++ and python with cppyy
Xia Xin
xiaxinx at gmail.com
Mon May 27 08:20:10 CEST 2013
Hi,
I think I find the problem.
The linux distro I am using is Ubuntu. In the distro, the default
library search path is not controlled by LD_LIBRARY_PATH, but
/etc/ld.so.conf file! Mad.
So, I can load the librarys in /usr/lib with just a name, but have to
give a path to the library in my home.
Apologize for disturbing you, Thank you all!
Best regards,
Xia Xin
2013/5/26 Xia Xin <xiaxinx at gmail.com>:
> Hi,
>
> This is the result. It shows that the pypy-c does not search the
> LD_LIBRARY_PATH env.
>
>>>>> import ctypes
>>>>> ctypes.CDLL('libMyClassDict.so')
> Traceback (most recent call last):
> File "<stdin>", line 1, in <module>
> File "/opt/pypy/lib-python/2.7/ctypes/__init__.py", line 367, in __init__
> self._handle = _ffi.CDLL(name, mode)
> OSError: libMyClassDict.so: libMyClassDict.so: cannot open shared
> object file: No such file or directory
>>>>> ctypes.CDLL('./libMyClassDict.so')
> <CDLL './libMyClassDict.so', handle <_ffi.CDLL object at
> 0x000000000493aaa0> at 4895da8>
>
>
> maybe I make a mistake in compiling the pypy-c? I did that like this.
>
> $ hg clone https://bitbucket.org/pypy/pypy
> $ cd pypy
> $ hg up reflex-support
> $ pypy ../../rpython/bin/rpython --Ojit targetpypystandalone --withmod-cppyy
>
> Thank you!
>
>
> Best regards,
> Xia Xin
>
>
> 2013/5/26 <wlavrijsen at lbl.gov>:
>> Hi,
>>
>>> Sorry, I did not find any mistakes except that AttributeError. So I
>>> think maybe there are some problems in my OS.
>>
>>
>> there may still be another problem lurking around that the AttributeError
>> is hiding (and which I'd consider a bug :} ).
>>
>> Could you try the various cases using ctypes.CDLL(), either with CPython
>> or PyPy?
>>
>> >>> import ctypes
>> >>> ctypes.CDLL('libMyClassDict.so')
>>
>> If there's an issue with the error reporting, then this may show it.
>>
>>
>> Best regards,
>> Wim
>> --
>> WLavrijsen at lbl.gov -- +1 (510) 486 6411 -- www.lavrijsen.net
More information about the pypy-dev
mailing list