Difference between revisions of "Installation/Outdated/Howto compile OpenFOAM the easy way"

From OpenFOAMWiki
(New page: ==Introduction== This is a step-by-step guide that tries to make the installation of OpenFOAM development version as easy as possible. It is extracted from the detailed post of Jaswinder ...)
 
Line 32: Line 32:
 
   |_gcc-4.2.1 (or the version of gcc you downloaded)
 
   |_gcc-4.2.1 (or the version of gcc you downloaded)
 
   |_java (the actual directory name depends on the version of java)
 
   |_java (the actual directory name depends on the version of java)
 +
</bash>
 +
 +
== Setting your system up for compilation ==
 +
 +
You first need to modify the script which sets the working environment for OpenFOAM as follows:
 +
 +
* Open the ~/OpenFOAM/OpenFOAM-1.4.1-dev/.OpenFOAM-1.4.1-dev/bashrc and edit make the following changes:
 +
** Set the compilation option to
 +
*** ''opt'' if you want the optimized version of the code
 +
*** ''debug'' if you want the debug version of the code
 +
** Set the environment variable WM_64 to on if you are working on a 64 bit system with
 +
<bash>
 +
export WM_64=on
 +
</bash>
 +
** Comment out the commands sourcing the script files for 3rd-party post processing utilities
 +
* Copy the ~/OpenFOAM/OpenFOAM-1.4.1-dev/.OpenFOAM-1.4.1-dev (hidden) to your home directory
 +
 +
Then
 +
 +
* Open the file ~/.bashrc
 +
* Add the line
 +
<bash>
 +
. ~/.OpenFOAM-1.4.1-dev/bashrc
 
</bash>
 
</bash>

Revision as of 00:35, 5 July 2008

1 Introduction

This is a step-by-step guide that tries to make the installation of OpenFOAM development version as easy as possible. It is extracted from the detailed post of Jaswinder Pal Singh that you can read here [1].

1.1 Notes

  • The guide provides information on how to compile the development version of OpenFOAM, without visualization tools. For more information please refer to the detailed compilation procedure.
  • This procedure is known to know with OpenFOAM 1.4.1 on openSUSE 10.3 and 11.0

2 Preparation

  • Open the SVN repository in your browser and find the URL to the most recent version of OpenFOAM-dev available in the repository or of the one you want to install. For example, for OpenFOAM 1.4.1, the URL is
 
http://openfoam-extend.svn.sourceforge.net/svnroot/openfoam-extend/trunk/Core/OpenFOAM-1.4.1-dev/
  • Use svn checkout command to download the files contained in the repository to your workstation:
 
svn co http://openfoam-extend.svn.sourceforge.net/svnroot/openfoam-extend/trunk/Core/OpenFOAM-1.4.1-dev/
  • Be sure to have the following directory structure in your home directory:
 
OpenFOAM
 |_OpenFOAM-1.4.1-dev
 |_linux (linux64 for 64 bit systems)
   |_gcc-4.2.1 (or the version of gcc you downloaded)
   |_java (the actual directory name depends on the version of java)

3 Setting your system up for compilation

You first need to modify the script which sets the working environment for OpenFOAM as follows:

  • Open the ~/OpenFOAM/OpenFOAM-1.4.1-dev/.OpenFOAM-1.4.1-dev/bashrc and edit make the following changes:
    • Set the compilation option to
      • opt if you want the optimized version of the code
      • debug if you want the debug version of the code
    • Set the environment variable WM_64 to on if you are working on a 64 bit system with
 
export WM_64=on
    • Comment out the commands sourcing the script files for 3rd-party post processing utilities
  • Copy the ~/OpenFOAM/OpenFOAM-1.4.1-dev/.OpenFOAM-1.4.1-dev (hidden) to your home directory

Then

  • Open the file ~/.bashrc
  • Add the line
 
. ~/.OpenFOAM-1.4.1-dev/bashrc