Macaulay2 / homebrew-tap

The Macaulay2 tap for Homebrew
6 stars 7 forks source link

Trouble installing from homebrew #191

Closed M-Roth-GIT closed 1 year ago

M-Roth-GIT commented 1 year ago

Tried to update Macaulay2 using Homebrew, called with the command brew install Macaulay2/tap/M2.

As far as I can tell the error occurred in building the documentation. A more detailed error message appears below. Running an Apple M1 Pro chip, MacOS Monterey.

==> cmake --build M2/BUILD/build-brew --target install-Macaulay2Doc
Last 15 lines from /Users/mike/Library/Logs/Homebrew/macaulay2/07.cmake:
 -- capturing example results for "Module _ List"                            -- 0.0871383 seconds elapsed
 -- capturing example results for "sheaf(Variety)"                           -- 0.0855257 seconds elapsed
 -- capturing example results for "format"                                   -- 0.0850377 seconds elapsed
 -- capturing example results for "polynomial rings"                         -- 0.0909576 seconds elapsed
 -- making example results for "Grassmannian(ZZ,ZZ)"                         -- 0.513987 seconds elapsed
 -- capturing example results for "matrices to and from modules"             -- 0.0875512 seconds elapsed
 -- capturing example results for "HH^ZZ SheafOfRings"                       -- 0.0866739 seconds elapsed
 -- capturing example results for "quotientRemainder"                        -- 0.0869851 seconds elapsed
 -- capturing example results for "ProjectiveHilbertPolynomial ZZ"           -- 0.0849783 seconds elapsed
currentString:1:1:(3):[2]: error: installPackage: 2 error(s) occurred running examples for package Macaulay2Doc
dmat lu qq PLU
FAILED: Macaulay2/packages/CMakeFiles/install-Macaulay2Doc usr-dist/arm64-Darwin-macOS-12.6.7/lib/Macaulay2/Macaulay2Doc/.installed /tmp/macaulay2-20230725-37968-k6k8kw/M2-release-1.22/M2/BUILD/build-brew/Macaulay2/packages/CMakeFiles/install-Macaulay2Doc /tmp/macaulay2-20230725-37968-k6k8kw/M2-release-1.22/M2/BUILD/build-brew/usr-dist/arm64-Darwin-macOS-12.6.7/lib/Macaulay2/Macaulay2Doc/.installed 
mahrud commented 1 year ago

Could you try brew test gfan? If that gives an error, try the following:

brew uninstall gfan
brew install --build-bottle gfan
brew install M2

Also, I'm surprised that brew decided to compile M2 instead of installing from a bottle. Could you tell me what this gives?

brew unbottled M2
M-Roth-GIT commented 1 year ago

Hello Mahrud Sarrafı —

Thank you for your super-speedy reply! I was only expecting to hear from someone in a week or two. But, of course I would be happy if the problem can be resolved sooner.

" brew test gfan” test produced an error. I am including part of the error message below, although not formatted in the best possible way.

dyld[47080]: Symbol not found: (__ZNKSt5ctypeIcE13_M_widen_initEv) Referenced from: '/opt/homebrew/Cellar/gfan/0.6.2_10/bin/gfan' Expected in: '/usr/lib/libstdc++.6.dylib' Error: macaulay2/tap/gfan: failed An exception occurred within a child process: BuildError: Failed executing: /opt/homebrew/Cellar/gfan/0.6.2_10/bin/gfan _version /opt/homebrew/Library/Homebrew/formula.rb:2702:in block in system' /opt/homebrew/Library/Homebrew/formula.rb:2638:inopen' /opt/homebrew/Library/Homebrew/formula.rb:2638:in system' /opt/homebrew/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/sorbet-runtime-0.5.10461/lib/types/private/methods/call_validation.rb:157:incall'

Uninstalling and installing gfan worked without error.

The command “brew install M2” also worked (!).

After installation, the command “brew unbottled M2” produced the following output.

A 1 mike% brew unbottled M2 ==> Populating dependency tree... ==> :arm64_monterey bottle status macaulay2: unbottled deps: normaliz topcom

I think there still may be some issue with the install. When I run Macaulay 2, it starts up correctly. When I try and use it with a package my student Sasha Zotine has written, it produces a ton of errors, of the following kind :

/opt/homebrew/Cellar/macaulay2/1.22_1/share/Macaulay2/Core/programs.m2:120:29:(1):[67]: error: could not find normaliz /opt/homebrew/Cellar/macaulay2/1.22_1/share/Macaulay2/Core/methods.m2:154:80:(1):[66]: --back trace-- /opt/homebrew/Cellar/macaulay2/1.22_1/share/Macaulay2/Core/option.m2:17:8:(1):[65]: --back trace--

I will ask my colleague Greg Smith if he knows why this is happening.

Thank you very much for your help installing Macaulay 2 using homebrew.

Sincerely,

Mike Roth

On Jul 25, 2023, at 14:42, Mahrud Sayrafi @.***> wrote:

Could you try brew test gfan? If that gives an error, try the following:

brew uninstall gfan brew install --build-bottle gfan brew install M2 Also, I'm surprised that brew decided to compile M2 instead of installing from a bottle. Could you tell me what this gives?

