I tried to install Odin on my Opensuse Tumbleweed dev machine without any success. The primary problem stems from LLVM-23 which is available in Opensuse but does not work when trying to build Odin from source.
I tried to use distrobox and use LLVM-19 and matching clang installation in the container, build a static binary and export it to the host. This does not work either due to how LLVM is dynamically linked in the binary. I would like to know if:
there is an option to build the native binary by statically linkin a specific version of LLVM? If so, I can build the binary in a container and export it to the host machine and hope it will work.
a dev/nightly version I can pull that works with LLVM-23? This will be the most suitable option for me
any other way option I am not aware of to make this work
I can of course, keep the odin binary in the container and move files to and from the host everytime I need to compile something but, that is not a good experience since this is the first time I am trying out Odin as a language.
Any help or suggestions will be greatly appreciated. Thanks.
I don’t understand why you’d need a container for older LLVM releases. The tumbleweed repo contains all versions from v18 to v23… Just name the exact version, e.g. zypper in libLLVM22. It will only install v23 if you do not specify a version for LLVM packages.
$ zypper se -i libLLVM
Loading repository data...
Reading installed packages...
S | Name | Summary | Type
---+-----------------+--------------------+--------
i | libLLVM18 | Libraries for LLVM | package
i | libLLVM19 | Libraries for LLVM | package
i | libLLVM20 | Libraries for LLVM | package
i | libLLVM21 | Libraries for LLVM | package
i | libLLVM21-32bit | Libraries for LLVM | package
i | libLLVM22 | Libraries for LLVM | package
i | libLLVM22-32bit | Libraries for LLVM | package
i | libLLVM23 | Libraries for LLVM | package
i | libLLVM23-32bit | Libraries for LLVM | package
$ ldd ./odin | grep -i llvm
libLLVM.so.22.1 => /lib64/libLLVM.so.22.1 (0x00007fc42a800000)
$ ls -lah /lib64/libLLVM*
lrwxrwxrwx 1 root root 15 Aug 27 23:40 /lib64/libLLVM.so -> libLLVM.so.23.1
-rwxr-xr-x 1 root root 117M Aug 2 23:30 /lib64/libLLVM.so.18.1
-rwxr-xr-x 1 root root 122M Aug 23 15:52 /lib64/libLLVM.so.19.1
-rwxr-xr-x 1 root root 134M Aug 23 15:52 /lib64/libLLVM.so.20.1
-rwxr-xr-x 1 root root 131M Aug 23 15:52 /lib64/libLLVM.so.21.1
-rwxr-xr-x 1 root root 142M Aug 28 10:20 /lib64/libLLVM.so.22.1
-rwxr-xr-x 1 root root 148M Aug 27 23:40 /lib64/libLLVM.so.23.1
I had version 23 already installed and was not sure if it was a good idea to remove it. I have now removed 23 (after creating a system snapshot pre installation) and replaced with llvm22 and building from source worked afterwards.