Linux
System packages
There are many different Linux distributions, that each use different package managemers and name packages in a different way. The following commands should cover the most common Linux distributions, feel free to suggest your favorite distribution if it is not covered.
Debian/Ubuntu family
sudo apt-get update \
&& sudo apt-get install build-essential ca-certificates curl \
libhdf5-dev libhwloc-dev libudev-dev pkg-config \
unzip util-linux wget
Fedora family
sudo dnf makecache --refresh \
&& sudo dnf group install c-development \
&& sudo dnf install ca-certificates curl \
hdf5-devel hwloc-devel libudev-devel pkg-config \
unzip util-linux wget
RHEL family
sudo dnf makecache --refresh \
&& sudo dnf groupinstall "Devlopment tools" \
&& sudo dnf install epel-release \
&& sudo /usr/bin/crb enable \
&& sudo dnf makecache --refresh \
&& sudo dnf install ca-certificates curl \
hdf5-devel hwloc-devel libudev-devel pkg-config \
unzip util-linux wget
Arch family
sudo pacman -Sy \
&& sudo pacman -S base-devel ca-certificates curl \
libhdf5 libhwloc pkg-config \
unzip util-linux wget
openSUSE family
sudo zypper ref \
&& sudo zypper in -t pattern devel_C_C++ \
&& sudo zypper in ca-certificates curl \
hdf5-devel hwloc-devel libudev-devel pkg-config \
unzip util-linux wget
Rust
To compile Rust code, you will need a Rust toolchain. You can install the one we need like this:
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- --default-toolchain none \
&& . "$HOME/.cargo/env" \
&& rustup toolchain install nightly-2024-10-28
If you want to use rust-analyzer
, you may want to add a --component rust-analyzer
flag to the rustup toolchain install
command at the end. This
will ensure that you get a rust-analyzer
version that is fully compatible with
the compiler version that we are going to use.
HDF5-to-PNG renderer
Throughout the second part of the course, we will be producing HDF5 files which contain time series of tabulated chemical concentrations. For quick and dirty debugging, it is convenient to render those tabulated concentrations into colorful PNG images.
To this end, you can use the data-to-pics
program which was developed as part
of a previous version of this course. It can be installed as follows:
cargo install --git https://github.com/HadrienG2/grayscott.git data-to-pics
Environment test
Your Rust development environment should now be ready for this course’s practical work. I highly advise testing it by using the following shell script:
wget https://plmlab.math.cnrs.fr/grasland/numerical-rust-cpu/-/archive/solution/numerical-rust-cpu-solution.zip \
&& unzip numerical-rust-cpu-solution.zip \
&& rm numerical-rust-cpu-solution.zip \
&& cd numerical-rust-cpu-solution/exercises \
&& cargo run -- -n3 \
&& mkdir pics \
&& data-to-pics -o pics/ \
&& cd ../.. \
&& rm -rf numerical-rust-cpu-solution
It downloads, builds and runs the expected source code at the end of the last chapter of this course, then renders the associated images, and finally cleans up after itself by deleting everything.