Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Brewing polymake on Apple Silicon / M1 / arm #2

Closed
tom111 opened this issue Jan 16, 2021 · 6 comments
Closed

Brewing polymake on Apple Silicon / M1 / arm #2

tom111 opened this issue Jan 16, 2021 · 6 comments

Comments

@tom111
Copy link

tom111 commented Jan 16, 2021

Naively trying to build the polymake formula on an M1 Mac Mini with only arm Homebrew results in this:

==> yes 'n' | perl Makefile.PL INSTALL_BASE=/opt/homebrew/Cellar/polymake/4.3/libexec/perl5
Last 15 lines from /Users/tom/Library/Logs/Homebrew/polymake/215.perl5:
2021-01-16 13:28:05 +0100

yes 'n' | perl Makefile.PL INSTALL_BASE=/opt/homebrew/Cellar/polymake/4.3/libexec/perl5

Do you want to run external tests?
These tests *will* *fail* if you do not have network connectivity. [n] *** Found LibreSSL-2.8.3 installed in /usr
*** Be sure to use the same compiler and options to compile your OpenSSL, perl,
    and Net::SSLeay. Mixing and matching compilers is not supported.
Checking if your kit is complete...
Looks good
WARNING: /opt/homebrew/opt/perl/bin/perl is loading libcrypto in an unsafe way
sh: line 1: 94293 Broken pipe: 13         yes 'n'
     94294 Abort trap: 6           | perl Makefile.PL INSTALL_BASE=/opt/homebrew/Cellar/polymake/4.3/libexec/perl5

It does not really look like an architecture issue, but I don't know perl well enough to judge that actually.

@apaffenholz
Copy link
Owner

I don't think it's a perl problem. It might be related to the line above complaining about libcrypto, which may not work in combination with the perl coming from brew.

Maybe this is fixed with the version of the Formula in the branch "amd64_big_sur", which additionally installs the brew-version of openssl and tells Net::SSLeay to use this version instead of the system one. So possibly
cd /usr/local/Homebrew/Library/Taps/apaffenholz/homebrew-polymake
git checkout amd64_big_sur
brew install polymake
solves this.

I have no way to test this, and I am also not too confident. There might also be more failures later in the installation.

@tom111
Copy link
Author

tom111 commented Jan 17, 2021

It's the same with the patch on the amd64_big_sur branch.

[ It's no big deal. I can wait until you get your hands on an M1 or I'll investigate myself later. Thanks. ]

@apaffenholz
Copy link
Owner

My bad. Maybe. I got the brew name of macs with M1 wrong. Its "arm64_big_sur" and not "amd64_big_sur".

I fixed the name, so you may try again. Still no guarantee that this will work and/or fix all problems.

@tom111
Copy link
Author

tom111 commented Jan 17, 2021

OK, the error is still the same. I'm also not sure if it picked up openssl@1.1 because there is still the same message:
*** Found LibreSSL-2.8.3 installed in /usr ***

@apaffenholz
Copy link
Owner

apaffenholz commented Jan 17, 2021

I checked the formula on intel macs: openssl is already a prerquisite of python@3.9, which is one of ninja, and this is a prerequisite of polymake. So openssl is always installed for polymake, and prior to compiling the perl modules.

On intel with Big Sur the Makefile for Net::SSLeay also picks up this version of libcrypto.dylib even without setting OPENSSL_PREFIX. So it uses this openssl for all versions of mac os. On the other hand, if I force Net::SSLeay to use the system version it ends with the exact same error on my intel as on your M1.

As the correct openssl is not even picked up on your machine if OPENSSL_PREFIX is set for Net::SSLeay I assume that something went wrong with the installation of openssl. I can't check, but convincing Net::SLLeay to use the brew version should fix the error. You may check the folder /usr/local/opt/openssl on your machine, or try to configure and build the module Net::SSLeay independently. Maybe this gives a hint.

@apaffenholz
Copy link
Owner

The formula now does work also for arm processors. Checked on MacOS 14.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants