Macaulay2 / homebrew-tap

The Macaulay2 tap for Homebrew
6 stars 7 forks source link

build issue on macos ventura after brew update #200

Closed mikestillman closed 7 months ago

mikestillman commented 9 months ago

@mahrud, one person at KTH just upgraded homebrew, and M2 stopped working. Doing brew update, brew upgrade macaulay2 didn't work. Then I uninstalled macaulay2, and tried installing as below. Here is the error. At first, It appeared like it could be related to libfactory and singular, but now we just get the following error (she is working on mac m2, on ventura): Any ideas what this could be? (I thought there was a list of things to try on the macaulay2 homebrew site, but I didn't see those). What is the best way to upgrade to a newer version of macaulay2?

alsat@alsat-mbp ~ % brew install macaulay2
==> Downloading https://formulae.brew.sh/api/formula.jws.json
#################################################################################### 100.0%
==> Downloading https://formulae.brew.sh/api/cask.jws.json
#################################################################################### 100.0%
==> Fetching macaulay2/tap/macaulay2
==> Downloading https://github.com/Macaulay2/M2/commit/84c7b9f67bfdb6b821e24546ab2dd4e2455d
#################################################################################### 100.0%
==> Downloading https://github.com/Macaulay2/M2/archive/refs/tags/release-1.22.tar.gz
Already downloaded: /Users/alsat/Library/Caches/Homebrew/downloads/62af3a24e20792277dc5d0a8fcfedd4099bd87dc9c76dae1f8e6825433192632--M2-release-1.22.tar.gz
==> Installing macaulay2 from macaulay2/tap
==> Patching
==> Applying 84c7b9f67bfdb6b821e24546ab2dd4e2455dfdbf.patch
patching file 'M2/Macaulay2/e/aring-gf-flint-big.hpp'
patching file 'M2/Macaulay2/e/aring-gf-flint.hpp'
patching file 'M2/Macaulay2/e/aring-qq-flint.hpp'
patching file 'M2/Macaulay2/e/aring-zz-flint.hpp'
patching file 'M2/Macaulay2/e/aring-zzp-flint.hpp'
patching file 'M2/Macaulay2/e/dmat-gf-flint-big.hpp'
patching file 'M2/Macaulay2/e/dmat-gf-flint.hpp'
patching file 'M2/Macaulay2/e/dmat-lu-inplace.hpp'
patching file 'M2/Macaulay2/e/dmat-lu-zzp-flint.hpp'
patching file 'M2/Macaulay2/e/dmat-qq-flint.hpp'
patching file 'M2/Macaulay2/e/dmat-zz-flint.hpp'
patching file 'M2/Macaulay2/e/dmat-zzp-flint.hpp'
patching file 'M2/Macaulay2/e/interface/flint.cpp'
patching file 'M2/Macaulay2/e/interface/ring.cpp'
patching file 'M2/Macaulay2/e/mat-linalg.hpp'
==> git clone https://github.com/Macaulay2/M2-emacs.git M2/Macaulay2/editors/emacs --branch
==> git clone https://github.com/Macaulay2/memtailor.git M2/submodules/memtailor
==> git clone https://github.com/Macaulay2/mathic.git M2/submodules/mathic
==> git clone https://github.com/Macaulay2/mathicgb.git M2/submodules/mathicgb
==> cmake -GNinja -SM2 -BM2/BUILD/build-brew -DBUILD_NATIVE=OFF -DCMAKE_PREFIX_PATH=/opt/ho
==> cmake --build M2/BUILD/build-brew --target M2-core M2-emacs M2-highlightjs
==> cmake --build M2/BUILD/build-brew --target install-Macaulay2Doc
Last 15 lines from /Users/alsat/Library/Logs/Homebrew/macaulay2/07.cmake:
 -- capturing example results for "Module _ List"                            -- 0.0618183 seconds elapsed
 -- capturing example results for "sheaf(Variety)"                           -- 0.0599823 seconds elapsed
 -- capturing example results for "format"                                   -- 0.0593311 seconds elapsed
 -- capturing example results for "polynomial rings"                         -- 0.0661276 seconds elapsed
 -- making example results for "Grassmannian(ZZ,ZZ)"                         -- 0.468875 seconds elapsed
 -- capturing example results for "matrices to and from modules"             -- 0.06267 seconds elapsed
 -- capturing example results for "HH^ZZ SheafOfRings"                       -- 0.0618913 seconds elapsed
 -- capturing example results for "quotientRemainder"                        -- 0.0628503 seconds elapsed
 -- capturing example results for "ProjectiveHilbertPolynomial ZZ"           -- 0.0596169 seconds elapsed