brew unbottled M2 — Reply to this email directly, view it on GitHub https://github.com/Macaulay2/homebrew-tap/issues/191#issuecomment-1650351257, or unsubscribe https://github.com/notifications/unsubscribe-auth/APXZUINP6BFJALX2CERLYDTXSAHRFANCNFSM6AAAAAA2XOSKFA. You are receiving this because you authored the thread.

mahrud commented 1 year ago

No problem! I've seen similar issues before, so it wasn't too difficult to address.

Regarding the Normaliz errors, could you try starting M2 with M2 -q and trying again? If that works, you might need to run uninstallAllPackages() in Macaulay2 first to remove the outdated versions of packages. If that doesn't work, you could also make an issue on the main repository.

Also, if you have the time, there's one thing you could do to help others with the same setup as you not run into the same issue. It would involved "bottling" some brew software and uploading them here. I will then place them in the right place for others to use automatically. Here are how you could do that:

brew uninstall --ignore-dependencies gfan normaliz topcom
brew install --build-bottle gfan
brew bottle --no-rebuild gfan
brew install --build-bottle normaliz
brew bottle --no-rebuild normaliz
brew install --build-bottle topcom
brew bottle --no-rebuild topcom

And then upload the created bottles ending in .tar.gz here or email them to me directly.

M-Roth-GIT commented 1 year ago

Hello Mahrud Sayrafi —

The previous message was missing a location to upload. I tried sending the files via email, but gmail complained. However I am happy to upload them wherever they should be uploaded.

I could start M2 with M2 -q, but when I loaded the package I got similar error messages.

i2 : load "ToricHigherDirectImages.m2" /opt/homebrew/Cellar/macaulay2/1.22_1/share/Macaulay2/Normaliz.m2:111:17:(2):[51]: error: could not find normaliz /opt/homebrew/Cellar/macaulay2/1.22_1/share/Macaulay2/NormalToricVarieties.m2:18:1:(3):[20]: --entering debugger (type help to see debugger commands) /opt/homebrew/Cellar/macaulay2/1.22_1/share/Macaulay2/NormalToricVarieties.m2:18:0-31:21: --source code: newPackage( "NormalToricVarieties", AuxiliaryFiles => true, Version => "1.9", Date => "31 May 2020", Authors => {{ Name => "Gregory G. Smith", Email => @. @.>", HomePage => "http://www.mast.queensu.ca/~ggsmith http://www.mast.queensu.ca/~ggsmith"}}, Headline => "routines for working with normal toric varieties and related objects", Keywords => {"Toric Geometry"}, PackageExports => {"Polyhedra", "Schubert2"}, PackageImports => {"FourierMotzkin","Normaliz","LLLBases"}, DebuggingMode => false )

I don’t understand the error, since “Normalize.m2” is in the directory "/opt/homebrew/Cellar/macaulay2/1.22_1/share/Macaulay2”.

Very mysterious!

Thank you again for your help. I hope that the bottled versions will be useful.

Sincerely,

Mike

mahrud commented 1 year ago

That's strange! What happens if you type normaliz --version directly in a terminal?

(I will send you an email about the bottles in a moment)

M-Roth-GIT commented 1 year ago

Well, I am not sure where to type it!

If I type it in at the command line, then I get a message that there is no such command. If I type it in while running Macaulay, I get the message that “normaliz” is a symbol.

I don’t want to take up your valuable time debugging. Maybe a good next step is for me to ask Greg Smith about it when I see him on Thursday.

Sincerely,

Mike

On Jul 25, 2023, at 16:54, Mahrud Sayrafi @.***> wrote:

That's strange! What happens if you type normaliz --version directly in a terminal?

(I will send you an email about the bottles in a moment)

— Reply to this email directly, view it on GitHub https://github.com/Macaulay2/homebrew-tap/issues/191#issuecomment-1650546702, or unsubscribe https://github.com/notifications/unsubscribe-auth/APXZUIO63FR2A5EQQOWXIRLXSAXCFANCNFSM6AAAAAA2XOSKFA. You are receiving this because you authored the thread.

mahrud commented 1 year ago

Sounds like a good next step! I'll close this issue for now.

(ps: if I had to give another guess, I'd say perhaps the path to brew binary files is not in your path, which means you might need to add something like export PATH="/opt/homebrew/bin:$PATH" to .zshrc or something like that)

M-Roth-GIT commented 1 year ago

Hi Marhud —

I am sorry to clutter your inbox with distractions. I am writing to let you know (in case someone else has this problem) that your suggestion fixed everything.

For some reason, I had decided that "/opt/homebrew/Cellar/macaulay2/1.22_1/bin/“ was the right path to use to call the installed version of Macaulay 2 (I am not sure how I arrived at that conclusion).  

I also tried "brew --prefix M2” to see which directory I should use, and it returned "/opt/homebrew/opt/macaulay2”. that did not really work either (even after adding “/bin”).

But, your suggestion, "/opt/homebrew/bin” fixed everything. Macaulay 2 seems to be working correctly, and does not generate errors loading, or running Sasha’s package.

Thanks again for fixing everything!

Sincerely,

Mike