ASDF Crystal and LLVM version

I use asdf to manage my crystal versions. When asdf installs, it looks like it just finds the latest tar and downloads the binary from that.

When I run crystal -v, I get this:

Crystal 0.34.0 (2020-04-06)

LLVM: 6.0.1
Default target: x86_64-apple-macosx

But my llvm is set to 10

[10:08AM] jeremywoertink$ llvm-config --version
10.0.0

Does crystal still use 10 if it sees it even though the version lists 6? Or does anyone know how to get that built version of crystal to be higher than 6?

1 Like

The osx packages in github are built and linked against llvm 6.

That compiler will not use llvm 10 as it is installed.

If you build the compiler from sources and have a newer llvm installed, using ./bin/crystal will use the new compiler.

In order to update the llvm used in the osx packages we need to upload a pre built package of llvm.

1 Like

Ah, I see. Ok, thanks!

I wanted to use brew, but every time I install from brew, it wipes out the previous version. I’ll see how hard it would be to just manage building from source.

Were you looking for some specific benefit on using llvm 10?

The relevant code for the osx packages is in the omnibus directory of https://github.com/crystal-lang/distribution-scripts

1 Like

I’m curious about what it would take to make crystal compile WASM. Since the latest LLVM stuff can do it, my thought was that it would be possible to make crystal do it too. I assumed that I would have to compile crystal with the latest version of LLVM for it to work though.

Not really a huge deal though. More of just experimenting without borking my versions I need for work :laughing:

Ok, yes, the way to go then is compile the compiler from source.

Eventually the linked llvm can be updated. We went from 3.9.1 to 6.0.1, so it’s about time :stuck_out_tongue:

2 Likes