currentString:1:1:(3):[2]: error: installPackage: 14 error(s) occurred running examples for package Macaulay2Doc
dmat lu qq PLU
FAILED: Macaulay2/packages/CMakeFiles/install-Macaulay2Doc usr-dist/arm64-Darwin-macOS-13.6.1/lib/Macaulay2/Macaulay2Doc/.installed /tmp/macaulay2-20231204-1387-1lklp71/M2-release-1.22/M2/BUILD/build-brew/Macaulay2/packages/CMakeFiles/install-Macaulay2Doc /tmp/macaulay2-20231204-1387-1lklp71/M2-release-1.22/M2/BUILD/build-brew/usr-dist/arm64-Darwin-macOS-13.6.1/lib/Macaulay2/Macaulay2Doc/.installed 
cd /tmp/macaulay2-20231204-1387-1lklp71/M2-release-1.22/M2/BUILD/build-brew/Macaulay2/packages && /tmp/macaulay2-20231204-1387-1lklp71/M2-release-1.22/M2/BUILD/build-brew/usr-dist/arm64-Darwin-macOS-13.6.1/bin/M2 -q --stop --silent --no-preload --no-threads -e errorDepth=3 -e debugLevel=0 -e "installPackage(\"Macaulay2Doc\", Verbose => false, RerunExamples => false, CheckDocumentation => true, IgnoreExampleErrors => false, RemakeAllDocumentation => false, InstallPrefix => \"/tmp/macaulay2-20231204-1387-1lklp71/M2-release-1.22/M2/BUILD/build-brew/usr-dist/\", UserMode => false, SeparateExec => true, DebuggingMode => true)" -e "\"info-\"|\"Macaulay2Doc\" << Macaulay2Doc#\"test number\" << close" -e "exit 0" && gzip -nf9 /tmp/macaulay2-20231204-1387-1lklp71/M2-release-1.22/M2/BUILD/build-brew/usr-dist/common/share/info/Macaulay2Doc.info
ninja: build stopped: subcommand failed.
mahrud commented 9 months ago

See https://github.com/Macaulay2/homebrew-tap/issues/197 and https://github.com/Macaulay2/M2/issues/2992.

As a temporary fix until this is fixed in the upstream, you can install M2 with brew install M2 --HEAD, which builds the upstream version (i.e. more recent than 1.22) but does not generate package documentation, so you'll have to use online documentation.

Originally posted by @mahrud in https://github.com/Macaulay2/homebrew-tap/issues/197#issuecomment-1806935224

mahrud commented 9 months ago

Ah, I just realized that this may be different:

currentString:1:1:(3):[2]: error: installPackage: 14 error(s) occurred running examples for package Macaulay2Doc

Could you run:

brew install --build-bottle --debug --keep-tmp M2

Once it fails, could you test me which were the tests that failed and ideally attach the error logs here?

mahrud commented 9 months ago

It seems that M2 can't find gfan or normaliz during the build. Could you run:

brew test gfan
normaliz --version

It could be that the path isn't set, in which case maybe you need to run something like this to add Homebrew to your PATH:

(echo; echo 'eval "$(/opt/homebrew/bin/brew shellenv)"') >> ~/.zprofile
eval "$(/opt/homebrew/bin/brew shellenv)"

After those, try to install M2 again:

brew install --build-bottle M2

If it succeeds this time, it would be great if you could bottle M2 for others using your macOS version:

brew bottle --no-rebuild
tom111 commented 9 months ago

I also cannot build M2 via homebrew at the moment. It fails during "install packages". Could it be that some ulimit is too low? Here's what I found in ~/Library/Logs/Homebrew/macaulay2/08.cmake. What is "Error 24"?

