In /opt/homebrew/Cellar/crystal/1.6.0/share/crystal/src/llvm/lib_llvm.cr:13:17
13 | VERSION = {{`#{LibLLVM::LLVM_CONFIG} --version`.chomp.stringify}}
^
Error: error executing command: "" --version, got exit status 127
More info:
sergehulne@Serges-Mac-mini crystalline % shards install
Resolving dependencies
Fetching https://github.com/elbywan/crystal-lsp.git
Fetching https://github.com/spider-gazelle/priority-queue.git
Fetching https://github.com/hugopl/version_from_shard.git
Fetching https://github.com/samueleaton/sentry.git
Fetching https://github.com/spider-gazelle/bisect.git
Installing lsp (0.1.2)
Installing version_from_shard (1.2.5)
Installing bisect (1.2.1)
Installing priority-queue (1.0.1)
Installing sentry (0.3.2 at e448ce8)
Shard "lsp" may be incompatible with Crystal 1.6.0
sergehulne@Serges-Mac-mini crystalline % mkdir bin
sergehulne@Serges-Mac-mini crystalline % crystal build ./src/crystalline.cr -o ./bin/crystalline --release --no-debug --progress -Dpreview_mt
--: : command not foundvel)
Showing last frame. Use --error-trace for full trace.
In /opt/homebrew/Cellar/crystal/1.6.0/share/crystal/src/llvm/lib_llvm.cr:13:17
13 | VERSION = {{`#{LibLLVM::LLVM_CONFIG} --version`.chomp.stringify}}
^
I updated to Crystal 1.7, but the problem persists:
Error: error executing command: "" --version, got exit status 127
sergehulne@Serges-Mac-mini crystalline % shards install
Resolving dependencies
Fetching https://github.com/spider-gazelle/priority-queue.git
Fetching https://github.com/hugopl/version_from_shard.git
Fetching https://github.com/elbywan/crystal-lsp.git
Fetching https://github.com/samueleaton/sentry.git
Fetching https://github.com/spider-gazelle/bisect.git
Using lsp (0.1.2)
Using version_from_shard (1.2.5)
Using bisect (1.2.1)
Using priority-queue (1.0.1)
Using sentry (0.3.2 at e448ce8)
sergehulne@Serges-Mac-mini crystalline % crystal build ./src/crystalline.cr -o ./bin/crystalline --release --no-debug --progress -Dpreview_mt
--: : command not foundvel)
Showing last frame. Use --error-trace for full trace.
In /opt/homebrew/Cellar/crystal/1.7.2/share/crystal/src/llvm/lib_llvm.cr:13:17
13 | VERSION = {{`#{LibLLVM::LLVM_CONFIG} --version`.chomp.stringify}}
^
Error: error executing command: "" --version, got exit status 127
sergehulne@Serges-Mac-mini crystalline % crystal version
Crystal 1.7.2 (2023-01-23)
LLVM: 14.0.6
Default target: aarch64-apple-darwin22.2.0
sergehulne@Serges-Mac-mini crystalline %
Looks like you’re missing LLVM.
We ought to improve the error message to be clear on that.
What version of llvm is recommended (I’m using Brew to install software under Mac OS) ?
I have reinstalled LLVM@15 (via Brew), I still get the same error (I have reinstalled Crystalline from scratch):
sergehulne@Serges-Mac-mini Crystal % cd crystalline
sergehulne@Serges-Mac-mini crystalline % shards install
Resolving dependencies
Fetching https://github.com/elbywan/crystal-lsp.git
Fetching https://github.com/samueleaton/sentry.git
Fetching https://github.com/hugopl/version_from_shard.git
Fetching https://github.com/spider-gazelle/priority-queue.git
Fetching https://github.com/spider-gazelle/bisect.git
Installing lsp (0.1.2)
Installing version_from_shard (1.2.5)
Installing bisect (1.2.1)
Installing priority-queue (1.0.1)
Installing sentry (0.3.2 at e448ce8)
sergehulne@Serges-Mac-mini crystalline % mkdir bin
sergehulne@Serges-Mac-mini crystalline % crystal build ./src/crystalline.cr -o ./bin/crystalline --release --no-debug --progress -Dpreview_mt
--: : command not foundvel)
Showing last frame. Use --error-trace for full trace.
In /opt/homebrew/Cellar/crystal/1.7.2/share/crystal/src/llvm/lib_llvm.cr:13:17
13 | VERSION = {{`#{LibLLVM::LLVM_CONFIG} --version`.chomp.stringify}}
^
Error: error executing command: "" --version, got exit status 127
Unfortunately, LLVM 15 is not yet supported. You need a version between 8 and 14 (inclusive).
You should be able to get 14 in brew.
Perhaps the problem is somewhere else:
brew reinstall llvm@14
==> Fetching llvm@14
==> Downloading https://ghcr.io/v2/homebrew/core/llvm/14/manifests/14.0.6-2
######################################################################## 100.0%
==> Downloading https://ghcr.io/v2/homebrew/core/llvm/14/blobs/sha256:4ce14f420e0df7003c6f15c8d5f0f012
==> Downloading from https://pkg-containers.githubusercontent.com/ghcr1/blobs/sha256:4ce14f420e0df7003
######################################################################## 100.0%
==> Reinstalling llvm@14
==> Pouring llvm@14--14.0.6.arm64_ventura.bottle.2.tar.gz
🍺 /opt/homebrew/Cellar/llvm@14/14.0.6: 5,827 files, 959.2MB
==> Running `brew cleanup llvm@14`...
Disable this behaviour by setting HOMEBREW_NO_INSTALL_CLEANUP.
Hide these hints with HOMEBREW_NO_ENV_HINTS (see `man brew`).
sergehulne@Serges-Mac-mini crystalline % crystal build ./src/crystalline.cr -o ./bin/crystalline --release --no-debug --progress -Dpreview_mt
--: : command not foundvel)
Showing last frame. Use --error-trace for full trace.
In /opt/homebrew/Cellar/crystal/1.7.2/share/crystal/src/llvm/lib_llvm.cr:13:17
13 | VERSION = {{`#{LibLLVM::LLVM_CONFIG} --version`.chomp.stringify}}
^
Error: error executing command: "" --version, got exit status 127
Here in a extract of brew list on my Mac :
imagemagick llvm@11 z3
imath llvm@14 zstd
jasper lua
What’s the output of llvm-config?
Apparently it is not accessible from the command line, perhaps I should try to see where Brew stored it and modify the PATH accordingly?
sergehulne@Serges-Mac-mini app % llvm-config
zsh: command not found: llvm-config
I added the following to my .zshrc
export PATH=/opt/homebrew/Cellar/llvm@14/14.0.6/bin:$PATH
And the script seems to be running now.
Thank you.
You can try brew link llvm@14
to symlink the binaries into the Homebrew bin path
Thank you!
I managed to compile crystalline with the help this forum (@straight-shoota et al.), but I get the following error when using it in VSCode:
ld: library not found for -lssl e[33;1m(this usually means you need to install the development package for libssl)e[0m
clang: error: linker command failed with exit code 1 (use -v to see invocation)
e[31;1mError: e[0me[1mexecution of command failed with code: 1: `cc "${@}" -o /Users/sergehulne/.cache/crystal/Users-sergehulne-Documents-code-Crystal-CrystApp_4_Svelte-CrystApp-lib-rucksack-src-.rucksack_packer.cr/macro_run -rdynamic -L/opt/homebrew/Cellar/crystal/1.7.2/libexec/../../../../lib `command -v pkg-config > /dev/null && pkg-config --libs --silence-errors libssl || printf %s '-lssl -lcrypto'` `command -v pkg-config > /dev/null && pkg-config --libs --silence-errors libcrypto || printf %s '-lcrypto'` -lz -lgc -L/opt/homebrew/Cellar/libevent/2.1.12/lib -levent -liconv`e[0m
[Info - 17:24:02] Connection to server got closed. Server will restart.
[Error - 17:24:02] Request textDocument/hover failed.
Its seems to point to a missing ssl library, but SSL is installed:
openssl version
OpenSSL 1.1.1l 24 Aug 2021
``
That means the openssl binary is installed. That does not necessarily include the development libraries (which the error message explicitly asks for).
Make sure you have libssl and libcrypto in your lib path and/or accessible via pkgconf.
IIRC there is some issue with OpenSSL on Mac with brew and you need to explicitly copy the lib/pc config to a discoverable path.