CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > OpenFOAM > OpenFOAM Installation

[foam-extend.org] Install foam-extend-4.0 on Ubuntu 20.04.1 LTS

Register Blogs Community New Posts Updated Threads Search

Like Tree17Likes
  • 13 Post By Daniel_Khazaei
  • 2 Post By ismailalkis
  • 1 Post By mpanch13114
  • 1 Post By jeffer7

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   November 12, 2020, 23:09
Default Install foam-extend-4.0 on Ubuntu 20.04.1 LTS
  #1
Senior Member
 
Daniel
Join Date: Mar 2013
Location: Noshahr, Iran
Posts: 348
Rep Power: 21
Daniel_Khazaei will become famous soon enough
Hello to everyone,

As many of you may need to run solids4Foam toolbox with all available features, it is recommended to use foam-extend-4.0 instead of foam-extend-4.1 as it seems to have some stability issues.

Ubuntu 20.04.1 LTS doesn't come with gcc-5 and qt-4 out of the box and installing these packages using previous versions' repositories is not recommended as it may cause incompatibility and unexpected behavior through out the system. So here, we build both libraries from scratch to avoid any possible conflicts in the future.

1. First, we need to build gcc-5.5 from source:

Although gcc-5 can be built successfully using "ThirdParty" scripts of foam-extend itself, the rest of the ThirdParty packages that depend on it fail to link against correct libraries properly after installing Ubuntu 20.04.1 LTS (It used to work on Ubuntu 19.10). Therefore, we build and install gcc-5 with the following approach and set foam-extend-4.0 up to use it during the compile process.

1-1 Create a folder called "workspace" in your "home" directory, you can name the folder what ever you want as it does not matter!

1-2 Download gcc-5 patch attached and put inside "workspace" folder.

Note: gcc-5 needs to be patched for glib compatibility, otherwise it fails to build.

1-3 Now open the terminal and follow the instructions:

Code:
cd ~
cd workspace
wget https://ftpmirror.gnu.org/gcc/gcc-5.5.0/gcc-5.5.0.tar.gz
tar xf gcc-5.5.0.tar.gz
cd gcc-5.5.0
patch -p1 < ../glib.sanitizer.patch
contrib/download_prerequisites
1-4 Start building and finally installing gcc-5

Code:
cd ..
mkdir build && cd build

// Now configure gcc-5
../gcc-5.5.0/configure  -v --build=x86_64-linux-gnu --host=x86_64-linux-gnu  --target=x86_64-linux-gnu --prefix=/usr/local/gcc-5.5  --enable-checking=release --enable-languages=c,c++,fortran  --enable-shared --disable-multilib --program-suffix=-5

// Change 4 to any number based on the available CPU cores
make -j 4 > log.make 2>&1

// Inspect log.make for possible errors before proceeding to install
sudo make install-strip
Now you have a working gcc-5 installation located at:
Code:
/usr/local/gcc-5.5
You may now close the terminal.

2. Building foam-extend-4.0

Here I assume that you have already installed all the required libraries needed to build foam-extend-4.0 with the exception of qt4 and gcc-5.

2-1 Create "foam" directory and clone foam-extend-4.0

Code:
cd ~
mkdir foam
cd foam
git clone git://git.code.sf.net/p/foam-extend/foam-extend-4.0 foam-extend-4.0
Close the terminal and proceed with the next step.

2-2 Download the attached files and put them inside foam-extend-4.0 directory according to the following instruction:

file name: fe40.patch
Code:
foam/foam-extend-4.0/
file name: prefs.sh
Code:
foam/foam-extend-4.0/etc/
file name: qt-everywhere-opensource-src-4.8.7.patch
Code:
foam/foam-extend-4.0/ThirdParty/rpmBuild/SOURCES/
file names: "bison-3.2.4.spec", "cmake-3.12.1.spec" and "qt-everywhere-opensource-src-4.8.7.spec"
Code:
foam/foam-extend-4.0/ThirdParty/rpmBuild/SPECS/
Important: Even though these packages should automatically get downloaded using foam-extend-4.0 scripts, please download manually and put all of them inside

Code:
foam/foam-extend-4.0/ThirdParty/rpmBuild/SOURCES/
to avoid any unexpected failure. List of the packages needed:

