Hello. Last January I had some troubles building pyCUDA on my Macbook
(Leopard), now I've upgraded to Snow Leopard and am trying to get CUDA
4 running and (inevitably) it isn't going smoothly.

If anyone can point out any obvious errors in my setup, I'd love your
feedback. I watched the original notes about Snow Leopard build issues
over the last year, I'd hoped it would go smoother!

I'm hoping to add pyCUDA to my EuroPython tutorial on High Performance
Python Computing, it'd be grand to give a short demo (I'm covering
Cython, ShedSkin, numpy etc).

I'm on:
Show Leopard (upgraded from Leopard with CUDA 3)
CUDA 4 (complete reinstall, CUDA 3 originals deleted) - CUDA 4
binaries compiled tonight and run fine
pycuda latest head
gcc-4.0 (system default for 'gcc')
Python 2.7.1
numpy 1.5.1

I'm using the default siteconf.py with the Snow Leopard CXX/LDFLAGs
and an added CUDA_ROOT line (pointing at the default directory):
----
./configure # start with the default siteconf.py and then edit
ian-ozsvalds-macbook:pycuda ian$ more siteconf.py
BOOST_INC_DIR = []
BOOST_LIB_DIR = []
BOOST_COMPILER = 'gcc' # gcc exists, no gcc43 on this machine
USE_SHIPPED_BOOST = True
BOOST_PYTHON_LIBNAME = ['boost_python-gcc43-mt']
BOOST_THREAD_LIBNAME = ['boost_thread-gcc43-mt']
CUDA_TRACE = False
CUDA_ENABLE_GL = False
CUDA_ENABLE_CURAND = True
CUDA_ROOT = '/usr/local/cuda' # added as noted in FAQs
CUDADRV_LIB_DIR = []
CUDADRV_LIBNAME = ['cuda']
CUDART_LIB_DIR = []
CUDART_LIBNAME = ['cudart']
#CXXFLAGS = []
#LDFLAGS = []

# http://wiki.tiker.net/PyCuda/Installation/Mac#Step_3:_Build_PyCUDA
# if on Snow Leopard, include these lines:
CXXFLAGS = ["-arch", "x86_64", "-arch", "i386"]
LDFLAGS = ["-arch", "x86_64", "-arch", "i386"]

CXXFLAGS.extend(['-isysroot', '/Developer/SDKs/MacOSX10.6.sdk'])
LDFLAGS.extend(['-isysroot', '/Developer/SDKs/MacOSX10.6.sdk'])
----


When I build it starts out looking reasonable:
----
ian-ozsvalds-macbook:pycuda ian$ sudo make
ctags -R src || true
ctags: illegal option -- R
usage: ctags [-BFadtuwvx] [-f tagsfile] file ...
/Library/Frameworks/Python.framework/Versions/2.7/Resources/Python.app/Contents/MacOS/Python
setup.py build
('bpl-subset/bpl_subset', '/boost/', '', 'python', '.hpp')
*** Error occurred in plausibility checking for path of Boost Python library.
*** Error occurred in plausibility checking for path of Boost Thread library.
('/usr/local/cuda', '/bin/', '', 'nvcc', '')
('/usr/local/cuda/include', '/', '', 'cuda', '.h')
('/usr/local/cuda/lib', '/', 'lib', 'cuda', '.so')
('/usr/local/cuda/lib', '/', 'lib', 'cuda', '.dylib')
*** Cannot find CUDA runtime library. Checked locations:
*** Note that this may not be a problem as this component is often
installed system-wide.
running build
running build_py
creating build
creating build/lib.macosx-10.3-i386-2.7
creating build/lib.macosx-10.3-i386-2.7/pycuda
----
The above few lines show the first signs of "lib.macosx-10.3-i386".

