Macaulay2 / homebrew-tap

The Macaulay2 tap for Homebrew
7 stars 6 forks source link

cddlib issue on Apple M3 Pro #245

Closed crgibbons closed 1 month ago

crgibbons commented 1 month ago

When attempting to install M2 from homebrew, I receive the warning:

==> Pouring topcom-1.1.2_6.ventura.bottle.tar.gz Warning: No available formula with the name "macaulay2/tap/cddlib@0.94m". Did you mean macaulay2/tap/linbox?

To confirm that this was a warning that would prevent M2 from running, I attempted to open M2 from brew --prefix M2/bin/M2 but received the following error (for me, brew --prefix M2 evaluates to /usr/local/opt/macaulay2)

dyld[732]: Library not loaded: /usr/local/opt/factory/lib/libfactory-4.2.1.dylib Referenced from: <158914BC-B9BF-36D2-8E6F-9B7EFD1F1BE0> /usr/local/Cellar/macaulay2/1.19.1_3/bin/M2-binary Reason: tried: '/usr/local/opt/macaulay2/bin/../lib/Macaulay2/lib/libfactory-4.2.1.dylib' (no such file), '/libfactory-4.2.1.dylib' (no such file), '/usr/local/opt/factory/lib/libfactory-4.2.1.dylib' (no such file), '/System/Volumes/Preboot/Cryptexes/OS/usr/local/opt/factory/lib/libfactory-4.2.1.dylib' (no such file), '/usr/local/opt/factory/lib/libfactory-4.2.1.dylib' (no such file), '/usr/local/lib/libfactory-4.2.1.dylib' (no such file), '/usr/lib/libfactory-4.2.1.dylib' (no such file, not in dyld cache), '/usr/local/opt/macaulay2/bin/../lib/Macaulay2/lib/libfactory-4.2.1.dylib' (no such file), '/libfactory-4.2.1.dylib' (no such file), '/usr/local/Cellar/factory/4.4.0/lib/libfactory-4.2.1.dylib' (no such file), '/System/Volumes/Preboot/Cryptexes/OS/usr/local/Cellar/factory/4.4.0/lib/libfactory-4.2.1.dylib' (no such file), '/usr/local/Cellar/factory/4.4.0/lib/libfactory-4.2.1.dylib' (no such file), '/usr/local/lib/libfactory-4.2.1.dylib' (no such file), '/usr/lib/libfactory-4.2.1.dylib' (no such file, not in dyld cache) /usr/local/opt/macaulay2/bin/M2: line 2: 732 Abort trap: 6 DYLD_LIBRARY_PATH=dirname "$0"/../lib/Macaulay2/lib:$DYLD_LIBRARY_PATH dirname "$0"/M2-binary "$@"

More details on the output of brew install Macaulay2/tap/M2 below.

==> Auto-updating Homebrew... Adjust how often this is run with HOMEBREW_AUTO_UPDATE_SECS or disable with HOMEBREW_NO_AUTO_UPDATE. Hide these hints with HOMEBREW_NO_ENV_HINTS (see man brew). macaulay2 1.19.1_3 is already installed but outdated (so it will be upgraded). ==> Downloading https://ghcr.io/v2/macaulay2/tap/macaulay2/manifests/1.24.05_1 Already downloaded: /Users/boss/Library/Caches/Homebrew/downloads/bc6733cc637337a24c7aa4f8444edc30923c8dd811751821a4398b9d8e356c5e--macaulay2-1.24.05_1.bottle_manifest.json ==> Fetching dependencies for macaulay2/tap/macaulay2: macaulay2/tap/topcom ==> Fetching macaulay2/tap/topcom ==> Downloading https://github.com/Macaulay2/homebrew-tap/releases/download/topc Already downloaded: /Users/boss/Library/Caches/Homebrew/downloads/2c1004e3f531c21ec4bb028784d2d11b4f549ca358c53e81c8faad816e72e82e--topcom-1.1.2_6.ventura.bottle.tar.gz ==> Fetching macaulay2/tap/macaulay2 ==> Downloading https://ghcr.io/v2/macaulay2/tap/macaulay2/blobs/sha256:5b821509 Already downloaded: /Users/boss/Library/Caches/Homebrew/downloads/55daf0e4c3a832ad976166151bd5e217e8d2b716da79e5c7beb7a34018fdd0bb--macaulay2--1.24.05_1.ventura.bottle.tar.gz ==> Upgrading macaulay2/tap/m2 1.19.1_3 -> 1.24.05_1 ==> Installing dependencies for macaulay2/tap/macaulay2: macaulay2/tap/topcom ==> Installing macaulay2/tap/macaulay2 dependency: macaulay2/tap/topcom ==> Pouring topcom-1.1.2_6.ventura.bottle.tar.gz Warning: No available formula with the name "macaulay2/tap/cddlib@0.94m". Did you mean macaulay2/tap/linbox?

mahrud commented 1 month ago

I'm confused about why your brew is downloading bottles for ventura rather than arm64_ventura or arm64_sonoma. Maybe we can build topcom locally. This should be quick. Try the following:

brew remove topcom --ignore-dependencies
brew install --build-bottle topcom

(if this failed, try without --build-bottle)

Then try installing (or upgrading) M2 again.

If this doesn't help, could you add the output of brew config and brew doctor?

mahrud commented 1 month ago

Oh, could you also show me the following:

cd $(brew --repo macaulay2/tap)
git show --summary
crgibbons commented 1 month ago

Show and tell from the summary (before trying the fix)

commit 48a482b5667670114352307402e04e7ca8cca34e (HEAD -> main, origin/main, origin/HEAD)
Author: Mahrud Sayrafi <mahrud@umn.edu>
Date:   Fri Oct 4 02:33:02 2024 +0000

    givaro: update 4.2.0_1 bottle.

Reinstalling topcom did the trick. (FWIW, this is a new install, not an upgrade of a previous install)

mahrud commented 1 month ago

Great! Your brew is up to date. I'm not sure what happened ...

FWIW, this is a new install, not an upgrade of a previous install

Is it possible that your laptop had synced everything in the cloud, including the old M2? This is the line that makes me suspect this may have happened:

==> Upgrading macaulay2/tap/m2
1.19.1_3 -> 1.24.05_1

At some point in the past we had a cddlib@0.94m bottle, but now we just use the cddlib bottle that is available via Homebrew's own library.

mahrud commented 1 month ago

Also, the fact that your brew was downloading x86 bottles worries me that for some your brew might be set to run using the emulator instead of using native arm64 binaries. If this wasn't intentional, you might want to look into it.

crgibbons commented 1 month ago

Thanks for that - I will take a look and see what's happening with my homebrew set up!

crgibbons commented 1 month ago

And yes, I think I had gotten synched to the cloud somehow (or via the "smart" transfer from one MacBook on the intel chipset to a new one). I bet that's what's going on with my homebrew, too.

mahrud commented 1 month ago

Okay, that makes sense. I'll close this issue for now but let me know if anything else comes up.

crgibbons commented 1 month ago

@mahrud - I reinstalled brew for the M3 chip and can verify that everything installs smoothly now.

mahrud commented 1 month ago

Excellent, thanks for letting me know!