Code:
bison-3.2.4.tar.gz
cmake-3.12.1.tar.gz
hwloc-1.10.1.tar.gz
libccmio-2.6.1.tar.gz
mesquite-2.1.2.tar.gz
metis-5.1.0.tar.gz
ParaView-v4.4.0-source.tar.gz
parmetis-4.0.3.tar.gz
ParMGridGen-1.0.tar.gz
PyFoam-0.6.4.tar.gz
qt-everywhere-opensource-src-4.8.7.tar.gz
scotch_6.0.4.tar.gz
Note: make sure the packages' names are consistent.

2.3 Open terminal and set the environment variables:

Code:
cd ~/foam/foam-extend-4.0
source etc/bashrc
 
echo "alias fe40='source \$HOME/foam/foam-extend-4.0/etc/bashrc'" >> $HOME/.bashrc
You can close the terminal.

2.4 Now open terminal and start building foam-extend-4.0

Important: It also includes building qt 4.8.7 and paraview 4.4.0 with MPI, and python enabled by default.

Code:
cd ~/foam/foam-extend-4.0
git apply fe40.patch

// source foam-extend
fe40

// build ThirdParty packages, change 4 based on the available CPU cores
export WM_NCOMPPROCS=4
cd $WM_THIRD_PARTY_DIR

./AllMake.stage1 > log.stage1.make 2>&1
./AllMake.stage2 > log.stage2.make 2>&1
./AllMake.stage3 > log.stage3.make 2>&1
./AllMake.stage4 > log.stage4.make 2>&1

// Now build foam-extend-4.0
fe40
cd $WM_PROJECT_DIR
./Allwmake > log.make 2>&1

// Create user directory
mkdir -p $FOAM_RUN
cp -r $FOAM_TUTORIALS $FOAM_RUN
Congratulations, you have successfully installed foam-extend-4.0!
Note: I will probably create a repository to automate all these steps for further convenience

Hope it helps...

D. Khazaei
Attached Files
File Type: zip foam-extend-4.0-patch.zip (25.5 KB, 195 views)
File Type: zip gcc-5-patch.zip (953 Bytes, 180 views)
elvis, Hrishikesh, Bana and 10 others like this.
Daniel_Khazaei is offline   Reply With Quote

Old   May 12, 2021, 04:14
Red face Some packages were not found
  #2
New Member
 
Jiayu Sun
Join Date: Jul 2020
Location: Harbin,China
Posts: 18
Rep Power: 6
Richal Sun is on a distinguished road
Hi Daniel,

Thank you for your sharing. It really helps me a lot. But I got stuck in step 2.2. I couldn't find all the packages you mentioned. The packages I didn't find are bison-3.2.4.tar.gz, cmake-3.12.1.tar.gz, parmetics-4.0.3.tar.gz, PyFoam-0.6.4.tar.gz, qt-everywhere-opensource-src-4.8.7.tar.gz.
I'm sorry to disturb you.It can be found directly by Google.

Jiayu Sun

Last edited by Richal Sun; May 12, 2021 at 04:42. Reason: Solved
Richal Sun is online now   Reply With Quote

Old   May 23, 2021, 06:54
Default
  #3
New Member
 
bunyamin ismail alkis
Join Date: Feb 2019
Posts: 1
Rep Power: 0
ismailalkis is on a distinguished road
ismail@ENASUS:~/foam/foam-extend-4.0$ git apply fe40.patch
error: patch failed: ThirdParty/tools/makeThirdPartyFunctionsForRPM:177
error: ThirdParty/tools/makeThirdPartyFunctionsForRPM: patch does not apply
error: patch failed: wmake/rules/linux64Gcc/c:2
error: wmake/rules/linux64Gcc/c: patch does not apply
error: patch failed: wmake/rules/linux64Gcc/c++:2
error: wmake/rules/linux64Gcc/c++: patch does not apply



Anyone can help me resolve this ?
yuanyang and Annie13 like this.
ismailalkis is offline   Reply With Quote

Old   May 23, 2021, 07:56
Default Will this work for Fedora?
  #4
Senior Member
 
Sultan Islam
Join Date: Dec 2015
Location: Canada
Posts: 141
Rep Power: 10
EternalSeekerX is on a distinguished road
Quote:
Originally Posted by Daniel_Khazaei View Post
Hello to everyone,

As many of you may need to run solids4Foam toolbox with all available features, it is recommended to use foam-extend-4.0 instead of foam-extend-4.1 as it seems to have some stability issues.

Ubuntu 20.04.1 LTS doesn't come with gcc-5 and qt-4 out of the box and installing these packages using previous versions' repositories is not recommended as it may cause incompatibility and unexpected behavior through out the system. So here, we build both libraries from scratch to avoid any possible conflicts in the future.

1. First, we need to build gcc-5.5 from source:

Although gcc-5 can be built successfully using "ThirdParty" scripts of foam-extend itself, the rest of the ThirdParty packages that depend on it fail to link against correct libraries properly after installing Ubuntu 20.04.1 LTS (It used to work on Ubuntu 19.10). Therefore, we build and install gcc-5 with the following approach and set foam-extend-4.0 up to use it during the compile process.

1-1 Create a folder called "workspace" in your "home" directory, you can name the folder what ever you want as it does not matter!

1-2 Download gcc-5 patch attached and put inside "workspace" folder.

Note: gcc-5 needs to be patched for glib compatibility, otherwise it fails to build.

1-3 Now open the terminal and follow the instructions:

Code:
cd ~
cd workspace
wget https://ftpmirror.gnu.org/gcc/gcc-5.5.0/gcc-5.5.0.tar.gz
tar xf gcc-5.5.0.tar.gz
cd gcc-5.5.0
patch -p1 < ../glib.sanitizer.patch
contrib/download_prerequisites
1-4 Start building and finally installing gcc-5

Code:
cd ..
mkdir build && cd build

// Now configure gcc-5
../gcc-5.5.0/configure  -v --build=x86_64-linux-gnu --host=x86_64-linux-gnu  --target=x86_64-linux-gnu --prefix=/usr/local/gcc-5.5  --enable-checking=release --enable-languages=c,c++,fortran  --enable-shared --disable-multilib --program-suffix=-5

// Change 4 to any number based on the available CPU cores
make -j 4 > log.make 2>&1

// Inspect log.make for possible errors before proceeding to install
sudo make install-strip
Now you have a working gcc-5 installation located at:
Code:
/usr/local/gcc-5.5
You may now close the terminal.

2. Building foam-extend-4.0

Here I assume that you have already installed all the required libraries needed to build foam-extend-4.0 with the exception of qt4 and gcc-5.

2-1 Create "foam" directory and clone foam-extend-4.0

Code:
cd ~
mkdir foam
cd foam
git clone git://git.code.sf.net/p/foam-extend/foam-extend-4.0 foam-extend-4.0
Close the terminal and proceed with the next step.

2-2 Download the attached files and put them inside foam-extend-4.0 directory according to the following instruction:

file name: fe40.patch
Code:
foam/foam-extend-4.0/
file name: prefs.sh
Code:
foam/foam-extend-4.0/etc/
file name: qt-everywhere-opensource-src-4.8.7.patch
Code:
foam/foam-extend-4.0/ThirdParty/rpmBuild/SOURCES/
file names: "bison-3.2.4.spec", "cmake-3.12.1.spec" and "qt-everywhere-opensource-src-4.8.7.spec"
Code:
foam/foam-extend-4.0/ThirdParty/rpmBuild/SPECS/
Important: Even though these packages should automatically get downloaded using foam-extend-4.0 scripts, please download manually and put all of them inside

Code:
foam/foam-extend-4.0/ThirdParty/rpmBuild/SOURCES/
to avoid any unexpected failure. List of the packages needed:

Code:
bison-3.2.4.tar.gz
cmake-3.12.1.tar.gz
hwloc-1.10.1.tar.gz
libccmio-2.6.1.tar.gz
mesquite-2.1.2.tar.gz
metis-5.1.0.tar.gz
ParaView-v4.4.0-source.tar.gz
parmetis-4.0.3.tar.gz
ParMGridGen-1.0.tar.gz
PyFoam-0.6.4.tar.gz
qt-everywhere-opensource-src-4.8.7.tar.gz
scotch_6.0.4.tar.gz
Note: make sure the packages' names are consistent.

2.3 Open terminal and set the environment variables:

Code:
cd ~/foam/foam-extend-4.0
source etc/bashrc
 
echo "alias fe40='source \$HOME/foam/foam-extend-4.0/etc/bashrc'" >> $HOME/.bashrc
You can close the terminal.

2.4 Now open terminal and start building foam-extend-4.0

Important: It also includes building qt 4.8.7 and paraview 4.4.0 with MPI, and python enabled by default.

Code:
cd ~/foam/foam-extend-4.0
git apply fe40.patch

