numba / llvmlite

A lightweight LLVM python binding for writing JIT compilers
https://llvmlite.pydata.org/
BSD 2-Clause "Simplified" License
1.92k stars 316 forks source link

"invalid deployment target for -stdlib=libc++" #305

Open trbabb opened 7 years ago

trbabb commented 7 years ago

I'm trying to build llvmlite from source on OSX 10.12.6. When I run python3 setup.py build, I get:

/Users/xxxxx/code/llvmlite/venv/bin/python /Users/xxxx/code/llvmlite/ffi/build.py
LLVM version... 4.0.0

MACOSX_DEPLOYMENT_TARGET=10.6 clang++ -std=c++11 -stdlib=libc++ -dynamiclib -I/opt/local/libexec/llvm-4.0/include -pipe -Os -std=c++11 -stdlib=libc++ [snip ...]
clang: error: invalid deployment target for -stdlib=libc++ (requires OS X 10.7 or later)

My shell does not have $MACOSX_DEPLOYMENT_TARGET set, and a grep doesn't offer any clues on why that's being set to a lower version. Any ideas about what I should check?

Thanks!

seibert commented 7 years ago

If you set MACOSX_DEPLOYMENT_TARGET=10.9 in your environment, the build should pick it up (that's what our conda recipes do). I'm curious why it is defaulting to 10.6, since the CMake file should set it to 10.9 by default?

trbabb commented 7 years ago

Yep, if I manually set that variable in my shell and build, looks like it compiles.

But that is my question too: Why doesn't it work out of the box? I can't tell where the build defaults I found by grepping (all >= 10.7, apparently) are getting overridden.

seibert commented 7 years ago

@sklam: Any ideas how MACOSX_DEPLOYMENT_TARGET could be set before cmake is called by setup.py?

jakirkham commented 6 years ago

There's also a CMAKE_OSX_DEPLOYMENT_TARGET that could be set. That might help. Syntax is the same as MACOSX_DEPLOYMENT_TARGET.