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

Blast from the past: installing OpenFOAM 1.5 in modern Linux boxes

Register Blogs Community New Posts Updated Threads Search

Rating: 2 votes, 5.00 average.

Blast from the past: installing OpenFOAM 1.5 in modern Linux boxes

Posted April 2, 2011 at 09:23 by wyldckat
Updated July 30, 2012 at 17:14 by wyldckat (Added v2)

Here we are in 2011 and we need good oldie OpenFOAM 1.5 to work in our latest über advanced Linux box.
Our trusty gcc compiler nowadays comes in flavours 4.4.x, 4.5.x and 4.6.0 was released a little while ago.
The official release of OpenFOAM 1.5 latest compatible gcc was 4.3.x. And you think to yourself: now what do I do?

Well, not to worry! After a request from the forum user kurne, I rolled up my sleeves and made a cookbook script of a hybrid OpenFOAM 1.5 with 1.7.x script updates. The script is attached and currently is for 64bit machines only - why? Because nowadays 64bit is the standard
NOTE: v2 works for both 64bit and 32bit builds as well, although I haven't tested it yet... As for v3, check the "Further notes" section near the end of this post.

How to use it? Well, first I would advise you to install from source the latest OpenFOAM, which right now is 1.7.1 or 1.7.x. Why? Because then you would be certain that all of the necessary packages are already installed. You can also try simply installing the packages listed here: Building OpenFOAM1.7.0 from source post #4 and onward

OK, no, you can't use it yet! Now you've got to edit your ~/.bashrc file, also known as $HOME/.bashrc. Probably near the end of it you'll find something like this:
Code:
. $HOME/OpenFOAM/OpenFOAM-1.7.1/etc/bashrc
Well, now you're going to want 1.5 as well. Therefore, change any lines that look like the one above to something like this:
Code:
alias of171='. $HOME/OpenFOAM/OpenFOAM-1.7.1/etc/bashrc'
alias of15='. $HOME/OpenFOAM/OpenFOAM-1.5/etc/bashrc'
As you can plainly see, I'm assuming that OpenFOAM 1.5 will be installed in the base folder "$HOME/OpenFOAM".


Start a new terminal/console! Hopefully you don't need to logout and then log back in. Run:
Code:
foam
If nothing happens and it outputs an error saying something like "not found", then you're ready to go on.


Now, download the file attached to this post. Unpack it:
Code:
gunzip of15w17.sh.gz
And Now you can run it:
Code:
./of15w17.sh
At the end, it should display this friendly message:
Code:
All done and ready to get work! Well, only if you run:
     source /home/username/OpenFOAM/OpenFOAM-1.5/etc/bashrc
This message indicates that you're ready to go! Run:
Code:
of15
To start the environment for OpenFOAM 1.5.

If you want to use any of your other OpenFOAM installations, simply run the respective alias:
Code:
of171
If by any chance it stops running before or without that friendly message, then post it in the comments to this page. If your trying to use it in Ubuntu, then please do it here: OpenFOAM-1.5 on Ubuntu 10.04


Ah, I almost forgot: what about ParaView you ask?
Well, there's more than one way to do many things and installing ParaView is no exception:

Further notes:
  • NOTE about v3: the attachment "of15w17_v3.sh.gz" was only tested yet with Ubuntu 11.10 x86_64.
    It assumes you've already installed packages for Ubuntu mentioned here: http://www.openfoam.org/download/git.php
    Also on Ubuntu, don't forget to also run:
    Code:
    sudo apt-get install libglib2.0-dev binutils-dev
    On x86_64, also include: libc6-dev-i386
  • Related to the previous bullet point:
    Quote:
    Originally Posted by wyldckat View Post
    Now I remember, I saw this before while I was trying to build Gcc 4.3.3 on Ubuntu 11.10. Things changed so much that a new few hacks are necessary. One such hack is this for 64bit platforms:
    Code:
    export LIBRARY_PATH=/usr/lib/x86_64-linux-gnu
    Then try again building Gcc 4.3.3. The source for this hack was this: http://www.lukedodd.com/?p=225

    The reason why this was added is because the library moved from the usual "/usr/lib" folder. To see where the required "libc.a" is located, run:
    Code:
    dpkg-query -S libc.a


Good luck!
Bruno
Attached Files
File Type: gz of15w17.sh.gz (1.4 KB, 6278 views)
File Type: gz of15w17_v2.sh.gz (1.8 KB, 4910 views)
File Type: gz of15w17_v3.sh.gz (2.2 KB, 5252 views)
« Prev     Main     Next »
Total Comments 1

Comments

  1. Old Comment

    Updated instructions

    Instructions on how to build OpenFOAM 1.5 and 1.5.x for more recent Ubuntu versions can be found here:
    permalink
    Posted August 13, 2014 at 14:57 by wyldckat wyldckat is offline
 

All times are GMT -4. The time now is 00:22.