// source foam-extend
fe40

// build ThirdParty packages, change 4 based on the available CPU cores
export WM_NCOMPPROCS=4
cd $WM_THIRD_PARTY_DIR

./AllMake.stage1 > log.stage1.make 2>&1
./AllMake.stage2 > log.stage2.make 2>&1
./AllMake.stage3 > log.stage3.make 2>&1
./AllMake.stage4 > log.stage4.make 2>&1

// Now build foam-extend-4.0
fe40
cd $WM_PROJECT_DIR
./Allwmake > log.make 2>&1

// Create user directory
mkdir -p $FOAM_RUN
cp -r $FOAM_TUTORIALS $FOAM_RUN
Congratulations, you have successfully installed foam-extend-4.0!
Note: I will probably create a repository to automate all these steps for further convenience

Hope it helps...

D. Khazaei
Hello, I am wondering if this will work for fedora? Also side note, last I tried foam extend for ubuntu 18. It still had an issue where it would show foam warning about not being able to load any decomposition methods when running decomposePar with hierarchical or patches Constraints. Did you have that same issue when using it on ubuntu 20?
EternalSeekerX is offline   Reply With Quote

Old   November 5, 2021, 14:29
Default
  #5
Member
 
Richardpluff
Join Date: May 2014
Posts: 95
Rep Power: 12
CRI_CFD is on a distinguished road
This post was really useful for me, thank you!


I don't know if this can be related to installation, but I am facing problems when running cases or meshing in parallel. For example, snappy seems to work in parallel but when it is about to write castellated mesh (1 folder), it returns the following message:


Doing final balancing
---------------------

Found 0 zoned faces to keep together.
[0] Number of cells in new mesh : 5
[0] Number of faces in new mesh : 26
[0] Number of points in new mesh: 26
[2] Number of cells in new mesh : 20086
[2] Number of faces in new mesh : 81972
[2] Number of points in new mesh: 43650
[1] Number of cells in new mesh : 3199
[1] Number of faces in new mesh : 17227
[1] Number of points in new mesh: 13341
[1] Number of cells in new mesh : 24987
[1] Number of faces in new mesh : 111291
[1] Number of points in new mesh: 64087
[0]
[0]
[0] --> FOAM FATAL ERROR:
[0] Problem. oldPointI:1953206 newPointI:-1
[0]
[0] From function fvMeshDistribute::mergeSharedPoints()
[0] in file fvMeshDistribute/fvMeshDistribute.C at line 613.
[0]
FOAM parallel run aborting
[0]
--------------------------------------------------------------------------
MPI_ABORT was invoked on rank 0 in communicator MPI_COMM_WORLD
with errorcode 1.

NOTE: invoking MPI_ABORT causes Open MPI to kill all MPI processes.
You may or may not see output from other processes, depending on
exactly when Open MPI kills them.



Any ideas about why this is happening?


Thanks in advance foamers!
CRI_CFD is offline   Reply With Quote

Old   March 11, 2022, 03:10
Default foam-extend-4.0 Docker Version
  #6
New Member
 
Panchatcharam Mariappan
Join Date: Apr 2014
Posts: 17
Rep Power: 12
mpanch13114 is on a distinguished road
I have tried these combinations, but it did not work well. I have created the trusty version of Ubuntu (14.04) in docker and installed foam-extend-4.0. This works fine.

You can pull the images from docker

Code:
docker pull pmariappan/foam-extend-4.0:latest
docker -it  pmariappan/foam-extend-4.0:latest bash
Note, if you need to detach and execute and pull the results to see in paraview, please refer docker website.
amuzeshi likes this.
mpanch13114 is offline   Reply With Quote

Old   May 3, 2023, 15:03
Default Foam extend 4.1 for Ubuntu 22.04
  #7
New Member
 
Jefferson Galeano
Join Date: May 2023
Posts: 4
Rep Power: 3
jeffer7 is on a distinguished road
Hello

How can I install Foam extend 4.1 in Ubuntu 22.04?
I already try with this link: https://openfoamwiki.net/index.php/I...end-4.1/Ubuntu, but it doesn't works, as seen in the attachment.

Any suggestion?
Attached Images
File Type: png foam extend .png (84.6 KB, 24 views)
jeffer7 is offline   Reply With Quote

Old   November 7, 2023, 00:47
Default
  #8
New Member
 
