Python 2.6.2 (r262:71600, Apr 16 2009, 09:17:39)
[GCC 4.0.1 (Apple Computer, Inc. build 5250)] on darwin
Type "help", "copyright", "credits" or "license"
for more information.
>> import pyopencl
Traceback (most
recent call last):
File "<stdin>", line 1, in <module>
File "/Library/Frameworks/Python.framework/Versions/2.6/lib/
python2.6/site-packages/pyopencl-0.91-py2.6-macosx-10.3-fat.egg/
pyopencl/__init__.py", line 3, in <module>
import pyopencl._cl as _cl
ImportError: dlopen(/Library/Frameworks/Python.framework/Versions/
2.6/lib/python2.6/site-packages/pyopencl-0.91-py2.6-macosx-10.3-
fat.egg/pyopencl/_cl.so, 2): Symbol not found:
__ZNK5boost6python7objects21py_function_impl_base9max_arityEv
Referenced from: /Library/Frameworks/Python.framework/Versions/2.6/
lib/python2.6/site-packages/pyopencl-0.91-py2.6-macosx-10.3-fat.egg/
pyopencl/_cl.so
Expected in: dynamic lookup
Hi
thanks for the help but im still not up and running.
I built boost and pyopencl using Python 2.6.2 and everything worked
until i tried to import pyopencl
and get
>>
import pyopencl
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "pyopencl/__init__.py", line 3, in <module>
import pyopencl._cl as _cl
ImportError: No module named _cl
_cl.py exists in the site-packages directory so im not sure whats
going on there
When I rebuilt boost using my EPD version of Python and then tried
building pyopencl I got
Jake-Ross-Computer:pyopencl-0.91 Ross$ CC=gcc-4.0
make
ctags -R src || true
ctags: illegal option -- R
usage: ctags [-BFadtuwvx] [-f tagsfile] file ...
/Library/Frameworks/Python.framework/Versions/5.0.0/Resources/
Python.app/Contents/MacOS/Python setup.py build
running build
running build_py
running build_ext
building '_cl' extension
gcc-4.0 -fno-strict-aliasing -no-cpp-precomp -mno-fused-madd -fno-
common -dynamic -I/Library/Frameworks/Python.framework/Versions/
5.0.0/include -O3 -DNDEBUG -Isrc/cpp -I/Users/Ross/Boost/include -I/
Library/Frameworks/Python.framework/Versions/5.0.0/lib/python2.5/
site-packages/numpy/core/include -I/Library/Frameworks/
Python.framework/Versions/5.0.0/include/python2.5 -c src/wrapper/
wrap_cl.cpp -o build/temp.macosx-10.3-i386-2.5/src/wrapper/
wrap_cl.o -arch i386 -arch x86_64 -isysroot /Developer/SDKs/
MacOSX10.6.sdk
In file included from /Developer/SDKs/MacOSX10.6.sdk/System/Library/
Frameworks/OpenCL.framework/Headers/opencl.h:12,
from src/wrapper/wrap_cl.hpp:15,
from src/wrapper/wrap_cl.cpp:1:
/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.
In file included from /Developer/SDKs/MacOSX10.6.sdk/System/Library/
Frameworks/OpenCL.framework/Headers/opencl.h:12,
from src/wrapper/wrap_cl.hpp:15,
from src/wrapper/wrap_cl.cpp:1:
/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.
In file included from /Library/Frameworks/Python.framework/Versions/
5.0.0/include/python2.5/Python.h:57,
from /Users/Ross/Boost/include/boost/python/detail/
wrap_python.hpp:142,
from /Users/Ross/Boost/include/boost/python/detail/
prefix.hpp:13,
from /Users/Ross/Boost/include/boost/python/
args.hpp:8,
from /Users/Ross/Boost/include/boost/python.hpp:11,
from src/wrapper/wrap_helpers.hpp:8,
from src/wrapper/wrap_cl.hpp:38,
from src/wrapper/wrap_cl.cpp:1:
/Library/Frameworks/Python.framework/Versions/5.0.0/include/
python2.5/pyport.h:761:2: error: #error "LONG_BIT definition
appears wrong for platform (bad gcc/glibc config?)."
lipo: can't figure out the architecture type of: /var/folders/HR/
HR4MJfTvGmSHMD5GW6NlvU+++TI/-Tmp-//ccIFYar5.out
error: command 'gcc-4.0' failed with exit status 1
make: *** [all] Error 1
I filtered out the -Wno-long-double flag from CFLAGS adding the
snippet to the hack_distutils
import sys
#====================filtier out -Wno-long-double==============
from distutils import sysconfig
cvars = sysconfig.get_config_vars()
cflags = cvars.get('BASECFLAGS')
cvars['BASECFLAGS']='-fno-strict-aliasing -no-cpp-precomp -mno-
fused-madd -fno-common -dynamic'
#==============================================================
Thanks
Jake
On Sep 16, 2009, at 9:27 AM, James Snyder wrote:
Hmm.. again, this is a distutils related issue.
It looks like
you've got the latest EPD (guessing from the 5.0.0 in your path)
and they likely compiled it with a 10.3 target using gcc 4.0.1 (or
similar), and they seem to have used a generic "gcc" rather than
specifying a particular version like "gcc-4.0" when they did the
build.
First, make sure that when you are building boost it's building for
that python install, and not Apple's (if you're wanting to use that
python install). I think it should display which version it has
selected in some of the output prior to the full build stage.
Second, you'll either need to filter out that "-Wno-long-double"
from the CFLAGS/CXXFLAGS that distutils is putting together, or try
building with gcc-4.0.1.
For pyopencl, the following seems to force using gcc-4.0.1:
CC=gcc-4.0 make
It's also possible that something similar may be needed for boost,
although a quick test using Apple's Python 2.6.1 and boost having
been built with gcc 4.2 and rebuilding pyopencl with the above
gcc-4.0 appears to work.
Good luck :-)
-jsnyder
P.S.: Anyone know of any guides out there that lay out some general
rules for working around these issues when one has multiple python
installs that might have been built using different compilers and
are installed in different places? This seems to be somewhat
unique to OS X due to Apple always providing a python install, but
users frequently install pre-packaged python distributions.
Andreas: It looks like hack_distutils() or something similar with
aksetup_helper could be modified to pick up on situations like this?
On Sep 16, 2009, at 12:03 AM, Jake Ross wrote:
hi
Im trying to get started with PyOpenCL but am running into some
walls. Whenever I try to build the package either by using ./
configure ... make or python setup.py build I get the following
error
Jake-Ross-Computer:pyopencl-0.91 Ross$ python setup.py build
running build
running build_py
running build_ext
building '_cl' extension
gcc -fno-strict-aliasing -Wno-long-double -no-cpp-precomp -mno-
fused-madd -fno-common -dynamic -I/Library/Frameworks/
Python.framework/Versions/5.0.0/include -O3 -DNDEBUG -Isrc/cpp -I/
Library/Frameworks/Python.framework/Versions/5.0.0/lib/python2.5/
site-packages/numpy/core/include -I/Library/Frameworks/
Python.framework/Versions/5.0.0/include/python2.5 -c src/wrapper/
wrap_cl.cpp -o build/temp.macosx-10.3-i386-2.5/src/wrapper/
wrap_cl.o -arch i386 -arch x86_64 -isysroot /Developer/SDKs/
MacOSX10.6.sdk
cc1plus: error: unrecognized command line option "-Wno-long-double"
cc1plus: error: unrecognized command line option "-Wno-long-double"
lipo: can't figure out the architecture type of: /var/folders/HR/
HR4MJfTvGmSHMD5GW6NlvU+++TI/-Tmp-//ccBx1lvA.out
error: command 'gcc' failed with exit status 1
I followed the instructions on the wiki to install Boost but
always get
...failed updating 28 targets...
dont really know where to go from here. Im pretty excited to
start working with pyopencl so any help would be great
Thanks
Jake
Jake Ross
New Mexico Geochronology Research Laboratory
jirhiker(a)nmt.edu
jirhiker(a)gmail.com
575-835-5994 (office)
_______________________________________________
PyOpenCL mailing list
PyOpenCL(a)tiker.net
http://tiker.net/mailman/listinfo/pyopencl_tiker.net
Jake Ross
NM Tech
jirhiker(a)nmt.edu
jirhiker(a)gmail.com
575-835-5994 (office)
Jake Ross
NM Tech
jirhiker(a)nmt.edu
jirhiker(a)gmail.com
575-835-5994 (office)