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

Affine Gap fails to compile in OSX Mountain Lion #46

Closed
derekeder opened this issue Sep 10, 2012 · 2 comments
Closed

Affine Gap fails to compile in OSX Mountain Lion #46

derekeder opened this issue Sep 10, 2012 · 2 comments
Labels

Comments

@derekeder
Copy link
Contributor

When running on Mountain Lion

python setup.py install

executes successfully, but when the dedupe library is called, the following error occurs:

Traceback (most recent call last):
File "examples/canonical_example.py", line 3, in
import exampleIO
File "/Users/derekeder/projects/open-city/deduplication/dedupe/examples/exampleIO.py", line 3, in
import dedupe.core
File "/Users/derekeder/projects/open-city/deduplication/dedupe/dedupe/init.py", line 14, in
import affinegap
ImportError: dlopen(/Users/derekeder/projects/open-city/deduplication/dedupe/dedupe/affinegap.so, 2): Symbol not found: _newarrayobject
Referenced from: /Users/derekeder/projects/open-city/deduplication/dedupe/dedupe/affinegap.so
Expected in: flat namespace
in /Users/derekeder/projects/open-city/deduplication/dedupe/dedupe/affinegap.so

@derekeder
Copy link
Contributor Author

This appears to be an issue with clang, the default compiler for OSX from Lion (10.7) and on.

This can be solved in two ways:

  • change the default compiler set in xCode by adding the following lines your .bash_profile

#Set LLVM GCC as the default compiler for the system
export CPP='llvm-gcc-4.2'
export CC='llvm-gcc-4.2'
export CXX='llvm-g++'

For more, see http://stackoverflow.com/questions/6796982/clang-and-the-default-compiler-in-os-x-lion

  • Run setup.py by specifying the compiler in the command line

LDSHARED="gcc-4.2 -Wl,-F. -bundle -undefined dynamic_lookup" CC=gcc-4.2 python setup.py install

for more info, see http://stackoverflow.com/questions/5967065/python-distutils-not-using-correct-version-of-gcc

@derekeder
Copy link
Contributor Author

Update: we updated cython and rebuilt the affinegap.so and it now compiles using clang

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Feb 8, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

1 participant