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

Building for Anaconda on OS X requires extra linker flags #52

Open
tibbetts opened this issue Sep 18, 2015 · 5 comments
Open

Building for Anaconda on OS X requires extra linker flags #52

tibbetts opened this issue Sep 18, 2015 · 5 comments

Comments

@tibbetts
Copy link
Contributor

Requires
extra_link_args = ["-stdlib=libstdc++","-mmacosx-version-min=10.6"],

LDFLAGS isn't respected, not sure the right way to detect when this is needed.

@riastradh-probcomp
Copy link
Contributor

What goes wrong if you don't change the stdlib or if you omit the macosx-version-min?

@tibbetts
Copy link
Contributor Author

Build failure:

g++ -bundle -undefined dynamic_lookup -L/Users/tibbetts/anaconda/lib -arch x86_64 -arch x86_64 build/temp.macosx-10.5-x86_64-2.7/crosscat/cython_code/CyclicComponentModel.o build/temp.macosx-10.5-x86_64-2.7/cpp_code/src/utils.o build/temp.macosx-10.5-x86_64-2.7/cpp_code/src/numerics.o build/temp.macosx-10.5-x86_64-2.7/cpp_code/src/RandomNumberGenerator.o build/temp.macosx-10.5-x86_64-2.7/cpp_code/src/ComponentModel.o build/temp.macosx-10.5-x86_64-2.7/cpp_code/src/CyclicComponentModel.o -L/Users/tibbetts/anaconda/lib -o build/lib.macosx-10.5-x86_64-2.7/crosscat/cython_code/CyclicComponentModel.so
ld: library not found for -lgcc_s.10.5
clang: error: linker command failed with exit code 1 (use -v to see invocation)
error: command 'g++' failed with exit status 1

----------------------------------------
Command "/Users/tibbetts/anaconda/bin/python -c "import setuptools, tokenize;__file__='/var/folders/h9/8d2yv2ln0gq74mp5mffdw8qw0000gn/T/pip-6CaCIe-build/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /var/folders/h9/8d2yv2ln0gq74mp5mffdw8qw0000gn/T/pip-pFbKkb-record/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /var/folders/h9/8d2yv2ln0gq74mp5mffdw8qw0000gn/T/pip-6CaCIe-build

@riastradh-probcomp
Copy link
Contributor

Is that without -stdlib=libstdc++, or is that without -mmacosx-version-min=10.6?

@riastradh-probcomp
Copy link
Contributor

I just tried setting LDFLAGS and it took effect:

% LDFLAGS=-wotsit python setup.py build
...
c++ -pthread -shared -Wl,-O1 -Wl,-Bsymbolic-functions -Wl,-Bsymbolic-functions -Wl,-z,relro -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -D_FORTIFY_SOURCE=2 -g -fstack-protector --param=ssp-buffer-size=4 -Wformat -Werror=format-security -wotsit build/temp.linux-x86_64-2.7/crosscat/cython_code/CyclicComponentModel.o build/temp.linux-x86_64-2.7/cpp_code/src/utils.o build/temp.linux-x86_64-2.7/cpp_code/src/numerics.o build/temp.linux-x86_64-2.7/cpp_code/src/RandomNumberGenerator.o build/temp.linux-x86_64-2.7/cpp_code/src/ComponentModel.o build/temp.linux-x86_64-2.7/cpp_code/src/CyclicComponentModel.o -o build/lib.linux-x86_64-2.7/crosscat/cython_code/CyclicComponentModel.so
c++: error: unrecognized command line option ‘-wotsit’
error: command 'c++' failed with exit status 1

@tibbetts
Copy link
Contributor Author

I stand corrected, the following line builds successfully:

LDFLAGS="-stdlib=libstdc++ -mmacosx-version-min=10.6" pip install git+ssh://git@github.com/probcomp/crosscat

@tibbetts tibbetts changed the title Building for Anaconda on OSX requires extra linker flags Building for Anaconda on OS X requires extra linker flags Sep 21, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants