Difference between revisions of "Installation/Linux/foam-extend-4.0/Ubuntu"
(→Ubuntu 18.04) |
(→Ubuntu 20.04) |
||
Line 102: | Line 102: | ||
In order to include the 18.04 repositories create a file <bash>bionic_legacy.list</bash> in <bash>/etc/apt/sources.list.d</bash> which contains the line: | In order to include the 18.04 repositories create a file <bash>bionic_legacy.list</bash> in <bash>/etc/apt/sources.list.d</bash> which contains the line: | ||
− | <bash> | + | <bash> deb http://gb.archive.ubuntu.com/ubuntu/ bionic universe |
− | deb http://gb.archive.ubuntu.com/ubuntu/ bionic universe | + | |
</bash> | </bash> | ||
Line 113: | Line 112: | ||
then update the apt package lists: | then update the apt package lists: | ||
− | <bash> | + | <bash> apt update |
− | apt update | + | |
</bash> | </bash> | ||
Revision as of 14:50, 10 August 2020
1 Introduction
This page is dedicated to preparing an Ubuntu system for installing the foam-extend project .
Contents
2 Ubuntu versions
2.1 Ubuntu 12.04
Run the following commands:
sudo apt-get update
sudo apt-get install git-core build-essential binutils-dev flex bear \ bison zlib1g-dev qt4-dev-tools libqt4-dev libncurses5-dev libreadline-dev \ libxt-dev rpm mercurial graphviz python python-dev
Then follow the instructions on the previous page, subsection Get the source code, although keep in mind to run the following commands before you run source etc/bashrc:
echo export WM_COMPILER=Gcc49 >> etc/prefs.sh echo export WM_THIRD_PARTY_USE_GCC_492=1 >> etc/prefs.sh echo export compilerInstall=FOAM >> etc/prefs.sh
More specifically, the commands should be executed something like this:
cd ~/foam/foam-extend-4.0 echo export WM_COMPILER=Gcc49 >> etc/prefs.sh echo export WM_THIRD_PARTY_USE_GCC_492=1 >> etc/prefs.sh echo export compilerInstall=FOAM >> etc/prefs.sh source etc/bashrc
2.2 Ubuntu 14.04
Run the following commands:
sudo apt-get update
sudo apt-get install git-core build-essential binutils-dev cmake flex \ bison zlib1g-dev qt4-dev-tools libqt4-dev libncurses5-dev libiberty-dev \ libxt-dev rpm mercurial graphviz python python-dev
Then continue following the instructions on the previous page, subsection Get the source code.
2.3 Ubuntu 16.04
Run the following commands:
sudo apt-get update
sudo apt-get install git-core build-essential binutils-dev cmake flex \ zlib1g-dev qt4-dev-tools libqt4-dev libncurses5-dev libiberty-dev \ libxt-dev rpm mercurial graphviz python python-dev
Then follow the instructions on the previous page, subsection Get the source code, although keep in mind to run the following commands before you run source etc/bashrc:
echo export WM_THIRD_PARTY_USE_BISON_27=1 >> etc/prefs.sh
More specifically, the commands should be executed something like this:
cd ~/foam/foam-extend-4.0 echo export WM_THIRD_PARTY_USE_BISON_27=1 >> etc/prefs.sh source etc/bashrc
Note: If you are using Ubuntu within WSL, then study this thread: Problems compiling foam-extend-4.0 + fsiFoam on Ubuntu+WSL
2.4 Ubuntu 18.04
Run the following commands:
sudo apt-get update
sudo apt-get install git-core build-essential binutils-dev cmake flex bear \ zlib1g-dev qt4-dev-tools libqt4-dev libncurses5-dev libreadline-dev \ libxt-dev rpm mercurial graphviz python python-dev python3 python3-dev gcc-5 g++-5
Then follow the instructions on the previous page, subsection Get the source code, but keep in mind to run a few additional commands before you run source etc/bashrc... More specifically, the commands should be executed something like this:
cd ~/foam/foam-extend-4.0 echo export WM_THIRD_PARTY_USE_BISON_27=1 >> etc/prefs.sh echo export QT_SELECT=qt4 >> etc/prefs.sh echo "export WM_CC='gcc-5'" >> etc/prefs.sh echo "export WM_CXX='g++-5'" >> etc/prefs.sh echo "export QT_BIN_DIR=/usr/bin/" >> etc/prefs.sh source etc/bashrc
Then before running Allwmake.firstInstall, run the following commands:
sed -i -e 's=rpmbuild --define=rpmbuild --define "_build_id_links none" --define=' ThirdParty/tools/makeThirdPartyFunctionsForRPM sed -i -e 's/gcc/\$(WM_CC)/' wmake/rules/linux64Gcc/c sed -i -e 's/g++/\$(WM_CXX)/' wmake/rules/linux64Gcc/c++
If you want to compile Paraview you also need to tell foam-extend where to find QT4:
export QT_BIN_DIR=/usr/bin
2.5 Ubuntu 20.04
Ubuntu 20.04 does not supply gcc/g++5 in its repository.
The gcc5 toolchain can be installed from the 18.04 repositories. Be aware that this may break some dependencies in rare cases.
In order to include the 18.04 repositories create a filebionic_legacy.listin
/etc/apt/sources.list.dwhich contains the line:
deb http://gb.archive.ubuntu.com/ubuntu/ bionic universe
Ubuntu 20.04 has also dropped QT4. So if you want to install Paraview that comes with foam-extend you have to install QT4 from another repository. To do that, add the repository for QT4:
sudo add-apt-repository ppa:rock-core/qt4
then update the apt package lists:
apt update
After that follow instructions for Ubuntu 18.04 above.