astropy / halotools

Python package for studying large scale structure, cosmology, and galaxy evolution using N-body simulations and halo models
http://halotools.rtfd.org
100 stars 63 forks source link

pip install failure on MacOS High Sierra 10.13 #813

Open duncandc opened 7 years ago

duncandc commented 7 years ago

I tried to install Halotools with pip install halotools and the install fails with the following error:

Command "python setup.py egg_info" failed with error code 1 in /private/var/folders/02/_3trvknx2199yf629jn2hm3r0000gn/T/pip-build-syx0iqkf/halotools/

duncandc commented 7 years ago

After trying to install this using setup.py, I get the following error:

unable to execute 'x86_64-apple-darwin13.4.0-clang++': No such file or directory error: command 'x86_64-apple-darwin13.4.0-clang++' failed with exit status 1

There is some issue with clang on OS 10.13 that I cannot figure out. Setting CC=clang or gcc does not solve the problem for me.

This seems to be similar to issue #447 that @manodeep was having last year.

aphearin commented 7 years ago

I've never encountered that before, Duncan. Tagging @eteq and @bsipocz in case they've seen this issue come up before in other affiliated packages that use cython.

bsipocz commented 7 years ago

@aphearin - Sorry, I haven't seen this before as I don't have any c++ dependencies for my projects. Hopefully @eteq or stackoverflow will know a solution.

duncandc commented 7 years ago

ok, one more thing that is interesting. For some reason, the setup script is looking for a much older version of the compiler. Here is the version of clang I have. (gcc and g++ all link to the same thing)

clang --version
Apple LLVM version 9.0.0 (clang-900.0.37)
Target: x86_64-apple-darwin17.0.0
Thread model: posix
InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin

This is different than x86_64-apple-darwin13.4.0-clang++ that comes up in the error.

duncandc commented 7 years ago

Okay, there is a VERY simple solution. Setting the CXX variable is key. export CXX=clang solves the problem. I think the astropy setup utils could be slightly more informative when the c++ or the c compilers are not set.

manodeep commented 7 years ago

The default compiler is the compiler that was originally used to compile python. Which tends to be fairly old. @duncandc glad you got the compilation sorted.

duncandc commented 7 years ago

ok, all is good. I think we should consider adding a note about setting CXX=clang to the installation troubleshooting page. @aphearin thoughts? https://halotools.readthedocs.io/en/latest/installation_troubleshooting.html#installation-troubleshooting

aphearin commented 7 years ago

Sounds good, Duncan. Since you encountered the issue then you're probably the best person to write the docs modification in a way that will be clearest to other people who encounter it.

Zellar209 commented 5 years ago

I encountered the same problem, but after the "export CXX=clang", the error still exits.

aphearin commented 5 years ago

@Zellar209 - can you give some more details of your system information? For example, I am able to reproduce a cython build problem in python 3.6, but not in 2.7.

youmin817 commented 5 years ago

"export CXX=clang" is not working for me..

aphearin commented 5 years ago

@youmin817 - what version of python? Can you give some system information?

youmin817 commented 5 years ago

@youmin817 - what version of python? Can you give some system information?

I have python3.7

JiaminShi commented 4 years ago

@youmin817 I have the similar issue and I fixed it by running export CC=/usr/bin/clang export CXX=/usr/bin/clang++

manodeep commented 4 years ago

@JamieShi Do you get the performance boost with threads when using /usr/bin/clang to compile?

vishalbarad commented 3 years ago

@JiaminShi Thank you. I had similar problem. I used export CC=/usr/bin/clang export CXX=/usr/bin/clang++ and my problem solved.