Skip to content

Commit

Permalink
Port to Ubuntu 24.04, excluding ASTE, code_aster, and FEniCS
Browse files Browse the repository at this point in the history
  • Loading branch information
MakisH committed Apr 29, 2024
1 parent 4ac47a4 commit 3c7c855
Show file tree
Hide file tree
Showing 14 changed files with 70 additions and 29 deletions.
13 changes: 8 additions & 5 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 20.04 "base box" and asks e.g. VirtualBox to start a virtual machine.
Vagrant pulls an Ubuntu 24.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 Down Expand Up @@ -40,7 +40,7 @@ A few things you may need:

## What is included?

This box is based on the ~~[generic/ubuntu2004](https://github.com/lavabit/robox/tree/master/scripts/ubuntu2004)~~ [bento/ubuntu-20.04](https://github.com/chef/bento) base box and installs:
This box is based on the [bento/ubuntu-24.04](https://github.com/chef/bento) base box and installs:

- Xubuntu-core (Xfce desktop environment) and related tools
- VirtualBox guest additions
Expand All @@ -58,12 +58,9 @@ This box is based on the ~~[generic/ubuntu2004](https://github.com/lavabit/robox
- OpenFOAM v2312 and the OpenFOAM-preCICE adapter (master)
- deal.II 9.3 from the official backports and the deal.II-preCICE adapter (master)
- CalculiX 2.20 from source and the CalculiX-preCICE adapter (master)
- FEniCS latest from the FEniCS PPA and the FEniCS-preCICE adapter (PIP)
- SU2 7.5.1 and the SU2-preCICE adapter (master)
- code_aster 14.6 and the code_aster-preCICE adapter (master)
- DUNE 2.9.1 and the experimental DUNE-preCICE adapter (main)
- DuMuX 3.8 and the DuMuX-preCICE adapter (v2.0.0)
- ASTE (master)
- Paraview from APT
- Gnuplot

Expand All @@ -76,6 +73,12 @@ The adapter repositories remain in `/home/vagrant/`.
It also adds a few shortcuts on the Desktop (see `post-install.sh`).
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 (master)
- code_aster 14.6 and the code_aster-preCICE adapter (master)
- FEniCS latest from the FEniCS PPA and the FEniCS-preCICE adapter (PIP)

## Troubleshooting

### This does not seem to work on my machine
Expand Down
11 changes: 7 additions & 4 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-20.04"
config.vm.box = "bento/ubuntu-24.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 Down Expand Up @@ -50,15 +50,18 @@ Vagrant.configure("2") do |config|
config.vm.provision "shell", path: "provisioning/install-openfoam.sh", privileged: false
config.vm.provision "shell", path: "provisioning/install-dealii.sh", privileged: false
config.vm.provision "shell", path: "provisioning/install-calculix.sh", privileged: false
config.vm.provision "shell", path: "provisioning/install-fenics.sh", privileged: false
# FEniCS is not yet available for Ubuntu 24.04: https://launchpad.net/~fenics-packages/+archive/ubuntu/fenics
# config.vm.provision "shell", path: "provisioning/install-fenics.sh", privileged: false
config.vm.provision "shell", path: "provisioning/install-fmiprecice.sh", privileged: false
config.vm.provision "shell", path: "provisioning/install-micro-manager.sh", privileged: false
config.vm.provision "shell", path: "provisioning/install-su2.sh", privileged: false
config.vm.provision "shell", path: "provisioning/install-code_aster.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
# config.vm.provision "shell", path: "provisioning/install-code_aster.sh", privileged: false
config.vm.provision "shell", path: "provisioning/install-dune.sh", privileged: false
config.vm.provision "shell", path: "provisioning/install-paraview.sh", privileged: false
config.vm.provision "shell", path: "provisioning/install-julia-bindings.sh", privileged: false
config.vm.provision "shell", path: "provisioning/install-aste.sh", privileged: false
# VTK dependency conflicts with ParaView
# config.vm.provision "shell", path: "provisioning/install-aste.sh", privileged: false

# Post-installation steps
config.vm.provision "shell", path: "provisioning/post-install.sh", privileged: false
Expand Down
11 changes: 10 additions & 1 deletion provisioning/install-aste.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,16 @@
set -ex

# Install the C++ vtk library
sudo apt-get -y install libvtk7-dev

# The following packages have unmet dependencies:
# python3-paraview : Conflicts: python3-vtk9 but 9.1.0+really9.1.0+dfsg2-7.1build3 is to be installed
# sudo apt-get -y install libvtk9-dev

sudo apt-get -y install libmetis-dev

python -m venv ~/python-venvs/aste
source ~/python-venvs/aste/bin/activate

python3 -m pip install sympy scipy jinja2

# Get aste
Expand All @@ -21,3 +28,5 @@ fi
# Add aste to PATH and libmetis to the library path
echo "export PATH=\"\${HOME}/aste/build:\${PATH}\"" >>~/.bashrc
echo "export LD_LIBRARY_PATH=\"\${HOME}/aste/build:\${LD_LIBRARY_PATH}\"" >>~/.bashrc

deactivate
4 changes: 2 additions & 2 deletions provisioning/install-basics.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ sudo apt-get update
sudo apt-get upgrade -qy

# Install the Xfce desktop environment and basic applications
sudo apt-get install -y xubuntu-core^
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 python3-dev pipx python-is-python3 python3-venv

Expand All @@ -19,7 +19,7 @@ sudo apt-get install -y python3-dev pipx python-is-python3 python3-venv
# echo "autologin-user=vagrant" | sudo tee --append /usr/share/lightdm/lightdm.conf.d/60-xubuntu.conf

# Install the VirtualBox guest additions
sudo apt-get install -y virtualbox-guest-dkms virtualbox-guest-utils virtualbox-guest-x11
sudo apt-get install -y virtualbox-guest-utils virtualbox-guest-x11

# Create Desktop
mkdir -p ~/Desktop
Expand Down
2 changes: 1 addition & 1 deletion provisioning/install-calculix.sh
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ fi
(
cd calculix-adapter
git pull
make -j "$(nproc)"
ADDITIONAL_FFLAGS=-fallow-argument-mismatch make -j "$(nproc)"
)

# Add the CalculiX adapter to PATH
Expand Down
2 changes: 1 addition & 1 deletion provisioning/install-config-visualizer.sh
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,6 @@ echo 'export PATH="${HOME}/.local/bin:${PATH}"' >> ~/.bashrc
# Add the GUI in the apps menu
mkdir -p ~/.local/share/applications ~/.local/share/icons

CV_LOC_SHARE=~/.local/pipx/venvs/precice-config-visualizer-gui==${PRECICE_CONFIG_VISUALIZER_GUI_VERSION}/share
CV_LOC_SHARE=~/.local/share/pipx/venvs/precice-config-visualizer-gui/share
cp $CV_LOC_SHARE/applications/org.precice.config_visualizer.desktop ~/.local/share/applications/
cp $CV_LOC_SHARE/icons/hicolor/scalable/apps/org.precice.config_visualizer.svg ~/.local/share/icons/
2 changes: 0 additions & 2 deletions provisioning/install-dealii.sh
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
#!/usr/bin/env bash
set -ex

# Install deal.II from the deal.II 9.3.0 backports PPA
sudo add-apt-repository ppa:ginggs/deal.ii-9.3.0-backports
sudo apt-get update
sudo apt-get install -y libdeal.ii-dev

Expand Down
5 changes: 4 additions & 1 deletion provisioning/install-fenics.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,7 @@ sudo apt-get -y update
sudo apt-get -y install --no-install-recommends fenics

# Install the FEniCS-preCICE adapter from PIP
pip3 install --user fenicsprecice
python -m venv ~/python-venvs/fenicsprecice
source ~/python-venvs/fenicsprecice/bin/activate
python -m pip install fenicsprecice
deactivate
7 changes: 6 additions & 1 deletion provisioning/install-fmiprecice.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
#!/usr/bin/env bash
set -ex

python -m venv ~/python-venvs/fmiprecice
source ~/python-venvs/fmiprecice/bin/activate

# Install the FMI runner from PIP
pip3 install --user fmiprecice
python -m pip install fmiprecice

deactivate
7 changes: 6 additions & 1 deletion provisioning/install-julia-bindings.sh
Original file line number Diff line number Diff line change
@@ -1,11 +1,16 @@
#!/usr/bin/env bash

python -m venv ~/python-venvs/julia
source ~/python-venvs/julia/bin/activate

# install latest julia
pip3 install jill
python -m pip install jill
jill install --confirm

# install preCICE bindings
julia -e 'using Pkg; Pkg.add("PreCICE")'

# to test the installation, run the following command:
# julia -e 'using Pkg; Pkg.test("PreCICE")'

deactivate
7 changes: 6 additions & 1 deletion provisioning/install-micro-manager.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@
#!/usr/bin/env bash
set -ex

pip install --user micro-manager-precice
python -m venv ~/python-venvs/micro-manager
source ~/python-venvs/micro-manager/bin/activate

python -m pip install micro-manager-precice

deactivate
13 changes: 9 additions & 4 deletions provisioning/install-precice.sh
Original file line number Diff line number Diff line change
Expand Up @@ -58,11 +58,16 @@ sudo apt-get -y install gnuplot # needed for watchpoint scripts of tutorials
### OPTIONAL - preCICE Python bindings and Python example
# Get PIP and the preCICE Python bindings
sudo apt-get install -y python3-pip
pip3 install --upgrade pip
pip3 install --user pyprecice

# Additional python packages
pip3 install --user pandas matplotlib polars # Needed for the post-processing scripts
python -m venv ~/python-venvs/pyprecice
source ~/python-venvs/pyprecice/bin/activate

python -m pip install pyprecice

# Additional python packages -> Should go into tutorials venvs
# pip3 install --user pandas matplotlib polars # Needed for the post-processing scripts

deactivate

# Get the Python solverdummy into the examples
if [ ! -d "python-bindings/" ]; then
Expand Down
11 changes: 10 additions & 1 deletion provisioning/install-su2.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,10 @@
set -ex

# Install dependencies
pip3 install --user mpi4py
python -m venv ~/python-venvs/su2precice
source ~/python-venvs/su2precice/bin/activate
python -m pip install mpi4py setuptools
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
Expand Down Expand Up @@ -35,9 +38,15 @@ fi
# Configure and build the SU2 adapter
(
cd "${SU2_HOME}"

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

./meson.py build -Denable-pywrapper=true --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

deactivate
4 changes: 0 additions & 4 deletions provisioning/post-install.sh
Original file line number Diff line number Diff line change
@@ -1,10 +1,6 @@
#!/usr/bin/env bash
set -ex

# Remove fenics-ufl package
# Workaround for https://github.com/precice/vm/issues/4
# pip3 uninstall -y fenics-ufl

# Create a link to the default shared folder
ln -sf /vagrant/ ~/Desktop/shared

Expand Down

0 comments on commit 3c7c855

Please sign in to comment.