[AstroPy] installation problems on a mac

Michael Droettboom mdroe at stsci.edu
Wed Jun 25 10:35:59 EDT 2014


Many of the gcc compiler flags that astropy uses come directly from the 
Python being used.  (This is how distutils, the standard Python tool 
that astropy uses to build itself, works).  The idea is that the 
compiler flags for the extensions should match the compiler flags that 
were used to build the Python interpreter they will be used with.

If you're using EPD python, that's probably the old SDK they used to 
build their Python (and it makes sense they would use an old one if they 
are trying to be as portable as possible).

Never being an EPD user, I don't know what the usual solution to this 
is.  You may try upgrading to Enthought Canopy or Anaconda, as I don't 
think EPD is being actively supported anymore.

Mike

On 06/24/2014 08:11 PM, Stephen Bailey wrote:
> Hello.  I'm having difficulty installing astropy on a Mac (10.9.3, 
> Xcode 5.1.1, EPD 7.3-1 python 2.7.3).
>
> The failure is rather basic: when installing via pip it can't find 
> math.h; when installing from git source it can't find stdio.h (see 
> details below).  It suspiciously includes the gcc option:
>
> -isysroot /Developer-3.2.6/SDKs/MacOSX10.6.sdk
>
> which looks like it is trying to find a very old (and perhaps 
> no-longer-existent?) XCode installation.  That might be the original 
> Xcode that was installed on this Mac 3 years ago, but has been 
> upgraded multiple times since then.  I'm not using macports.
>
> It should be looking in
>
> /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.9.sdk/usr/include/math.h
>
> A simple hello.c program is able to find <stdio.h> without any special 
> gcc options.
>
> Any ideas for why astropy is trying to use the wrong sysroot or 
> whatever else might be wrong?
>
> Thanks for the help.
>
> Stephen Bailey
>
>
>
>
> FF:temp $ pip install --no-deps astropy
> ...
> Downloading/unpacking astropy
>   Downloading astropy-0.3.2.tar.gz (6.4MB): 6.4MB downloaded
>   Running setup.py egg_info for package astropy
>     Configured with: 
> --prefix=/Applications/Xcode.app/Contents/Developer/usr 
> --with-gxx-include-dir=/usr/include/c++/4.2.1
> Installing collected packages: astropy
>   Running setup.py install for astropy
>     Configured with: 
> --prefix=/Applications/Xcode.app/Contents/Developer/usr 
> --with-gxx-include-dir=/usr/include/c++/4.2.1
>     building 'astropy.io.fits.compression' extension
>     gcc -fno-strict-aliasing -fno-common -dynamic -arch x86_64 
> -isysroot /Developer-3.2.6/SDKs/MacOSX10.6.sdk -DNDEBUG -g -O3 -arch 
> x86_64 -isysroot /Developer-3.2.6/SDKs/MacOSX10.6.sdk 
> -I/Library/Frameworks/EPD64.framework/Versions/7.3/lib/python2.7/site-packages/numpy/core/include 
> -Icextern/cfitsio 
> -I/Library/Frameworks/EPD64.framework/Versions/7.3/include/python2.7 
> -c astropy/io/fits/src/compressionmodule.c -o 
> build/temp.macosx-10.5-x86_64-2.7/astropy/io/fits/src/compressionmodule.o 
> -Wno-unused-variable -Wno-parentheses -Wno-uninitialized -Wno-format 
> -Wno-strict-prototypes -Wno-unused -Wno-comments -Wno-switch 
> -Wno-declaration-after-statement
>     astropy/io/fits/src/compressionmodule.c:93:10: fatal error: 
> 'math.h' file not found
>     #include <math.h>
>              ^
>     1 error generated.
>     error: command 'gcc' failed with exit status 1
>     Complete output from command 
> /Library/Frameworks/EPD64.framework/Versions/7.3/bin/python -c "import 
> setuptools;__file__='/private/var/folders/lt/w2k_kx011kd7s2g9rk27xgzc0000gn/T/pip_build_sbailey/astropy/setup.py';exec(compile(open(__file__).read().replace('\r\n', 
> '\n'), __file__, 'exec'))" install --record 
> /var/folders/lt/w2k_kx011kd7s2g9rk27xgzc0000gn/T/pip-Sv1zUF-record/install-record.txt 
> --single-version-externally-managed:
>     Configured with: 
> --prefix=/Applications/Xcode.app/Contents/Developer/usr 
> --with-gxx-include-dir=/usr/include/c++/4.2.1
>
> running install
> ...
> creating build/temp.macosx-10.5-x86_64-2.7/cextern/cfitsio
>
> gcc -fno-strict-aliasing -fno-common -dynamic -arch x86_64 -isysroot 
> /Developer-3.2.6/SDKs/MacOSX10.6.sdk -DNDEBUG -g -O3 -arch x86_64 
> -isysroot /Developer-3.2.6/SDKs/MacOSX10.6.sdk 
> -I/Library/Frameworks/EPD64.framework/Versions/7.3/lib/python2.7/site-packages/numpy/core/include 
> -Icextern/cfitsio 
> -I/Library/Frameworks/EPD64.framework/Versions/7.3/include/python2.7 
> -c astropy/io/fits/src/compressionmodule.c -o 
> build/temp.macosx-10.5-x86_64-2.7/astropy/io/fits/src/compressionmodule.o 
> -Wno-unused-variable -Wno-parentheses -Wno-uninitialized -Wno-format 
> -Wno-strict-prototypes -Wno-unused -Wno-comments -Wno-switch 
> -Wno-declaration-after-statement
>
> astropy/io/fits/src/compressionmodule.c:93:10: fatal error: 'math.h' 
> file not found
>
> #include <math.h>
>
>          ^
>
> 1 error generated.
>
> error: command 'gcc' failed with exit status 1
>
> ----------------------------------------
> Cleaning up...
> Command /Library/Frameworks/EPD64.framework/Versions/7.3/bin/python -c 
> "import 
> setuptools;__file__='/private/var/folders/lt/w2k_kx011kd7s2g9rk27xgzc0000gn/T/pip_build_sbailey/astropy/setup.py';exec(compile(open(__file__).read().replace('\r\n', 
> '\n'), __file__, 'exec'))" install --record 
> /var/folders/lt/w2k_kx011kd7s2g9rk27xgzc0000gn/T/pip-Sv1zUF-record/install-record.txt 
> --single-version-externally-managed failed with error code 1 in 
> /private/var/folders/lt/w2k_kx011kd7s2g9rk27xgzc0000gn/T/pip_build_sbailey/astropy
> Storing complete log in /Users/sbailey/.pip/pip.log
>
>
>
>
>
>
> FF:astropy $ python setup.py build
> Configured with: 
> --prefix=/Applications/Xcode.app/Contents/Developer/usr 
> --with-gxx-include-dir=/usr/include/c++/4.2.1
> running build
> running build_py
> running build_ext
> building 'astropy._compiler' extension
> gcc -fno-strict-aliasing -fno-common -dynamic -arch x86_64 -isysroot 
> /Developer-3.2.6/SDKs/MacOSX10.6.sdk -DNDEBUG -g -O3 -arch x86_64 
> -isysroot /Developer-3.2.6/SDKs/MacOSX10.6.sdk 
> -I/Library/Frameworks/EPD64.framework/Versions/7.3/include/python2.7 
> -c astropy/_compiler.c -o 
> build/temp.macosx-10.5-x86_64-2.7/astropy/_compiler.o
> In file included from astropy/_compiler.c:1:
> /Library/Frameworks/EPD64.framework/Versions/7.3/include/python2.7/Python.h:33:10: 
> fatal error:
>       'stdio.h' file not found
> #include <stdio.h>
>          ^
> 1 error generated.
> error: command 'gcc' failed with exit status 1
>
>
>
>
> _______________________________________________
> AstroPy mailing list
> AstroPy at scipy.org
> http://mail.scipy.org/mailman/listinfo/astropy


-- 
Michael Droettboom
Science Software Branch
Space Telescope Science Institute

http://www.droettboom.com

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/astropy/attachments/20140625/378c5b1b/attachment.html>


More information about the AstroPy mailing list