jobovy / apogee

Tools for dealing with APOGEE data
BSD 3-Clause "New" or "Revised" License
42 stars 25 forks source link

cannot get galpy to compile #21

Closed chukus closed 9 years ago

chukus commented 9 years ago

Hi

I am trying to use the setup but I get the clang error while it is trying to install galpy. I do not use homebrew, but macports, so I was wondering if there is a way around it.

jobovy commented 9 years ago

Could you tell me a little more about the error you are getting? Just sending the output from the installation would be fine.

On Friday, July 24, 2015, chukus notifications@github.com wrote:

Hi

I am trying to use the setup but I get the clang error while it is trying to install galpy. I do not use homebrew, but macports, so I was wondering if there is a way around it.

— Reply to this email directly or view it on GitHub https://github.com/jobovy/apogee/issues/21.

jobovy commented 9 years ago

Also, if this is only an issue with the installation of galpy, please open an issue at jobovy/galpy.

chukus commented 9 years ago

Hi. Sorry for taking so long to answer back, I was traveling.

I have not tried to install galpy separately. This is the output from trying to install the setup.py script from the apogee github. The error about galpy is almost at the end.

By the way, my python installation is from anaconda.

sudo python setup.py install

/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/setuptools/dist.py:291: UserWarning: The version specified ('1.') is an invalid version, this may not work as expected with newer versions of setuptools, pip, and PyPI. Please see PEP 440 for more details. "details." % self.metadata.version running install running bdist_egg running egg_info writing requirements to apogee.egg-info/requires.txt writing apogee.egg-info/PKG-INFO writing top-level names to apogee.egg-info/top_level.txt writing dependency_links to apogee.egg-info/dependency_links.txt reading manifest file 'apogee.egg-info/SOURCES.txt' writing manifest file 'apogee.egg-info/SOURCES.txt' installing library code to build/bdist.macosx-10.10-x86_64/egg running install_lib running build_py creating build/bdist.macosx-10.10-x86_64/egg creating build/bdist.macosx-10.10-x86_64/egg/apogee copying build/lib/apogee/init.py -> build/bdist.macosx-10.10-x86_64/egg/apogee creating build/bdist.macosx-10.10-x86_64/egg/apogee/samples copying build/lib/apogee/samples/init.py -> build/bdist.macosx-10.10-x86_64/egg/apogee/samples creating build/bdist.macosx-10.10-x86_64/egg/apogee/samples/data copying build/lib/apogee/samples/data/rcmodel_mass_agez.sav -> build/bdist.macosx-10.10-x86_64/egg/apogee/samples/data copying build/lib/apogee/samples/data/rcmodel_mass_agez_coarseage.sav -> build/bdist.macosx-10.10-x86_64/egg/apogee/samples/data copying build/lib/apogee/samples/data/rcmodel_mode_jkz_h_parsec_newlogg.sav -> build/bdist.macosx-10.10-x86_64/egg/apogee/samples/data copying build/lib/apogee/samples/data/rcmodel_mode_jkz_ks_parsec_newlogg.sav -> build/bdist.macosx-10.10-x86_64/egg/apogee/samples/data copying build/lib/apogee/samples/data/rcmodel_omega_agez.sav -> build/bdist.macosx-10.10-x86_64/egg/apogee/samples/data copying build/lib/apogee/samples/isomodel.py -> build/bdist.macosx-10.10-x86_64/egg/apogee/samples copying build/lib/apogee/samples/make_rcsample.py -> build/bdist.macosx-10.10-x86_64/egg/apogee/samples copying build/lib/apogee/samples/rc.py -> build/bdist.macosx-10.10-x86_64/egg/apogee/samples creating build/bdist.macosx-10.10-x86_64/egg/apogee/select copying build/lib/apogee/select/init.py -> build/bdist.macosx-10.10-x86_64/egg/apogee/select copying build/lib/apogee/select/apogeeSelect.py -> build/bdist.macosx-10.10-x86_64/egg/apogee/select copying build/lib/apogee/select/volumeSelect.py -> build/bdist.macosx-10.10-x86_64/egg/apogee/select creating build/bdist.macosx-10.10-x86_64/egg/apogee/test copying build/lib/apogee/test/init.py -> build/bdist.macosx-10.10-x86_64/egg/apogee/test copying build/lib/apogee/test/_util.py -> build/bdist.macosx-10.10-x86_64/egg/apogee/test copying build/lib/apogee/test/test_allStar.py -> build/bdist.macosx-10.10-x86_64/egg/apogee/test copying build/lib/apogee/test/test_rcCat.py -> build/bdist.macosx-10.10-x86_64/egg/apogee/test creating build/bdist.macosx-10.10-x86_64/egg/apogee/tools copying build/lib/apogee/tools/init.py -> build/bdist.macosx-10.10-x86_64/egg/apogee/tools copying build/lib/apogee/tools/bitmask.py -> build/bdist.macosx-10.10-x86_64/egg/apogee/tools copying build/lib/apogee/tools/download.py -> build/bdist.macosx-10.10-x86_64/egg/apogee/tools copying build/lib/apogee/tools/path.py -> build/bdist.macosx-10.10-x86_64/egg/apogee/tools copying build/lib/apogee/tools/read.py -> build/bdist.macosx-10.10-x86_64/egg/apogee/tools creating build/bdist.macosx-10.10-x86_64/egg/apogee/util copying build/lib/apogee/util/init.py -> build/bdist.macosx-10.10-x86_64/egg/apogee/util copying build/lib/apogee/util/dens_kde.py -> build/bdist.macosx-10.10-x86_64/egg/apogee/util copying build/lib/apogee/util/solarabundances.py -> build/bdist.macosx-10.10-x86_64/egg/apogee/util byte-compiling build/bdist.macosx-10.10-x86_64/egg/apogee/init.py to init.pyc byte-compiling build/bdist.macosx-10.10-x86_64/egg/apogee/samples/init.py to init.pyc byte-compiling build/bdist.macosx-10.10-x86_64/egg/apogee/samples/isomodel.py to isomodel.pyc byte-compiling build/bdist.macosx-10.10-x86_64/egg/apogee/samples/make_rcsample.py to make_rcsample.pyc byte-compiling build/bdist.macosx-10.10-x86_64/egg/apogee/samples/rc.py to rc.pyc byte-compiling build/bdist.macosx-10.10-x86_64/egg/apogee/select/init.py to init.pyc byte-compiling build/bdist.macosx-10.10-x86_64/egg/apogee/select/apogeeSelect.py to apogeeSelect.pyc byte-compiling build/bdist.macosx-10.10-x86_64/egg/apogee/select/volumeSelect.py to volumeSelect.pyc byte-compiling build/bdist.macosx-10.10-x86_64/egg/apogee/test/init.py to init.pyc byte-compiling build/bdist.macosx-10.10-x86_64/egg/apogee/test/_util.py to _util.pyc byte-compiling build/bdist.macosx-10.10-x86_64/egg/apogee/test/test_allStar.py to test_allStar.pyc byte-compiling build/bdist.macosx-10.10-x86_64/egg/apogee/test/test_rcCat.py to test_rcCat.pyc byte-compiling build/bdist.macosx-10.10-x86_64/egg/apogee/tools/init.py to init.pyc byte-compiling build/bdist.macosx-10.10-x86_64/egg/apogee/tools/bitmask.py to bitmask.pyc byte-compiling build/bdist.macosx-10.10-x86_64/egg/apogee/tools/download.py to download.pyc byte-compiling build/bdist.macosx-10.10-x86_64/egg/apogee/tools/path.py to path.pyc byte-compiling build/bdist.macosx-10.10-x86_64/egg/apogee/tools/read.py to read.pyc byte-compiling build/bdist.macosx-10.10-x86_64/egg/apogee/util/init.py to init.pyc byte-compiling build/bdist.macosx-10.10-x86_64/egg/apogee/util/dens_kde.py to dens_kde.pyc byte-compiling build/bdist.macosx-10.10-x86_64/egg/apogee/util/solarabundances.py to solarabundances.pyc creating build/bdist.macosx-10.10-x86_64/egg/EGG-INFO copying apogee.egg-info/PKG-INFO -> build/bdist.macosx-10.10-x86_64/egg/EGG-INFO copying apogee.egg-info/SOURCES.txt -> build/bdist.macosx-10.10-x86_64/egg/EGG-INFO copying apogee.egg-info/dependency_links.txt -> build/bdist.macosx-10.10-x86_64/egg/EGG-INFO copying apogee.egg-info/requires.txt -> build/bdist.macosx-10.10-x86_64/egg/EGG-INFO copying apogee.egg-info/top_level.txt -> build/bdist.macosx-10.10-x86_64/egg/EGG-INFO zip_safe flag not set; analyzing archive contents... apogee.samples.rc: module references file creating 'dist/apogee-1.-py2.7.egg' and adding 'build/bdist.macosx-10.10-x86_64/egg' to it removing 'build/bdist.macosx-10.10-x86_64/egg' (and everything under it) Processing apogee-1.-py2.7.egg removing '/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/apogee-1.-py2.7.egg' (and everything under it) creating /opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/apogee-1.-py2.7.egg Extracting apogee-1.-py2.7.egg to /opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages apogee 1. is already the active version in easy-install.pth

