Discussion:
[PyCUDA] BOOST dependency needed or not?
r***@blue.alter.pl
2016-02-07 19:50:31 UTC
Permalink
Hi,

I've read on https://wiki.tiker.net/PyCuda/Installation/Linux
that "Boost C++ libraries are no longer a dependency of PyCUDA."
Also on Mac installation wiki it's written that you do not need boost for
pycuda.

Yet I'm unable to install pycuda WITHOUT boost on my system, is it
possible? How?

Or is it a bad wording, and boost on linux is needed to properly compile
and install pycuda.


I'm on ubuntu 15.10 with fresh MANUAL installation of cuda-7.5 which
works ok.

Here is error message during pycuda attempt:

***@black:~/pycuda-2015.1.3$ python setup.py build
running build
running build_py
running build_ext
building '_driver' extension
x86_64-linux-gnu-gcc -pthread -fwrapv -Wall -O3 -DNDEBUG
-fno-strict-aliasing -D_FORTIFY_SOURCE=2 -g -fstack-protector-strong
-Wformat -Werror=format-security -fPIC -DPYGPU_PYCUDA=1
-DPYGPU_PACKAGE=pycuda -DHAVE_CURAND=1 -Isrc/cpp
-I/usr/local/cuda-7.5/include
-I/usr/lib/python2.7/dist-packages/numpy/core/include
-I/usr/include/python2.7 -c src/cpp/cuda.cpp -o
build/temp.linux-x86_64-2.7/src/cpp/cuda.o
In file included from src/cpp/cuda.cpp:1:0:
src/cpp/cuda.hpp:30:32: fatal error: boost/shared_ptr.hpp: No such file
or directory
compilation terminated.
error: command 'x86_64-linux-gnu-gcc' failed with exit status 1


--
r
Andreas Kloeckner
2016-02-08 07:27:19 UTC
Permalink
Post by r***@blue.alter.pl
Hi,
I've read on https://wiki.tiker.net/PyCuda/Installation/Linux
that "Boost C++ libraries are no longer a dependency of PyCUDA."
Also on Mac installation wiki it's written that you do not need boost for
pycuda.
You don't need boost installed to install PyCUDA. (Unless you switch off
the default-on option 'USE_SHIPPED_BOOST"--see 'siteconf.py')

Andreas
r***@blue.alter.pl
2016-02-08 21:07:43 UTC
Permalink
Post by Andreas Kloeckner
Post by r***@blue.alter.pl
running build
running build_py
running build_ext
building '_driver' extension
x86_64-linux-gnu-gcc -pthread -fwrapv -Wall -O3 -DNDEBUG
-fno-strict-aliasing -D_FORTIFY_SOURCE=2 -g -fstack-protector-strong
-Wformat -Werror=format-security -fPIC -DPYGPU_PYCUDA=1
-DPYGPU_PACKAGE=pycuda -DHAVE_CURAND=1 -Isrc/cpp
-I/usr/local/cuda-7.5/include
-I/usr/lib/python2.7/dist-packages/numpy/core/include
-I/usr/include/python2.7 -c src/cpp/cuda.cpp -o
build/temp.linux-x86_64-2.7/src/cpp/cuda.o
src/cpp/cuda.hpp:30:32: fatal error: boost/shared_ptr.hpp: No such file
or directory
compilation terminated.
error: command 'x86_64-linux-gnu-gcc' failed with exit status 1
You don't need boost installed to install PyCUDA. (Unless you switch off
the default-on option 'USE_SHIPPED_BOOST"--see 'siteconf.py')
I didn't change (as you can see quotted above) this option and yet
pycuda build complains about boost not present. In fact no matter if you
use or not the option, build fails

No matter if you use python setup.py build or configure.py/make -> both
complain about boost not present because strictly speaking there are
includes of boost code in pycuda, which are all the time present no
matter what compile/build option.

What is proper way to build and install pycuda without boost?


--
r
Andreas Kloeckner
2016-02-09 01:23:29 UTC
Permalink
Post by r***@blue.alter.pl
running build
running build_py
running build_ext
building '_driver' extension
x86_64-linux-gnu-gcc -pthread -fwrapv -Wall -O3 -DNDEBUG
-fno-strict-aliasing -D_FORTIFY_SOURCE=2 -g -fstack-protector-strong
-Wformat -Werror=format-security -fPIC -DPYGPU_PYCUDA=1
-DPYGPU_PACKAGE=pycuda -DHAVE_CURAND=1 -Isrc/cpp
-I/usr/local/cuda-7.5/include
-I/usr/lib/python2.7/dist-packages/numpy/core/include
-I/usr/include/python2.7 -c src/cpp/cuda.cpp -o
build/temp.linux-x86_64-2.7/src/cpp/cuda.o
src/cpp/cuda.hpp:30:32: fatal error: boost/shared_ptr.hpp: No such file
or directory
compilation terminated.
error: command 'x86_64-linux-gnu-gcc' failed with exit status 1
Well, if you look in bpl-subset/bpl_subset, there should be all the
pieces of boost there that you need to build. If you're missing those
files, then that's a problem (and could cause the issue you're
seeing). If you got your source using git, did you

