Ubuntu#
sudo apt update
sudo apt install -y build-essential gcc-10 g++-10 gcc-10-plugin-dev cmake git-all patchelf pigz
Note that if you are running Ubuntu 22.04 it will ship with gcc-11 by default whereas Ubuntu 20.04 will ship with gcc-9.
Currently gcc-10 is the preferred compiler. If you would like to use gcc-11 on 20.04, you will need to add an alternate PPA:
sudo add-apt-repository ppa:ubuntu-toolchain-r/test
sudo apt install gcc-11 g++-11 gcc-11-plugin-dev
You can then tell ubuntu that you would like to use a particular version of gcc as your default with the following commands:
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-10 10
sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-10 10
sudo update-alternatives --set gcc /usr/bin/gcc-10
sudo update-alternatives --set g++ /usr/bin/g++-10
Getting dependencies#
If you are on the ANL network you can mount fileshares and copy the dependencies directly to your machine.
First add this to your /etc/fstab
making sure to give it a valid smb credentials file.
//vms-fs.es.anl.gov/VMS /mnt/p cifs credentials=/path/to/.smbcredentials,iocharset=utf8 0 0
And then mount the share onto /mnt/p
sudo apt install -y cifs-utils
sudo mkdir -p /mnt/p /opt/polaris/deps
sudo chown $USER:$USER -R /opt/polaris/deps
sudo mount /mnt/p
Given the above setup you can then grab the correct set of dependencies using the ./bin/get-deps.sh
script.
OS=ubuntu-20.04 CXX=gcc-11.4.0 ./bin/get-deps.sh