Open pajacobs-ghub opened 3 months ago
Hi @pajacobs-ghub, this looks like possibly a homebrew issue with LLVM versions. Chapel v2.0.1 does not support LLVM 18 and the homebrew formula pins to LLVM 17, but I see in the output references to LLVM 18.
Can you try running brew reinstall chapel
and see if the problem persists? If that doesn't work, can you also post the output of /opt/homebrew/Cellar/chapel/2.0.1/libexec/util/printchplenv --all
, which prints some extra information about the backend compilers.
Jade, Still the same behaviour. A copy of the console follows. Peter J.
peterj@mini ~ % brew reinstall chapel
==> Downloading https://ghcr.io/v2/homebrew/core/chapel/manifests/2.0.1
Already downloaded: /Users/peterj/Library/Caches/Homebrew/downloads/b812b2defe5d32958839328dacf86428255cecf7eb6a1536e29d2cb225e67829--chapel-2.0.1.bottle_manifest.json
==> Fetching chapel
==> Downloading https://ghcr.io/v2/homebrew/core/chapel/blobs/sha256:e75b261ff8378a1a86db49794ca9cc4419d8eadc7e7a4ce9a17430a5757bb778
Already downloaded: /Users/peterj/Library/Caches/Homebrew/downloads/c94063350d1c54f7bfdd22494799629e5db66adb0973d19d0a8fdfc9a9078894--chapel--2.0.1.arm64_sonoma.bottle.tar.gz
==> Reinstalling chapel
==> Pouring chapel--2.0.1.arm64_sonoma.bottle.tar.gz
🍺 /opt/homebrew/Cellar/chapel/2.0.1: 11,008 files, 191.9MB
==> Running brew cleanup chapel
...
Disable this behaviour by setting HOMEBREW_NO_INSTALL_CLEANUP.
Hide these hints with HOMEBREW_NO_ENV_HINTS (see man brew
).
peterj@mini ~ % chpl --version
dyld[1100]: Symbol not found: __ZN4llvm16MetadataTracking5trackEPvRNS_8MetadataENS_12PointerUnionIJPNS_15MetadataAsValueEPS2_EEE
Referenced from:
I just did a brew upgrade
on my M1 Mac, whose previous installation of 2.0 had been working (specifically, it was version 2.0.0_2, and I'm now seeing the same thing. :(
Surprisingly to me, the new version is 2.0.1, which was not intended as a homebrew release, yet also shouldn't affect the homebrew build.
Checking brew list llvm
, though, I'm finding that it does look like brew is using llvm 18 rather than 17…
An explicit brew install llvm@17
seems to fix the issue for me—@pajacobs-github, I'll be curious whether it does for you as well (not to say that this should be required, just as a workaround).
Yes, it does fix the issue for me. Thank you.
Thanks for confirming @pajacobs-ghub! It looks like recent changes to the formula have been innocuous, so I'm not sure why it would have broken in this way. I'm also not sure why the verification we do with the formula wouldn't have caught this in homebrew's CI testing. We'll try to sort this out to prevent others from stepping into this pothole.
And thanks for letting us know about this!
Capturing my console output and information about my system for posterity. Here's my "About Mac" window:
Here's the list of packages that were updated as a result of my brew upgrade
:
You have 37 outdated formulae installed.
==> Upgrading 37 outdated packages:
z3 4.12.6 -> 4.13.0
tree-sitter 0.22.1 -> 0.22.6
hugo 0.124.1 -> 0.126.1
xterm 390 -> 391
cmake 3.29.2 -> 3.29.3
chapel 2.0.0_2 -> 2.0.1
docker-completion 25.0.4 -> 26.1.3
glib 2.80.0_2 -> 2.80.2
libxcb 1.16.1 -> 1.17.0
python-matplotlib 3.8.4 -> 3.9.0
aws-sdk-cpp 1.11.285 -> 1.11.315
llvm 17.0.6_1 -> 18.1.5
aom 3.8.2 -> 3.9.0
fonttools 4.50.0 -> 4.51.0
rsync 3.2.7_1 -> 3.3.0
gcc 13.2.0 -> 14.1.0
webp 1.3.2 -> 1.4.0
fribidi 1.0.13 -> 1.0.14
libnghttp2 1.60.0 -> 1.61.0
emacs 29.2 -> 29.3
giflib 5.2.1 -> 5.2.2
re2 20240401 -> 20240501
snappy 1.1.10 -> 1.2.0
openssl@3 3.2.1 -> 3.3.0
libxmu 1.1.4 -> 1.2.1
libimagequant 4.3.0 -> 4.3.1
doxygen 1.10.0 -> 1.11.0
node 21.7.1 -> 22.2.0
libomp 18.1.4 -> 18.1.6
unbound 1.19.2 -> 1.20.0
python@3.11 3.11.8 -> 3.11.9
imagemagick 7.1.1-30 -> 7.1.1-32
jasper 4.2.3 -> 4.2.4
apache-arrow 15.0.2_2 -> 16.1.0
git 2.44.0 -> 2.45.1
jpeg-turbo 3.0.2 -> 3.0.3
gnutls 3.8.3 -> 3.8.4
Here are the install steps related to LLVM:
==> Downloading https://ghcr.io/v2/homebrew/core/llvm/manifests/18.1.5
######################################################################### 100.0%
==> Fetching llvm
==> Downloading https://ghcr.io/v2/homebrew/core/llvm/blobs/sha256:a383be0855450
######################################################################### 100.0%
where you can see that the brew cleanup
stage that it runs removed LLVM 17:
==> Upgrading llvm
17.0.6_1 -> 18.1.5
==> Pouring llvm--18.1.5.arm64_monterey.bottle.tar.gz
🍺 /opt/homebrew/Cellar/llvm/18.1.5: 7,722 files, 1.8GB
==> Running `brew cleanup llvm`...
Removing: /opt/homebrew/Cellar/llvm/17.0.6_1... (7,207 files, 1.7GB)
Removing: /Users/bradc/Library/Caches/Homebrew/llvm_bottle_manifest--17.0.6_1... (19.8KB)
Removing: /Users/bradc/Library/Caches/Homebrew/llvm--17.0.6_1... (426.6MB)
Probably unrelated, but it also auto-removed some older LLVMs:
==> Autoremoving 11 unneeded formulae:
docker-completion
fonttools
llvm@14
llvm@15
…
Uninstalling /opt/homebrew/Cellar/llvm@14/14.0.6... (5,827 files, 959.2MB)
Uninstalling /opt/homebrew/Cellar/llvm@15/15.0.7... (5,857 files, 1GB)
And here are the install steps related to Chapel:
==> Downloading https://ghcr.io/v2/homebrew/core/chapel/manifests/2.0.1
######################################################################### 100.0%
==> Fetching chapel
==> Downloading https://ghcr.io/v2/homebrew/core/chapel/blobs/sha256:a11ed899b3c
######################################################################### 100.0%
…
==> Upgrading chapel
2.0.0_2 -> 2.0.1
==> Pouring chapel--2.0.1.arm64_monterey.bottle.tar.gz
🍺 /opt/homebrew/Cellar/chapel/2.0.1: 11,008 files, 191.5MB
==> Running `brew cleanup chapel`...
Removing: /opt/homebrew/Cellar/chapel/2.0.0_2... (11,046 files, 191.7MB)
Removing: /Users/bradc/Library/Caches/Homebrew/chapel_bottle_manifest--2.0.0_2... (39.6KB)
Removing: /Users/bradc/Library/Caches/Homebrew/chapel--2.0.0_2... (57.1MB)
Here's the full brew upgrade
output:
Here's the failure I saw after the brew upgrade
:
$ chpl ~/chapel/test/release/examples/hello.chpl
dyld[67768]: Symbol not found: (__ZN4llvm16MetadataTracking5trackEPvRNS_8MetadataENS_12PointerUnionIJPNS_15MetadataAsValueEPS2_EEE)
Referenced from: '/opt/homebrew/Cellar/chapel/2.0.1/libexec/bin/darwin-arm64/chpl'
Expected in: '/opt/homebrew/Cellar/llvm/18.1.5/lib/libLLVM.dylib'
Abort trap: 6
Here's the brew install
of llvm@17:
$ brew install llvm@17
==> Downloading https://formulae.brew.sh/api/formula.jws.json
==> Downloading https://formulae.brew.sh/api/cask.jws.json
==> Downloading https://ghcr.io/v2/homebrew/core/llvm/17/manifests/17.0.6
######################################################################### 100.0%
==> Fetching llvm@17
==> Downloading https://ghcr.io/v2/homebrew/core/llvm/17/blobs/sha256:0915b16498
######################################################################### 100.0%
==> Pouring llvm@17--17.0.6.arm64_monterey.bottle.tar.gz
==> Caveats
To use the bundled libc++ please add the following LDFLAGS:
LDFLAGS="-L/opt/homebrew/opt/llvm@17/lib/c++ -Wl,-rpath,/opt/homebrew/opt/llvm@17/lib/c++"
llvm@17 is keg-only, which means it was not symlinked into /opt/homebrew,
because this is an alternate version of another formula.
If you need to have llvm@17 first in your PATH, run:
echo 'export PATH="/opt/homebrew/opt/llvm@17/bin:$PATH"' >> /Users/bradc/.bash_profile
For compilers to find llvm@17 you may need to set:
export LDFLAGS="-L/opt/homebrew/opt/llvm@17/lib"
export CPPFLAGS="-I/opt/homebrew/opt/llvm@17/include"
==> Summary
🍺 /opt/homebrew/Cellar/llvm@17/17.0.6: 6,642 files, 1.5GB
==> Running `brew cleanup llvm@17`...
Disable this behaviour by setting HOMEBREW_NO_INSTALL_CLEANUP.
Hide these hints with HOMEBREW_NO_ENV_HINTS (see `man brew`).
At which point things worked again:
$ chpl ~/chapel/test/release/examples/hello.chpl
$ ./hello
Hello, world!
As an update, as we've been discussing this internally today, we're increasingly believing that the problem isn't with the Chapel 2.0.1 formula, but with something related to the upgrade of the default homebrew LLVM from 17 to 18. That said, we're not quite sure what it could be, as we thought that our formula should pin to, and require, LLVM 17 to be installed. We posted a comment on the homebrew PR that introduced LLVM 18, hoping for help: https://github.com/Homebrew/homebrew-core/pull/165206#issuecomment-2125877604
Summary of Problem
Description:
The Homebrew-installed compiler is not starting on MacOS. It has been a while (January 2024) since I last tried using the compiler (v1.33, I think) but it was working then.
Is this a blocking issue with no known work-arounds?
I don't know
Steps to Reproduce
Source Code: See notes in the configuration information.
Compile command:
Execution command:
Associated Future Test(s):
Configuration Information
Output of
chpl --version
:peterj@mini ~ % chpl --version dyld[2395]: Symbol not found: __ZN4llvm16MetadataTracking5trackEPvRNS_8MetadataENS_12PointerUnionIJPNS_15MetadataAsValueEPS2_EEE Referenced from: /opt/homebrew/Cellar/chapel/2.0.1/libexec/bin/darwin-arm64/chpl
Expected in: <0C3379D6-AFA4-3FF3-97DD-387FECFCA3CF> /opt/homebrew/Cellar/llvm/18.1.5/lib/libLLVM.dylib
zsh: abort chpl --version
Output of
$CHPL_HOME/util/printchplenv --anonymize
:peterj@mini ~ % /opt/homebrew/Cellar/chapel/2.0.1/libexec/util/printchplenv machine info: Darwin mini.modem 23.5.0 Darwin Kernel Version 23.5.0: Wed May 1 20:16:51 PDT 2024; root:xnu-10063.121.3~5/RELEASE_ARM64_T8103 arm64 CHPL_HOME: /opt/homebrew/Cellar/chapel/2.0.1/libexec script location: /opt/homebrew/Cellar/chapel/2.0.1/libexec/util/chplenv CHPL_TARGET_PLATFORM: darwin CHPL_TARGET_COMPILER: llvm CHPL_TARGET_ARCH: arm64 CHPL_TARGET_CPU: native CHPL_LOCALE_MODEL: flat CHPL_COMM: none CHPL_TASKS: qthreads CHPL_LAUNCHER: none CHPL_TIMERS: generic CHPL_UNWIND: none CHPL_MEM: jemalloc CHPL_ATOMICS: cstdlib CHPL_GMP: none CHPL_HWLOC: bundled CHPL_RE2: bundled CHPL_LLVM: system CHPL_AUX_FILESYS: none peterj@mini ~ %
Back-end compiler and version, e.g.
gcc --version
orclang --version
:peterj@mini ~ % clang --version Apple clang version 15.0.0 (clang-1500.3.9.4) Target: arm64-apple-darwin23.5.0 Thread model: posix InstalledDir: /Library/Developer/CommandLineTools/usr/bin peterj@mini ~ % gcc --version Apple clang version 15.0.0 (clang-1500.3.9.4) Target: arm64-apple-darwin23.5.0 Thread model: posix InstalledDir: /Library/Developer/CommandLineTools/usr/bin
(For Cray systems only) Output of
module list
: