Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Port to Ubuntu 24.04 #94

Draft
wants to merge 5 commits into
base: develop
Choose a base branch
from
Draft
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
11 changes: 7 additions & 4 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,9 +58,7 @@ 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)
Expand All @@ -76,6 +74,11 @@ 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?

- 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
8 changes: 5 additions & 3 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,11 +50,13 @@ 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
Expand Down
10 changes: 9 additions & 1 deletion provisioning/install-aste.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,15 @@
set -ex

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

# The following packages have unmet dependencies:
sudo apt-get -y install libvtk9-dev libvtk9-qt-dev
sudo apt-get -y install libmetis-dev

python -m venv ~/python-venvs/aste
# shellcheck disable=SC1090 # We don't need to lint this external script
source ~/python-venvs/aste/bin/activate

python3 -m pip install sympy scipy jinja2

# Get aste
Expand All @@ -21,3 +27,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
6 changes: 5 additions & 1 deletion provisioning/install-fenics.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,8 @@ 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
# shellcheck disable=SC1090 # We don't need to lint this external script
source ~/python-venvs/fenicsprecice/bin/activate
python -m pip install fenicsprecice
deactivate
4 changes: 2 additions & 2 deletions provisioning/install-fmiprecice.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#!/usr/bin/env bash
set -ex

# Install the FMI runner from PIP
pip3 install --user fmiprecice
# Install the FMI runner (stand-alone application) from PyPI
pipx install fmiprecice
8 changes: 7 additions & 1 deletion provisioning/install-julia-bindings.sh
Original file line number Diff line number Diff line change
@@ -1,11 +1,17 @@
#!/usr/bin/env bash

python -m venv ~/python-venvs/julia
# shellcheck disable=SC1090 # We don't need to lint this external script
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
4 changes: 3 additions & 1 deletion provisioning/install-micro-manager.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
#!/usr/bin/env bash
set -ex

pip install --user micro-manager-precice
# Install the micro-manager (stand-alone application) from PyPI
pipx install micro-manager-precice
Copy link
Member

@fsimonis fsimonis May 3, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The micro-manager two-scale tutorial is compatible with pix installations since precice/tutorials#533


2 changes: 1 addition & 1 deletion provisioning/install-paraview.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/env bash
set -ex

sudo apt-get install -y paraview
sudo apt-get install -y --no-install-recommends paraview
14 changes: 10 additions & 4 deletions provisioning/install-precice.sh
Original file line number Diff line number Diff line change
Expand Up @@ -58,11 +58,17 @@ 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
# shellcheck disable=SC1090 # We don't need to lint this external script
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
12 changes: 11 additions & 1 deletion provisioning/install-su2.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,11 @@
set -ex

# Install dependencies
pip3 install --user mpi4py
python -m venv ~/python-venvs/su2precice
# shellcheck disable=SC1090 # We don't need to lint this external script
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 +39,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
Loading