cant install numpy on mac os x 10.7 with pip and homebrew fails

1

I'm trying to install numpy on my mac running 10.7.5

I did the following command

sudo /usr/local/bin/python /usr/local/bin/pip install numpy

and the error is something related with ld: library not found for -lcrt1.10.6.o Here is the complete output:

sudo /usr/local/bin/python /usr/local/bin/pip install numpy

Downloading/unpacking numpy
  Running setup.py egg_info for package numpy
    Running from numpy source directory.
    non-existing path in 'numpy/distutils': 'site.cfg'
    F2PY Version 2
    blas_opt_info:
      FOUND:
        extra_link_args = ['-Wl,-framework', '-Wl,Accelerate']
        define_macros = [('NO_ATLAS_INFO', 3)]
        extra_compile_args = ['-msse3', '-I/System/Library/Frameworks/vecLib.framework/Headers']

    lapack_opt_info:
      FOUND:
        extra_link_args = ['-Wl,-framework', '-Wl,Accelerate']
        define_macros = [('NO_ATLAS_INFO', 3)]
        extra_compile_args = ['-msse3']

build_src
building py_modules sources
building library "npymath" sources
customize Gnu95FCompiler
Found executable /usr/local/bin/gfortran
customize Gnu95FCompiler
customize Gnu95FCompiler using config
C compiler: xcrun clang -fno-strict-aliasing -fno-common -dynamic -I/usr/local/include -I/usr/local/opt/sqlite/include -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.7.sdk -I/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.7.sdk/System/Library/Frameworks/Tk.framework/Versions/8.5/Headers -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes

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/src/npysort -Inumpy/core/include -I/usr/local/Cellar/python/2.7.3/Frameworks/Python.framework/Versions/2.7/include/python2.7 -c'
xcrun: _configtest.c
xcrun clang _configtest.o -o _configtest
ld: library not found for -lcrt1.10.6.o
clang: error: linker command failed with exit code 1 (use -v to see invocation)
ld: library not found for -lcrt1.10.6.o
clang: error: linker command failed with exit code 1 (use -v to see invocation)
failure.
removing: _configtest.c _configtest.o
Traceback (most recent call last):
  File "<string>", line 16, in <module>
  File "/private/tmp/pip-build-root/numpy/setup.py", line 214, in <module>
    setup_package()
  File "/private/tmp/pip-build-root/numpy/setup.py", line 207, in setup_package
    configuration=configuration )
  File "/private/tmp/pip-build-root/numpy/numpy/distutils/core.py", line 186, in setup
    return old_setup(**new_attr)
  File "/usr/local/Cellar/python/2.7.3/Frameworks/Python.framework/Versions/2.7/lib/python2.7/distutils/core.py", line 152, in setup
    dist.run_commands()
  File "/usr/local/Cellar/python/2.7.3/Frameworks/Python.framework/Versions/2.7/lib/python2.7/distutils/dist.py", line 953, in run_commands
    self.run_command(cmd)
  File "/usr/local/Cellar/python/2.7.3/Frameworks/Python.framework/Versions/2.7/lib/python2.7/distutils/dist.py", line 972, in run_command
    cmd_obj.run()
  File "/private/tmp/pip-build-root/numpy/numpy/distutils/command/egg_info.py", line 8, in run
    self.run_command("build_src")
  File "/usr/local/Cellar/python/2.7.3/Frameworks/Python.framework/Versions/2.7/lib/python2.7/distutils/cmd.py", line 326, in run_command
    self.distribution.run_command(command)
  File "/usr/local/Cellar/python/2.7.3/Frameworks/Python.framework/Versions/2.7/lib/python2.7/distutils/dist.py", line 972, in run_command
    cmd_obj.run()
  File "/private/tmp/pip-build-root/numpy/numpy/distutils/command/build_src.py", line 152, in run
    self.build_sources()
  File "/private/tmp/pip-build-root/numpy/numpy/distutils/command/build_src.py", line 163, in build_sources
    self.build_library_sources(*libname_info)
  File "/private/tmp/pip-build-root/numpy/numpy/distutils/command/build_src.py", line 298, in build_library_sources
    sources = self.generate_sources(sources, (lib_name, build_info))
  File "/private/tmp/pip-build-root/numpy/numpy/distutils/command/build_src.py", line 385, in generate_sources
    source = func(extension, build_dir)
  File "numpy/core/setup.py", line 648, in get_mathlib_info
    raise RuntimeError("Broken toolchain: cannot link a simple C program")
RuntimeError: Broken toolchain: cannot link a simple C program
Complete output from command python setup.py egg_info:
Running from numpy source directory.

non-existing path in 'numpy/distutils': 'site.cfg'

F2PY Version 2

blas_opt_info:

FOUND:

