Difference between revisions of "OpenFOAM installation"

From Supercomputación y Cálculo Científico UIS
(Installation for OpenFOAM 2.3.1 (from sources))
 
 
(4 intermediate revisions by the same user not shown)
Line 2: Line 2:
  
 
<div class="thumbnail img-thumbnail">http://wiki.sc3.uis.edu.co/images/a/a8/Logo_sc33.png</div>  
 
<div class="thumbnail img-thumbnail">http://wiki.sc3.uis.edu.co/images/a/a8/Logo_sc33.png</div>  
<p><div class="btn btn-primary"><i class="fa  fa-long-arrow-left"></i> [[OpenFOAM (API)]]</div></p>
+
<p><div class="btn btn-primary"><i class="fa  fa-long-arrow-left"></i> [[OpenFoam (API)]]</div></p>
  
 
<div class="col-md-14">
 
<div class="col-md-14">
Line 14: Line 14:
  
 
== Installation ==
 
== Installation ==
First you need to check the required packages.  They can be obtained using aptitude.  Here is a complete list for the platform:
+
1. First you need to check the required packages.  They can be obtained using aptitude.  Here is a complete list for the platform:
 
+
{{Command|<nowiki>aptitude search build-essential
{{Command|<nowiki>aptitude search build-essential</nowiki>}}
+
aptitude search flex
{{Command|<nowiki>aptitude search flex</nowiki>}}
+
aptitude search bison
{{Command|<nowiki>aptitude search bison</nowiki>}}
+
aptitude search cmake
{{Command|<nowiki>aptitude search cmake</nowiki>}}
+
aptitude search zlib1g-dev
{{Command|<nowiki>aptitude search zlib1g-dev</nowiki>}}
+
aptitude search libopenmpi-dev
{{Command|<nowiki>aptitude search libopenmpi-dev</nowiki>}}
+
aptitude search openmpi-bin
{{Command|<nowiki>aptitude search openmpi-bin</nowiki>}}
+
aptitude search qt4-dev-tools
{{Command|<nowiki>aptitude search qt4-dev-tools</nowiki>}}
+
aptitude search libqt4-dev
{{Command|<nowiki>aptitude search libqt4-dev</nowiki>}}
+
aptitude search libqt4-opengl-dev
{{Command|<nowiki>aptitude search libqt4-opengl-dev</nowiki>}}
+
aptitude search gnuplot
{{Command|<nowiki>aptitude search gnuplot</nowiki>}}
+
aptitude search libxt-dev
{{Command|<nowiki>aptitude search libxt-dev</nowiki>}}
+
aptitude search freeglut3-dev
{{Command|<nowiki>aptitude search freeglut3-dev</nowiki>}}
+
aptitude search libqtwebkit-dev
{{Command|<nowiki>aptitude search libqtwebkit-dev</nowiki>}}
+
aptitude search libreadline-dev
{{Command|<nowiki>aptitude search libreadline-dev</nowiki>}}
+
aptitude search libncurses-dev</nowiki>}}
{{Command|<nowiki>aptitude search libncurses-dev</nowiki>}}
+
2. Then you must create a folder that is accesible for all the users, like /usr/local or /opt.   
 
 
Then you must create a folder that is accesible for all the users, like /usr/local or /opt.   
 
 
{{Command|<nowiki>mkdir /usr/local/OpenFOAM</nowiki>}}
 
