Received from Andreas Kloeckner on Thu, Jun 07, 2012 at 05:51:13PM EDT:
> Lev Givon <[email protected]> writes:
> 
> > When I recently tried running the sample program on the main codepy
> > documentation page, I noticed that I had to manually add the python
> > library (python2.7 in my case) to the list of libraries guessed by
> > codepy.jit.guess_toolchain in order to get the program to run. Any
> > ideas as to why the toolchain guesser isn't finding the python library
> > by default on my system? The python library on my system is located at
> > /usr/lib64/libpython2.7.so.
> >
> > I'm using codepy 2012.1.2, cgen 2012.1, python 2.7, gcc 4.6.1, and
> > boost 1.46.1 on 64-bit Linux.
> 
> Can you use
> 
> cmod = mod.compile(guess_toolchain(), debug=True)
> 
> in that program and post what command line you get? (You may have to rm
> -rf /tmp/codepy...)
> 
> I get:
> 
> g++ -pthread -fno-strict-aliasing -g -fwrapv -O2 -Wall -g
> -fstack-protector --param=ssp-buffer-size=4 -Wformat -Wformat-security
> -Werror=format-security -fPIC -pthread -shared -Wl,-O1
> -Wl,-Bsymbolic-functions -Wl,-z,relro -Xlinker -export-dynamic -Wl,-O1
> -Wl,-Bsymbolic-functions -DNDEBUG -I/usr/include/python2.7
> /tmp/codepy-compiler-cache-v5-uid1000/575fd541fda8bf46c781d288179477c0/module.cpp
> -L/usr/lib -lboost_python -lpthread -ldl -lutil -o
> /tmp/codepy-compiler-cache-v5-uid1000/575fd541fda8bf46c781d288179477c0/module.so

g++ -pthread -fno-strict-aliasing -O2 -g -frecord-gcc-switches
-Wstrict-aliasing=2 -pipe -Wformat -Werror=format-security
-Wp,-D_FORTIFY_SOURCE=2 -fstack-protector --param=ssp-buffer-size=4
-fPIC -O2 -g -frecord-gcc-switches -Wstrict-aliasing=2 -pipe -Wformat
-Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -fstack-protector
--param=ssp-buffer-size=4 -fPIC -g -fPIC -pthread -shared
-Wl,--as-needed -Wl,--no-undefined -Wl,-z,relro -Wl,-O1 -Wl,--build-id
-Wl,--enable-new-dtags -Xlinker -export-dynamic -DNDEBUG
-I/usr/include/python2.7 -I/usr/include/boost
/tmp/codepy-compiler-cache-v5-uid500/a426cbcb2e2ac5ecd9dd1ee86c183635/module.cpp
-L/usr/lib64 -lboost_python -lpthread -ldl -lutil -o
/tmp/codepy-compiler-cache-v5-uid500/a426cbcb2e2ac5ecd9dd1ee86c183635/module.so

The compilation error I observe is 

/tmp//cccXeGRs.o: In function 
`boost::python::detail::converter_target_type<boost::python::to_python_value<char
const* const&> >::get_pytype()': 
/usr/include/boost/python/detail/caller.hpp:103: undefined reference to 
`PyString_Type'
/tmp//cccXeGRs.o: In function `incref<_object>': 
/usr/include/boost/python/refcount.hpp:16: undefined reference to 
`_Py_NoneStruct'
collect2: ld returned 1 exit status

> This means that on my system -lboost_python automatically pulls in
> -lpython2.7. Not sure I know why that's not working for you. Can you ldd
> the libboost_python.so you're using?
> 
> Andreas

$ ldd /usr/lib64/libboost_python.so
linux-vdso.so.1 =>  (0x00007fffabb1e000)
libutil.so.1 => /lib64/libutil.so.1 (0x00002b242fcfa000)
libpthread.so.0 => /lib64/libpthread.so.0 (0x00002b242fefd000)
libdl.so.2 => /lib64/libdl.so.2 (0x00002b243011a000)
librt.so.1 => /lib64/librt.so.1 (0x00002b243031e000)
libpython2.7.so.1.0 => /usr/lib64/libpython2.7.so.1.0 (0x00002b2430527000)
libstdc++.so.6 => /usr/lib64/libstdc++.so.6 (0x00002b24308e8000)
libgcc_s.so.1 => /usr/lib64/libgcc_s.so.1 (0x00002b2430bec000)
libc.so.6 => /lib64/libc.so.6 (0x00002b2430e01000) 
/lib64/ld-linux-x86-64.so.2 (0x00002b242f85e000)
libm.so.6 => /lib64/libm.so.6 (0x00002b243118e000)

                                                                L.G.

_______________________________________________
PyCUDA mailing list
[email protected]
http://lists.tiker.net/listinfo/pycuda

Reply via email to