Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 8 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

## What does this do?

Vagrant pulls an Ubuntu 24.04 "base box" and asks e.g. VirtualBox to start a virtual machine.
Vagrant pulls an Ubuntu 26.04 "base box" and asks, e.g., VirtualBox to start a virtual machine.
It then installs basic tools (such as a desktop environment), a preCICE release,
several solvers and adapters, as well as example and tutorial files.

Expand All @@ -15,7 +15,7 @@ Ready-to-use boxes are available on [Vagrant Cloud](https://app.vagrantup.com/pr
**Note:** If you only want to directly get a pre-built box, look at the [documentation](https://www.precice.org/installation-vm.html).

1. Get a Virtual Machine provider, such as [VirtualBox](https://www.virtualbox.org/)
2. Get [Vagrant](https://www.vagrantup.com/)
2. Get [Vagrant](https://www.vagrantup.com/) and the [vagrant-reload plugin](https://github.com/aidanns/vagrant-reload)
3. Go to the root folder of this repository and start with `vagrant up`.
4. Be patient. Vagrant will now setup your virtual machine. You don't have to do anything and your terminal will be very busy.
5. After the provisioning finishes, restart the machine with `vagrant reload` to get a full GUI
Expand All @@ -40,21 +40,24 @@ A few things you may need:

## What is included?

This box is based on the [bento/ubuntu-24.04](https://github.com/chef/bento) base box and installs:
This box is based on the [bento/ubuntu-26.04](https://github.com/chef/bento) base box and installs:

- Xubuntu-core (Xfce desktop environment) and related tools
- VirtualBox guest additions
- Terminator (a nice split-window terminal emulator, find it in `Applications > System`)
- GNU C++, C, Fortran compilers
- Python, Julia, Rust
- Git, CMake, ccmake
- Editors: nano, vim, gedit
- Diff viewer: meld
- preCICE latest from the master branch (built in release-with-debug-info mode)
- preCICE config visualizer with its GUI (PyPI, latest)
- preCICE Python bindings (PyPI, latest), under `~/python-venvs/pyprecice`.
- preCICE Julia bindings (Pkg, latest)
- preCICE Rust bindings (Cargo, latest)
- preCICE FMI Runner (PyPI, latest)
- preCICE Micro Manager (PyPI, latest)
- OpenFOAM v2512 and the OpenFOAM-preCICE adapter (Git, develop branch)
- ASTE (Git, develop branch)
- OpenFOAM v2606 and the OpenFOAM-preCICE adapter (Git, develop branch)
- deal.II 9.5 from the official PPA and the deal.II-preCICE adapter (Git, develop branch)
- CalculiX 2.20 from source and the CalculiX-preCICE adapter (Git, develop branch)
- FEniCS latest from the FEniCS PPA. The FEniCS-preCICE adapter is installed automatically in the Python virtual environment of each tutorial.
Expand All @@ -75,8 +78,6 @@ At the end, it cleans up all object files and the APT cache (see `cleanup.sh`).

## What should be there but is currently not included?

- ASTE (Git, develop branch) -> Cannot build using the VTK packages bundled in Ubuntu 24.04. Will enable again in the next upgrade.
- preCICE Rust bindings (Cargo, latest) -> Cargo too old in Ubuntu 24.04.
- code_aster 14.6 and the code_aster-preCICE adapter -> Adapter currently unmaintained.

## Troubleshooting
Expand Down
25 changes: 12 additions & 13 deletions Vagrantfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ Vagrant.configure("2") do |config|
# This allows us to create performance oriented images for Linux (libvirt) and Windows (hyperv).
# However, it does not build: https://github.com/precice/vm/issues/83
# config.vm.box = "generic/ubuntu2004"
config.vm.box = "bento/ubuntu-24.04"
config.vm.box = "bento/ubuntu-26.04"

# We don't want the box to automatically update every time it starts.
# We can instead handle updates internally, without destroying the machine.
Expand All @@ -18,9 +18,9 @@ Vagrant.configure("2") do |config|
# Display the VirtualBox GUI when booting the machine
vb.gui = true
# Number of cores
vb.cpus = 2
vb.cpus = 4
# Customize the amount of memory on the VM:
vb.memory = "2048"
vb.memory = "4096"
# Video memory (the default may be too low for some applications)
vb.customize ["modifyvm", :id, "--vram", "64"]
# The default graphics controller is VboxSVGA. This seems to cause issues with auto-scaling.
Expand All @@ -32,13 +32,16 @@ Vagrant.configure("2") do |config|
config.vm.provider :libvirt do |lv|
lv.forward_ssh_port = true
lv.title = "preCICE-VM"
lv.cpus = 2
lv.memory = 2048
lv.cpus = 4
lv.memory = 4096
end

# Install a desktop environment and basic tools
config.vm.provision "shell", path: "provisioning/install-basics.sh", privileged: false

# Reload the VM (requires https://github.com/aidanns/vagrant-reload)
config.vm.provision :reload

# Install common development tools
config.vm.provision "shell", path: "provisioning/install-devel.sh", privileged: false

Expand All @@ -54,10 +57,7 @@ Vagrant.configure("2") do |config|
config.vm.provision "shell", path: "provisioning/install-micro-manager.sh", privileged: false
config.vm.provision "shell", path: "provisioning/install-paraview.sh", privileged: false

# NOTE: In Ubuntu 24.04, building ASTE will succeed, but running the aste-turbine tutorial, for example, will break.
# See the documentation: https://precice.org/tooling-aste.html#dependencies
# Disabling until the upgrade to Ubuntu 26.04
# config.vm.provision "shell", path: "provisioning/install-aste.sh", privileged: false
config.vm.provision "shell", path: "provisioning/install-aste.sh", privileged: false

# Install additional packages for training
config.vm.provision "shell", path: "provisioning/install-training-python.sh", privileged: false
Expand All @@ -69,11 +69,10 @@ Vagrant.configure("2") do |config|
config.vm.provision "shell", path: "provisioning/install-dune.sh", privileged: false
config.vm.provision "shell", path: "provisioning/install-su2.sh", privileged: false

# Rust tutorials incompatible with cargo 1.75.0, shipped with Ubuntu 24.04
# Error: The package requires the Cargo feature called `edition2024`, but that feature is not stabilized in this version of Cargo (1.75.0).
# config.vm.provision "shell", path: "provisioning/install-rust-bindings.sh", privileged: false
# NOTE: On Ubuntu 24.04, the Rust cargo installation is too old.
config.vm.provision "shell", path: "provisioning/install-rust-bindings.sh", privileged: false

# code_aster does not build on Ubuntu 22.04/24.04 due to multiple issues: https://github.com/precice/code_aster-adapter/issues/26
# code_aster does not build on Ubuntu 22.04 or later due to multiple issues: https://github.com/precice/code_aster-adapter/issues/26
# config.vm.provision "shell", path: "provisioning/install-code_aster.sh", privileged: false

# Post-installation steps
Expand Down
Empty file modified provisioning/install-aste.sh
100644 → 100755
Empty file.
40 changes: 34 additions & 6 deletions provisioning/install-basics.sh
Original file line number Diff line number Diff line change
@@ -1,19 +1,41 @@
#!/usr/bin/env bash
set -ex

# Some repos are a bit fragile and need multiple download tries
echo 'APT::Acquire::Retries "4";' | sudo tee /etc/apt/apt.conf.d/80-retries
# Make APT calls non-interactive
echo 'debconf debconf/frontend select Noninteractive' | sudo debconf-set-selections

# Pre-seeding of interactive dialogs (keyboard configuration, gdm3)
cat <<EOF | sudo tee /tmp/preseed.cfg
keyboard-configuration question select us
keyboard-configuration modelcode string evdev-abnt2
keyboard-configuration layoutcode string us
keyboard-configuration store_defaults_in_legacy_files boolean false
keyboard-configuration variantcode string
keyboard-configuration toggle string No toggling
EOF
sudo debconf-set-selections /tmp/preseed.cfg

# We (may) need the multiverse repository for the VBox Guest Additions
sudo apt-add-repository multiverse
sudo apt-get update
sudo apt-get upgrade -qy

sudo DEBIAN_FRONTEND=noninteractive apt-get -y \
-o Dpkg::Options::="--force-confold" \
-o Dpkg::Options::="--force-confdef" \
upgrade

# Some repos are a bit fragile and need multiple download tries
echo 'APT::Acquire::Retries "4";' | sudo tee /etc/apt/apt.conf.d/80-retries

# Install the Xfce desktop environment and basic applications
sudo apt-get install -y xubuntu-core
sudo apt-get install -y thunar xfce4-terminal terminator bash-completion tree atril firefox firefox-locale-en baobab catfish
sudo apt-get install -y xubuntu-core lightdm
sudo apt-get install -y thunar thunar-archive-plugin xfce4-terminal terminator bash-completion tree atril firefox firefox-locale-en baobab catfish
sudo apt-get install -y python3-dev pipx python-is-python3 python3-venv python3-pip python3-pybind11

# Remove GNOME display manager and desktop packages
sudo apt-get purge -y gdm3 gnome-shell ubuntu-desktop
sudo apt-get autoremove -y --purge

# Setup auto-login for the graphical session
# Disabled due to https://github.com/precice/vm/issues/40
# echo "autologin-user=vagrant" | sudo tee --append /usr/share/lightdm/lightdm.conf.d/60-xubuntu.conf
Expand All @@ -25,10 +47,16 @@ sudo apt-get install -y virtualbox-guest-utils
mkdir -p ~/Desktop

# Use US-English keyboard layout
L='us' && sudo sed -i 's/XKBLAYOUT=\"\w*"/XKBLAYOUT=\"'$L'\"/g' /etc/default/keyboard
# L='us' && sudo sed -i 's/XKBLAYOUT=\"\w*"/XKBLAYOUT=\"'$L'\"/g' /etc/default/keyboard
# Add a shortcut to the keyboard options on the Desktop
cp /usr/share/applications/xfce-keyboard-settings.desktop ~/Desktop/
chmod +x ~/Desktop/xfce-keyboard-settings.desktop

# Set a hostname
echo "precicevm" | sudo tee /etc/hostname

# Workaround for the network timeout at boot
sudo systemctl mask systemd-networkd-wait-online.service

# Workaround for not being able to shut down the VM from inside itself
sudo DEBIAN_FRONTEND=noninteractive systemctl mask systemd-timesyncd
6 changes: 4 additions & 2 deletions provisioning/install-dune.sh
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,8 @@ fi
(
cd dune-elastodynamics
git pull
# Apply patch https://github.com/maxfirmbach/dune-elastodynamics/pull/2
sed -i 's/VERSION 3.1/VERSION 3.13/g' CMakeLists.txt
)

# Get the plain DUNE-preCICE adapter
Expand Down Expand Up @@ -82,8 +84,8 @@ CMAKE_FLAGS="$CMAKE_FLAGS -DCMAKE_DISABLE_FIND_PACKAGE_Kokkos=TRUE" ./dune-commo
# Set the DUNE_CONTROL_PATH (DUNE recursively finds modules in this directory)
echo "export DUNE_CONTROL_PATH=\"\${HOME}/dune-dumux\"" >> ~/.bashrc

# Copy the built example code to the tutorials
cp ~/dune-dumux/dune-adapter/dune-precice-howto/build-cmake/examples/dune-perpendicular-flap ~/tutorials/perpendicular-flap/solid-dune
# Make the built example code discoverable
echo "export PATH=\"\${HOME}/dune-dumux/dune-adapter/dune-precice-howto/build-cmake/examples:\${PATH}\"" >> ~/.bashrc

# We are done with DUNE, let's do back home
cd ~
5 changes: 1 addition & 4 deletions provisioning/install-fenics.sh
Original file line number Diff line number Diff line change
@@ -1,11 +1,8 @@
#!/usr/bin/env bash
set -ex

# Install FEniCS from APT
sudo apt-get install -y software-properties-common
sudo add-apt-repository -y ppa:fenics-packages/fenics
sudo apt-get -y update
sudo apt-get -y install --no-install-recommends fenics
sudo apt-get -y install fenics

# Install the FEniCS-preCICE adapter from PIP
# python -m venv ~/python-venvs/fenicsprecice
Expand Down
7 changes: 2 additions & 5 deletions provisioning/install-julia-bindings.sh
Original file line number Diff line number Diff line change
@@ -1,11 +1,8 @@
#!/usr/bin/env bash

# install latest julia
pipx install jill
jill install --confirm

# install preCICE bindings
julia -e 'using Pkg; Pkg.add("PreCICE")'
curl -fsSL https://install.julialang.org | sh -s -- --yes
echo "export PATH=\"\${HOME}/.juliaup/bin:\${PATH}\"" >> ~/.bashrc

# to test the installation, run the following command:
# julia -e 'using Pkg; Pkg.test("PreCICE")'
12 changes: 6 additions & 6 deletions provisioning/install-openfoam.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@ set -ex
# Add the signing key, add the repository, update:
wget -q -O - https://dl.openfoam.com/add-debian-repo.sh | sudo bash

# Install OpenFOAM v2512:
sudo apt-get install -y openfoam2512-dev
# Install OpenFOAM v2606:
sudo apt-get install -y openfoam2606-dev
# Enable OpenFOAM by default:
echo ". /usr/lib/openfoam/openfoam2512/etc/bashrc" >> ~/.bashrc
echo ". /usr/lib/openfoam/openfoam2606/etc/bashrc" >> ~/.bashrc

# Get the OpenFOAM-preCICE adapter
if [ ! -d "openfoam-adapter/" ]; then
Expand All @@ -16,9 +16,9 @@ fi
(
cd openfoam-adapter
git pull
openfoam2512 ./Allclean
openfoam2512 ./Allwmake
openfoam2606 ./Allclean
openfoam2606 ./Allwmake
)

# Build the tutorials partitioned-heat-conduction solver
cd ~/tutorials/partitioned-heat-conduction/solver-openfoam && openfoam2512 wmake
cd ~/tutorials/partitioned-heat-conduction/solver-openfoam && openfoam2606 wmake
3 changes: 3 additions & 0 deletions provisioning/install-paraview.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,6 @@
set -ex

sudo apt-get install -y --no-install-recommends paraview

# Workaround for https://bugs.launchpad.net/ubuntu/+source/paraview/+bug/2155064
sudo apt-get install -y qt6-svg-plugins
7 changes: 4 additions & 3 deletions provisioning/install-precice.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,10 @@ fi
(
cd precice
git pull

# Patch for Ubuntu 26.04, see https://github.com/precice/precice/commit/6a0be7aa64087f21740c566921e83e97e03e1067
sed -i 's/libxml2/libxml2-dev/g' cmake/CPackConfig.cmake

mkdir -p build && cd build/
cmake -DCMAKE_INSTALL_PREFIX=/usr -DBUILD_SHARED_LIBS=ON -DCMAKE_BUILD_TYPE=RelWithDebInfo -DPRECICE_RELEASE_WITH_DEBUG_LOG=ON -DBUILD_TESTING=OFF -Wno-dev ..
make -j "$(nproc)"
Expand Down Expand Up @@ -43,9 +47,6 @@ fi
(
cd tutorials/quickstart/solid-cpp/ && cmake . && make
)
(
cd tutorials/heat-exchanger && ./download-meshes.sh
)
sudo apt-get -y install gnuplot # needed for watchpoint scripts of tutorials


Expand Down
20 changes: 12 additions & 8 deletions provisioning/install-su2.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,13 @@ source ~/python-venvs/su2precice/bin/activate
python -m pip install mpi4py setuptools # pyprecice is installed by the tutorials
sudo apt-get -y install swig

# Get SU2 7.5.1 from GitHub
wget --quiet https://github.com/su2code/SU2/archive/refs/tags/v7.5.1.tar.gz
tar -xzf v7.5.1.tar.gz
rm -fv v7.5.1.tar.gz
# Get SU2 from GitHub
git clone --depth=1 --branch=v7.5.1 --recurse-submodules https://github.com/su2code/SU2.git

# Add SU2 and the SU2 adapter to PATH and apply.
# We first export to a separate script, so that we can load it here (non-interactive shell).
{
echo "export SU2_HOME=\"\${HOME}/SU2-7.5.1\""
echo "export SU2_HOME=\"\${HOME}/SU2\""
echo "export SU2_RUN=\"\${SU2_HOME}/SU2_CFD\""
echo "export PATH=\"\${SU2_RUN}/bin/:\${HOME}/su2-adapter/run/:\${PATH}\""
echo "export PYTHONPATH=\"\${SU2_RUN}/bin/:\${PYTHONPATH}\""
Expand All @@ -40,14 +38,20 @@ fi
(
cd "${SU2_HOME}"

# Add a previously implied header (compatibility with Ubuntu 24.04)
# Add a previously implied header (compatibility with Ubuntu 24.04 and later)
sed -i '1s/^/#include <cstdint>\n/' SU2_CFD/src/output/filewriter/CParaviewXMLFileWriter.cpp
sed -i '1s/^/#include <cstdint>\n/' SU2_CFD/src/SU2_CFD.cpp

./meson.py build -Denable-pywrapper=true --prefix="${SU2_RUN}" &&\
# Replace pipes with shlex in Ninja configure (compatibility with Ubuntu 26.04 and Python >= 3.13)
# See https://github.com/ninja-build/ninja/commit/9cf13cd1ecb7ae649394f4133d121a01e191560b
sed -i 's/pipes/shlex/g' externals/ninja/configure.py

# Disable unnecessary dependencies to save space and to workaround an issue that CGNS does not build.
./meson.py build -Denable-pywrapper=true -Denable-cgns=false -Denable-tecio=false --prefix="${SU2_RUN}" &&\
./ninja -C build install
)

# Remove the libSU2Core.a library to save space (approx. 500MB)
rm -fv ~/SU2-7.5.1/SU2_CFD/obj/libSU2Core.a
rm -fv ~/SU2/SU2_CFD/obj/libSU2Core.a

deactivate
6 changes: 4 additions & 2 deletions provisioning/install-training-fsi.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,14 @@ set -ex
source ~/python-venvs/pyprecice/bin/activate
python -m pip install pyfoam
deactivate
pipx install ccx2paraview

# ccx2paraview is incompatible with newer vtk versions: https://github.com/calculix/ccx2paraview/issues/58
# pipx install ccx2paraview

# FreeCAD AppImage from https://www.freecad.org/downloads.php (~780MB)
(
cd ~/Desktop
wget https://github.com/FreeCAD/FreeCAD/releases/download/1.1.1/FreeCAD_1.1.1-Linux-x86_64-py311.AppImage
wget --quiet https://github.com/FreeCAD/FreeCAD/releases/download/1.1.1/FreeCAD_1.1.1-Linux-x86_64-py311.AppImage
mv FreeCAD_1.1.1-Linux-x86_64-py311.AppImage FreeCAD.AppImage
chmod +x FreeCAD.AppImage
)
Empty file modified provisioning/install-training-python.sh
100644 → 100755
Empty file.
14 changes: 8 additions & 6 deletions provisioning/post-install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,16 @@ ln -sf /vagrant/ ~/Desktop/shared
cp /usr/share/applications/terminator.desktop ~/Desktop/
chmod +x ~/Desktop/terminator.desktop

# Disable the screensaver and automatic screen lock
{
# Disable the screensaver and automatic screen lock
echo "xset s off -dpms"
echo "gsettings set org.gnome.desktop.screensaver lock-enabled false"
} >> ~/.bashrc

# Add aliases and enable the python venv by default
{

# Add aliases and enable the python venv by default
echo "source ${HOME}/.alias"
echo "source ${HOME}/python-venvs/pyprecice/bin/activate"
} >> ~/.bashrc

# Add OpenMPI settings
echo "export OMPI_MCA_btl='self,sm'"
echo "export PRTE_MCA_rmaps_default_mapping_policy=:oversubscribe"
} >> ~/.bashrc
Loading