Then later we get odd errors and a later failure:
----
…
gcc-4.0 -fno-strict-aliasing -fno-common -dynamic -O3 -DNDEBUG
-DPYGPU_PYCUDA=1 -DBOOST_MULTI_INDEX_DISABLE_SERIALIZATION=1
-DPYGPU_PACKAGE=pycuda -DHAVE_CURAND=1 -DBOOST_PYTHON_SOURCE=1
-Isrc/cpp -Ibpl-subset/bpl_subset -I/usr/local/cuda/include
-I/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/numpy/core/include
-I/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7
-c bpl-subset/bpl_subset/libs/python/src/wrapper.cpp -o
build/temp.macosx-10.3-i386-2.7/bpl-subset/bpl_subset/libs/python/src/wrapper.o
-arch x86_64 -arch i386 -isysroot /Developer/SDKs/MacOSX10.6.sdk
In file included from
/Developer/SDKs/MacOSX10.6.sdk/usr/include/architecture/i386/math.h:626,
                 from /Developer/SDKs/MacOSX10.6.sdk/usr/include/math.h:28,
                 from
/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7/pyport.h:312,
                 from
/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7/Python.h:58,
                 from
bpl-subset/bpl_subset/boost/python/detail/wrap_python.hpp:142,
                 from bpl-subset/bpl_subset/boost/python/detail/prefix.hpp:13,
                 from
bpl-subset/bpl_subset/boost/python/detail/wrapper_base.hpp:7,
                 from bpl-subset/bpl_subset/boost/python/wrapper.hpp:7,
                 from bpl-subset/bpl_subset/libs/python/src/wrapper.cpp:5:
