Installing polymake with macOS12 Monterey

Discussions on installation issues go here.
theo
Posts: 4
Joined: 11 Feb 2022, 22:07

Installing polymake with macOS12 Monterey

Postby theo » 11 Feb 2022, 22:40

I'm having problems installing polymake with an intel chip mac running macOS12 Monterey (I had a previous installation that seemed to be working, but some commands that called perl/c++ were not functional). I tried following the installation instructions here

https://polymake.org/doku.php/install/macos

(with the latest release 4.6) and have run into some snags. After some initial setbacks (where I couldn't install Net::SSLeay), I uninstalled and reinstalled xcode, and tried to begin anew. The next problem arose in trying to install ZEFRAM/Module-Runtime-0.013.tar.gz. Here's the log file output from that:

cpanm (App::cpanminus) 1.7045 on perl 5.034000 built for darwin-thread-multi-2level
Work directory is /Users/****/.cpanm/work/1644610830.3920
You have make /usr/bin/make
You have /usr/bin/curl
You have /usr/bin/tar: bsdtar 3.5.1 - libarchive 3.5.1 zlib/1.2.11 liblzma/5.0.5 bz2lib/1.0.8
You have /usr/bin/unzip
--> Working on ZEFRAM/Module-Runtime-0.013.tar.gz
Fetching http://www.cpan.org/authors/id/Z/ZE/ZEF ... 013.tar.gz
-> OK
Unpacking Module-Runtime-0.013.tar.gz
Entering Module-Runtime-0.013
Checking configure dependencies from META.json
Checking if you have warnings 0 ... Yes (1.51)
Checking if you have Module::Build 0.38 ... Yes (0.4231)
Checking if you have ExtUtils::Install 1.46 ... Yes (2.20)
Checking if you have strict 0 ... Yes (1.12)
Configuring Module-Runtime-0.013
Running Build.PL
Created MYMETA.yml and MYMETA.json
Creating new 'Build' script for 'Module-Runtime' version '0.013'
-> OK
Checking dependencies from MYMETA.json ...
Checking if you have Test::More 0 ... Yes (1.302183)
Checking if you have strict 0 ... Yes (1.12)
Checking if you have warnings 0 ... Yes (1.51)
Checking if you have Module::Build 0 ... Yes (0.4231)
Building and testing Module-Runtime-0.013
Building Module-Runtime
t/cmn.t ........... ok
t/dependency.t .... ok
t/import_error.t .. ok
t/ivmn.t .......... ok
t/ivms.t .......... ok
t/mnf.t ........... ok
t/pod_cvg.t ....... skipped: Test::Pod::Coverage not available
t/pod_syn.t ....... skipped: Test::Pod not available
t/rm.t ............ ok

# Failed test at t/taint.t line 16.
# ''
# doesn't match '(?^:\AInsecure dependency )'

# Failed test at t/taint.t line 18.
# ''
# doesn't match '(?^:\AInsecure dependency )'

# Failed test at t/taint.t line 20.
# ''
# doesn't match '(?^:\AInsecure dependency )'
# Looks like you failed 3 tests of 5.
t/taint.t .........
Dubious, test returned 3 (wstat 768, 0x300)
Failed 3/5 subtests
t/um.t ............ ok
t/upo.t ........... ok

Test Summary Report
-------------------
t/taint.t (Wstat: 768 Tests: 5 Failed: 3)
Failed tests: 2-4
Non-zero exit status: 3
Files=12, Tests=303, 0 wallclock secs ( 0.03 usr 0.02 sys + 0.50 cusr 0.10 csys = 0.65 CPU)
Result: FAIL
Failed 1/12 test programs. 3/303 subtests failed.
-> FAIL Installing ZEFRAM/Module-Runtime-0.013.tar.gz failed. See /Users/***/.cpanm/work/1644610830.3920/build.log for details. Retry with --force to force install it.

after which I dutifully forced it to install anyway. When I got to the ./configure step, it looked like some more problems as well that are perl related, and here's the output

checking C++ compiler ... ok (g++ is Apple CLANG (roughly 10.0) from Xcode 13.0.0)
checking C++ library ... ok (libc++ 12000, C++ 201402)
checking for package manager ... no package manager specified
determining architecture ... ok (darwin.x86_64)
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 ... ok
checking mpfr installation ... ok
checking boost installation ... ok
checking perl module XML::SAX ... failed
WARNING: perl module XML::SAX required for polymake not found on your machine.
Please be sure to install it prior to starting to use polymake.
If you have installed them in a non-standard location
please add the path to the environment variable PERL5LIB.
checking perl module Term::ReadKey ... failed
WARNING: perl module Term::ReadKey required for polymake not found on your machine.
Please be sure to install it prior to starting to use polymake.
If you have installed them in a non-standard location
please add the path to the environment variable PERL5LIB.
checking perl module Term::ReadLine ... ok
checking perl module JSON ... ok
checking shared perl library ... ok

Configuring bundled extensions:
bundled extension java ... disabled by command-line
bundled extension bliss ... failed
bundled extension cdd ... ok (bundled)
bundled extension flint ... ok (ok (2.8.0 @ system))
bundled extension javaview ... disabled because of unsatisfied prerequisite: java
bundled extension jreality ... disabled because of unsatisfied prerequisite: java
bundled extension libnormaliz ... ok (bundled [OpenMP support disabled])
bundled extension lrs ... ok (bundled)
bundled extension nauty ... ok (source: bundled)
bundled extension ppl ... ok (1.2.0 @ /usr/local)
bundled extension scip ... failed
bundled extension singular ... ok (4.2.1 @ /usr/local/Cellar/singular/4.2.1_1)
bundled extension soplex ... failed
bundled extension sympol ... ok (bundled)
bundled extension atint ... ok
* If you want to change the configuration of bundled extensions please see build/bundled.log and try configure --help.

* Configuration successful.
* You can run 'ninja -C build/Opt install' now to build and install polymake.
WARNING: Please install/check the following perl modules prior to starting polymake:
XML::SAX, Term::ReadKey

and then ninja -C build/Opt -j2 took forever to finish and the end result doesn't work at all. Help?

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

Re: Installing polymake with macOS12 Monterey

Postby paffenholz » 12 Feb 2022, 21:10

What happens if you try to start polymake? Does it print anything to the terminal?

It seems that perl on Monterey does not provide the modules XML::SAX and Term::ReadKey. polymake needs both. It should state this again when you try to start the program, though.

You can try to add the modules with

Code: Select all

cpanm XML::SAX cpanm Term::ReadKey
The Module Module::Runtime is only required for the database connection from polymake to polydb. polymake should work without, so lack of this module should not prevent polymake from starting.

From the failed tests of Module::Runtime I can't see what the actual problem is. As I don't have a Mac with Monterey I also cannot test. You can try if

Code: Select all

cpanm MongoDB
works directly. The detour via installing Module::Runtime first in an older version was only necessery as the newer ones did not work with MongoDB. Maybe this is fixed.

Andreas

theo
Posts: 4
Joined: 11 Feb 2022, 22:07

Re: Installing polymake with macOS12 Monterey

Postby theo » 13 Feb 2022, 04:40

First off, thanks for the help!

I did as you suggest, successfully adding XML::SAX and Term::ReadKey. I tried running through the whole thing again after that. On the ./configuration step again, it still said that the bundled extensions bliss, scip, and soplex all failed. After that, the install took a while and finished with a lot of errors -- many of which look like the following

Code: Select all

warning: dylib (/usr/local/lib/libflint.dylib) was built for newer macOS version (12.0) than being linked (11.3)
I was having problems trying to run it after that, so I ended up restarting the terminal and trying again, making some progress this time. Trying to run polymake failed with the following error

Code: Select all

Can't locate JSON.pm in @INC (you may need to install the JSON module) (@INC contains: /Users/***/polymake/share/polymake/perllib /Users/***/polymake/lib/polymake/perlx/5.34.0/darwin-thread-multi-2level /Users/***/polymake/lib/polymake/perlx/5.34.0 /Users/***/polymake/lib/polymake/perlx /usr/local/Cellar/perl/5.34.0/lib/perl5/site_perl/5.34.0/darwin-thread-multi-2level /usr/local/Cellar/perl/5.34.0/lib/perl5/site_perl/5.34.0 /usr/local/Cellar/perl/5.34.0/lib/perl5/5.34.0/darwin-thread-multi-2level /usr/local/Cellar/perl/5.34.0/lib/perl5/5.34.0 /usr/local/lib/perl5/site_perl/5.34.0) at /Users/***/polymake/share/polymake/perllib/Polymake.pm line 42. Compilation failed in require at /Users/***/polymake/bin/polymake line 156. BEGIN failed--compilation aborted at /Users/***/polymake/bin/polymake line 156.
which seemed odd as I know JSON was supposedly installed in the earlier steps. So, plowing ahead, I went ahead and entered the lines

Code: Select all

echo "export PERL5LIB=$HOME/perl5/lib/perl5:$HOME/perl5${PERL5LIB+:$PERL5LIB}" >> $HOME/.zshrc echo "source ~/perl5/perlbrew/etc/bashrc" >> $HOME/.zshrc echo 'export ARCHFLAGS="-arch x86_64"' >> $HOME/.zshrc source $HOME/.zshrc
once again, and sure enough this time it let me actually start up polymake (and I did so with --reconfigure the first time), and here's the output

Code: Select all

polymake: WARNING: Recompiling in /Users/***/.polymake/wrappers.0/build/Opt, please be patient... ninja: Entering directory `/Users/***/.polymake/wrappers.0/build/Opt' [1/1] /usr/local/opt/perl/bin/perl /Users/***/polymake/share/polymake/support/generate_ninja_targets.pl /Users/***/.polymake/wrappers.0/build/targets.ninja /Users/***/polymake/share/polymake /Users/***/.polymake/wrappers.0/build/config.ninja [1/5] /usr/local/opt/perl/bin/perl /Users/***/polymake/share/polymake/support/generate_ninja_targets.pl --cpperl-list /Users/***/.polymake/wrappers.0/build/cpperl/input.lst /Users/***/.polymake/wrappers.0/apps/common/cpperl [2/5] /usr/local/opt/perl/bin/perl /Users/***/polymake/share/polymake/support/generate_cpperl_modules.pl --gen-rules /Users/***/.polymake/wrappers.0/build/cpperl/gen.ninja --ext-config /Users/***/.polymake/wrappers.0/build/config.ninja /Users/***/.polymake/wrappers.0/apps/common/cpperl/Matrix.cpperl /Users/***/.polymake/wrappers.0/apps/common/cpperl/generated/Matrix.cc [3/5] : /Users/***/.polymake/wrappers.0/build/cpperl/gen.ninja [4/5] /usr/local/opt/perl/bin/perl /Users/***/polymake/share/polymake/support/generate_ninja_targets.pl --source-list /Users/***/.polymake/wrappers.0/build/sources.lst [1/3] g++ -c -o /Users/***/.polymake/wrappers.0/build/Opt/apps/common/cpperl/Matrix.o -MMD -MT /Users/***/.polymake/wrappers.0/build/Opt/apps/common/cpperl/Matrix.o -MF /Users/***/.polymake/wrappers.0/build/Opt/apps/common/cpperl/Matrix.o.d -fPIC -pipe -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 -DPOLYMAKE_WITH_FLINT -DPOLYMAKE_DEBUG=0 -DNDEBUG -O3 -DPOLYMAKE_APPNAME=common -I/Users/***/polymake/include/polymake/external -I/Users/***/polymake/include /Users/***/.polymake/wrappers.0/apps/common/cpperl/generated/Matrix.cc && : 'COMPILER_USED=10.0' [2/3] g++ -mmacosx-version-min=11.3 -bundle -undefined dynamic_lookup -L/usr/local/lib -fstack-protector-strong -o /Users/***/.polymake/wrappers.0/build/Opt/lib/common.bundle /Users/***/.polymake/wrappers.0/build/Opt/apps/common/cpperl/Matrix.o -lc++ -lflint -lmpfr -lgmp -lpthread ld: warning: object file (/Users/***/.polymake/wrappers.0/build/Opt/apps/common/cpperl/Matrix.o) was built for newer macOS version (12.0) than being linked (11.3) ld: warning: dylib (/usr/local/lib/libflint.dylib) was built for newer macOS version (12.0) than being linked (11.3) ld: warning: dylib (/usr/local/lib/libgmp.dylib) was built for newer macOS version (12.0) than being linked (11.3) [3/3] touch /Users/***/.polymake/wrappers.0/build/Opt/.apps.built Welcome to polymake version 4.6 Copyright (c) 1997-2021 Ewgenij Gawrilow, Michael Joswig, and the polymake team Technische Universität Berlin, Germany https://polymake.org This is free software licensed under GPL; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. Press F1 or enter 'help;' for basic instructions. Application polytope currently uses following contributed and third-party software packages: SVG, cdd, flint, libnormaliz, lrs, nauty, permlib, polyDB, povray, ppl, singular, sketch, sympol, threejs, tikz, tosimplex For more details: show_credits; polytope >
and now it seems it is mostly(?) functional. However, I still have to enter the lines

Code: Select all

echo "export PERL5LIB=$HOME/perl5/lib/perl5:$HOME/perl5${PERL5LIB+:$PERL5LIB}" >> $HOME/.zshrc echo "source ~/perl5/perlbrew/etc/bashrc" >> $HOME/.zshrc echo 'export ARCHFLAGS="-arch x86_64"' >> $HOME/.zshrc source $HOME/.zshrc
in terminal every time before attempting to run it, and I have not been successful at all at adding to the $PATH so that I can run it easier. From what I can find here https://stackoverflow.com/questions/115 ... 9#18077919, I think I need to add (with the actual folder in there)

Code: Select all

export PATH=$HOME/<polymake_install_folder>/bin/:$PATH
to .zshrc. Will adding in the lines about PERL fix things there as well so those don't need to be added in every time?

Thanks again for your help.

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

Re: Installing polymake with macOS12 Monterey

Postby paffenholz » 14 Feb 2022, 09:10

The error from flint would suggest that you actually build polymake on Big Sur, not on Monterey. But if it works this should be fine.

The JSON-module is apparantly not found while configuring, but it is found at start. Those are installed at

Code: Select all

$HOME/perl5/lib/perl5:$HOME/perl5
and as you have probably opened a new terminal for the second attempt an

Code: Select all

export PERL5LIB=$HOME/perl5/lib/perl5:$HOME/perl5${PERL5LIB+:$PERL5LIB}
would have been necessary for configure to find it. You did this before starting polymake, so it was then found.

The for last lines

Code: Select all

echo "export PERL5LIB=$HOME/perl5/lib/perl5:$HOME/perl5${PERL5LIB+:$PERL5LIB}" >> $HOME/.zshrc echo "source ~/perl5/perlbrew/etc/bashrc" >> $HOME/.zshrc echo 'export ARCHFLAGS="-arch x86_64"' >> $HOME/.zshrc source $HOME/.zshrc
should only be neccessary once. They write the perl paths into

Code: Select all

$HOME/.zshrc
, which should be the configuration for your terminal. You can check the file with an editor (e.g.

Code: Select all

nano ~/.zshrc
), they should be at the end. Tha you need to do this every time suggests that you use a different terminal, you can check with

Code: Select all

echo $SHELL
. If this is not zsh, then you should add the lines to the appropriate configuration file instead.

In any case the last line

Code: Select all

source $HOME/.zshrc
would have been sufficient, as this reads the configuration file. The three lines before just add the commands to this file.

In this configuration file you can also append the polymake directory to the path with

Code: Select all

export PATH=$HOME/<polymake_install_folder>/bin/${PATH+:$PATH}
Hope this works,
Andreas


Return to “Installing polymake”