-
Notifications
You must be signed in to change notification settings - Fork 68
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
OSX makefile fix and install instructions #149
Conversation
Thanks, just so I understand: is the |
@@ -42,6 +42,7 @@ ifeq ($(OS), WINNT) | |||
SHLIB_EXT = dll | |||
else ifeq ($(OS), Darwin) | |||
SHLIB_EXT = dylib | |||
LIBS += -stdlib=libstdc++ -lc++ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this linking against both libc++
and libstdc++
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i don't know whether this change is needed b/c of gcc or not. just know that it works. perhaps @btello can say.
moreover both -libstdc++ and lc++ are needed. removing either one causes the build to fail for different reasons. transcripts follow.
julia> Pkg.build("Clang")
INFO: Building Clang
g++ wrapclang.cpp.o -rdynamic -shared -o libwrapclang.dylib -L/usr/local/Cellar/llvm/3.6.2/lib -L/usr/local/Cellar/llvm/3.6.2/lib -lclang -stdlib=libstdc++
Undefined symbols for architecture x86_64:
"std::__1::__vector_base_common<true>::__throw_length_error() const", referenced from:
void std::__1::vector<CXCursor, std::__1::allocator<CXCursor> >::__push_back_slow_path<CXCursor const>(CXCursor const&) in wrapclang.cpp.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make: *** [libwrapclang.dylib] Error 1
================================[ ERROR: Clang ]================================
LoadError: failed process: Process(`make`, ProcessExited(2)) [2]
while loading /Users/arthurb/.julia/v0.4/Clang/deps/build.jl, in expression starting on line 19
================================================================================
================================[ BUILD ERRORS ]================================
WARNING: Clang had build errors.
- packages with build errors remain installed in /Users/arthurb/.julia/v0.4
- build the package(s) and all dependencies with `Pkg.build("Clang")`
- build a single package by running its `deps/build.jl` script
================================================================================
julia> Pkg.build("Clang")
INFO: Building Clang
g++ wrapclang.cpp.o -rdynamic -shared -o libwrapclang.dylib -L/usr/local/Cellar/llvm/3.6.2/lib -L/usr/local/Cellar/llvm/3.6.2/lib -lclang -lc++
Undefined symbols for architecture x86_64:
"std::terminate()", referenced from:
___clang_call_terminate in wrapclang.cpp.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make: *** [libwrapclang.dylib] Error 1
================================[ ERROR: Clang ]================================
LoadError: failed process: Process(`make`, ProcessExited(2)) [2]
while loading /Users/arthurb/.julia/v0.4/Clang/deps/build.jl, in expression starting on line 19
================================================================================
================================[ BUILD ERRORS ]================================
WARNING: Clang had build errors.
- packages with build errors remain installed in /Users/arthurb/.julia/v0.4
- build the package(s) and all dependencies with `Pkg.build("Clang")`
- build a single package by running its `deps/build.jl` script
================================================================================
julia> Pkg.build("Clang")
INFO: Building Clang
g++ wrapclang.cpp.o -rdynamic -shared -o libwrapclang.dylib -L/usr/local/Cellar/llvm/3.6.2/lib -L/usr/local/Cellar/llvm/3.6.2/lib -lclang -stdlib=libstdc++ -lc++
julia>
Yeah I'm not exactly sure what the reason is that you would need both c++ libraries but this fix appears to do the trick for me as well. |
Does something like |
yes, |
bump. is there a reason not to merge this PR? i'm happy to make the change @yuyichao inquired about but am unsure what the difference is. |
Linking against both C++ standard libraries is not advised. Please try 04aad3a. |
8fa3cb8 fixes this. |
addresses #138
and adds more detail to README