Precompiled packages (Ubuntu)
# Add the repository curl -s https://dl.openfoam.com/add-debian-repo.sh | sudo bash # Install preferred package. Eg, sudo apt-get install openfoam2112-default # Use the openfoam shell session. Eg, openfoam2112
- Frequently Asked Questions
For Debian and Ubuntu, OpenCFD works actively with the Debian (science) maintainers to improve the packaging, but also provides its own early-release Ubuntu repository For Linux newcomers: Ubuntu is a Debian-derivative and thus its repositories invariably contain references to deb or debian.
To use the OpenFOAM early-release Ubuntu repository, you will need to add the signing key and the repository location(s) to your system. This typically only needs to be done once per distribution. The most convenient way is to use the installer script with one of these commands:
curl -s https://dl.openfoam.com/add-debian-repo.sh | sudo bash
wget -q -O - https://dl.openfoam.com/add-debian-repo.sh | sudo bash
which conveniently bundles several operations. After this you should immediately be able to install your preferred OpenFOAM package. For example,
sudo apt-get install openfoam2112-default
After migrating from one version to another, you can remove the old version with the usual commands. For example,
sudo apt-get autoremove openfoam2112-default
Supported versions and distributions
It is too early to establish a policy about which older OpenFOAM versions will be supported, but these should generally be covered by the regular Debian and Ubuntu updates (not the early release repo).
The goal of the early release repository is to support the newest Ubuntu LTS versions (allowing for a few months transition when a new LTS is released). The Ubuntu rolling releases will generally also be targeted, since these provide a good advanced warning of issues that may appear in the next LTS.
Following the precompiled packages - sub-packages descriptions, the following represent typical installation commands:
As documented in precompiled packages - locations.
After installation - using the OpenFOAM environment
As documented in precompiled packages - OpenFOAM environment.
After adding the repositories and installing a particular version of
OpenFOAM, upgrade notifications should also appear
(for example for
Direct integration in Debian is expected to further improve in the
near future. Packages older than
2006 should be used with some
caution. The OpenFOAM applications are located under
configuration files under
/usr/share/openfoam/etc, which means that
you will need to manually define the location of the OpenFOAM
directory as follows:
|Debian (science)||package openfoam - see debian search and tracker||Maintained independently, with input from OpenCFD||older is "stable" (used for debian), newest is "testing" (used for ubuntu)|
|sourceforge repo||sourceforge repo||Actively maintained by OpenCFD||backend for https://dl.openfoam.com/repos/deb|
- Reference README contents that should appear on the sourceforge repo.
- Reference installer script contents that should appear on dl.openfoam.com/
Frequently Asked Questions
What does the installer script actually do?
- Adds the https://dl.openfoam.com/pubkey.gpg signing key for the repository
- Adds repository information for a given distribution (eg, buster, focal, etc.):
deb [arch=amd64] https://dl.openfoam.com/repos/deb DIST main
apt-get updateto refresh the repositories, which means you should immediately be able to install your preferred OpenFOAM package. For example,
sudo apt-get install openfoam2112-default
Cannot find MPI library
This is a very strange issue in which the Ubuntu triggers fails to properly link the mpi libraries.
The contents for
$ dpkg-query -L libopenmpi-dev | grep libmpi /usr/lib/x86_64-linux-gnu/openmpi/lib/libmpi.so /usr/lib/x86_64-linux-gnu/openmpi/lib/libmpi_cxx.so ...
Reverse lookup is also correct:
$ dpkg-query -S /usr/lib/x86_64-linux-gnu/openmpi/lib/libmpi.so libopenmpi-dev:amd64: /usr/lib/x86_64-linux-gnu/openmpi/lib/libmpi.so
Except that none of the links actually exist on the regular Ubuntu install (the docker install is OK for some unknown reason). It appears that the triggers for
libopenmpi-devmight be run too soon.
The following brute-force method (there might be a cleaner way) seems to work to retrigger things properly.
$ sudo dpkg --remove --force-all libopenmpi-dev $ sudo apt install libopenmpi-dev
After this all of the
.solinks exist as expected.
Copyright (C) 2020-2021 OpenCFD Ltd.