install:macos

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Next revision
Previous revision
install:macos [2020/02/06 13:19] – created paffenholzinstall:macos [2024/04/11 16:57] (current) – [Install dependencies with Homebrew] paffenholz
Line 1: Line 1:
-== Install polymake on Mac OS ==+===== Install polymake on Mac OS =====
  
-The latest release 4.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):+The latest release 4.should work on all Mac OS versions greater or equal to 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   * Install the xcode command line tools
-  * (for some versions) install SDK headers 
   * install Homebrew   * install Homebrew
   * install Perlbrew   * install Perlbrew
   * install some dependencies using Homebrew   * install some dependencies using Homebrew
   * install some dependencies using Perlbrew/cpanm   * install some dependencies using Perlbrew/cpanm
 +  * install a python dependence
   * download and install polymake   * download and install polymake
  
 For all steps you need an open Terminal. You can find the Terminal app in the Subfolder //Utilities// of //Applications//. 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 ===+If you don't want to install Homebrew, you can try to install dependencies yourself. Some instructions are [[install:macos:source|here]]. 
 + 
 +==== Install the Command Line Tools ====
  
 In the terminal type In the terminal type
 <code>xcode-select --install</code> <code>xcode-select --install</code>
-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). +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** necessary and **not** recommended (you then need to install the command line tools on top from within XCode).  
 + 
 +==== Install Homebrew ==== 
 + 
 +Installation instructions are [[https://brew.sh/|here]]. In most cases it should be sufficient to copy and execute the first code line on that page into your terminal, that is:
  
-On MacOS **10.14** you may need an additional step. Run  
-<code>ls /System/Library/Perl/5.18/darwin-thread-multi-2level/CORE/EXTERN.h</code> 
-If that returns a //File not found// error then run 
-<code>sudo installer -pkg /Library/Developer/CommandLineTools/Packages/macOS_SDK_headers_for_macOS_10.14.pkg -allowUntrusted -target /</code> 
-This will ask for your passoword. You need to be an administrator of your Mac to run this command. If this fails, then run 
 <code> <code>
-softwareupdate -+/bin/bash -"$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
-softwareupdate -i "Command Line Tools (macOS Mojave version 10.14) for Xcode-10.3"+
 </code> </code>
-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. 
  
-=== Install Homebrew ===+==== Install Perlbrew ====
  
-Installation instructions are [[https://brew.sh/|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!+Installation instructions are  [[https://perlbrew.pl/|here]]. In most cases it should be sufficient to copy and execute the first code line on that page into your terminal, that is:
  
-=== Install Perlbrew ===+<code> 
 +\curl -L https://install.perlbrew.pl | bash 
 +</code>
  
-Installation instructions are  [[https://perlbrew.pl/|here]]. In most cases it should be sufficient to copy and execute the first code line on that page into your terminalMake sure you copy the whole line!+We have to add some variables to the shell environment. Recent macs usually use ''zsh'' as their shell. You can check this with 
 +<code> 
 +echo $SHELL 
 +</code> 
 +If you use ''bash'', you have to  
 +  * replace ''.zshrc'' with ''.bashrc'' in the terminal commands below  
 +  * add <code>if -f ~/.bashrc ]; then ~/.bashrc; fi </code> at the end of the file ''$HOME/.bash_profile'' if it is not already present
  
-Now add some paths to your Terminal config and reload the config:+Now add some paths to your Terminal config and reload the config. For an Intel Mac type the following lines in the terminal:
 <code> <code>
-echo "export PERL5LIB=$HOME/perl5/lib/perl5:$HOME/perl5${PERL5LIB+:$PERL5LIB}" >> $HOME/.bash_profile +echo "export PERL5LIB=$HOME/perl5/lib/perl5:$HOME/perl5${PERL5LIB+:$PERL5LIB}" >> $HOME/.zshrc 
-echo "source ~/perl5/perlbrew/etc/bashrc" >> $HOME/.bash_profile +echo "source ~/perl5/perlbrew/etc/bashrc" >> $HOME/.zshrc 
-echo 'export ARCHFLAGS="-arch x86_64"' >> $HOME/.bash_profile +echo 'export ARCHFLAGS="-arch x86_64"' >> $HOME/.zshrc 
-source $HOME/.bash_profile+source $HOME/.zshrc 
 +</code> 
 +and for a Silicon Mac use 
 +<code> 
 +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 arm64"' >> $HOME/.zshrc 
 +source $HOME/.zshrc
 </code> </code>
  
-=== Install dependencies with Homebrew === 
  
 +==== Install dependencies with Homebrew ====
 +
 +Run the following lines in your terminal:
 +<code>
 +brew install gmp
 +brew install mpfr
 +brew install boost
 +brew install readline
 +brew install ppl
 +brew install flint
 +brew install singular
 +brew install python3
 +brew install ninja
 +brew install ccache
 +brew install mongo-c-driver
 +brew install jupyterlab
 +</code>
 +
 +==== Install dependencies with Perlbrew ====
 +
 +Run the following lines in your terminal:
 +<code>
 +yes N | perlbrew install-cpanm
 +cpanm --local-lib=~/perl5 local::lib && eval $(perl -I ~/perl5/lib/perl5/ -Mlocal::lib)
 +cpanm SVG
 +cpanm JSON
 +cpanm install Net::SSLeay
 +cpanm Term::ReadLine::Gnu
 +cpanm Term::ReadKey
 +cpanm XML::SAX
 +</code>
 +
 +
 +==== Download polymake ====
 +
 +You find the sources [[download:start|here]]. Get the source tarball from the Linux section of that page. Download to //Downloads//.
 +
 +In the terminal do
 +<code>
 +cd Downloads
 +tar -xvjf polymake-4.11.tar.bz2
 +</code>
 +
 +==== Configure and install polymake ====
 +
 +=== Compilation ===
 +
 +Essentially, polymake is compiled and installed with the following commands. This will put the polymake binary into ''/usr/local''. You may have to use ''sudo'' for installing.
 +
 +<code>
 +cd ~/Downloads/polymake-4.11
 +./configure --without-java
 +ninja -C build/Opt -j2 install
 +</code>
 +
 +However, we recommend to install into a directory in your ''$HOME''-folder. For this, create a folder with
 +<code>
 +mkdir $HOME/<polymake_install_folder>
 +</code>
 +where ''<polymake_install_folder>'' is a name of your choice, e.g. ''polymake_bin''. Then compile and install with (replace with the correct folder name!)
 +
 +<code>
 +cd ~/Downloads/polymake-4.11
 +./configure --without-java --prefix=$HOME/<polymake_install_folder>
 +ninja -C build/Opt -j2 install
 +</code>
 +
 +You can then call ''polymake'' with
 +<code>
 +$HOME/<polymake_install_folder>/bin/polymake
 +</code>
 +or add ''$HOME/<polymake_install_folder>/bin/'' to your path.
 +
 +=== Configuration ===
 +
 +If you use ''Safari'' as your default browser, then you need to switch to another one for polymake. Please do
 +<code>
 +set_custom $Visual::webbrowser=open -a "Firefox"
 +</code>
 +inside the polymake shell. Replace ''Firefox'' by ''Google Chrome'' if you prefer this browser.
  
  
  • install/macos.1580995172.txt.gz
  • Last modified: 2020/02/06 13:19
  • by paffenholz