{{Command|<nowiki>mkdir /usr/local/OpenFOAM</nowiki>}}
In that folder use the wget command to download the source package for both the base OpenFOAM and Third Party Scripts:
+
3. In that folder use the wget command to download the source package for both the base OpenFOAM and Third Party Scripts:
{{Command|<nowiki>wget http://downloads.sourceforge.net/foam/OpenFOAM-2.3.1.tgz</nowiki>}}
+
{{Command|<nowiki>wget http://downloads.sourceforge.net/foam/OpenFOAM-2.3.1.tgz
{{Command|<nowiki>wget http://downloads.sourceforge.net/foam/ThirdParty-2.3.1.tgz}}
+
wget http://downloads.sourceforge.net/foam/ThirdParty-2.3.1.tgz</nowiki>}}
 
+
4. Untar the files
 +
{{Command|<nowiki>tar -xvzf OpenFoam-x.x.x
 +
tar -xvzf ThirdParty-x.x.x</nowiki>}}
 +
{{Note|<nowiki>The compilers must be:
 +
GCC: 4.5.0 and above; LLVM Clang: 3.4 and above; Intel ICC: 14.0.1</nowiki>}}
  
 
+
5. Edit /etc/profile.d/apps.sh and add the following lines.  Then replicate these changes in the apps.sh file of every node.
== Setting-up ==
+
{{File|/etc/profile.d/apps.sh|<pre><nowiki>
1. Replace ${ADMIN_EMAIL}, ${HOSTNAME}, ${DNS_DOMAIN}, ${IP_ADDR} for the adequate values.
 
 
 
2. Redirect messages from root, postmaster, admin, etc, to the administrator.
 
 
 
Edit /etc/mail/aliases
 
{{File|/etc/mail/aliases|<pre><nowiki>
 
 
...
 
...
operator: root
+
export FOAM_INST_DIR=/usr/local/OpenFOAM
admin: root
+
foamDotFile=$FOAM_INST_DIR/OpenFOAM-2.3.1/etc/bashrc
root: ${ADMIN_EMAIL}
+
[ -f $foamDotFile ] && . $foamDotFile
 
...
 
...
</pre></nowiki>}}
+
</nowiki></pre>}}
Update the aliases database:
+
 
{{Command|<nowiki>/usr/sbin/newaliases</nowiki>}}
+
6. Run ./Allwmake
4. Verify that sendmail knows about the different names that the client can have.
+
{{Command|<nowiki>cd $FOAM_INST_DIR/OpenFOAM-2.3.1/
 +
./Allwmake</nowiki>}}
  
Edit /etc/mail/local-host-names
+
7. Test!
{{File|/etc/mail/local-host-names|<pre><nowiki>
+
{{Command|<nowiki>cd $FOAM_INST_DIR/OpenFOAM-2.3.1/bin/
...
+
./foamInstallationTest</nowiki>}}
localhost
 
localhost.localdomain
 
${HOSTNAME}
 
${HOSTNAME}.${DNS_DOMAIN}
 
...
 
</pre></nowiki>}}
 
Verify that the host appears in /etc/hosts
 
{{File|/etc/hosts|<pre><nowiki>
 
...
 
${IP_ADDR}  ${HOSTNAME}.${DNS_DOMAIN}  ${HOSTNAME}
 
...</nowiki></pre>}}
 
Edit /etc/mail/sendmail.mc
 
{{File|/etc/mail/sendmail.mc|<pre><nowiki>
 
...
 
dnl #
 
dnl # Masquerading options
 
FEATURE(`always_add_domain')dnl
 
MASQUERADE_AS(`${HOSTNAME}.${DNS_DOMAIN}')dnl
 
FEATURE(`allmasquerade')dnl
 
FEATURE(`masquerade_envelope')dnl
 
dnl #
 
dnl # Default Mailer setup
 
MAILER_DEFINITIONS
 
MAILER(`local')dnl
 
MAILER(`smtp')dnl
 
...</nowiki></pre>}}
 
5. Activate the new configuration
 
{{Command|<nowiki>yes | sendmailconfig</nowiki>}}
 
== Security ==
 
By default Debian installs sendmail enabled only for localhost.<br>
 
If tcp-wrappers are used, a line similar to the following should be added to /etc/hosts.allow
 
{{File|/etc/hosts.allow|<pre><nowiki>
 
...
 
sendmail: 127.0.0.1
 
</nowiki></pre>}}
 
If different filters are used, it's necessary to allow the access to the port localhost:25/tcp from localhost:1025/tcp
 
== Cleaning-up (optional)==
 
Remove ssmtp
 
{{Command|<nowiki>aptitude remove ssmtp</nowiki>}}
 
If the DNS setup isn't defined in /etc/network/interfaces, remove resolvconf
 
{{Command|<nowiki>aptitude remove resolvconf</nowiki>}}
 
  
 
             </p>
 
             </p>

Latest revision as of 03:49, 27 April 2015


Logo_sc33.png

OpenFOAM Installation

OpenFOAM 2.3.1 over Debian 7.0

Installation

1. First you need to check the required packages. They can be obtained using aptitude. Here is a complete list for the platform:

aptitude search build-essential aptitude search flex aptitude search bison aptitude search cmake aptitude search zlib1g-dev aptitude search libopenmpi-dev aptitude search openmpi-bin aptitude search qt4-dev-tools aptitude search libqt4-dev aptitude search libqt4-opengl-dev aptitude search gnuplot aptitude search libxt-dev aptitude search freeglut3-dev aptitude search libqtwebkit-dev aptitude search libreadline-dev aptitude search libncurses-dev

2. Then you must create a folder that is accesible for all the users, like /usr/local or /opt.

mkdir /usr/local/OpenFOAM

3. In that folder use the wget command to download the source package for both the base OpenFOAM and Third Party Scripts:

wget http://downloads.sourceforge.net/foam/OpenFOAM-2.3.1.tgz wget http://downloads.sourceforge.net/foam/ThirdParty-2.3.1.tgz

4. Untar the files

tar -xvzf OpenFoam-x.x.x tar -xvzf ThirdParty-x.x.x
NOTE: The compilers must be: GCC: 4.5.0 and above; LLVM Clang: 3.4 and above; Intel ICC: 14.0.1


5. Edit /etc/profile.d/apps.sh and add the following lines. Then replicate these changes in the apps.sh file of every node.

File: /etc/profile.d/apps.sh
...
export FOAM_INST_DIR=/usr/local/OpenFOAM
foamDotFile=$FOAM_INST_DIR/OpenFOAM-2.3.1/etc/bashrc
[ -f $foamDotFile ] && . $foamDotFile
...

6. Run ./Allwmake

cd $FOAM_INST_DIR/OpenFOAM-2.3.1/ ./Allwmake


7. Test!

cd $FOAM_INST_DIR/OpenFOAM-2.3.1/bin/ ./foamInstallationTest