/Developer/SDKs/MacOSX10.6.sdk/usr/include/AvailabilityMacros.h:108:14:
warning: #warning Building for Intel with Mac OS X Deployment Target <
10.4 is invalid.
…
gcc-4.0 -fno-strict-aliasing -fno-common -dynamic -O3 -DNDEBUG
-DPYGPU_PYCUDA=1 -DBOOST_MULTI_INDEX_DISABLE_SERIALIZATION=1
-DPYGPU_PACKAGE=pycuda -DHAVE_CURAND=1 -DBOOST_PYTHON_SOURCE=1
-Isrc/cpp -Ibpl-subset/bpl_subset -I/usr/local/cuda/include
-I/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/numpy/core/include
-I/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7
-c bpl-subset/bpl_subset/libs/thread/src/pthread/thread.cpp -o
build/temp.macosx-10.3-i386-2.7/bpl-subset/bpl_subset/libs/thread/src/pthread/thread.o
-arch x86_64 -arch i386 -isysroot /Developer/SDKs/MacOSX10.6.sdk
…
c++ -g -bundle -undefined dynamic_lookup -g
build/temp.macosx-10.3-i386-2.7/src/cpp/cuda.o
build/temp.macosx-10.3-i386-2.7/src/cpp/bitlog.o
build/temp.macosx-10.3-i386-2.7/src/wrapper/wrap_cudadrv.o
build/temp.macosx-10.3-i386-2.7/src/wrapper/mempool.o
build/temp.macosx-10.3-i386-2.7/bpl-subset/bpl_subset/libs/python/src/converter/arg_to_python_base.o
build/temp.macosx-10.3-i386-2.7/bpl-subset/bpl_subset/libs/python/src/converter/builtin_converters.o
build/temp.macosx-10.3-i386-2.7/bpl-subset/bpl_subset/libs/python/src/converter/from_python.o
build/temp.macosx-10.3-i386-2.7/bpl-subset/bpl_subset/libs/python/src/converter/registry.o
build/temp.macosx-10.3-i386-2.7/bpl-subset/bpl_subset/libs/python/src/converter/type_id.o
build/temp.macosx-10.3-i386-2.7/bpl-subset/bpl_subset/libs/python/src/object/class.o
build/temp.macosx-10.3-i386-2.7/bpl-subset/bpl_subset/libs/python/src/object/enum.o
build/temp.macosx-10.3-i386-2.7/bpl-subset/bpl_subset/libs/python/src/object/function.o
build/temp.macosx-10.3-i386-2.7/bpl-subset/bpl_subset/libs/python/src/object/function_doc_signature.o
build/temp.macosx-10.3-i386-2.7/bpl-subset/bpl_subset/libs/python/src/object/inheritance.o
build/temp.macosx-10.3-i386-2.7/bpl-subset/bpl_subset/libs/python/src/object/iterator.o
build/temp.macosx-10.3-i386-2.7/bpl-subset/bpl_subset/libs/python/src/object/life_support.o
build/temp.macosx-10.3-i386-2.7/bpl-subset/bpl_subset/libs/python/src/object/pickle_support.o
build/temp.macosx-10.3-i386-2.7/bpl-subset/bpl_subset/libs/python/src/object/stl_iterator.o
build/temp.macosx-10.3-i386-2.7/bpl-subset/bpl_subset/libs/python/src/dict.o
build/temp.macosx-10.3-i386-2.7/bpl-subset/bpl_subset/libs/python/src/errors.o
build/temp.macosx-10.3-i386-2.7/bpl-subset/bpl_subset/libs/python/src/exec.o
build/temp.macosx-10.3-i386-2.7/bpl-subset/bpl_subset/libs/python/src/import.o
build/temp.macosx-10.3-i386-2.7/bpl-subset/bpl_subset/libs/python/src/list.o
build/temp.macosx-10.3-i386-2.7/bpl-subset/bpl_subset/libs/python/src/long.o
build/temp.macosx-10.3-i386-2.7/bpl-subset/bpl_subset/libs/python/src/module.o
build/temp.macosx-10.3-i386-2.7/bpl-subset/bpl_subset/libs/python/src/numeric.o
build/temp.macosx-10.3-i386-2.7/bpl-subset/bpl_subset/libs/python/src/object_operators.o
build/temp.macosx-10.3-i386-2.7/bpl-subset/bpl_subset/libs/python/src/object_protocol.o
build/temp.macosx-10.3-i386-2.7/bpl-subset/bpl_subset/libs/python/src/slice.o
build/temp.macosx-10.3-i386-2.7/bpl-subset/bpl_subset/libs/python/src/str.o
build/temp.macosx-10.3-i386-2.7/bpl-subset/bpl_subset/libs/python/src/tuple.o
build/temp.macosx-10.3-i386-2.7/bpl-subset/bpl_subset/libs/python/src/wrapper.o
build/temp.macosx-10.3-i386-2.7/bpl-subset/bpl_subset/libs/smart_ptr/src/sp_collector.o
build/temp.macosx-10.3-i386-2.7/bpl-subset/bpl_subset/libs/smart_ptr/src/sp_debug_hooks.o
build/temp.macosx-10.3-i386-2.7/bpl-subset/bpl_subset/libs/thread/src/pthread/once.o
build/temp.macosx-10.3-i386-2.7/bpl-subset/bpl_subset/libs/thread/src/pthread/thread.o
build/temp.macosx-10.3-i386-2.7/src/wrapper/wrap_curand.o
-L/usr/local/cuda/lib -lcuda -lcurand -o
build/lib.macosx-10.3-i386-2.7/pycuda/_driver.so -arch x86_64 -arch
i386 -isysroot /Developer/SDKs/MacOSX10.6.sdk -Xlinker -rpath -Xlinker
/usr/local/cuda/lib
ld: -rpath can only be used when targeting Mac OS X 10.5 or later
collect2: ld returned 1 exit status
ld: -rpath can only be used when targeting Mac OS X 10.5 or later
collect2: ld returned 1 exit status
lipo: can't open input file: /var/tmp//ccGfQOKJ.out (No such file or directory)
error: command 'c++' failed with exit status 1
make: *** [all] Error 1
----

The build line:
c++ -g -bundle -undefined dynamic_lookup -g
build/temp.macosx-10.3-i386-2.7/src/cpp/cuda.o
referse to macosx-10.3-i386-2.7 - does anyone know where that comes
from? I'm a bit lost with all the weirdness of 32/64 bit Mac OS (along
with the various versions of Python - I've got 2.5, 2.6 and 2.7 on
this box).

All pointers very gladly received!

Cheers,
Ian.


-- 
Ian Ozsvald (A.I. researcher, screencaster)
i...@ianozsvald.com

http://IanOzsvald.com
http://SocialTiesApp.com/
http://MorConsulting.com/
http://blog.AICookbook.com/
http://TheScreencastingHandbook.com
http://FivePoundApp.com/
http://twitter.com/IanOzsvald

_______________________________________________
PyCUDA mailing list
PyCUDA@tiker.net
http://lists.tiker.net/listinfo/pycuda

Reply via email to