Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Compilation issue with MacOSX Mojave #71

Closed
ncourty opened this issue Oct 19, 2018 · 7 comments
Closed

Compilation issue with MacOSX Mojave #71

ncourty opened this issue Oct 19, 2018 · 7 comments
Labels

Comments

@ncourty
Copy link
Collaborator

ncourty commented Oct 19, 2018

I encountered the following issue while installing POT on MacOSX Mojave, with
python 3.6

python setup.py build running build running build_py running build_ext building 'ot.lp.emd_wrap' extension /usr/bin/gcc -Wno-unused-result -Wsign-compare -Wunreachable-code -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -I/anaconda3/include -arch x86_64 -I/anaconda3/include -arch x86_64 -Iot/lp -I/anaconda3/lib/python3.6/site-packages/numpy/core/include -I/Users/nico/code/POT/ot/lp -I/anaconda3/include/python3.6m -c ot/lp/emd_wrap.cpp -o build/temp.macosx-10.7-x86_64-3.6/ot/lp/emd_wrap.o warning: include path for stdlibc++ headers not found; pass '-std=libc++' on the command line to use the libc++ standard library instead [-Wstdlibcxx-not-found] In file included from ot/lp/emd_wrap.cpp:648: In file included from /anaconda3/lib/python3.6/site-packages/numpy/core/include/numpy/arrayobject.h:4: In file included from /anaconda3/lib/python3.6/site-packages/numpy/core/include/numpy/ndarrayobject.h:18: In file included from /anaconda3/lib/python3.6/site-packages/numpy/core/include/numpy/ndarraytypes.h:1823: /anaconda3/lib/python3.6/site-packages/numpy/core/include/numpy/npy_1_7_deprecated_api.h:15:2: warning: "Using deprecated NumPy API, disable it by " "#defining NPY_NO_DEPRECATED_API NPY_1_7_API_VERSION" [-W#warnings] #warning "Using deprecated NumPy API, disable it by " \ ^ In file included from ot/lp/emd_wrap.cpp:650: ot/lp/EMD.h:19:10: fatal error: 'iostream' file not found #include <iostream> ^~~~~~~~~~ 2 warnings and 1 error generated. error: command '/usr/bin/gcc' failed with exit status 1

I finally solved it by adding in setup.py the following extra argument for the compiler
extra_compile_args=["-stdlib=libc++"]

However before pushing a PR, it is not clear to me if adding this option will break compatibility with other OS. Meanwhile, it is a simple workaround for this problem.

@rflamary
Copy link
Collaborator

Hello @ncourty

You should definitely do a PR with the change. The tests on travis will tell us if it breaks anything.

If it does we can maybe test the MacosX version in setup.py and handle the parameter automatically.

@ncourty
Copy link
Collaborator Author

ncourty commented Oct 19, 2018

Travis test is failing on the branch. It seems it is really an OSX Mojave dependant argument, linked to the clang compiler that ships with XCode 10.

@rishab-sharma
Copy link

I still seem to have this issue on Mojave python 3.6

@rflamary
Copy link
Collaborator

rflamary commented Jul 8, 2019

Hello @rishab-sharma

Could you try with the master in the git? We still did not make a proper release since the PR.

@joshua-gould
Copy link

Still fails for me when installing from master branch.

warning: include path for stdlibc++ headers not found; pass '-stdlib=libc++' on the command line to use the libc++ standard library instead [-Wstdlibcxx-not-found]

@ncourty
Copy link
Collaborator Author

ncourty commented Jul 9, 2019

hi @rishab-sharma and @joshua-gould , could you please tell which version of OSX Mojave you are running ? Also, is command line tools properly installed from Xcode ? If so, what version of gcc do you have on your computer ? Thx

@joshua-gould
Copy link

Apple LLVM version 10.0.1 (clang-1001.0.46.4)
Mojave 10.14.5
XCode Version 10.2.1 (10E1001)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants