Could not load library libLLVM-15jl.so

When I try to precompile the ParalelStencil Package I get an error:

ERROR: LoadError: InitError: could not load library "/home/caspar/.julia/artifacts/a80fabdc38a167e0757ca96c55bda6be7c65e1b4/lib/libEnzyme-15.so"
libLLVM-15jl.so: cannot open shared object file: No such file or directory

So it seems to require llvm15, I think? I installed llvm15 via my package manager, but it did not seem to fix the issue:

➜  ~ pacman -Qi llvm15
Name            : llvm15
Version         : 15.0.7-1
Description     : Compiler infrastructure (LLVM 15)
Architecture    : x86_64
URL             : https://llvm.org/
Licenses        : custom:Apache 2.0 with LLVM Exception
Groups          : None
Provides        : None
Depends On      : llvm15-libs  perl
Optional Deps   : None
Required By     : None
Optional For    : clang15
Conflicts With  : None
Replaces        : None
Installed Size  : 58.44 MiB
Packager        : Evangelos Foutras <foutrelis@archlinux.org>
Build Date      : Sat Aug 19 18:39:06 2023
Install Date    : Sat Nov 4 10:12:13 2023
Install Reason  : Explicitly installed
Install Script  : No
Validated By    : Signature

Here is the full error message:

(pde on gpus) pkg> precompile
Precompiling project...
  βœ— ParallelStencil
  0 dependencies successfully precompiled in 2 seconds. 58 already precompiled.

ERROR: The following 1 direct dependency failed to precompile:

ParallelStencil [94395366-693c-11ea-3b26-d9b7aac5d958]

Failed to precompile ParallelStencil [94395366-693c-11ea-3b26-d9b7aac5d958] to "/home/caspar/.julia/compiled/v1.9/ParallelStencil/jl_JZeb4g".
ERROR: LoadError: InitError: could not load library "/home/caspar/.julia/artifacts/a80fabdc38a167e0757ca96c55bda6be7c65e1b4/lib/libEnzyme-15.so"
libLLVM-15jl.so: cannot open shared object file: No such file or directory
Stacktrace:
 [1] __init__()
   @ Enzyme.API ~/.julia/packages/Enzyme/rbuCz/src/api.jl:527
 [2] include(x::String)
   @ ParallelStencil.ParallelKernel ~/.julia/packages/ParallelStencil/s1TBh/src/ParallelKernel/ParallelKernel.jl:41
 [3] top-level scope
   @ ~/.julia/packages/ParallelStencil/s1TBh/src/ParallelKernel/ParallelKernel.jl:44
 [4] include(x::String)
   @ ParallelStencil ~/.julia/packages/ParallelStencil/s1TBh/src/ParallelStencil.jl:46
 [5] top-level scope
   @ ~/.julia/packages/ParallelStencil/s1TBh/src/ParallelStencil.jl:49
 [6] top-level scope
   @ stdin:3
during initialization of module API
in expression starting at /home/caspar/.julia/packages/ParallelStencil/s1TBh/src/ParallelKernel/AD.jl:1
in expression starting at /home/caspar/.julia/packages/ParallelStencil/s1TBh/src/ParallelKernel/ParallelKernel.jl:1
in expression starting at /home/caspar/.julia/packages/ParallelStencil/s1TBh/src/ParallelStencil.jl:1
in expression starting at stdin:3

other than that llvm 16 was allready installed.

How did you install Julia? If using archlinux repository, the answer is β€œdon’t”: Julia - ArchWiki. Follow the suggestions in the installation section.

2 Likes

libLLVM-15jl.so refers to a Julia specific fork of LLVM. Using generic LLVM will likely not work unless you apply our patches. This shared library is usually located in lib/julia of a standard Julia install.

Your use of pacman and the reported issue suggests that you may be using the Arch distribution of Julia. If so, please ask the Arch maintainer. We cannot help you much with their packaging other than telling you that distribution packaging of Julia is probably not going to work. As we are developing Julia we are maintaining many patch sets on dependencies, so using generically configured and unpatched dependencies is likely to cause issues.

If you would like help here, our first suggestion is to download Julia directly from julialang.org or via juliaup. If this is what you did, please let us know.

To summarize, we think you are encountering issue specific to the Arch Linux distribution of Julia and direct your attention to the Arch Linux package maintainers.