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

Pkg.build fails with LoadError: Unable to open libLLVM! #29720

Closed
markleary opened this issue Oct 18, 2018 · 34 comments
Closed

Pkg.build fails with LoadError: Unable to open libLLVM! #29720

markleary opened this issue Oct 18, 2018 · 34 comments
Assignees

Comments

@markleary
Copy link

Using Julia 0.7.0 on RHEL 7.5. Julia was installed from julia-epel-7 repo referenced in the documentation (https://copr.fedorainfracloud.org/coprs/nalimilan/julia/). Building any package fails with:

ERROR: LoadError: LoadError: Unable to open libLLVM!

llvm6-libs.x86_64-6.0.0-4.el7 package was installed from the julia repo. This rpm installs libLLVM to /usr/lib64/llvm6/lib/. For some reason the build process does not find the lib. I worked around the issue by creating a symlink in /usr/lib64:

ln -s /usr/lib64/llvm6/lib/libLLVM-6.0.0.so /usr/lib64/libLLVM.so

With this symlink in place, packages build successfully.

Julia versioninfo():

Julia Version 0.7.0
Commit a4cb80f3ed (2018-08-08 06:46 UTC)
Platform Info:
  OS: Linux (x86_64-redhat-linux)
  CPU: Intel(R) Xeon(R) CPU E7-8880 v3 @ 2.30GHz
  WORD_SIZE: 64
  LIBM: libopenlibm
  LLVM: libLLVM-6.0.0 (ORCJIT, haswell)

build log:

ERROR: LoadError: LoadError: Unable to open libLLVM!
Stacktrace:
 [1] error(::String) at ./error.jl:33
 [2] (::getfield(BinaryProvider, Symbol("#open_libllvm#114")))() at /bbkinghome/mleary/.julia/packages/BinaryProvider/1nGWd/src/PlatformNames.jl:650
 [3] detect_cxx11_string_abi() at /bbkinghome/mleary/.julia/packages/BinaryProvider/1nGWd/src/PlatformNames.jl:653
 [4] detect_compiler_abi() at /bbkinghome/mleary/.julia/packages/BinaryProvider/1nGWd/src/PlatformNames.jl:666
 [5] top-level scope at none:0
 [6] include at ./boot.jl:317 [inlined]
 [7] include_relative(::Module, ::String) at ./loading.jl:1038
 [8] include at ./sysimg.jl:29 [inlined]
 [9] include(::String) at /bbkinghome/mleary/.julia/packages/BinaryProvider/1nGWd/src/BinaryProvider.jl:1
 [10] top-level scope at none:0
 [11] top-level scope at none:2
in expression starting at /bbkinghome/mleary/.julia/packages/BinaryProvider/1nGWd/src/PlatformNames.jl:683
in expression starting at /bbkinghome/mleary/.julia/packages/BinaryProvider/1nGWd/src/BinaryProvider.jl:12
ERROR: LoadError: Failed to precompile BinaryProvider [b99e7846-7c00-51b0-8f62-c81ae34c0232] to /bbkinghome/mleary/.julia/compiled/v0.7/BinaryProvider/ek6VZ.ji.
Stacktrace:
 [1] include(::String) at ./client.jl:398
 [2] top-level scope at none:0
in expression starting at /bbkinghome/mleary/.julia/packages/Rmath/Py9gH/deps/build.jl:1

julia-epel-7.repo

[julia-epel-7]
name=Copr repo for julia owned by nalimilan
baseurl=https://copr-be.cloud.fedoraproject.org/results/nalimilan/julia/epel-7-$basearch/
enabled=True
gpgcheck=True
gpgkey=https://copr-be.cloud.fedoraproject.org/results/nalimilan/julia/pubkey.gpg
skip_if_unavailable=True
@nalimilan
Copy link
Member

AFAIK this is fixed with 1.0.1. Why don't you update?

@egnha
Copy link

egnha commented Oct 25, 2018

@nalimilan Even on 1.0.1, I run into a similar problem (ERROR: LoadError: LoadError: Unable to open libLLVM!) when attempting to build ZMQ and MBedTLS, as part of the IJulia build. Could you kindly point me to the fix?

@moppymopperson
Copy link

I'm having the same issue as @egnha, though I'm on Ubuntu 18.

@nalimilan
Copy link
Member

@egnha I can't reproduce on Fedora 28 nor on Centos 7. What OS and what exact version of the package are you using?

Cc: @cdluminate for Debian/Ubuntu.

@cdluminate
Copy link
Contributor

@nalimilan Cannot reproduce on both amd64 and ppc64el. Tested with julia version Debian ⛬ julia/1.0.1-2

@cdluminate
Copy link
Contributor

Maybe something wrong with the shared lib / symlink /usr/lib/x86_64-linux-gnu/julia/libLLVM.so ?

These files / symlinks are included in the official binary tarball.

~/b/julia-1.0.0 ❯❯❯ find | rg LLVM
./lib/julia/libLLVM-6.0.so
./lib/julia/libLLVM.so
./lib/julia/libLLVM-6.0.0.so

@nazywamsiepawel
Copy link

nazywamsiepawel commented Oct 29, 2018

I'm having the same issue on macOS Mojave, 10.14 with an anaconda setup and Julia v1.0.1

I create a new environment, install julia via conda install -c conda-forge julia

In order to access Julia via jupyter notebooks I do the following:

using Pkg Pkg.add("IJulia")

All goes fab,but then then opening jupyter notebook and selecting Julia yields the following:

Blosc not installed properly, run Pkg.build("ZMQ"), restart Julia and try again

Hoping for a successful resolution of the above, I run:

using Pkg Pkg.build("ZMQ")

Which slaps me back with the error that we are all experiencing here:

Error: Error buildingZMQ: │ ERROR: LoadError: LoadError: Unable to open libLLVM!

Is there anything wrong with the process I'm following? It's the first time I'm trying to get Julia to work with Jupyter Notebook.

Julia info

Julia Version 1.0.1 Platform Info: OS: macOS (x86_64-apple-darwin16.7.0) CPU: Intel(R) Core(TM) i7-6920HQ CPU @ 2.90GHz WORD_SIZE: 64 LIBM: libopenlibm LLVM: libLLVM-6.0.0 (ORCJIT, skylake)

@MaxBalashov
Copy link

I'm having the same issue on macOS Mojave, 10.14 with an anaconda setup and Julia v1.0.1

I create a new environment, install julia via conda install -c conda-forge julia

In order to access Julia via jupyter notebooks I do the following:

using Pkg Pkg.add("IJulia")

All goes fab,but then then opening jupyter notebook and selecting Julia yields the following:

Blosc not installed properly, run Pkg.build("ZMQ"), restart Julia and try again

Hoping for a successful resolution of the above, I run:

using Pkg Pkg.build("ZMQ")

Which slaps me back with the error that we are all experiencing here:

Error: Error buildingZMQ: │ ERROR: LoadError: LoadError: Unable to open libLLVM!

Is there anything wrong with the process I'm following? It's the first time I'm trying to get Julia to work with Jupyter Notebook.

Julia info

Julia Version 1.0.1 Platform Info: OS: macOS (x86_64-apple-darwin16.7.0) CPU: Intel(R) Core(TM) i7-6920HQ CPU @ 2.90GHz WORD_SIZE: 64 LIBM: libopenlibm LLVM: libLLVM-6.0.0 (ORCJIT, skylake)

I also have such problem!

@quentinlouis
Copy link

quentinlouis commented Nov 1, 2018

@nazywamsiepawel Exactly the same problem for me !

@rnevils
Copy link

rnevils commented Nov 1, 2018

@nazywamsiepawel I am having same issue, Mojave 10.14, installing Julia via anaconda and trying to use jupyter. However, I was able to to get Julia working with juypter notebooks by avoiding Anaconda altogether. Using homebrew to install Julia, then running

using IJulia 
notebook()

worked for me. However I this is only the notebooks and I still want to be able to use JuypterLab

edit: fixed it by adding ENV["JUPYTER"]="jupyter"

@liushuya7
Copy link

liushuya7 commented Nov 1, 2018

I'm having the exact same Issue when I tried to use IJulia via Anaconda. But problem solved when I switched to JuliaPro.

@zlewko
Copy link

zlewko commented Nov 4, 2018

same issue on ubuntu 18.04 when julia is installed via anaconda.

corrected with:
ln -s /usr/lib/llvm-6.0/lib/libLLVM-6.0.0.so /usr/lib/libLLVM.so

@mgei
Copy link

mgei commented Nov 11, 2018

Same issue for me on Ubuntu 16.04, conda 4.5.11, Julia 1.0.1

@GabrielEdogawa
Copy link

same issue on ubuntu 18.04 when julia is installed via anaconda.

corrected with:
ln -s /usr/lib/llvm-6.0/lib/libLLVM-6.0.0.so /usr/lib/libLLVM.so

Yeah but I guess the solution differs in Mac. Can somebody show me where I can find libLLVM-6.0.0 in Mac system? I performed the same installation steps of the same version of Julia in a same Mac system with @nazywamsiepawel and I even do not know where to find that library.

@versipellis
Copy link

versipellis commented Nov 19, 2018

Confirming the same issue on Ubuntu 18.10, Julia 1.0.2, conda 4.5.11.

Also resolved with linking:
ln -s /usr/lib/llvm-5.0/lib/libLLVM-5.0.0.so /usr/lib/libLLVM.so

@mbudisic
Copy link

mbudisic commented Jan 2, 2019

Confirming the same issue on Ubuntu 18.10, Julia 1.0.3, conda 4.5.12.

Fixed by softlinking as above.

@yuvilio
Copy link

yuvilio commented Jan 6, 2019

Same here, ln -s fixed. Obviously the llvm's library path may slightly differ on different linux distros (and which package one uses to provide it) or other operatiing systems. For my Ubuntu 18.10 setup, it happened to be provided by a few packages including libjulia1.

Similarly fixed it with tracking the file down and making the libLLVM available in the more generic library path:

$ dpkg -S libLLVM.so 
llvm-6.0-dev: /usr/lib/llvm-6.0/lib/libLLVM.so
libjulia1: /usr/lib/x86_64-linux-gnu/julia/libLLVM.so
$ sudo ln -s /usr/lib/x86_64-linux-gnu/julia/libLLVM.so /usr/lib/libLLVM.so
$

The install requiring it, (Pkg.add("IJulia") in my case) worked smoothly after.

@krinsman
Copy link

krinsman commented Jan 17, 2019

Maybe this issue should be merge with (or vice versa) JuliaPackaging/BinaryProvider.jl#130 ?

It also seems to be discussed here: conda-forge/julia-feedstock#60

@krinsman
Copy link

krinsman commented Jan 17, 2019

Since this is an issue with the conda-forge julia package, the solution might be found in the current build script for that package, found here:

https://github.com/conda-forge/julia-feedstock/blob/master/recipe/build.sh

In particular, note that the package does not install the conda-forge llvm package for Julia to use by default, and that the following flag is used in the make: USE_SYSTEM_LLVM=0.

@j-fu
Copy link

j-fu commented Apr 4, 2019

Same issue on OpenSUSE 15 with julia 1.0.3 from the science repo, here we need ln -s /usr/lib64/libLLVM.so.5 /usr/lib64/libLLVM.so.
An alternative without root access is to link to a user accessible directory on LD_LIBRARY_PATH:

$ mkdir $HOME/lib64
$ ln -s /usr/lib64/libLLVM.so.5 $HOME/lib64/libLLVM.so
$ export LD_LIBRARY_PATH=$HOME/lib64/.$LD_LIBRARY_PATH

(I had some error trying this out for the inital version of this post)

@j-fu
Copy link

j-fu commented Apr 5, 2019

Same issue on OpenSUSE 15 with julia 1.0.3 from the science repo, here we need ln -s /usr/lib64/libLLVM.so.5 /usr/lib64/libLLVM.so.
An alternative without root access is to link to a user accessible directory on LD_LIBRARY_PATH:

$ mkdir $HOME/lib64
$ ln -s /usr/lib64/libLLVM.so.5 $HOME/lib64/libLLVM.so
$ export LD_LIBRARY_PATH=$HOME/lib64/.$LD_LIBRARY_PATH

Update (thanks to our sysadmin): OpenSuse 15 has a package llvm-devel which creates the link.
So this might be an issue of package dependencies to be addressed in the distro.

@nalimilan
Copy link
Member

Can you file an issue against the OpenSUSE repo (and post the link here)?

@j-fu
Copy link

j-fu commented Apr 5, 2019

Same issue on OpenSUSE 15 with julia 1.0.3 from the science repo, here we need ln -s /usr/lib64/libLLVM.so.5 /usr/lib64/libLLVM.so.
An alternative without root access is to link to a user accessible directory on LD_LIBRARY_PATH:

$ mkdir $HOME/lib64
$ ln -s /usr/lib64/libLLVM.so.5 $HOME/lib64/libLLVM.so
$ export LD_LIBRARY_PATH=$HOME/lib64/.$LD_LIBRARY_PATH

Update (thanks to our sysadmin): OpenSuse 15 has a package llvm-devel which creates the link.
So this might be an issue of package dependencies to be addressed in the distro.
Update: Similar discussion is already running on https://bugzilla.opensuse.org/show_bug.cgi?id=1114692 .
I put in my 2cts in there and gave the link to the discussion here.

@nalimilan
Copy link
Member

Thanks. Actually it looks like the problem is just that OpenSUSE should use USE_LLVM_SHLIB=1 instead of USE_LLVM_SHLIB=0 in the juliabuildopts file.

@j-fu
Copy link

j-fu commented Oct 7, 2019

Thanks for the hint. Over at OpenSuse they tried it and it worked: https://bugzilla.opensuse.org/show_bug.cgi?id=1114692#c7
On Tumbleweed I was able to check this - it is there now.

@ViralBShah
Copy link
Member

Let's reopen if still an issue.

@eahenle
Copy link

eahenle commented Sep 22, 2022

Currently running into this issue when running the following CI workflow on GHA:

runs-on: windows-latest

steps:
      - name: checkout commit
        uses: actions/checkout@master

      - name: set up Julia
        uses: julia-actions/setup-julia@latest
        with:
          version: '1.8.1'
      
      - name: build package
        uses: julia-actions/julia-buildpkg@latest

@WT215
Copy link

WT215 commented Nov 22, 2022

Currently running into this issue when running the following CI workflow on GHA:

runs-on: windows-latest

steps:
      - name: checkout commit
        uses: actions/checkout@master

      - name: set up Julia
        uses: julia-actions/setup-julia@latest
        with:
          version: '1.8.1'
      
      - name: build package
        uses: julia-actions/julia-buildpkg@latest

can you explained more on how to implement this please? Many thanks!

@eahenle
Copy link

eahenle commented Nov 22, 2022

@WT215 Sounds like you're asking generally about implementing CI on GitHub Actions? If so, let's chat on Gitter instead of cluttering this issue 😉

@gustaphe
Copy link

gustaphe commented Jan 9, 2023

Currently running into this issue when running the following CI workflow on GHA

Did you end up solving this? I'm having the same problem.

@eahenle
Copy link

eahenle commented Jan 9, 2023

@gustaphe No ☹️

I have found the upstream issue, though: JuliaPackaging/BinaryProvider.jl#211
In my case, one of my package's dependencies uses BinaryProvider, which is deprecated.

@msanchezr99
Copy link

Having this issue in Windows 10. I try to run "using Plots" and it shows FFMPEG not installed properly. It says I must run "build FFMPEG" but when I do it shows load error saying unable to open libLLVM. Don't know what to do!

@droodman
Copy link

droodman commented Mar 31, 2024

I'm exactly same issue as described by @msanchezr99, except in Windows 11 Pro 23H2. It's preventing me from using Plots. Julia version 1.10.2.

Update: at least for me, this fix works. Find the llvm library with Base.libllvm_path() and then create a copy of it in the same folder called libLLVM.dll. No idea what the underlying issue is.

@gustaphe
Copy link

gustaphe commented Apr 8, 2024

@droodman broken link.

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