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

How to Install OpenFOAM on 64 Ubuntu 9.04

Register Blogs Community New Posts Updated Threads Search

 
 
LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
Old   July 1, 2009, 13:57
Smile How to Install OpenFOAM on 64 Ubuntu 9.04
  #1
Senior Member
 
Steve Hansel
Join Date: Jun 2009
Location: Colorado, USA
Posts: 112
Rep Power: 16
hansel is on a distinguished road
This article explains what I did to make OpenFOAM and Paraview work on Ubuntu 9.04.

Background:
I have a quad core 64 bit computer running Ubuntu 9.04. I downloaded OpenFOAM 1.5 about 1.5 months ago. I didn't read the install directions very well, and stumbled into a working system within hours (minutes), including a working paraview / paraFoam. Later, I tried to upgrade to 1.5-dev. I figured the install was so easy that I'd just rebuild everything. I spent the next 3 weeks trying to get a working OpenFOAM and paraview on my system. Had I not seen that it worked before, I would have given up. I'm posting this to hopefully save others an amazing amount of frustration.

Lessons Learned:
Before I get into the 'How to do it', I'd like to list some lessons learned.

1) The binary distribution of ThirdParty (and maybe OpenFOAM1.5) Can't be trusted on 64 bit Ubuntu 9.04. I don't say this lightly. Cmake doesn't work, some libraries don't load, etc. It's very confusing, and it was a hard lesson to accept. I downloaded several times and from several sources. I don't simply have a bad copy.

2) The older versions of QT WILL NOT build working code. Paraview will complain that it can't open one of it's own libraries. I'm sure of this for QT-4.3.1 and I'm pretty sure it's the case for QT-4.3.5. This is ironic since the OpenFOAM readme makes a big point of stating you really need to use those versions.

3) If you mess up on a build, (wrong environement variables, wrong library path, wrong settings, etc.) You are best off wiping the directory clean, and starting with a new copy from your tar files. Rebuilding, especially if you change a library, doesn't seem dependable. (There is probably a way to clean, but I don't know it.)

4) A current version of gcc won't compile OpenFOAM. Apparently some exception handing was changed that makes it incompatible.

5) There is a lot of bad advice in these forums when it comes to Ubuntu and paraview. If someone is having problems on Ubuntu please don't give them the generic answer that they need the older version of QT. That bad advice cost me days of time.

How to:
These instructions are the results of much trial and error. I tried to keep notes, and start with a clean distribution if I went down the wrong path. I did install some libraries that may or may not have been needed. I'll list everything I used and you can decide if you think they are needed or not. My notes are a little sketchy, but hopefully I can list what I did.

1) Install Ubuntu 9.04 and let it update everything it wants to.

2) System Menu -> Administration -> Synaptic Package Manager
Install these packages:
cmake (2.6.2-1ubuntu1)
libpq-dev (8.3.7-1)
libpq5 (8.3.7-1)
mesa-common-dev (7.4-0ubuntu3.1)
qt4-demos (4.5.0-0ubuntu4.1)
qt4-designer (4.5.0-0ubuntu4.1)
qt4-dev-tools-dbg (4.5.0-0ubuntu4.1)
qt4-doc (4.5.0-0ubuntu4.1)
qt4-doc-html (4.5.0-0ubuntu4.1)
qt4-qmake (4.5.0-0ubuntu4.1)
qt4-qtconfig (4.5.0-0ubuntu4.1)
zlib1g-dev (1:1.2.3.3.dfsg-12ubuntu2)
libgmp3-doc (2:4.2.4+dfsg-2ubuntu1)
libmath-bigint-gmp-perl (1.24-1)
bison (1:2.3.dfsg-5)
flex-old (2.5.4a-7build1)
libvtk5 (5.0.4-1.1ubuntu1)
libvtk5-dev (5.0.4-1.1ubuntu1)
openssh-server (1:5.1p1-5ubuntu1)
libqt4-assistant (4.5.0-0ubuntu4.1)
libqt4-dbus (4.5.0-0ubuntu4.1)
libqt4-designer (4.5.0-0ubuntu4.1)
libqt4-dev (4.5.0-0ubuntu4.1)
libqt4-help (4.5.0-0ubuntu4.1)
libqt4-network (4.5.0-0ubuntu4.1)
libqt4-opengl (4.5.0-0ubuntu4.1)
libqt4-opengl-dev (4.5.0-0ubuntu4.1)
libqt4-qt3support (4.5.0-0ubuntu4.1)
libqt4-script (4.5.0-0ubuntu4.1)
libqt4-scripttools (4.5.0-0ubuntu4.1)
libqt4-sql (4.5.0-0ubuntu4.1)
libqt4-sql-mysql (4.5.0-0ubuntu4.1)
libqt4-sql-sqlite (4.5.0-0ubuntu4.1)
libqt4-svg (4.5.0-0ubuntu4.1)
libqt4-test (4.5.0-0ubuntu4.1)
libqt4-webkit (4.5.0-0ubuntu4.1)
libqt4-xml (4.5.0-0ubuntu4.1)
libqt4-xmlpatterns (4.5.0-0ubuntu4.1)
libqtcore4 (4.5.0-0ubuntu4.1)
libqtgui4 (4.5.0-0ubuntu4.1)
libvtk5-qt4 (5.0.4-1.1ubuntu1)
libvtk5-qt4-dev (5.0.4-1.1ubuntu1)
python-dbg (2.6.2-0ubuntu1)
python-dev (2.6.2-0ubuntu1)
python-qt4 (4.4.4-2ubuntu6)
python-qt4-common (4.4.4-2ubuntu6)
python-qt4-dbg (4.4.4-2ubuntu6)
python-qt4-dev (4.4.4-2ubuntu6)
python-sip4 (4.7.9-1ubuntu1)
python-sip4-dbg (4.7.9-1ubuntu1)
python-sip4-dev (4.7.9-1ubuntu1)
python2.6-dbg (2.6.2-0ubuntu1)
python2.6-dev (2.6.2-0ubuntu1)
qt4-demos (4.5.0-0ubuntu4.1)
qt4-designer (4.5.0-0ubuntu4.1)
qt4-dev-tools (4.5.0-0ubuntu4.1)
qt4-doc (4.5.0-0ubuntu4.1)
qt4-qmake (4.5.0-0ubuntu4.1)
qt4-qtconfig (4.5.0-0ubuntu4.1)
git-core (1:1.6.0.4-1ubuntu2)
git-doc (1:1.6.0.4-1ubuntu2)

