PolyChord / PolyChordLite

Public version of PolyChord: See polychord.co.uk for PolyChordPro
https://polychord.io/
Other
84 stars 26 forks source link

error installing pypolychord #13

Open timothydmorton opened 5 years ago

timothydmorton commented 5 years ago

Hi-- After pip installing failed for me (#11), I tried to python setup.py install and get the following:

22:47 $ python setup.py install
running install
running bdist_egg
running egg_info
writing pypolychord.egg-info/PKG-INFO
writing dependency_links to pypolychord.egg-info/dependency_links.txt
writing requirements to pypolychord.egg-info/requires.txt
writing top-level names to pypolychord.egg-info/top_level.txt
reading manifest file 'pypolychord.egg-info/SOURCES.txt'
writing manifest file 'pypolychord.egg-info/SOURCES.txt'
installing library code to build/bdist.macosx-10.7-x86_64/egg
running install_lib
running build_py
running build_ext
building '_pypolychord' extension
clang -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -mmacosx-version-min=10.9 -fPIC -I/include -I/include -I/Users/tdm/repositories/PolyChordLite/src/polychord/ -I/Users/tdm/miniconda3/envs/isochrones/lib/python3.6/site-packages/numpy/core/include -I/Users/tdm/miniconda3/envs/isochrones/include/python3.6m -c /Users/tdm/repositories/PolyChordLite/pypolychord/_pypolychord.cpp -o build/temp.macosx-10.7-x86_64-3.6/Users/tdm/repositories/PolyChordLite/pypolychord/_pypolychord.o
In file included from /Users/tdm/repositories/PolyChordLite/pypolychord/_pypolychord.cpp:3:
/Users/tdm/repositories/PolyChordLite/pypolychord/_array.hpp:41:14: error: expected expression
    nlives = {};
             ^
/Users/tdm/repositories/PolyChordLite/pypolychord/_array.hpp:42:16: error: expected expression
    loglikes = {};
               ^
2 errors generated.
error: command 'clang' failed with exit status 1

Running this on MacOS 10.11.6

timothydmorton commented 5 years ago

(btw, CC=gcc python setup.py install does work)

williamjameshandley commented 5 years ago

I've never managed to get this working on clang (feel free to submit a PR if you do).

It should work with gcc, but you need to pass a more specific reference to both CXX and CC gcc compilers (as for some bizarre reason in OSX gcc and gxx alias to clang).

If you run make pypolychord, it should give you the requisite compilation line, but it should be something like:

CC=gcc-8 CXX=g++-8 python setup.py install --user

Let me know if that worked.

timothydmorton commented 5 years ago

I don't have gcc-8 on my system but it proceeded with gcc-6 without issue. However, when I try to build the libraries with gcc-6, I get

/Library/Developer/CommandLineTools/usr/bin/make -C /Users/tdm/repositories/PolyChordLite/src/polychord /Users/tdm/repositories/PolyChordLite/lib/libchord.a
gfortran-6 -ffree-line-length-none -cpp -fPIC -fno-stack-arrays -Ofast -c utils.F90
gfortran-6 -ffree-line-length-none -cpp -fPIC -fno-stack-arrays -Ofast -c abort.F90
gfortran-6 -ffree-line-length-none -cpp -fPIC -fno-stack-arrays -Ofast -c array_utils.f90
gfortran-6 -ffree-line-length-none -cpp -fPIC -fno-stack-arrays -Ofast -c settings.f90
gfortran-6 -ffree-line-length-none -cpp -fPIC -fno-stack-arrays -Ofast -c calculate.f90
gfortran-6 -ffree-line-length-none -cpp -fPIC -fno-stack-arrays -Ofast -c mpi_utils.F90
gfortran-6 -ffree-line-length-none -cpp -fPIC -fno-stack-arrays -Ofast -c random_utils.F90
gfortran-6 -ffree-line-length-none -cpp -fPIC -fno-stack-arrays -Ofast -c chordal_sampling.f90
gfortran-6 -ffree-line-length-none -cpp -fPIC -fno-stack-arrays -Ofast -c run_time_info.f90
gfortran-6 -ffree-line-length-none -cpp -fPIC -fno-stack-arrays -Ofast -c clustering.f90
gfortran-6 -ffree-line-length-none -cpp -fPIC -fno-stack-arrays -Ofast -c params.f90
gfortran-6 -ffree-line-length-none -cpp -fPIC -fno-stack-arrays -Ofast -c priors.f90
gfortran-6 -ffree-line-length-none -cpp -fPIC -fno-stack-arrays -Ofast -c read_write.F90
gfortran-6 -ffree-line-length-none -cpp -fPIC -fno-stack-arrays -Ofast -c feedback.f90
gfortran-6 -ffree-line-length-none -cpp -fPIC -fno-stack-arrays -Ofast -c generate.F90
gfortran-6 -ffree-line-length-none -cpp -fPIC -fno-stack-arrays -Ofast -c ini.f90
gfortran-6 -ffree-line-length-none -cpp -fPIC -fno-stack-arrays -Ofast -c nested_sampling.F90
gfortran-6 -ffree-line-length-none -cpp -fPIC -fno-stack-arrays -Ofast -c interfaces.F90
g++-6  -mmacosx-version-min=10.9 -stdlib=libc++ -fPIC -std=c++11 -fPIC -Ofast -c c_interface.cpp
g++-6: error: unrecognized command line option '-stdlib=libc++'
make[1]: *** [c_interface.o] Error 1
make: *** [/Users/tdm/repositories/PolyChordLite/lib/libchord.a] Error 2

Does this require gcc-8?

williamjameshandley commented 5 years ago

Does this require gcc-8?

Possibly - although this looks like a mac specific issue (the compiler flag -stdlib=libc++ isn't present in any of the PolyChord Makefiles, so it's something that OSX has imposed. Can you brew install gcc-8?