Closed GMS103 closed 1 year ago
In fact, after cd /usr/local ; ln -s /opt/homebrew/lib lib
, everything works: the end of brew install apaffenholz/polymake/polymake
gives this:
==> ./configure --prefix=/opt/homebrew/Cellar/polymake/4.5 --without-bliss --without-java --without-scip --without-soplex --without-singular --with-brew=bottle
==> ninja -C build/Opt install
==> Caveats
Note: This version comes without support for SVG export.
If you had any other version of polymake installed on your Mac
(both previous versions installed via Homebrew or any other installations)
you must start polymake once with
"polymake --reconfigure"
to remove the configuration of SVG support from your local
polymake setup. Afterwards you can use "polymake" as usual.
==> Summary
🍺 /opt/homebrew/Cellar/polymake/4.5: 3,355 files, 156.0MB, built in 11 minutes 34 seconds
==> Running `brew cleanup polymake`...
Disable this behaviour by setting HOMEBREW_NO_INSTALL_CLEANUP.
Hide these hints with HOMEBREW_NO_ENV_HINTS (see `man brew`).
$
@apaffenholz The brew prefix is hardcoded in https://github.com/apaffenholz/homebrew-polymake/blob/master/Formula/polymake.rb#L638, that should probably be corrected
Thanks for testing on M1.
I have replaced the fixed path with the corresponding env variable from homebrew. This works on intel macs. I don't have a mac with an M1, so I can't test on one.
Thanks for the quick reaction.
Nothing has changed for M1.
In fact, the file
homebrew-polymake-polymake-4.6/Formula/polymake.rb
in
https://github.com/apaffenholz/homebrew-polymake/releases/tag/polymake-4.6
still has /usr/local
.
(But perhaps I should do something else than brew install apaffenholz/polymake/polymake
?)
True. brew has a nice command that uploads bottles and creates the corresponding commit and release in one go, but the source packages are apparently from github, so the sources must be commited beforehand to create the correct packages. Never thought about this before. Now the sources should be correct.
But brew install apaffenholz/polymake/polymake
should clone the repo (by default into /usr/local/Homebrew/Library/Taps/apaffenholz/
, at least on intel), and use the formula in the repo. Which contained the env variable instead of the fixed path already after my first commit of the new bottles. I don't know how you ended up with the sources in https://github.com/apaffenholz/homebrew-polymake/releases/tag/polymake-4.6
.
Sorry, this won't work either. And I could have realized this much earlier by reading the output you provided more carefully.
The path /usr/local
is hard coded already into the polymake sources. We didn't bother to make this a variable that can be provided by the user or that is somehow deduced from the system, as, at least for homebrew on intel macs, there are several packages that polymake depends on that can only be installed into the default location for homebrew. Which is /usr/local
. So there was no point for us to spend time to be more flexible.
This has been there for such a long time that I completely forgot about it.
Is /opt/homebrew/
the "default" prefix on macs with M1, or on MacOS 12? In that case we need to fix this in polymake and changing the homebrew formula won't help. This will take a while.
All right, that makes sense. Yes, in an M1 Mac, you have
/opt/homebrew/.dockerignore
/opt/homebrew/.editorconfig
/opt/homebrew/.git
/opt/homebrew/.github
/opt/homebrew/.gitignore
/opt/homebrew/.shellcheckrc
/opt/homebrew/.sublime
/opt/homebrew/.vale.ini
/opt/homebrew/.vscode
/opt/homebrew/CHANGELOG.md
/opt/homebrew/CONTRIBUTING.md
/opt/homebrew/Caskroom
/opt/homebrew/Cellar
/opt/homebrew/Dockerfile
/opt/homebrew/Frameworks
/opt/homebrew/LICENSE.txt
/opt/homebrew/Library
/opt/homebrew/README.md
/opt/homebrew/SECURITY.md
/opt/homebrew/bin
/opt/homebrew/completions
/opt/homebrew/docs
/opt/homebrew/etc
/opt/homebrew/include
/opt/homebrew/lib
/opt/homebrew/manpages
/opt/homebrew/opt
/opt/homebrew/sbin
/opt/homebrew/share
/opt/homebrew/var
while in /usr/local
there is only (in my case)
/usr/local/bin
/usr/local/share
/usr/local/texlive
Yes, /opt/homebrew
is the default on M1 for all macOS versions,
and /usr/local
is still the default on x86_64 for all macOS versions.
I am available to test whenever you are done with the updating.
As there aren't any M1-bottles for polymake the formula would compile the sources anyway. So you could instead use the polymake sources from the polymake repo instead. Instructions are here (written for the previous version). The configure
command for polymake has an option --with-brew=<path>
where you can provide /opt/homebrew
. That is probably not tested very thoroughly.
Of course in Sage we also have build scripts for polymake; using the existing homebrew bottle is merely a convenience for users.
I will leave a comment here once I (think I) have fixed this. I won't be able to test myself.
As there aren't any M1-bottles for polymake the formula would compile the sources anyway. So you could instead use the polymake sources from the polymake repo instead.
As Matthias said, I do not really need to compile polymake (I was trying to build SageMath). But I shall test the formula when it is ready and let you know.
I have the same issue too.
Hi, is there any progress on this? Perhaps it is above but I couldn't quite follow.
Not really. We still cannot provide M1/M2 bottles or test the formula.
Hi, I'm trying to install polymake on my apple M1 as well (with the hope to get it to play nicely with Macaulay2 on apple M1's). The location for brew is /opt/homebrew, not /usr/local, as mentioned above. Is there anything I can test?
Here is the error I get when I try using brew to install polymake:
==> ./configure --prefix=/opt/homebrew/Cellar/polymake/4.6 --without-bliss --without-java --without-scip --without
Last 15 lines from /Users/mike/Library/Logs/Homebrew/polymake/219.configure:
2023-03-10 11:13:32 +0000
./configure
--prefix=/opt/homebrew/Cellar/polymake/4.6
--without-bliss
--without-java
--without-scip
--without-soplex
--without-singular
--with-brew=bottle
checking C++ compiler ... ok (clang++ is Apple CLANG (roughly 10.0) from Xcode 14.0.0)
checking C++ library ... ok (libc++ 13000, C++ 201402)
checking for package manager ... Homebrew installation seems corrupt: no shared libraries found in /usr/local/lib
There is essentially nothing in /usr/local/lib
, all libraries are in /opt/homebew/lib
Also, I would rather be installing the latest version of polymake (4.9?).
@apaffenholz @lkastner I would be willing to try to help get it working on apple M1 macs
This project is currently more or less unmaintained. I have no recent Mac, and also no Mac with an M1. So I have no posibility to reproduce any errors.
I can update the formula for polymake 4.9 . This will, however, most likely not fix the wrong libdir.
This location is set by homebrew in the variable libexec
, and the build formula for polymake uses that variable for compilation and installation. /usr/local/lib
ist the correct choice for intel Macs, while /opt/homebrew/lib
is the corresponding location on Macs with an M1. I have no idea why homebrew should provide the wrong one.
This should be fixed now.
The error was in the configuration of polymake. With the build options defined in the formula the configuration set the homebrew base path to /usr/local
without checking.
Until the next release of polymake the polymake configure script is patched in the formula.
It seems to me that
/opt/homebrew/lib
should be picked instead of/usr/local/lib
for the native version of homebrew on Apple M1: