python extensions under H10.0 / OSX

   2640   0   1
User Avatar
Member
117 posts
Joined: July 2005
Offline
Hi all,

Has anyone got a recipe for building python c/c++ extensions that will work under H10.0 OSX? I'm trying to use Numpy but I'm having a lot of trouble getting it compiled. Apple doesn't provide an X86_64 python25 binary. Macports can't build an x86_64 python25 or python26. I get the following if I use the H10.0 python25


/Library/Frameworks/Houdini.framework/Versions/10.0.595/Resources/python/bin/python2.5-64 setup.py build
Running from numpy source directory.
non-existing path in ‘numpy/distutils’: ‘site.cfg’
F2PY Version 2
blas_opt_info:
FOUND:
extra_link_args =
define_macros =
extra_compile_args =

lapack_opt_info:
FOUND:
extra_link_args =
define_macros =
extra_compile_args =

running build
running config_cc
unifing config_cc, config, build_clib, build_ext, build commands –compiler options
running config_fc
unifing config_fc, config, build_clib, build_ext, build commands –fcompiler options
running build_src
build_src
building py_modules sources
building library “npymath” sources
customize NAGFCompiler
Could not locate executable f95
customize AbsoftFCompiler
Could not locate executable f90
Could not locate executable f77
customize IBMFCompiler
Could not locate executable xlf90
Could not locate executable xlf
customize IntelFCompiler
Could not locate executable ifort
Could not locate executable ifc
customize GnuFCompiler
Could not locate executable g77
customize Gnu95FCompiler
Could not locate executable gfortran
customize G95FCompiler
Could not locate executable g95
don't know how to compile Fortran code on platform ‘posix’
C compiler: gcc-4.2 -fno-strict-aliasing -mno-fused-madd -fno-common -dynamic -DNDEBUG -g -fwrapv -Os -Wall -Wstrict-prototypes -DMACOSX -I/usr/include/ffi -DENABLE_DTRACE -arch i386 -arch ppc -pipe

compile options: ‘-Inumpy/core/src/private -Inumpy/core/src -Inumpy/core -Inumpy/core/src/npymath -Inumpy/core/src/multiarray -Inumpy/core/src/umath -Inumpy/core/include -I/System/Library/Frameworks/Python.framework/Versions/2.5/include/python2.5 -c’
gcc-4.2: _configtest.c
gcc-4.2 _configtest.o -o _configtest
ld: warning: in _configtest.o, missing required architecture x86_64 in file
Undefined symbols:
“_main”, referenced from:
start in crt1.10.6.o
ld: symbol(s) not found
collect2: ld returned 1 exit status
ld: warning: in _configtest.o, missing required architecture x86_64 in file
Undefined symbols:
“_main”, referenced from:
start in crt1.10.6.o
ld: symbol(s) not found
collect2: ld returned 1 exit status
failure.
removing: _configtest.c _configtest.o
Traceback (most recent call last):
File “setup.py”, line 187, in <module>
setup_package()
File “setup.py”, line 180, in setup_package
configuration=configuration )
File “/Users/drw900/Downloads/numpy-1.4.1rc2/numpy/distutils/core.py”, line 186, in setup
return old_setup(**new_attr)
File “/System/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/distutils/core.py”, line 151, in setup
dist.run_commands()
File “/System/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/distutils/dist.py”, line 974, in run_commands
self.run_command(cmd)
File “/System/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/distutils/dist.py”, line 994, in run_command
cmd_obj.run()
File “/Users/drw900/Downloads/numpy-1.4.1rc2/numpy/distutils/command/build.py”, line 37, in run
old_build.run(self)
File “/System/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/distutils/command/build.py”, line 112, in run
self.run_command(cmd_name)
File “/System/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/distutils/cmd.py”, line 333, in run_command
self.distribution.run_command(command)
File “/System/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/distutils/dist.py”, line 994, in run_command
cmd_obj.run()
File “/Users/drw900/Downloads/numpy-1.4.1rc2/numpy/distutils/command/build_src.py”, line 152, in run
self.build_sources()
File “/Users/drw900/Downloads/numpy-1.4.1rc2/numpy/distutils/command/build_src.py”, line 163, in build_sources
self.build_library_sources(*libname_info)
File “/Users/drw900/Downloads/numpy-1.4.1rc2/numpy/distutils/command/build_src.py”, line 298, in build_library_sources
sources = self.generate_sources(sources, (lib_name, build_info))
File “/Users/drw900/Downloads/numpy-1.4.1rc2/numpy/distutils/command/build_src.py”, line 385, in generate_sources
source = func(extension, build_dir)
File “numpy/core/setup.py”, line 657, in get_mathlib_info
raise RuntimeError(“Broken toolchain: cannot link a simple C program”)
RuntimeError: Broken toolchain: cannot link a simple C program
(hython10.0) ~/Downloads/numpy-1.4.1rc2/



I have the latest Xcode and can develop HDK extensions so the toolchain is all there. Any ideas ?

This is all much easier in the Linux world ….

-Drew
  • Quick Links