git submodule update --init

?

Andreas
r***@blue.alter.pl
2016-02-09 10:34:06 UTC
Permalink
Post by Andreas Kloeckner
Post by r***@blue.alter.pl
-I/usr/local/cuda-7.5/include
-I/usr/lib/python2.7/dist-packages/numpy/core/include
-I/usr/include/python2.7 -c src/cpp/cuda.cpp -o
build/temp.linux-x86_64-2.7/src/cpp/cuda.o
src/cpp/cuda.hpp:30:32: fatal error: boost/shared_ptr.hpp: No such file
or directory
compilation terminated.
error: command 'x86_64-linux-gnu-gcc' failed with exit status 1
Well, if you look in bpl-subset/bpl_subset, there should be all the
pieces of boost there that you need to build. If you're missing those
files, then that's a problem (and could cause the issue you're
seeing). If you got your source using git, did you
git submodule update --init
I'm using tar.gz distribution of pycuda, version pycuda-2015.1.3.tar.gz.

bpl-subset folders do contain files in it, including some boost files

Command outputs:
***@black:~/pycuda-2015.1.3/bpl-subset/bpl_subset$ find . | wc
2053 2053 75572

***@black:~/pycuda-2015.1.3$ ls -l bpl-subset/bpl_subset/
total 8
drwxr-xr-x 37 radek radek 4096 Aug 4 2015 boost
drwxr-xr-x 6 radek radek 4096 Aug 4 2015 libs
lrwxrwxrwx 1 radek radek 5 Feb 7 20:07 pycudaboost -> boost


Then I read again your initial email and realized that USE_SHIPPED_BOOST
variable means SHIPPED with pycuda not the opearting system.

I set to USE_SHIPPED_BOST is set to True, and started analyzing error message I have (below).
Looks like it was due to some problem of my python-dev package was damaged.
After correction Ive successfully started compilation (lots of warnings though)

Thank you for your help.
Please expect more questions in the future ;)


Error message during build if python-dev is missing/damaged.

***@black:~/pycuda-2015.1.3$ make
ctags -R src || true
/bin/sh: 1: ctags: not found
/usr/bin/python setup.py build
***************************************************************
*** WARNING: nvcc not in path.
*** May need to set CUDA_INC_DIR for installation to succeed.
***************************************************************
running build
running build_py
running build_ext
building '_driver' extension
x86_64-linux-gnu-gcc -pthread -fwrapv -Wall -O3 -DNDEBUG -fno-strict-aliasing -D_FORTIFY_SOURCE=2 -g -fstack-protector-strong -Wformat -Werror=format-security -fPIC -DBOOST_PYTHON_SOURCE=1 -DHAVE_CURAND=1 -DPYGPU_PACKAGE=pycuda -DBOOST_THREAD_DONT_USE_CHRONO=1 -DPYGPU_PYCUDA=1 -DBOOST_MULTI_INDEX_DISABLE_SERIALIZATION=1 -DBOOST_THREAD_BUILD_DLL=1 -Dboost=pycudaboost -DBOOST_ALL_NO_LIB=1 -Isrc/cpp -Ibpl-subset/bpl_subset -I/usr/local/cuda-7.5/include -I/usr/lib/python2.7/dist-packages/numpy/core/include -I/usr/include/python2.7 -c src/cpp/cuda.cpp -o build/temp.linux-x86_64-2.7/src/cpp/cuda.o
In file included from bpl-subset/bpl_subset/boost/python/detail/prefix.hpp:13:0,
from bpl-subset/bpl_subset/boost/python/args.hpp:8,
from bpl-subset/bpl_subset/boost/python.hpp:11,
from src/cpp/cuda.hpp:36,
from src/cpp/cuda.cpp:1:
bpl-subset/bpl_subset/boost/python/detail/wrap_python.hpp:50:23: fatal error: pyconfig.h: No such file or directory
compilation terminated.
error: command 'x86_64-linux-gnu-gcc' failed with exit status 1
Makefile:6: recipe for target 'all' failed
make: *** [all] Error 1


--
r

Loading...