Error: no such file or directory in reference to libLLVM8.so

This error appears any time I try to run the crystal command, even crystal --version.

Error follows:

crystal: error while loading shared libraries: libLLVM-8.so: cannot open shared object file: No such file or directory

I don’t think this is a bug, I think I have something misconfigured or broken. But I don’t know what. I have all the dependent libraries (just checked) and am running Manjaro linux on kernel 4.9.

what version of llvm do you have installed?

9.0.0-4

it looks like the crystal on your install is looking for llvm version 8 and you have version 9 on your computer. I have not seen this error and dont really know but can you install llvm-8 or reinstall crystal to try and get it to link against llvm-9

1 Like

Yup, sorry for forgetting that detail in my original message. Just uninstalled and reinstalled Crystal, and the error still happens. I only have llvm 7 or 9 available on this system. Is there any way to manually instruct the compiler to link to a particular version of llvm?

oooh maybe I could symlink libLLVM-8.so to libLLVM-9.so…

Gah, figures. Symlinking didn’t work either, it’s still expecting LLVM8.

How did you install Crystal?

The official distribution package has LLVM8 statically linked. It shouldn’t require any dynamic libraries.

I had the official repo version and updated to 0.32 by downloading the package from the arch package search and installing it with pacman -U. I wonder if I have a weird situation where I have more than one crystal on my path…

That was my problem, there was a dynamically-linked crystal on the $PATH at a higher position than the system one. Thanks for your help guys.

2 Likes