ulimit -c unlimited; ulimit -t 700; ulimit -s 8192; ulimit -n 512;  cd /private/tmp/M2-39235-0/72-rundir/; GC_MAXIMUM_HEAP_SIZE=400M "/private/tmp/macaulay2-20231209-65681-6x6gs3/M2-release-1.22/M2/BUILD/build-brew/usr-dist/arm64-Darwin-macOS-14.1.2/bin/M2-binary" -q --no-randomize --no-readline --silent --stop --print-width 77 -e 'needsPackage("MultiprojectiveVarieties",Reload=>true,FileName=>"/private/tmp/macaulay2-20231209-65681-6x6gs3/M2-release-1.22/M2/Macaulay2/packages/MultiprojectiveVarieties.m2")' <"/private/tmp/M2-39235-0/0_image_lp__Multirational__Map_rp.m2" >>"/private/tmp/macaulay2-20231209-65681-6x6gs3/M2-release-1.22/M2/BUILD/build-brew/usr-dist/common/share/doc/Macaulay2/MultiprojectiveVarieties/example-output/_image_lp__Multirational__Map_rp.errors" 2>&1
/private/tmp/macaulay2-20231209-65681-6x6gs3/M2-release-1.22/M2/BUILD/build-brew/usr-dist/common/share/doc/Macaulay2/MultiprojectiveVarieties/example-output/_image_lp__Multirational__Map_rp.errors:0:1:(3):[12]: (output file) error: Macaulay2 killed by signal 24
/private/tmp/M2-39235-0/0_image_lp__Multirational__Map_rp.m2:0:1: (input file)
M2: *** Error 24
 -- 1.81094 seconds elapsed
 -- making example results for "RAT MultiprojectiveVariety"                  -- 0.665852 seconds elapsed
 -- making example results for "degreeSequence"                              -- 0.754284 seconds elapsed
 -- making example results for "trim(MultirationalMap)"                      -- 0.777967 seconds elapsed
 -- making example results for "WeightedProjectiveVariety"                   -- 0.604296 seconds elapsed
 -- making example results for "tangentialChowForm(EmbeddedProjectiveVariety,ZZ)" -- 0.625526 seconds elapsed
 -- making example results for "MultiprojectiveVariety + MultiprojectiveVariety" -- 0.648169 seconds elapsed
 -- making example results for "isMember(MultirationalMap,RAT)"              -- 0.635132 seconds elapsed
 -- making example results for "tangentCone(EmbeddedProjectiveVariety,EmbeddedProjectiveVariety)" -- 0.706122 seconds elapsed
 -- making example results for "⋂"                                         -- 0.711955 seconds elapsed
 -- making example results for "⋃"                                         -- 1.07734 seconds elapsed
 -- making example results for "Hom(MultiprojectiveVariety,MultiprojectiveVariety)" -- 0.616724 seconds elapsed
 -- making example results for "MultiprojectiveVariety == MultiprojectiveVariety" -- 0.641787 seconds elapsed
 -- making example results for "EmbeddedProjectiveVariety ++ EmbeddedProjectiveVariety" -- 0.730392 seconds elapsed
 -- making example results for "tangentSpace"                                -- 0.633372 seconds elapsed
 -- making example results for "decompose(MultiprojectiveVariety)"           -- 0.660925 seconds elapsed
 -- making example results for "coneOfLines"                                 -- 0.738169 seconds elapsed
 -- making example results for "super(MultirationalMap)"                     -- 0.633578 seconds elapsed
 -- making example results for "show(MultirationalMap)"                      -- 0.79879 seconds elapsed
 -- making example results for "projectiveVariety(List,Ring)"                -- 0.602779 seconds elapsed
 -- making example results for "multidegree(ZZ,MultirationalMap)"            -- 0.872258 seconds elapsed
 -- making example results for "toRationalMap"                               -- 0.588748 seconds elapsed
 -- making example results for "MultiprojectiveVariety * MultiprojectiveVariety" -- 0.636005 seconds elapsed
 -- making example results for "coefficientRing(MultiprojectiveVariety)"     -- 0.623107 seconds elapsed
 -- making example results for "singularLocus(MultiprojectiveVariety)"       -- 0.690713 seconds elapsed
 -- making example results for "degree(MultirationalMap)"                    -- 1.03447 seconds elapsed
 -- making example results for "forceImage(MultirationalMap,MultiprojectiveVariety)" -- 0.644059 seconds elapsed
 -- making example results for "graph(MultirationalMap)"                     -- 0.727692 seconds elapsed
 -- making example results for "MultirationalMap ^** MultiprojectiveVariety" -- 2.1682 seconds elapsed
 -- making example results for "GG"                                          -- 0.556728 seconds elapsed
 -- making example results for "MultiprojectiveVariety \\\\ MultiprojectiveVariety" -- 0.621614 seconds elapsed
 -- making example results for "EmbeddedProjectiveVariety !"                 -- 1.42442 seconds elapsed
 -- making example results for "permute(MultiprojectiveVariety,List)"        -- 1.10434 seconds elapsed
 -- making example results for "shortcuts"                                   -- 0.900702 seconds elapsed
 -- making example results for "segreEmbedding"                              -- 0.781483 seconds elapsed
 -- making example results for "degrees(MultiprojectiveVariety)"             -- 0.673048 seconds elapsed
 -- making example results for "RAT List"                                    -- 0.649951 seconds elapsed
 -- making example results for "degree(MultirationalMap,Option)"             -- 2.67616 seconds elapsed
 -- making example results for "conormalVariety(EmbeddedProjectiveVariety)"  -- 0.807571 seconds elapsed
 -- making example results for "sectionalGenus"                              -- 0.584026 seconds elapsed
 -- making example results for "rationalMap(MultiprojectiveVariety,Tally)"   -- 0.717858 seconds elapsed
currentString:1:1:(3):[2]: error: installPackage: 1 error(s) occurred running examples for package MultiprojectiveVarieties
ninja: build stopped: subcommand failed.
mahrud commented 9 months ago

No idea what "Error 24" is coming from, but:

mahrud commented 7 months ago

This is resolved now that a bottle for arm64 has been added. We'll deal with the same issue for 1.23 when it is released ...