Compilation of Elmer under Ubuntu
(note: instructions may be out of date)
Download the source code and create
builddirectory as aboveInstall the dependencies
sudo apt install git cmake build-essential gfortran libopenmpi-dev libblas-dev liblapack-devWithout MPI: **
cmake .. -DWITH_OpenMP:BOOLEAN=TRUEWith MPI: **
cmake .. -DWITH_OpenMP:BOOLEAN=TRUE -DWITH_MPI:BOOLEAN=TRUEWith ElmerGUI: **
sudo apt install libqt4-dev libqwt-dev**cmake .. -DWITH_OpenMP:BOOLEAN=TRUE -DWITH_MPI:BOOLEAN=TRUE -DWITH_ELMERGUI:BOOLEAN=TRUEWith Elmer/Ice (enabling netcdf and MUMPS): **
sudo apt install libnetcdf-dev libnetcdff-dev libmumps-dev libparmetis-dev**cmake .. -DWITH_OpenMP:BOOLEAN=TRUE -DWITH_MPI:BOOLEAN=TRUE -DWITH_ElmerIce:BOOLEAN=TRUE -DWITH_Mumps:BOOL=TRUEmakesudo make installThe executables are in
/usr/local/binfolder, you may add this to your PATH if you will
These are more recent instructions on discussion forum for Ubuntu 22.04:
Following, detailed and working instructions to compile and install on Ubuntu 24.04
Clone the repository and cd into it
git clone https://github.com/ElmerCSC/elmerfem.git
cd elmerfemInstall dependencies
sudo apt install git cmake build-essential gfortran libopenmpi-dev libblas-dev liblapack-dev
As an alternative
Install all dependencies for complete installation:
sudo apt install git cmake build-essential gfortran libopenmpi-dev libblas-dev liblapack-dev qtscript5-dev libqt5svg5-dev libqwt-qt5-dev libnetcdf-dev libnetcdff-dev libmumps-dev libparmetis-devCreate the build directory inside the repo "elmerfem" and cd into it
mkdir build
cd buildCommand to create the Makefile, with the basis. No GUI, No MPI, nothing...
cmake -DWITH_ELMERGUI:BOOL=FALSE -DWITH_MPI:BOOL=FALSE -DCMAKE_INSTALL_PREFIX=<the-path-where-you-want-to-install> ../../elmerfemWith MPI add the following to the cmake command: **
cmake .. -DWITH_OpenMP:BOOLEAN=TRUE -DWITH_MPI:BOOLEAN=TRUEWith ElmerGUI, you first need to install the following packages: **
sudo apt install qtscript5-dev libqt5svg5-dev libqwt-qt5-devthen add the following options to the cmake command:cmake .. -DWITH_OpenMP:BOOLEAN=TRUE -DWITH_MPI:BOOLEAN=TRUE -DWITH_ELMERGUI:BOOLEAN=TRUEWith Elmer/Ice (enabling netcdf and MUMPS), you need to install the following packages: **
sudo apt install libnetcdf-dev libnetcdff-dev libmumps-dev libparmetis-devThen add the followinf options to the cmake command:cmake .. -DWITH_OpenMP:BOOLEAN=TRUE -DWITH_MPI:BOOLEAN=TRUE -DWITH_ElmerIce:BOOLEAN=TRUE -DWITH_Mumps:BOOL=TRUEDo you want to Compile Everything?
cmake -DWITH_ELMERGUI:BOOL=TRUE -DWITH_OpenMP:BOOLEAN=TRUE -DWITH_MPI:BOOL=TRUE -DWITH_ElmerIce:BOOLEAN=TRUE -DWITH_Mumps:BOOL=TRUE -DCMAKE_INSTALL_PREFIX=<the-path-where-you-want-to-install> ../../elmerfemCompile
makeInstall
(sudo) make installThe executables are in the folder you chose before , you may add this to your PATH if you will, by modifying the file /etc/environmentIssues with windows without borders? Modify /etc/environment by adding the following line
export QT_QPA_PLATFORM="xcb"