eggplantbren / DNest4

Diffusive Nested Sampling
MIT License
60 stars 21 forks source link

Trouble with python install on Mac #14

Closed omaclaren closed 8 years ago

omaclaren commented 8 years ago

Hi, Thanks for the great work on this.

Unfortunately, I've been having trouble getting the python install to work. I'm on a Mac running El Capitan (10.11.5). I'm using Anaconda Python, I think my default setup is Python 2.7.11, Anaconda 1.9.2 (x86_64).

I think it has something to do with how the c++ libraries work on recent Macs, as discussed e.g. here: http://stackoverflow.com/questions/14228856/how-to-compile-c-with-c11-support-in-mac-terminal

Note by default that Mac these days seems to use clang/clang++ instead of gcc/g++ and aliases the latter to the former.

Specifically, running python setup.py install gives

In file included from dnest4/_dnest4.cpp:289: In file included from /Users/user/Git-Working/DNest4/code/DNest4.h:9: /Users/user/Git-Working/DNest4/code/Barrier.h:4:10: fatal error: 'mutex' file not found

include

If I try adding "-stdlib=libc++" to the extra_compile_args in the setup.py I get

gcc -fno-strict-aliasing -I/Users/user/anaconda/include -arch x86_64 -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -Idnest4 -I/Users/user/Git-Working/DNest4/code -I/Users/user/anaconda/lib/python2.7/site-packages/numpy/core/include -I/Users/user/anaconda/include/python2.7 -c dnest4/_dnest4.cpp -o build/temp.macosx-10.5-x86_64-2.7/dnest4/_dnest4.o -std=c++11 -stdlib=libc++ -Wno-unused-function -Wno-uninitialized -DNO_THREADS clang: error: invalid deployment target for -stdlib=libc++ (requires OS X 10.7 or later)

(I also tried adding -stdlib=libc++ to the c++ makefile but that didn't help anything).

Let me know if there is anything else you need to know. Cheers! Oliver

dfm commented 8 years ago

Did you try: MACOSX_DEPLOYMENT_TARGET=10.9 python setup.py install as suggested in the README?

omaclaren commented 8 years ago

Ah I missed that sorry! This worked thanks!

dfm commented 8 years ago

👍