When it comes to qt, if it had qt4 in the name, I installed it. This list comes from my package manager history. Other packages will also be loaded with the ones you select. I'm sure 70% of this isn't needed, but this is what worked for me.

2) Download the OpenFOAM files: OpenFOAM-1.5.General.gtgz, ThirdParty.General.gtgz, ThirdParty.linux64Gcc.gtgz (yes, the untrustworthy binary distribution.)

3) Download gmp-4.1.3.tar.gz and mpfr-2.4.1.tar.gz. I got these because I was going to build gcc from source, but then had problems and didn't build gcc from scratch. I did install these two packages though, so I don't know if they are really needed or not.

4) Untar gmp-4.1.3
go in the directory
./configure
make
sudo make install

5) Untar mpfr-2.4.1.tar.gz
go in the directory.
./configure
make
sudo make install

6) Untar OpenFOAM-1.5.General.gtgz and ThirdParty.General.gtgz into an OpenFOAM directory somewhere. (Your home/OpenFOAM, /usr/local/OpenFOAM, whatever) *** Don't untar the binary distribution ***

7) Edit OpenFOAM/OpenFOAM-1.5/etc/bashrc and change the foamInstall=/usr/local/$WM_PROJECT to point to your location. If you put it in your home dir you might be okay as is.

8) Edit OpenFOAM/ThirdParty/ParaView3.3-cvs/CMakeLists.txt Comment out line 89 and 94 so it looks like below. (This is removing the check for the recommended version of QT.)

IF(NOT QT4_FOUND)
# MESSAGE(SEND_ERROR "Qt ${QT_MIN_VERSION} or greater not found. Please check the QT_QMAKE_EXECUTABLE variable.")
ELSE(NOT QT4_FOUND)
# don't go greater than supported version
STRING(REGEX MATCH "^4\\.3\\.[0-9]+" qt_version_tmp "${QTVERSION}")
IF (NOT qt_version_tmp)
# MESSAGE(SEND_ERROR "Qt ${QTVERSION} not supported. Please use Qt 4.3 (you may need to clean your

9) untar ONLY THE GCC part of the binary Third Party distribution. (Be in the top OpenFOAM directory)
tar --wildcards -xzvf ThirdParty.linux64Gcc.gtgz 'ThirdParty/gcc*' Hopefully this unpacks only the gcc part of that tarfile. We need to use this version of gcc, which fortunately seems to work.

10) edit ~/.bashrc and add the lines to the end: (change /usr/local to your location)

source /usr/local/OpenFOAM/OpenFOAM-1.5.x/etc/bashrc

export ParaView_INST_DIR=/usr/local/OpenFOAM/ThirdParty/ParaView3.3-cvs
export ParaView_DIR=/usr/local/OpenFOAM/ThirdParty/ParaView3.3-cvs/platforms/linux64Gcc
export PV_PLUGIN_PATH=/usr/local/OpenFOAM/OpenFOAM-1.5/lib/linux64GccDPOpt
export PATH=/usr/local/OpenFOAM/ThirdParty/ParaView3.3-cvs/platforms/linux64Gcc/bin:$PATH

11) logout and log back in to get the environment all set up.

12) cd OpenFOAM/OpenFOAM-1.5
./Allwmake &> make.log
[In another window] tail -f make.log so you can watch the messages.
Openfoam should build, but the Allwmake will fail when trying to do parafoam or something else. That's okay as far as I can tell. This takes a few hours.

13) cd (to your home directory or anywhere else you want to put the build log).
buildParaView3.3-cvs &> build.log
[in another window] tail -f build.log
This build also takes a while.

14) cd $FOAM_UTILITIES/postProcessing/graphics/PV3FoamReader
./Allwclean
./Allwmake
This only takes a minute.

Hopefully after doing this, you have a working installation. You might have to log out and in one more time. My notes were a little sketchy so if you have problems post here and I'll see if I can help.

Steve

Last edited by hansel; July 3, 2009 at 11:52.
hansel is offline   Reply With Quote

 

Tags
9.04, installing openfoam, ubuntu 9.04


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
OpenFOAM 1.5.x package - CentOS 5.3 x86_64 linnemann OpenFOAM Installation 7 July 30, 2009 03:14
qt4.3.4 with ubuntu 9.04 "jaunty jackalope"? sven OpenFOAM 4 May 30, 2009 18:22
OpenFOAM Install problem masb OpenFOAM 3 May 25, 2009 11:32
64bitrhel5 OF installation instructions mirko OpenFOAM Installation 2 August 12, 2008 18:07
Adventure of fisrst openfoam installation on Ubuntu 710 jussi OpenFOAM Installation 0 April 24, 2008 14:25


All times are GMT -4. The time now is 06:40.