Install with Homebrew

Questions and problems about using polymake go here.
misha
Posts: 2
Joined: 21 Apr 2024, 21:41

Install with Homebrew

Postby misha » 21 Apr 2024, 21:45

I try to install polymake 4.11 using Homebrew tap with perl version 5.38, but I cannot load polymake and get the following error message. My MacOS is Sonoma 14.4.1

Code: Select all

Can't locate loadable object for module Polymake::Ext in @INC (@INC contains: /opt/homebrew/Cellar/polymake/4.11/share/polymake/perllib /opt/homebrew/Cellar/polymake/4.11/lib/polymake/perlx /opt/homebrew/Cellar/polymake/4.11/libexec/perl5/lib/perl5/darwin-thread-multi-2level /opt/homebrew/Cellar/polymake/4.11/libexec/perl5/lib/perl5 /opt/homebrew/opt/perl/lib/perl5/site_perl/5.38/darwin-thread-multi-2level /opt/homebrew/opt/perl/lib/perl5/site_perl/5.38 /opt/homebrew/opt/perl/lib/perl5/5.38/darwin-thread-multi-2level /opt/homebrew/opt/perl/lib/perl5/5.38 /opt/homebrew/lib/perl5/site_perl/5.38) at /opt/homebrew/Cellar/polymake/4.11/share/polymake/perllib/Polymake/Namespaces.pm line 18. Compilation failed in require at /opt/homebrew/Cellar/polymake/4.11/share/polymake/perllib/Polymake/Namespaces.pm line 18. BEGIN failed--compilation aborted at /opt/homebrew/Cellar/polymake/4.11/share/polymake/perllib/Polymake/Namespaces.pm line 18. Compilation failed in require at /opt/homebrew/Cellar/polymake/4.11/share/polymake/perllib/Polymake.pm line 29. BEGIN failed--compilation aborted at /opt/homebrew/Cellar/polymake/4.11/share/polymake/perllib/Polymake.pm line 29. Compilation failed in require at /opt/homebrew/Cellar/polymake/4.11/libexec/perl5/bin/polymake line 156. BEGIN failed--compilation aborted at /opt/homebrew/Cellar/polymake/4.11/libexec/perl5/bin/polymake line 156.
What should I do? I try to uninstall --force and reinstall, but keep getting the same error message as above.

Thanks for helping in advance!

misha
Posts: 2
Joined: 21 Apr 2024, 21:41

install using binary

Postby misha » 22 Apr 2024, 22:15

I realized that Polymake is not compatible with Perl 5.38.2, so I tried to install perlbrew and perl 5.36.1 and switch to this older version. Then when I "./configure", I got this

Code: Select all

checking C++ compiler ... ok (g++ is Apple CLANG (roughly 10.0) from Xcode 15.0.0) checking C++ library ... ok (libc++ 170006, C++ 201402) checking for package manager ... no package manager specified determining architecture ... ok (darwin.arm64) determining compiler flags ... ok CFLAGS= CXXFLAGS= -std=c++14 -Wno-logical-op-parentheses -Wno-shift-op-parentheses -Wno-mismatched-tags -Wno-unused-local-typedef -Wno-error=unneeded-internal-declaration -Wshadow -Wconversion -Wno-sign-conversion -Wzero-as-null-pointer-constant LDFLAGS= checking gmp installation ... Could not compile a test program checking for the GNU Multiprecision Library (GMP). The most probable reasons are that the library is installed at a non-standard location, lacking developer's subpackage or missing at all. Please refer to the installation instructions at http://www.polymake.org/doku.php/howto/install. The complete error log follows: g++ -std=c++14 -Wno-logical-op-parentheses -Wno-shift-op-parentheses -Wno-mismatched-tags -Wno-unused-local-typedef -Wno-error=unneeded-internal-declaration -Wshadow -Wconversion -Wno-sign-conversion -Wzero-as-null-pointer-constant -o /var/folders/5r/bp47lxys6kb2h5vb6dqn3dyw0000gn/T//polymake_2424_configure /var/folders/5r/bp47lxys6kb2h5vb6dqn3dyw0000gn/T//polymake_2424_configure.cc -lgmp -lc++ /var/folders/5r/bp47lxys6kb2h5vb6dqn3dyw0000gn/T//polymake_2424_configure.cc:2:10: fatal error: 'gmp.h' file not found #include <gmp.h> ^~~~~~~ 1 error generated.
I installed gmp via Homebrew in /opt/homebrew and even if I exported /opt/homebrew in the PATH variable in the .profile in my home folder, Polymake in my home folder is still unable to find gmp.

Is there a way to let it find gmp installed by homebrew? =

paffenholz
Developer
Posts: 212
Joined: 24 Dec 2010, 13:47

Re: Install with Homebrew

Postby paffenholz » 23 Apr 2024, 13:08

The homebrew tap uses the perl from homebrew, so this should work, if that perl is the one in your $PATH in the terminal you start polymake in.

To compile from scratch on Silicon Macs currently requires the option "--with-brew=/opt/homebrew" for configure. This is currently not correctly detected in the configuration script, and will be fixed with the next version of polymake. If you have the latest MacOS version and XCode, then you probably also have to edit the file build/config.ninja and remove "-L/usr/local/lib" from LDFLAGS and add "-Wno-unused" to CFLAGS and CXXFLAGS (due to some older code bundled with polymake that newer clang versions now complain about).

Andreas


Return to “Helpdesk”