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

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

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   April 5, 2011, 05:38
Post How to compile OpenFOAM-1.7.x on CrunchBang linux 10
  #1
Senior Member
 
Gijsbert Wierink
Join Date: Mar 2009
Posts: 383
Rep Power: 18
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:
Code:
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:
Code:
cd
mkdir -p libs/zlib
cd libs/zlib
wget http://sourceforge.net/projects/libpng/files/zlib/1.2.5/zlib-1.2.5.tar.gz
tar xzf zlib-1.2.5.tar.gz
cd zlib-1.2.5
./configure
make
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.
Code:
cd ~/libs
mkdir curl
cd curl
wget http://curl.haxx.se/download/curl-7.21.4.tar.gz
tar xzf curl-7.21.4.tar.gz
cd curl-7.21.4
./configure
make
sudo make install
OK, now we can build git:
Code:
cd ~/libs
mkdir git
cd git
wget http://kernel.org/pub/software/scm/git/git-1.7.4.3.tar.bz2
tar xjf git-1.7.4.3.tar.bz2
cd git-1.7.4.3
./configure
make
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:
Code:
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:
Code:
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.

Code:
mkdir ~/OpenFOAM && cd ~/OpenFOAM
git clone git://github.com/OpenCFD/OpenFOAM-1.7.x.git
cd OpenFOAM-1.7.x
git pull
cd ~/OpenFOAM
wget http://downloads.sourceforge.net/foam/ThirdParty-1.7.1.gtgz
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:
Code:
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:
Code:
cd ~/OpenFOAM/OpenFOAM-1.7.x
./Allwmake >make.log 2>make.err &
You can follow the progress by:
Code:
cd ~/OpenFOAM/OpenFOAM-1.7.x
tail -f make.log
Enjoy!
__________________
Regards, Gijs

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

Reply


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.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 05:43
OpenFoam and Linux Tomislav Maric Main CFD Forum 13 October 25, 2007 05:45
OpenFOAM installation problem on Linux 32bit kumar OpenFOAM Installation 0 April 27, 2007 06: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 13:48.