extra_link_args = ['-Wl,-framework', '-Wl,Accelerate']

define_macros = [('NO_ATLAS_INFO', 3)]

extra_compile_args = ['-msse3', '-I/System/Library/Frameworks/vecLib.framework/Headers']



lapack_opt_info:

FOUND:

extra_link_args = ['-Wl,-framework', '-Wl,Accelerate']

define_macros = [('NO_ATLAS_INFO', 3)]

extra_compile_args = ['-msse3']



running egg_info

running build_src

build_src

building py_modules sources

building library "npymath" sources

customize Gnu95FCompiler

Found executable /usr/local/bin/gfortran

customize Gnu95FCompiler

customize Gnu95FCompiler using config

C compiler: xcrun clang -fno-strict-aliasing -fno-common -dynamic -I/usr/local/include -I/usr/local/opt/sqlite/include -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.7.sdk -I/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.7.sdk/System/Library/Frameworks/Tk.framework/Versions/8.5/Headers -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes



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/src/npysort -Inumpy/core/include -I/usr/local/Cellar/python/2.7.3/Frameworks/Python.framework/Versions/2.7/include/python2.7 -c'

xcrun: _configtest.c

xcrun clang _configtest.o -o _configtest

ld: library not found for -lcrt1.10.6.o

clang: error: linker command failed with exit code 1 (use -v to see invocation)

ld: library not found for -lcrt1.10.6.o

clang: error: linker command failed with exit code 1 (use -v to see invocation)

failure.

removing: _configtest.c _configtest.o

Traceback (most recent call last):

  File "<string>", line 16, in <module>

  File "/private/tmp/pip-build-root/numpy/setup.py", line 214, in <module>

setup_package()

  File "/private/tmp/pip-build-root/numpy/setup.py", line 207, in setup_package

configuration=configuration )

  File "/private/tmp/pip-build-root/numpy/numpy/distutils/core.py", line 186, in setup

return old_setup(**new_attr)

  File "/usr/local/Cellar/python/2.7.3/Frameworks/Python.framework/Versions/2.7/lib/python2.7/distutils/core.py", line 152, in setup

dist.run_commands()

  File "/usr/local/Cellar/python/2.7.3/Frameworks/Python.framework/Versions/2.7/lib/python2.7/distutils/dist.py", line 953, in run_commands

self.run_command(cmd)

  File "/usr/local/Cellar/python/2.7.3/Frameworks/Python.framework/Versions/2.7/lib/python2.7/distutils/dist.py", line 972, in run_command

    cmd_obj.run()

  File "/private/tmp/pip-build-root/numpy/numpy/distutils/command/egg_info.py", line 8, in run

    self.run_command("build_src")

  File "/usr/local/Cellar/python/2.7.3/Frameworks/Python.framework/Versions/2.7/lib/python2.7/distutils/cmd.py", line 326, in run_command

self.distribution.run_command(command)

  File "/usr/local/Cellar/python/2.7.3/Frameworks/Python.framework/Versions/2.7/lib/python2.7/distutils/dist.py", line 972, in run_command

cmd_obj.run()

  File "/private/tmp/pip-build-root/numpy/numpy/distutils/command/build_src.py", line 152, in run

    self.build_sources()

  File "/private/tmp/pip-build-root/numpy/numpy/distutils/command/build_src.py", line 163, in build_sources

self.build_library_sources(*libname_info)

  File "/private/tmp/pip-build-root/numpy/numpy/distutils/command/build_src.py", line 298, in build_library_sources

sources = self.generate_sources(sources, (lib_name, build_info))

  File "/private/tmp/pip-build-root/numpy/numpy/distutils/command/build_src.py", line 385, in generate_sources

source = func(extension, build_dir)

  File "numpy/core/setup.py", line 648, in get_mathlib_info

raise RuntimeError("Broken toolchain: cannot link a simple C program")

RuntimeError: Broken toolchain: cannot link a simple C program

----------------------------------------
Command python setup.py egg_info failed with error code 1 in /private/tmp/pip-build-root/numpy
Storing complete log in /Users/thomasrasilier/.pip/pip.log

any ideas? Thanks

otmezger

Posted 2013-03-20T10:47:16.983

Reputation: 211

none of the ides there actually worked – otmezger – 2013-03-20T13:37:57.223

Answers

1

I finally found the way to make this work... more with try and error than really understanding...

This did the trick:

cd /usr/lib
sudo ln -s /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.7.sdk/usr/lib/crt1.10.6.o 

Now I can install numpy with

sudo pip install numpy

otmezger

Posted 2013-03-20T10:47:16.983

Reputation: 211

I also needed to link a number of other libraries (like 5 in total)... very strange it wasn't looking in the right folder... maybe because it was on os x 10.7 and not 10.8? – otmezger – 2013-03-21T19:31:00.327