CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM Installation (https://www.cfd-online.com/Forums/openfoam-installation/)
-   -   [OpenFOAM.org] OpenFOAM - 2.2.0 installation on Ubuntu 16.04 (https://www.cfd-online.com/Forums/openfoam-installation/222399-openfoam-2-2-0-installation-ubuntu-16-04-a.html)

silviliril November 22, 2019 06:21

OpenFOAM - 2.2.0 installation on Ubuntu 16.04
 
Dear All,

I followed the instructions to install OpenFOAM-2.2.0 as given below in link for Ubuntu 13.10.
https://openfoamwiki.net/index.php/I...M-2.2.0/Ubuntu

But, it resulted in error. Can someone suggest me how to install OpenFOAM-2.2.0 on Ubuntu 16.04?

gcengineer November 22, 2019 22:37

What is the error?

sabrinacarson November 22, 2019 23:35

Error Message while installing
 
1 Attachment(s)
Thank you for replying.

My apologies. But it is ubuntu 18.04 and not 16.04.

I have attached the log.make file along with this post. The error started way before, but the error message seen at the end is like this:
Code:

collect2: error: ld returned 1 exit status
make[2]: *** [/home/silyi/OpenFOAM/OpenFOAM-2.2.0/platforms/linux64GccDPOpt/bin/twoPhaseEulerFoam] Error 1
make[1]: *** [twoPhaseEulerFoam] Error 2
make[1]: Target 'application' not remade because of errors.
make: *** [multiphase] Error 2
make: Target 'application' not remade because of errors.

Note: The custom solver I need is available only with OpenFOAM-2.2.0. Any other version is not useful to me.

tschenkel November 26, 2019 13:04

Hi Sabrina,


the actual error is above the snippet you posted. I assume it is missing a library and that is causing the compilation of the application twoPhaseEulerFlow to fail.

Very often that library is mpi, so check if there is a "mpi.h missing" somewhere in the path. I usually use foam-extend, but from memory, openfoam will need ThirdParty to be compiled before the actual openfoam compilation (as that will provide the included mpi libs).


Another problem with compiling such an old version (2.2) on a relatively modern system (18.04) is that the compiler won't be compatible:
I assume openfoam will need gcc 4, while ubuntu 18.04 has gcc 7 as default. If you check https://openfoamwiki.net/index.php/I...ibility_Matrix you will see that 2.2.0 will work with 4.7. Unfortunately the oldest gcc that U18.04 supports is 4.8.


But you can try working with that. Or hunt down an old version of Ubuntu. If all fails, OF does come with a gcc provided, which you can try to compile with the more modern one, so e.g. 4.7 compiled with 4.8.



If you need this to keep working, it may be worth porting the whole solver to OpenFoam-7.


Could you try 2.2.2? That one has been tested with gcc 4.8.

sabrinacarson November 26, 2019 22:10

Quote:

Originally Posted by tschenkel (Post 750794)
Hi Sabrina,


the actual error is above the snippet you posted. I assume it is missing a library and that is causing the compilation of the application twoPhaseEulerFlow to fail.

Very often that library is mpi, so check if there is a "mpi.h missing" somewhere in the path. I usually use foam-extend, but from memory, openfoam will need ThirdParty to be compiled before the actual openfoam compilation (as that will provide the included mpi libs).

Thank you for replying. I have tried to compiling OpenFOAM 2.2.2 with Ubuntu 18.04 as per the guideline provided by Bruno Santos on wiki page:
https://openfoamwiki.net/index.php/I...M-2.2.2/Ubuntu

Still I got the same error as explained for OpenFOAM 2.2.0.

My institution has latest hardware and multiple users. The admin has refused to reduce the ubuntu version to any lower one. The GCC version in the system is 7.4.0. I have been left with no choice.

Since, I am not good with fixing bugs, it would be of great help, if you can show me a way how to compile the OpenFOAM-2.2.0 with the older version GCC 4.7.x.

tschenkel November 27, 2019 05:44

Hi,


If you do not have root access to your system, you will need to get your sysadmin to install gcc-4.8 for you. This should not be a big deal, as it is available in the Ubuntu packaging system, so a simple

apt-get install gcc-4.8 g++-4.8

should do it.

Then you can try Bruno's instructions again.

If 2.2.0 doesn't like 4.8, then you'll have to ask sysadmin to provide you with 4.7, which they'd need to compile themselves: https://openfoamwiki.net/index.php/I...alling_GNU_Gcc

But at the moment, this is all gueswork, since you have not provided the actual error message you get. Can you post a link to the whole log file after running the compilation like:


./Allwmake | tee log.Allwmake




You can also try and compile gcc-4.7 as a user, installing it in your user home directory and then adjust paths. But this can get tricky quite quickly. You'll have to learn a lot about Linux or find your local Linux wizard for that.

HPE November 29, 2019 11:38

EDIT: if you share your solver, I can try to compile it for you in OF1906 which works smoothly on new operating systems.

silviliril November 29, 2019 12:51

phaseChangeHeatFoam
 
Quote:

Originally Posted by HPE (Post 751095)
EDIT: if you share your solver, I can try to compile it for you in OF1906 which works smoothly on new operating systems.

It will be of great help if you can compile the solver for a latest version of openfoam. Here is the link to the solver:
https://github.com/NimaSam/phaseChangeHeatFoam

HPE November 29, 2019 13:26

after the weekend, I'm dead now. :)
Will let you know.

HPE December 4, 2019 16:43

This weekend, I will try to compile it for you. Bear with me. My apologies for the delay.

sabrinacarson December 4, 2019 22:23

The wait will be worth it, if it gets compiled.

silviliril December 12, 2019 06:02

Hi,

Did you get any success compiling the solver for any latest version of OpenFOAM?


All times are GMT -4. The time now is 15:20.