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-2.0.x on Ubuntu 11.10 (https://www.cfd-online.com/Forums/openfoam-installation/93405-openfoam-2-0-x-ubuntu-11-10-a.html)

kpsl October 14, 2011 06:10

OpenFOAM-2.0.x on Ubuntu 11.10
 
Dear Foamers,

has anyone managed to fully install OF on the new Ubuntu release yet?

I have managed to install the first part with no problems, but when i get to makeParaView, compilation aborts without much information:

[ 3%] Built target vtklibxml2
make: *** [all] Error 2
Command exited with non-zero status 2

My guess is that QT that comes with Ubuntu 11.10 is too new (4.7.4) and that i might need an older version (probably 4.6.3 since this is what i usually use). Can anyone confirm this theory?

kpsl October 14, 2011 10:03

[Solved]

This is an issue with gcc-4.6.1.
It can be solved by editing the file

ParaView-3.10.1/VTK/Utilities/vtkmetaio/metaUtils.cxx

and including the line:

#include <stddef.h>

Afterwards paraview will compile without any problems.

kflora October 16, 2011 17:27

I too have had difficulties compiling OpenFoam 2.0.x on Kubuntu 11.10. A piece of my compilation below illustrates the problems:

make[2]: Leaving directory `/home/kevin/OpenFOAM/OpenFOAM-2.0.x/applications/solvers/multiphase/twoPhaseEulerFoam'
make[1]: Target `application' not remade because of errors.
make[1]: Leaving directory `/home/kevin/OpenFOAM/OpenFOAM-2.0.x/applications/solvers/multiphase'
make: *** [multiphase] Error 2
make[1]: Entering directory `/home/kevin/OpenFOAM/OpenFOAM-2.0.x/applications/solvers/stressAnalysis'
make[2]: Entering directory `/home/kevin/OpenFOAM/OpenFOAM-2.0.x/applications/solvers/stressAnalysis/solidDisplacementFoam'
make[2]: `/home/kevin/OpenFOAM/OpenFOAM-2.0.x/platforms/linux64GccDPOpt/bin/solidDisplacementFoam' is up to date.
make[2]: Leaving directory `/home/kevin/OpenFOAM/OpenFOAM-2.0.x/applications/solvers/stressAnalysis/solidDisplacementFoam'
make[2]: Entering directory `/home/kevin/OpenFOAM/OpenFOAM-2.0.x/applications/solvers/stressAnalysis/solidEquilibriumDisplacementFoam'
make[2]: `/home/kevin/OpenFOAM/OpenFOAM-2.0.x/platforms/linux64GccDPOpt/bin/solidEquilibriumDisplacementFoam' is up to date.
make[2]: Leaving directory `/home/kevin/OpenFOAM/OpenFOAM-2.0.x/applications/solvers/stressAnalysis/solidEquilibriumDisplacementFoam'
make[1]: Leaving directory `/home/kevin/OpenFOAM/OpenFOAM-2.0.x/applications/solvers/stressAnalysis'
make: Target `application' not remade because of errors.

As a result, when I go to run the damBreak4Phase tutorial, I see that the "alphaContactAngle" boundary was not compiled and doesn't show up a valid boundary type.

Does any one think that changing to an older compiler would help (current compiler with Kubuntu 11.10 is gcc 4.6.1)? Open to any other ideas.

kpsl October 16, 2011 17:39

did you install the required dependencies for ununtu before compiling?

Code:

sudo apt-get install build-essential flex cmake zlib1g-dev qt4-dev-tools libqt4-dev gnuplot libreadline-dev libxt-dev

kflora October 16, 2011 17:57

Yes I did. I just checked by executing your suggested code and nothing was upgraded as it was already the newest version.

For background, when I was running Kubutu 11.04 with OpenFoam 2.0.x. After updating Kubuntu to 11.10, OpenFoam seemed to be still running OK. Then I did a git pull to update 2.0.x and that's when my problems arose. I then did a fresh install of 2.0.x with the same error messages and issues.

giulio.topazio October 17, 2011 05:12

Hi i've similar problems. I'm following the link below : http://www.openfoam.com/download/ubuntu.php and i substituted oncelot for the version 11.10.
When i type in step 2 sudo apt-get update the terminal answers

W: Impossibile recuperare http://www.openfoam.com/download/ubu...-i386/Packages 404 Not Found

E: Impossibile scaricare alcuni file di indice: saranno ignorati o verranno usati quelli vecchi.

In English:
W: Unable to retrieve http://www.openfoam.com/download/ubu...-i386/Packages 404 Not Found

E:Can not download some index files will be ignored, or old ones used.

What's wrong?Who can help me out?
Thank you

P.S. Is the first time i use Ubuntu so i'm completly ignorant on :o

Hisham October 17, 2011 17:11

Hi Giulio

The conversation here is too advanced. It is about compiling the OpenFOAM code from scratch (this is also refereed to as install or sometimes the "real install").

For your case, I think OF is not yet available for Ubuntu 11.10 .... it is just 3 days old ... The guess is that they are currently porting it for this version. What you need to do is to keep checking the install webpage for any news on 11.10.

Regards,
Hisham

diego_angeli October 19, 2011 11:12

Quote:

Originally Posted by kflora (Post 328122)
Does any one think that changing to an older compiler would help (current compiler with Kubuntu 11.10 is gcc 4.6.1)? Open to any other ideas.

Hi, I've got similar problems in compiling OF2.0.x on Ubuntu Oneiric amd64 and I think you're right. I installed the gcc4.5 pack and I'm trying now to force OF to compile with it.

I'll let you know

D.

Jochem October 20, 2011 10:26

Hello,

I've got the same problem. Did you manage to compile OpenFoam-2.0.X using gcc4.5? If it worked can you tell me which commands you've used?

Regards,

Jochem

marupio October 20, 2011 13:47

I'm on the case. It looks like it's a bunch of linker errors - I can make them go away 1 by 1 by adding -lmissingLibrary to the options files... but I'm not sure if I'm wasting my time... I mean, this can fix it, but is this merely a work-around for a compiler error that is going to be fixed soon anyway?

Insights?

marupio October 20, 2011 16:29

1 Attachment(s)
Well, I finished anyway. To get it working on my machine, I had to change one line in 16 different files. I've attached the details as a text file.

I've sent the details of the fix to the guys at OpenFOAM.

Note: I'm not saying this is the proper fix - this is how it worked on my machine. Maybe it will help you guys.

diego_angeli October 21, 2011 11:52

Thanks David, kudos to you: the bugfix works perfectly!! You saved me additional days of struggle.

So it was not the compiler, though wrong linking options... I must admit that it left me quite puzzled however: some of the missing links referred to well-established solvers like interFoam whose building options should be assessed.

kflora October 21, 2011 12:11

David,

You bug fix worked me - well at least almost. I am still unable to run the multiphaseInterFoam demo receiving an error about the "interfaceCompression" apparently not compiling. But all the others seem to compile now.

Could you check to see if when you run the tutorial case for the damBreak4phase you get the same error as below? Perhaps it got missed on your bug list.

--> FOAM FATAL IO ERROR:
Unknown discretisation scheme interfaceCompression

kpsl October 21, 2011 12:14

Quote:

Originally Posted by kflora (Post 328932)
David,
--> FOAM FATAL IO ERROR:
Unknown discretisation scheme interfaceCompression

Sounds similar to a problem I've been having.

http://www.openfoam.com/mantisbt/view.php?id=316

marupio October 21, 2011 12:28

edit: this is in response to Kevin's problem above.

Funny - I was just noticing this myself, and was working on it. The problem is: with the "bugfix", interfaceProperties and twoPhaseInterfaceProperties libraries link to eachother. The only reason it worked for me (and maybe for Diego too) is we had a previously failed install with those libraries already in existence.

I believe the fix is this:

undo the changes I told you to make to src/transportModels/twoPhaseInterfaceProperties/Make/options

That is, change the last few lines of the file from this:
Code:

LIB_LIBS = \
    -linterfaceProperties \
    -lfiniteVolume

to this:

Code:

LIB_LIBS = -lfiniteVolume

kpsl October 21, 2011 18:37

EDIT: Looks like this doesn't help either. At least not for me...

Here is a workaround for those who don't mind downgrading to gcc-4.5

Note this is for 64bit and will install gcc-4.5 while leaving gcc-4.6 untouched. You can choose which version is the dominant one.
I have not fully tested this yet but it should take care of the problem as well.

Install gcc 4.5
Code:

sudo apt-get install gcc-4.5 g++-4.5
set default gcc
Code:

sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-4.6 40
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-4.5 30
sudo update-alternatives --config gcc

Choose option 1

set default g++
Code:

sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-4.6 40
sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-4.5 30
sudo update-alternatives --config g++

Choose option 1

set default x86_64-linux-gnu-gcc
Code:

sudo update-alternatives --install /usr/bin/x86_64-linux-gnu-gcc x86_64-linux-gnu-gcc /usr/bin/x86_64-linux-gnu-gcc-4.6 40
sudo update-alternatives --install /usr/bin/x86_64-linux-gnu-gcc x86_64-linux-gnu-gcc /usr/bin/x86_64-linux-gnu-gcc-4.5 30
sudo update-alternatives --config x86_64-linux-gnu-gcc

Choose option 1

set default x86_64-linux-gnu-g++
Code:

sudo update-alternatives --install /usr/bin/x86_64-linux-gnu-g++ x86_64-linux-gnu-g++ /usr/bin/x86_64-linux-gnu-g++-4.6 40
sudo update-alternatives --install /usr/bin/x86_64-linux-gnu-g++ x86_64-linux-gnu-g++ /usr/bin/x86_64-linux-gnu-g++-4.5 30
sudo update-alternatives --config x86_64-linux-gnu-g++

Yup, choose option 1.

You can revert back to gcc-4.6 by running the last line in each code section and choosing option 0 instead of 1.

nsf October 22, 2011 07:29

Changes as a patch
 
1 Attachment(s)
Hi all and thank you David for the fix!

I took the liberty of applying the changes as a git patch. It's based on this commit 93ce41240e5c2b04690f15152e52f48e03d4df39

The patch can be applied by

Code:

cd $WM_PROJECT_DIR
git checkout -b davidsFix
git apply --check fixOF.patch

If there's no errors of last command do

Code:

git am --signoff < fixOF.patch
When the OpenFoam foundation has a fix you can checkout the master branch, pull their changes and delete the branch "davidsFix".

Here's a good guide on git and patches:
http://ariejan.net/2009/10/26/how-to...atch-with-git/

Best Regards

Nicolas

ghindi October 23, 2011 17:07

Hi David,

I've used your bugfix and I've compiled OF but not all the combustion tutorials seem to work. Do you happen to have any other ideas on how to solve it?

Best regards,

Gustavo.

marupio October 24, 2011 14:45

What error are you getting? Is it a SIGFPE, with a stack dump?

nsf October 24, 2011 14:56

Hello David,

I also still have some problems. After applying your changes the compilation runs fine. There are no "undefined references" but it seems that applications now can't find certain libraries. For instance if you try $FOAM_TUTORIALS/incompressible/pisoFoam/les/pitzDaily it will say

Code:

--> FOAM FATAL ERROR:
Unknown turbulenceModel type LESModel

Valid turbulenceModel types:

1
(
laminar
)

So it would seem pisoFoam can't what ever library that contain the turbulence model. Nor can I decompose with scotch even though it compiled just fine.

I'm currently recompiling everything to see if the issue persists. I'll let you know.

/Nicolas


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