This is an old revision of the document!
Install polymake on Mac OS
The latest release 4.0 should work on all Mac OS versions greater or equal to 10.11. The installation requires a couple of steps (of which you have maybe done some already for other reasons):
- Install the xcode command line tools
- (for some versions) install SDK headers
- install Homebrew
- install Perlbrew
- install some dependencies using Homebrew
- install some dependencies using Perlbrew/cpanm
- install a python dependence
- download and install polymake
For all steps you need an open Terminal. You can find the Terminal app in the Subfolder Utilities of Applications.
Install the Command Line Tools
In the terminal type
xcode-select --install
Either this tells you that your command line tools are installed or opens a small window that asks you whether you want to install them. Confirm. It also offers to install the full XCode IDE. This is not neccessary and not recommended (you then need to install the command line tools on top from whithin XCode).
On MacOS 10.14 you may need an additional step. Run
ls /System/Library/Perl/5.18/darwin-thread-multi-2level/CORE/EXTERN.h
If that returns a File not found error then run
sudo installer -pkg /Library/Developer/CommandLineTools/Packages/macOS_SDK_headers_for_macOS_10.14.pkg -allowUntrusted -target /
This will ask for your passoword. You need to be an administrator of your Mac to run this command. If this fails, then run
softwareupdate -l softwareupdate -i "Command Line Tools (macOS Mojave version 10.14) for Xcode-10.3"
where you may need to replace the string in the second command to the one that looks similar in the return of the first command. Then repeat the previous installer command. It should now succeed.
The same problem may also occur on 10.15. Contact us in this case, we don't yet know a general solution.
Install Homebrew
Installation instructions are here. In most cases it should be sufficient to copy and execute the first code line on that page into your terminal. Make sure you copy the whole line!
Install Perlbrew
Installation instructions are here. In most cases it should be sufficient to copy and execute the first code line on that page into your terminal. Make sure you copy the whole line!
Now add some paths to your Terminal config and reload the config:
echo "export PERL5LIB=$HOME/perl5/lib/perl5:$HOME/perl5${PERL5LIB+:$PERL5LIB}" >> $HOME/.bash_profile echo "source ~/perl5/perlbrew/etc/bashrc" >> $HOME/.bash_profile echo 'export ARCHFLAGS="-arch x86_64"' >> $HOME/.bash_profile source $HOME/.bash_profile
Install dependencies with Homebrew
Run the collowing lines in your terminal:
brew install gmp brew install mpfr brew install boost brew install readline brew install ppl brew install python3 brew install ninja brew install ccache
Install dependencies with Perlbrew
Run the following lines in your terminal:
yes N | perlbrew install-cpanm cpanm --local-lib=~/perl5 local::lib && eval $(perl -I ~/perl5/lib/perl5/ -Mlocal::lib) brew link --force readline cpanm Term::ReadLine::Gnu brew unlink readline cpanm SVG cpanm Moo cpanm ZEFRAM/Module-Runtime-0.013.tar.gz cpanm MongoDB cpanm JSON cpanm install Net::SSLeay
Install a python dependence
pip3 install jupyter --user
Download polymake
You find the sources here. Get the source tarball from the Linux section of that page. Download to Downloads.
in the terminal do
cd Downloads tar -tvfj polymake-4.0.tar.bz2
Configure and install polymake
cd ~/Downloads/polymake-4.0 ./configure --without-java ninja -C build/Opt -j2 install
Full script
Here is also a script that does almost all these steps and allows some configuration.