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

Build error on OS X (unrecognized command line option '-rdynamic') #145

Closed
eschnett opened this issue Nov 4, 2015 · 2 comments
Closed

Comments

@eschnett
Copy link

eschnett commented Nov 4, 2015

I cannot build Clang on OS X El Capitan. I installed g++ via Macports; this is gcc 5.2.

julia> Pkg.build("Clang")
INFO: Building Clang
g++ wrapclang.cpp.o -rdynamic -shared -o libwrapclang.dylib -L/opt/local/libexec/llvm-3.7/lib  -L/opt/local/libexec/llvm-3.7/lib -lclang
g++: error: unrecognized command line option '-rdynamic'
make: *** [libwrapclang.dylib] Error 1
================================[ ERROR: Clang ]================================

LoadError: failed process: Process(`make`, ProcessExited(2)) [2]
while loading /Users/eschnett/.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/eschnett/.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

================================================================================
@Petr-Hlavenka
Copy link

Repost from Julia-users:

I've the same problem on Windows 7, julia 0.4.1 build from source on msys2, all build environment from julia

julia> Pkg.build("Clang")
INFO: Building Clang
g++ wrapclang.cpp.o -rdynamic -shared -o libwrapclang.so -L/home/phlavenk/julia/deps/llvm-3.3/build_Release/Release/lib  -L/home/phlavenk/julia/deps/llvm-3.3/build_Release/Release/lib -lclang
g++.exe: error: unrecognized command line option '-rdynamic'
Makefile:58: recipe for target 'libwrapclang.so' failed
make: *** [libwrapclang.so] Error 1
================================[ ERROR: Clang ]================================
...

If I run the compile step by myself without -rdynamic, i get following error

shell> g++ wrapclang.cpp.o -shared -o libwrapclang.so -L/home/phlavenk/julia/deps/llvm-3.3/build_Release/Release/lib  -L/home/phlavenk/julia/deps/llvm-3.3/build_Release/Release/lib -lclang
d:/msys64/home/phlavenk/julia/usr/x86_64-w64-mingw32/sys-root/mingw/bin/../lib/gcc/x86_64-w64-mingw32/5.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: cannot find -lclang
collect2.exe: error: ld returned 1 exit status

Only libclang.a is present in D:\msys64\home\phlavenk\julia\usr\lib, no libclang.so, lib or dll files are present.

Please could someone familiar with the unix build system track down why the build process is failing?
Cheers,
Petr

@bjarthur
Copy link

try using Homebrew and Xcode instead as described here: #149

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 a pull request may close this issue.

4 participants