Skip to content

Compilation issue with MacOSX Mojave #71

Closed

Description

@ncourty

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.

Activity

  1. rflamary commented on Oct 19, 2018

    @rflamary
    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.

  2. ncourty commented on Oct 19, 2018

    @ncourty
    CollaboratorAuthor

    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.

  3. rishab-sharma commented on Jul 7, 2019

    @rishab-sharma

    I still seem to have this issue on Mojave python 3.6

  4. rflamary commented on Jul 8, 2019

    @rflamary
    Collaborator

    Hello @rishab-sharma

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

  5. joshua-gould commented on Jul 9, 2019

    @joshua-gould

    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]

  6. ncourty commented on Jul 9, 2019

    @ncourty
    CollaboratorAuthor

    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

  7. joshua-gould commented on Jul 10, 2019

    @joshua-gould

    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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions