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

OSX makefile fix and install instructions #149

Closed
wants to merge 2 commits into from

Conversation

bjarthur
Copy link

addresses #138

and adds more detail to README

@ihnorton
Copy link
Collaborator

Thanks, just so I understand: is the stdlib change necessary because Homebrew Julia and llvm are built with gcc? (I don't have a mac to check this myself at the moment)

@@ -42,6 +42,7 @@ ifeq ($(OS), WINNT)
SHLIB_EXT = dll
else ifeq ($(OS), Darwin)
SHLIB_EXT = dylib
LIBS += -stdlib=libstdc++ -lc++
Copy link
Collaborator

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++?

Copy link
Author

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> 

@btello
Copy link

btello commented Nov 12, 2015

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.

@yuyichao
Copy link
Collaborator

Does something like -stdlib=libc++ -lc++abi works? (or a combination of these... ;-p)

@bjarthur
Copy link
Author

yes, -stdlib=libc++ -lc++abi works too. is that preferable?

@bjarthur
Copy link
Author

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.

@ihnorton
Copy link
Collaborator

Linking against both C++ standard libraries is not advised. Please try 04aad3a.

@bjarthur
Copy link
Author

8fa3cb8 fixes this.

@bjarthur bjarthur closed this Oct 14, 2016
@bjarthur bjarthur deleted the osxhomebrew branch July 27, 2017 10:47
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.

4 participants