Join Date: Sep 2022
Posts: 3
Rep Power: 4
CFD- is on a distinguished road
Quote:
Originally Posted by jeffer7 View Post
Hello

How can I install Foam extend 4.1 in Ubuntu 22.04?
I already try with this link: https://openfoamwiki.net/index.php/I...end-4.1/Ubuntu, but it doesn't works, as seen in the attachment.

Any suggestion?
Hi, I have same issue in Ubuntu 22.04 LTS while installing foam-extend 4.1. Were you able to resolve this issue?
CFD- is offline   Reply With Quote

Old   November 8, 2023, 20:03
Default
  #9
New Member
 
Jefferson Galeano
Join Date: May 2023
Posts: 4
Rep Power: 3
jeffer7 is on a distinguished road
I managed to fix it, what I did was delete one of the commands, which apparently the version does not recognize or already has it, so when I deleted it not long ago, this is how the command remained:

sudo apt-get install git-core build-essential binutils-dev cmake flex \
zlib1g-dev libncurses5-dev curl bison gnuplot gnuplot-qt gnuiplot-data \
libxt-dev rpm mercurial graphviz python3 python3-dev

I selected version 18
CFD- likes this.
jeffer7 is offline   Reply With Quote

Old   November 10, 2023, 07:02
Default
  #10
New Member
 
Join Date: Sep 2022
Posts: 3
Rep Power: 4
CFD- is on a distinguished road
Quote:
Originally Posted by jeffer7 View Post
I managed to fix it, what I did was delete one of the commands, which apparently the version does not recognize or already has it, so when I deleted it not long ago, this is how the command remained:

sudo apt-get install git-core build-essential binutils-dev cmake flex \
zlib1g-dev libncurses5-dev curl bison gnuplot gnuplot-qt gnuiplot-data \
libxt-dev rpm mercurial graphviz python3 python3-dev

I selected version 18
Thanks. I searched many threads where I came across issues pertinent to compiling foam-extend 4.1 on Ubuntu 22. However, I am able to install foam-extend 5.0 on Ubuntu 22.04 LTS.
CFD- is offline   Reply With Quote

Old   May 17, 2024, 12:17
Default
  #11
Senior Member
 
Dongyue Li
Join Date: Jun 2012
Location: Beijing, China
Posts: 848
Rep Power: 18
sharonyue is on a distinguished road
yes, you can install fe40, fe41, fe50 on ubuntu 22. fe40 and fe41 requires gcc 4.8. Thats all. Thirdparty like metis or somthing else is difficult to compile. But gcc4.8 compiles all the solvers and utilities.

I install all these openfoams in vmware.

OpenFOAM-11 of11
OpenFOAM-10 of10
OpenFOAM-9 of9
OpenFOAM-8 of8
OpenFOAM-7 of7
OpenFOAM-6 of6
OpenFOAM-5.x of5x
OpenFOAM-3.x of3x
OpenFOAM-v2306 of2306
OpenFOAM-v2206 of2206
OpenFOAM-v2106 of2106
OpenFOAM-v2006 of2006
OpenFOAM-v1906 of1906
foam-extend-4.0 fe40
foam-extend-4.1 fe41
foam-extend-5.0 fe50

This is the link: https://pan.baidu.com/s/18vKWVbadh-F...N6IFw?pwd=p698
__________________
My OpenFOAM algorithm website: http://dyfluid.com
By far the largest Chinese CFD-based forum: http://www.cfd-china.com/category/6/openfoam
We provide lots of clusters to Chinese customers, and we are considering to do business overseas: http://dyfluid.com/DMCmodel.html
sharonyue is offline   Reply With Quote

Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
[Other] mesh airfoil NACA0012 anand_30 OpenFOAM Meshing & Mesh Conversion 13 March 7, 2022 18:22
[foam-extend.org] Installing FOAM-Extend 4.0 on Ubuntu 20.04 serfriz OpenFOAM Installation 19 November 8, 2021 19:24
[foam-extend.org] Installing Foam Extend 4.0 on Linux Mint andysuth OpenFOAM Installation 1 May 11, 2019 09:37
[swak4Foam] Basic Error when installing swak4foam with foam extend 3.0 mnobrega OpenFOAM Community Contributions 6 April 1, 2014 02:47
[blockMesh] error message with modeling a cube with a hold at the center hsingtzu OpenFOAM Meshing & Mesh Conversion 2 March 14, 2012 10:56


All times are GMT -4. The time now is 05:44.