[AstroPy] OSX issues with the location of gfortran

Derek Homeier derek at astro.physik.uni-goettingen.de
Wed Jul 30 10:30:33 EDT 2014


On 30 Jul 2014, at 04:14 pm, Jim Ramberg <ramberg at yahoo.com> wrote:

> Recent  releases of OSX has gfortran being moved to the gcc package.  So astropy tests that have a preset path for gfortran are failing
> 
> Here is one of the errors I see:
> 
> /Users/ramberg/astropy/docs/convolution/kernels.rst:304: UnexpectedException
> __________________________________________________________________________ [doctest] index.rst __________________________________________________________________________
> 023 Hubble constant at z=0 (i.e., ``H0``), and the number of transverse proper
> 024 kpc corresponding to an arcminute at z=3::
> 025 
> 026   >>> from astropy.cosmology import WMAP9 as cosmo
> 027   >>> cosmo.H(0)  # doctest: +FLOAT_CMP
> 028   <Quantity 69.32 km / (Mpc s)>
> 029 
> 030 .. doctest-requires:: scipy
> 031 
> 032   >>> cosmo.kpc_proper_per_arcmin(3)  # doctest: +FLOAT_CMP
> UNEXPECTED EXCEPTION: ImportError('dlopen(/usr/local/lib/python2.7/site-packages/scipy/special/_ufuncs.so, 2): Library not loaded: /usr/local/Cellar/gfortran/4.8.1/gfortran/lib/libgfortran.3.dylib\n  Referenced from: /usr/local/lib/python2.7/site-packages/scipy/special/_ufuncs.so\n  Reason: image not found',)
> Traceback (most recent call last):
> 
> 
> 
> I was wondering if there is a workaround for this or should I just create a symlink 
> The correct location on my system is: /usr/local/Cellar/gcc/4.8.3_1/lib/gcc/x86_64-apple-darwin13.2.0/4.8.3/i386/libgfortran.3.dylib

There is no gfortran included with the system-provided gcc (which is actually clang/LLVM),
so it’s location depends on whatever additional gcc installation you are using, not on the
OS X version - yours seems to be a rather exotic one. So the gfortran path should probably
have been set at compile time of your astropy or scipy installation, wherever it found the
working gfortran installation during 'setup.py build’.
Creating the symlink might work around this, but a better solution would probably be to rebuild
your scipy installation to make it aware of the changed gfortran paths (and build against the
installed version, gcc-4.8.3, whereas yours apparently had originally been built agains 4.8.1).

HTH,
						Derek




More information about the AstroPy mailing list