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 on RHEL #16

Closed
mweastwood opened this issue Sep 21, 2014 · 6 comments
Closed

Building on RHEL #16

mweastwood opened this issue Sep 21, 2014 · 6 comments

Comments

@mweastwood
Copy link

I'm submitting this issue to document my experience trying to build Cxx on RHEL 6.5. Hopefully this helps somebody...

First of all, now that JuliaLang/julia#8297 has been merged, kf/staged needs to be rebased.

I used the following Make.user

$ cat Make.user 
LLVM_VER=svn
LLVM_ASSERTIONS=1
#LLVM_DEBUG=1
BUILD_LLVM_CLANG=1
BUILD_LLDB=1
LLDB_VER = master
USE_LLVM_SHLIB=1
LLDB_DISABLE_PYTHON=1

In order to build LLVM-SVN, I needed to upgrade gcc from v4.4 to v4.9 and apply this patch to LLVM.

LLDB wouldn't link without adding LLVM_LDFLAGS += -lpthread to deps/Makefile

After this, Julia builds and I get

julia> Pkg.clone("https://github.com/Keno/Cxx.jl") 
INFO: Cloning Cxx from https://github.com/Keno/Cxx.jl
INFO: Computing changes...

julia> Pkg.build("Cxx")
INFO: Building Cxx
Tuning for julia installation at: /scr2/mweastwood/julia/usr/bin
    CC /home/mweastwood/.julia/Cxx/deps/build/bootstrap.o
    LINK /home/mweastwood/.julia/Cxx/deps/usr/lib/libcxxffi.so
/scr2/mweastwood/julia/usr/bin/../../usr/lib/liblldbExpression.a(ClangExpressionParser.o): In function `lldb_private::ClangExpressionParser::Parse(lldb_private::Stream&)':
ClangExpressionParser.cpp:(.text._ZN12lldb_private21ClangExpressionParser5ParseERNS_6StreamE+0x394): warning: the use of `mktemp' is dangerous, better use `mkstemp'
Not building debug library because corresponding julia DEBUG library does not exist.
To build, simply run the build again once the library at
/scr2/mweastwood/julia/usr/bin/../../usr/lib/libjulia-debug.so
has been built.

julia> using Cxx
ERROR: error compiling init: could not load module libcxxffi: libcxxffi: cannot open shared object file: No such file or directory
 in include at ./boot.jl:246
 in include_from_node1 at ./loading.jl:128
 in reload_path at ./loading.jl:152
 in _require at ./loading.jl:67
 in require at ./loading.jl:52
while loading /home/mweastwood/.julia/Cxx/src/Cxx.jl, in expression starting on line 37

After changing "libcxxffi" to "libcxxffi.so" here I get

julia> using Cxx
Warning: redefining constant libcxxffi
ERROR: error compiling init: could not load module libcxxffi.so: /scr2/mweastwood/julia/usr/bin/../lib/libcxxffi.so: undefined symbol: _ZN12lldb_private15HostThreadPosix4JoinEPPv
 in include at ./boot.jl:246
 in include_from_node1 at ./loading.jl:128
 in reload_path at ./loading.jl:152
 in _require at ./loading.jl:67
 in require at ./loading.jl:52
while loading /home/mweastwood/.julia/Cxx/src/Cxx.jl, in expression starting on line 37

And now I'm stuck. :(

julia> versioninfo()
Julia Version 0.4.0-dev+715
Commit ea49d91* (2014-09-21 05:48 UTC)
Platform Info:
  System: Linux (x86_64-unknown-linux-gnu)
  CPU: Intel(R) Xeon(R) CPU E5-1620 v2 @ 3.70GHz
  WORD_SIZE: 64
  BLAS: libopenblas (USE64BITINT DYNAMIC_ARCH NO_AFFINITY Sandybridge)
  LAPACK: libopenblas
  LIBM: libopenlibm
  LLVM: libLLVM-svn
@jakebolewski
Copy link
Contributor

@mweastwood
Copy link
Author

That seems to work.

julia> using Cxx
WARNING: Could not add directory/usr/include/c++/4.8to clang search path!
WARNING: Could not add directory/usr/include/x86_64-linux-gnu/c++/4.8/to clang search path!
WARNING: Could not add directory/usr/include/x86_64-linux-gnuto clang search path!
Warning: requiring "Cxx" did not define a corresponding module.

julia> cxx"""
       uint64_t foo() {
           return $(1);
       }
       """

julia> x = @cxx foo()
0x0000000000000001

Are any of the warnings worth worrying about?

@mweastwood
Copy link
Author

Oh nice, the warnings are fixed by modifying https://github.com/Keno/Cxx.jl/blob/master/src/Cxx.jl#L75-78 as appropriate for my system.

@jakebolewski
Copy link
Contributor

Glad you got it working!

@hsnamkoong
Copy link

@jakebolewski Could you be more specific on what to remove? I think the line numbers got changed.

@nico202
Copy link

nico202 commented May 25, 2016

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

No branches or pull requests

4 participants