Skip to content

Fix compile on Mac OS 10.14 with Python 3.6. See https://github.com/… #546

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

Merged
merged 1 commit into from
May 29, 2019

Conversation

histed
Copy link
Contributor

@histed histed commented May 28, 2019

pandas-dev/pandas/issues/23424

Caiman master doesn't compile with a fresh Anaconda Python 3.6 install, throwing this error at the link step.

g++ -bundle -undefined dynamic_lookup -L/Users/histed/anaconda3/envs/caiman36/lib -arch x86_64 -L/Users/histed/anaconda3/envs/caiman36/lib -arch x86_64 -arch x86_64 build/temp.macosx-10.7-x86_64-3.6/caiman/source_extraction/cnmf/oasis.o -o build/lib.macosx-10.7-x86_64-3.6/caiman/source_extraction/cnmf/oasis.cpython-36m-darwin.so
clang: warning: libstdc++ is deprecated; move to libc++ with a minimum deployment target of OS X 10.9 [-Wdeprecated]
ld: library not found for -lstdc++
clang: error: linker command failed with exit code 1 (use -v to see invocation)
error: command 'g++' failed with exit status 1

The fix is to pass the -stdlib=libc++ to the linker as in attached pull req.

Pandas bug here: pandas-dev/pandas#23424 suggests that -mmacosx-version-min=10.9 is also required, but it didn't seem to be needed for me. On the other hand it doesn't seem to cause problems.

@histed
Copy link
Contributor Author

histed commented May 28, 2019

also: the compile works even without this patch with Anaconda 3.7 install.
Thanks! Mark

@epnev epnev requested a review from pgunn May 28, 2019 23:51
@epnev
Copy link
Contributor

epnev commented May 29, 2019

@histed Thanks for this. Can you remove the oasis.cpp file from your PR (or re-submit a new one without it)? As far as I understand this file is being generated during compiling. Or is there a reason you included it?

@pgunn
Copy link
Member

pgunn commented May 29, 2019

@histed I believe (not 100% sure) that the issue you saw is mentioned in the readme under known issues. Could you give the solution in there a go (if you have not done so yet)?

@histed histed force-pushed the histed/1905-py36macbuild branch from 89605fa to 52ca956 Compare May 29, 2019 14:40
@histed
Copy link
Contributor Author

histed commented May 29, 2019

@pgunn:

  • removed auto-gen Cython file
  • If you mean the 'xcode-select' steps in the README.md, these don't solve it. Those two lines are required, but they install clang/g++ from Xcode, and make sure the development headers are installed. I believe the present issue is due to linking with libstdc++.

@@ -46,15 +46,18 @@
# compile with: python setup.py build_ext -i
# clean up with: python setup.py clean --all
if sys.platform == 'darwin':
extra_compiler_args = ['-stdlib=libc++']
# see https://github.com/pandas-dev/pandas/issues/23424
extra_compiler_args = ['-stdlib=libc++'] # not needed #, '-mmacosx-version-min=10.9']
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What's this # not needed part? Seems superfluous to our needs?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

per the pandas/numpy issue it should be needed, but appears not to be in my testing.

@pgunn
Copy link
Member

pgunn commented May 29, 2019

@pgunn:

  • removed auto-gen Cython file
  • If you mean the 'xcode-select' steps in the README.md, these don't solve it. Those two lines are required, but they install clang/g++ from Xcode, and make sure the development headers are installed. I believe the present issue is due to linking with libstdc++.

Interesting - we had this tested, but maybe something changed again in upstream packages.

@epnev epnev merged commit 7d2bc28 into flatironinstitute:master May 29, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants