Try adding --cl-inc-dir=/path/to/cl/headers
HTH,
Andreas
That didn't work, BUT then I realized that I somehow downloaded the
tarball for 0.90, and not the current 0.91.3. Not sure where I got it
from. In any case, the Mac instructions specifically say 0.90.1 or
higher. My apologies for missing that.
Now I'm having a problem compiling only a 64-bit version of PyOpenCL.
My python and boost installations in MacPorts are only 64-bit so I
modified my config command to look like:
python configure.py \
--boost-inc-dir=/opt/local/include \
--boost-lib-dir=/opt/local/lib \
--boost-python-libname=boost_python-mt \
--boost-thread-libname=boost_thread-mt \
--cl-libname='' \
--ldflags='-Wl,-framework,OpenCL,-arch x86_64' \
--boost-compiler='gcc42' \
--python-exe=/opt/local/bin/python \
--cxxflags='-arch x86_64' \
However, during make, it's not recognizing the already-existing -arch
in cxxflags, resulting in commands like
/usr/bin/gcc-4.2 -fno-strict-aliasing -fno-common -dynamic -fwrapv
-Wall -O3 -DNDEBUG -I/opt/local/include -Isrc/cpp -I/opt/local/include
-I/opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/numpy/core/include
-I/opt/local/Library/Frameworks/Python.framework/Versions/2.6/include/python2.6
-c src/wrapper/wrap_cl.cpp -o
build/temp.macosx-10.6-i386-2.6/src/wrapper/wrap_cl.o -arch x86_64
-arch i386 -arch x86_64 -isysroot /Developer/SDKs/MacOSX10.6.sdk
with "-arch x86_64 -arch i386 -arch x86_64" in them. So I went
manually into setup.py and changed lines 60-70 to:
if 'darwin' in sys.platform:
# Build for i386 & x86_64 since OpenCL doesn't run on PPC
if "-arch" not in conf["CXXFLAGS"]:
#conf["CXXFLAGS"].extend(['-arch', 'i386'])
conf["CXXFLAGS"].extend(['-arch', 'x86_64'])
if "-arch" not in conf["LDFLAGS"]:
#conf["LDFLAGS"].extend(['-arch', 'i386'])
conf["LDFLAGS"].extend(['-arch', 'x86_64'])
# Compile against 10.6 SDK, first to support OpenCL
conf["CXXFLAGS"].extend(['-isysroot',
'/Developer/SDKs/MacOSX10.6.sdk'])
conf["LDFLAGS"].extend(['-isysroot',
'/Developer/SDKs/MacOSX10.6.sdk'])
commenting out lines 63 and 66, which specify i386 architecture.
Changed my config command to:
python configure.py \
--boost-inc-dir=/opt/local/include \
--boost-lib-dir=/opt/local/lib \
--boost-python-libname=boost_python-mt \
--boost-thread-libname=boost_thread-mt \
--cl-libname='' \
--ldflags='-Wl,-framework,OpenCL' \
--boost-compiler='gcc42' \
--python-exe=/opt/local/bin/python \
And it installed. However, in python:
>> import pyopencl
Fatal Python error:
Interpreter not initialized (version mismatch?)
Abort trap
Any ideas?
Faisal