CFD Online Logo CFD Online URL
Home > Forums > Software User Forums > OpenFOAM > OpenFOAM Installation

How to compile OpenFOAM-1.7.x on CrunchBang linux 10

Register Blogs Members List Search Today's Posts Mark Forums Read

LinkBack Thread Tools Display Modes
Old   April 5, 2011, 04:38
Post How to compile OpenFOAM-1.7.x on CrunchBang linux 10
Senior Member
Gijsbert Wierink
Join Date: Mar 2009
Posts: 383
Rep Power: 11
gwierink is on a distinguished road
Dear all,

Just for fun I tried out CrunchBang Linux, a Debian based distribution. It is minimalistic, uses OpenBox and it's just blazing fast. I thought to share my notes on compiling OpenFOAM-1.7.x on CrunchBang 10 (32 bit) with you. These are just my notes on setting up the system, combined with OpenCFD's instructions on installation. I just thought it would be nice to share .

First off, CrunchBang is Debian based, so OpenCFD's Ubuntu/Debian package may work out of the box, so do give that a try if you like. However, I decided to compile the updated OpenFOAM-1.7.x on my CrunchBang box. Here it goes.

First, make sure you have superuser right (sudo), because we need to install some libraries and programs. There are standard packages, but in many cases it is just nicer to compile the latest stable version yourself. In that way you know exactly what you have and it is optimized for your system. Now, add yourself to the "sudoers" to get superuser rights do:
sudo visudo
(which will ask for your user login password) and add your login name followed by "ALL=(ALL) ALL", just like the root account in the visudo file. In case you don't know, visudo uses the vi editor. First, type "i" to get into insert mode, add the text, press Esc, and save and exit by typing ":wq".

CrunchBang linux 10 came with gcc 4.4.5 and python 2.6.6, so that's fine. Then, to compile OpenFOAM we need zlib. I got zlib-1.2.5 from here. Create some directory to store the libs and compile zlib there. I create libs in my home directory, as:
mkdir -p libs/zlib
cd libs/zlib
tar xzf zlib-1.2.5.tar.gz
cd zlib-1.2.5
sudo make install
Now, to pull the latest OpenFOAM-1.7 code, called OpenFOAM-1.7.x, we need a program called git. It has to be version 1.7 or higher.
To build the latest stable git, we need a library called curl (here I use curl-7.21.4). Get it from here.
cd ~/libs
mkdir curl
cd curl
tar xzf curl-7.21.4.tar.gz
cd curl-7.21.4
sudo make install
OK, now we can build git:
cd ~/libs
mkdir git
cd git
tar xjf git-
cd git-
sudo make install
For building we need the flex library, and for some conversion and postprocessing tools we need a few libx libraries (otherwise tecio complains about missing X11/Intrinsic.h, for example). Also, for some handy tools like swak4Foam, funkySetFields, etc., we need svn and bison. Install these libs and programs by:
sudo apt-get install flex libxt-dev libxaw7-dev libxext-dev libxrender qt4-qmake qt4-dev-tools subversion-tools bison
Also make sure you have binutils and build-essential installed:
dpkg --get-selections | grep binutils && dpkg --get-selections | grep build-essential
Now we can get the OpenFOAM source code and get to work! Check out OpenCFD's git section for updated instructions.

mkdir ~/OpenFOAM && cd ~/OpenFOAM
git clone git://
cd OpenFOAM-1.7.x
git pull
cd ~/OpenFOAM
tar xzf ThirdParty-1.7.1.gtgz
mv ThirdParty-1.7.1 ThirdParty-1.7.x
Source OpenFOAM's bash in your bashrc by adding the line ". $HOME/OpenFOAM/OpenFOAM-1.7.x/etc/bashrc" to your ~/.bashrc file:
echo -e "\n. $HOME/OpenFOAM/OpenFOAM-1.7.x/etc/bashrc" >> ~/.bashrc
. ~/.bashrc
Finally, start building OpenFOAM. It is useful for error hunting to keep a record of the building process, so do:
cd ~/OpenFOAM/OpenFOAM-1.7.x
./Allwmake >make.log 2>make.err &
You can follow the progress by:
cd ~/OpenFOAM/OpenFOAM-1.7.x
tail -f make.log
Regards, Gijs

Last edited by gwierink; April 5, 2011 at 05:34.
gwierink is offline   Reply With Quote


Thread Tools
Display Modes

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 On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
OpenFOAM 1.7 installation on Redhat linux maxims OpenFOAM Installation 2 November 30, 2012 05:29
1.7.x Environment Variables on Linux 10.04 rasma OpenFOAM Installation 9 July 30, 2010 04:43
OpenFoam and Linux Tomislav Maric Main CFD Forum 13 October 25, 2007 04:45
OpenFOAM installation problem on Linux 32bit kumar OpenFOAM Installation 0 April 27, 2007 05:41
Installing OpenFOAM on SuSE Linux 91 Lars Edvardsen (Edvardsen) OpenFOAM Installation 2 January 10, 2005 03:26

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