Installed /opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/apogee-1.-py2.7.egg Processing dependencies for apogee===1. Searching for galpy Best match: galpy [unknown version] Downloading https://github.com/jobovy/galpy/tarball/master#egg=galpy Processing master Writing /tmp/easy_install-7T_ZDH/jobovy-galpy-8fa2154/setup.cfg Running jobovy-galpy-8fa2154/setup.py -q bdist_egg --dist-dir /tmp/easy_install-7T_ZDH/jobovy-galpy-8fa2154/egg-dist-tmp-15qvWB In file included from galpy/util/bovy_symplecticode.c:35: In file included from galpy/util/bovy_symplecticode.h:34: In file included from galpy/potential_src/potential_c_ext/galpy_potentials.h:7: galpy/util/interp_2d/interp_2d.h:8:10: fatal error: 'gsl/gsl_spline.h' file not found

include <gsl/gsl_spline.h>

     ^

1 error generated. error: Setup script exited with error: command '/usr/bin/clang' failed with exit status 1

jobovy commented 9 years ago

Yes, I understand that you haven't tried to install galpy separately, but the apogee package attempts to install galpy, so the real problem is that you cannot install galpy. Anyway, it doesn't matter.

I think the issue here is that you do have the GSL installed (so gsl-config --version probably works for you), but that the compiler cannot find the GSL header files and the GSL library. You can tell the installation about where you've installed the GSL library by defining

export CFLAGS=-I/usr/include
export LDFLAGS=-L/usr/lib

or

setenv CFLAGS -I/usr/include
setenv LDFLAGS -L/usr/lib

depending on your shell type (change the actual path to the include and lib directories that have the gsl directory). If you already have CFLAGS and LDFLAGS defined you just have to add the '-I/usr/include' and '-L/usr/lib' to them.

Please close the issue or let me know if this works.

chukus commented 9 years ago

Thank you!!. Adding the macports paths to gsl to CFLAGS and LDFLAGS did not work. I ended up copying the gsl library to /usr/include and all the libgsl. to /usr/lib. Then it ran all the way to the end . (with a few warnings along the way)

jobovy commented 9 years ago

Okay, I'm glad this seems to have done it. The apogee package doesn't use much galpy functionality, so even if not everything got compiled, that's fine for this package. But let me know if you think we warnings are something to worry about.