Closed adammathys closed 12 years ago
I've rerun the above with the verbose option. Here's the compilation command used by Codepy:
g++ -pthread -fno-strict-aliasing -g -O2 -g -fwrapv -O2 -Wall -fPIC -std=c++0x -pthread -shared -Wl,-O1 -Wl,-Bsymbolic-functions -Wl,-Bsymbolic-functions -Xlinker -export-dynamic -Wl,-O1 -Wl,-Bsymbolic-functions -DNDEBUG -DCUDA_SUPPORT -I/usr/include/python2.7 -I/home/adamm/.virtualenvs/au/local/lib/python2.7/site-packages/copperhead-0.2a1-py2.7-linux-x86_64.egg/copperhead/prelude -I/usr/local/cuda/include /tmp/codepy-compiler-cache-v5-uid1000/d0009f81104ade7d9a86f51a465339ba/module.o /tmp/codepy-compiler-cache-v5-uid1000/b2773585709ab7f476c3ad806407d1cd/gpu.o -L/usr/lib -L/usr/local/cuda/lib -L/usr/local/cuda/lib64 -lcuda -lcudart -lpthread -ldl -lutil -lcudart -o /tmp/codepy-compiler-cache-v5-uid1000/d0009f81104ade7d9a86f51a465339ba/codepy.temp.d0009f81104ade7d9a86f51a465339ba.module.so
For comparison, here are the commands with a build using siteconf.py
:
g++ -pthread -fno-strict-aliasing -g -O2 -g -fwrapv -O2 -Wall -fPIC -std=c++0x -c -DNDEBUG -DCUDA_SUPPORT -I/usr/include/python2.7 -I/home/adamm/.virtualenvs/ag/local/lib/python2.7/site-packages/copperhead/prelude -I/usr/include -I/usr/local/cuda/include /tmp/codepy-compiler-cache-v5-uid1000/2bf9f4cd60d0262f8d7821f38cad2836/module.cpp -o /tmp/codepy-compiler-cache-v5-uid1000/2bf9f4cd60d0262f8d7821f38cad2836/module.o
nvcc -Xcompiler -fPIC -arch=sm_21 -c -DNDEBUG -DCUDA_SUPPORT -U__BLOCKS__ -I/usr/include/python2.7 -I/home/adamm/.virtualenvs/ag/local/lib/python2.7/site-packages/copperhead/prelude -I/usr/include -I/home/adamm/.virtualenvs/ag/local/lib/python2.7/site-packages/numpy/core/include -I/usr/local/cuda/include /tmp/codepy-compiler-cache-v5-uid1000/7256c103cf7b8d03406fcaefc8a1e14b/gpu.cu -o /tmp/codepy-compiler-cache-v5-uid1000/7256c103cf7b8d03406fcaefc8a1e14b/gpu.o
g++ -pthread -fno-strict-aliasing -g -O2 -g -fwrapv -O2 -Wall -fPIC -std=c++0x -pthread -shared -Wl,-O1 -Wl,-Bsymbolic-functions -Wl,-Bsymbolic-functions -Xlinker -export-dynamic -Wl,-O1 -Wl,-Bsymbolic-functions -DNDEBUG -DCUDA_SUPPORT -I/usr/include/python2.7 -I/home/adamm/.virtualenvs/ag/local/lib/python2.7/site-packages/copperhead/prelude -I/usr/include -I/usr/local/cuda/include /tmp/codepy-compiler-cache-v5-uid1000/2bf9f4cd60d0262f8d7821f38cad2836/module.o /tmp/codepy-compiler-cache-v5-uid1000/7256c103cf7b8d03406fcaefc8a1e14b/gpu.o -L/usr/lib -L/usr/local/cuda/lib -L/usr/local/cuda/lib64 -lcuda -lcudart -lboost_python -lpthread -ldl -lutil -lcudart -o /tmp/codepy-compiler-cache-v5-uid1000/2bf9f4cd60d0262f8d7821f38cad2836/codepy.temp.2bf9f4cd60d0262f8d7821f38cad2836.module.so
From the looks of it, the only significant different I can see is that when using the siteconf.py
build -I/usr/include
is included in the build arguments. However, it's excluded in the other build. Seeing this, I tried to install Copperhead with siteconf.py
containing:
#!/usr/bin/python
BOOST_INC_DIR = "/usr/include"
BOOST_LIB_DIR = None
BOOST_PYTHON_LIBNAME =None
No luck, I get the same error message as before. I do get a slightly different compilation command:
g++ -pthread -fno-strict-aliasing -g -O2 -g -fwrapv -O2 -Wall -fPIC -std=c++0x -pthread -shared -Wl,-O1 -Wl,-Bsymbolic-functions -Wl,-Bsymbolic-functions -Xlinker -export-dynamic -Wl,-O1 -Wl,-Bsymbolic-functions -DNDEBUG -DCUDA_SUPPORT -I/usr/include/python2.7 -I/home/adamm/.virtualenvs/zn/local/lib/python2.7/site-packages/copperhead-0.2a1-py2.7-linux-x86_64.egg/copperhead/prelude -I/usr/include -I/usr/local/cuda/include /tmp/codepy-compiler-cache-v5-uid1000/437bdfcaa8955d24032c5799e7996047/module.o /tmp/codepy-compiler-cache-v5-uid1000/bdfc2a7bee5fb4d771ee9acc4bf2a355/gpu.o -L/usr/lib -L/usr/local/cuda/lib -L/usr/local/cuda/lib64 -lcuda -lcudart -lpthread -ldl -lutil -lcudart -o /tmp/codepy-compiler-cache-v5-uid1000/437bdfcaa8955d24032c5799e7996047/codepy.temp.437bdfcaa8955d24032c5799e7996047.module.so
It now looks almost identical to the working command; the missing -I/usr/include
has appeared.
Thanks for the report. I've updated the build process significantly - I hope the new script catches the lack of configuration before building.
Issue no longer present in most recent version of Copperhead.
Thanks for the report!
Despite have
boost_python
installed in the default location, I am unable to compile any Copperhead code after installation. During installation, it seems to find the boost libraries. I do get:Which leads me to believe that it knows where to look to find the
boost_python
libraries. However, if I try to run theaxpy.py
sample I get:The compiler appears to have difficult locating the correct boost libraries. Installing with a
siteconf.py
containing:solves the issue. For comparison, the generated
siteconf.py
looks like this:Perhaps having the generated
siteconf.py
fill in the default locations instead would work.