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

failed to precompile on julia 1.4.0 #464

Open
zwwi opened this issue Mar 22, 2020 · 14 comments
Open

failed to precompile on julia 1.4.0 #464

zwwi opened this issue Mar 22, 2020 · 14 comments

Comments

@zwwi
Copy link

zwwi commented Mar 22, 2020

I got an error LoadError: AssertionError: isdir(cxxclangdir) during precompiling; it works well on julia 1.3.1. The system is WSL2

@htyeim
Copy link

htyeim commented Mar 23, 2020

Failed on 1.4 also, but in my case (macOS 10.15), the error said:

ERROR: LoadError: LoadError: could not load library "/Users/user/.julia/packages/Cxx/1RaOv/src/../deps/usr/lib/libcxxffi"
dlopen(/Users/user/.julia/packages/Cxx/1RaOv/src/../deps/usr/lib/libcxxffi.dylib, 9): Symbol not found: __ZN4llvm11raw_ostream6handleEv
  Referenced from: /Users/user/.julia/packages/Cxx/1RaOv/src/../deps/usr/lib/libcxxffi.dylib
  Expected in: /Applications/Julia-1.4.app/Contents/Resources/julia/lib/julia/libLLVM.dylib
 in /Users/user/.julia/packages/Cxx/1RaOv/src/../deps/usr/lib/libcxxffi.dylib

@Gnimuc
Copy link
Member

Gnimuc commented Mar 23, 2020

I need to upgrade https://github.com/Gnimuc/CxxBuilder and release new libcxxffi binaries for Julia-1.4. This may take a couple of days(depends on China's Internet download speed 😂), so currently, if you'd like to use Cxx.jl with Julia-1.4, I would recommend to build Julia from source and then do a source build(pkg> build Cxx) for Cxx.jl.

This will take longer than I expected.

@drewrobson
Copy link
Contributor

Julia 1.4 uses LLVM_VER = 8.0.1, which has breaking changes relative to LLVM_VER = 6.0.1 used by Julia 1.3.

I think even source build won't work until Cxx.jl is updated to support the new LLVM version.

Here are the first lines of the Cxx build error on a source build of Julia 1.4:

┌ Error: Error building `Cxx`, showing the last 100 of log: 
│ /home/drew/julia_v1.4/usr/bin/../include/clang/AST/ExprCXX.h:171:7: note:   candidate expects 1 argument, 6 provided
│ /home/drew/julia_v1.4/usr/bin/../include/clang/AST/ExprCXX.h:171:7: note: candidate: ‘constexpr clang::CXXMemberCallExpr::CXXMemberCallExpr(clang::CXXMemberCallExpr&&)’
│ /home/drew/julia_v1.4/usr/bin/../include/clang/AST/ExprCXX.h:171:7: note:   candidate expects 1 argument, 6 provided
│ ../src/bootstrap.cpp: In function ‘void finish_clang_init(CxxInstance*, bool, const char*, size_t, time_t)’:
│ ../src/bootstrap.cpp:1610:59: error: ‘getNewMemBuffer’ is not a member of ‘llvm::MemoryBuffer’
│  1610 |     sm.overrideFileContents(MainFile, llvm::MemoryBuffer::getNewMemBuffer(0, fname));
│       |                                                           ^~~~~~~~~~~~~~~

@Gnimuc
Copy link
Member

Gnimuc commented Mar 25, 2020

@drewrobson you're right. I just fixed that. Could you give #465 a try?

@drewrobson
Copy link
Contributor

Thanks for your quick response! Now I'm getting a curl 404 error:

│ curl: (22) The requested URL returned error: 404 
│ make: *** [BuildBootstrap.Makefile:23: llvm_tars] Error 22

@drewrobson
Copy link
Contributor

These are the broken urls:

http://releases.llvm.org/8.0.1/llvm-8.0.1.src.tar.xz
http://releases.llvm.org/8.0.1/cfe-8.0.1.src.tar.xz
http://releases.llvm.org/8.0.1/compiler-rt-8.0.1.src.tar.xz
http://releases.llvm.org/8.0.1/libcxx-8.0.1.src.tar.xz
http://releases.llvm.org/8.0.1/libcxxabi-8.0.1.src.tar.xz
http://releases.llvm.org/8.0.1/polly-8.0.1.src.tar.xz
http://releases.llvm.org/8.0.1/libunwind-8.0.1.src.tar.xz
http://releases.llvm.org/8.0.1/lld-8.0.1.src.tar.xz

These urls work fine if I replace 8.0.1 with 6.0.1. Looks like https://releases.llvm.org/6.0.1 contains source files but https://releases.llvm.org/8.0.1 redirects to GitHub. Perhaps for 8.0.1, the urls should look like this:

https://github.com/llvm/llvm-project/releases/download/llvmorg-8.0.1/llvm-8.0.1.src.tar.xz

@Gnimuc
Copy link
Member

Gnimuc commented Mar 25, 2020

Yeah, I just noticed that. Now I'm trying to update those LLVM patches. ;)

@Gnimuc
Copy link
Member

Gnimuc commented Mar 25, 2020

OK, now I need to upgrade bootstrap.cpp to LLVM8, which may beyond my abilities, so don't expect this can be fixed soon.

@AmplitudeGravity
Copy link

Failed on 1.4 also, but in my case (macOS 10.15), the error said:

ERROR: LoadError: LoadError: could not load library "/Users/user/.julia/packages/Cxx/1RaOv/src/../deps/usr/lib/libcxxffi"
dlopen(/Users/user/.julia/packages/Cxx/1RaOv/src/../deps/usr/lib/libcxxffi.dylib, 9): Symbol not found: __ZN4llvm11raw_ostream6handleEv
  Referenced from: /Users/user/.julia/packages/Cxx/1RaOv/src/../deps/usr/lib/libcxxffi.dylib
  Expected in: /Applications/Julia-1.4.app/Contents/Resources/julia/lib/julia/libLLVM.dylib
 in /Users/user/.julia/packages/Cxx/1RaOv/src/../deps/usr/lib/libcxxffi.dylib

I have similar errors even I use juliapro 1.0.5

@Gnimuc
Copy link
Member

Gnimuc commented May 1, 2020

FYI, Cxx.jl(binary build) only works with Julia-v1.1.x~v1.3.x.

@mdav2
Copy link

mdav2 commented May 18, 2020

First off, great package you have here. However, is there a plan to resolve these issues for future versions of Julia? I am considering adding Cxx.jl as a dependency to a project, but I don't want to be permanently frozen at Julia 1.3 ...

@htyeim
Copy link

htyeim commented May 19, 2020

First off, great package you have here. However, is there a plan to resolve these issues for future versions of Julia? I am considering adding Cxx.jl as a dependency to a project, but I don't want to be permanently frozen at Julia 1.3 ...

I think it's a good time to rewrite the code in pure julia (:joy: what I have done with GPSTk)

@henry2004y
Copy link

Still failing on Julia 1.5.1. Looking forward to the working version!

@kapple19
Copy link

Also failing on Julia 1.6

julia> using Cxx
[ Info: Precompiling Cxx [a0b5b9ef-44b7-5148-a2d1-f6db19f3c3d2]
ERROR: LoadError: LoadError: could not load library "C:\Users\user\.julia\packages\Cxx\1RaOv\src\..\deps\usr\bin\libcxxffi"

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

8 participants