Difference between revisions of "Installation/swak4Foam/Building dependencies"

From OpenFOAMWiki
(Introduction: gave example about when these instructions apply)
(added quotes for changes needed for 4.0 and v1606+)
 
(5 intermediate revisions by the same user not shown)
Line 3: Line 3:
 
# If your system provides Bison 3.0 by default.
 
# If your system provides Bison 3.0 by default.
 
# And swak4Foam needs a version of Bison between 2.5 and 2.8.
 
# And swak4Foam needs a version of Bison between 2.5 and 2.8.
# Then you'll need to follow the instructions provided in section [[#Bison]].
+
# Then you'll need to follow the instructions provided in section [[#Bison|Bison]].
  
 
__FORCETOC__
 
__FORCETOC__
 
__TOC__
 
__TOC__
 +
 +
= <tt>m4</tt> =
 +
 +
'''Note''': {{tt|m4}} is only needed for building {{tt|bison}} from source code.
 +
 +
If {{tt|m4}} is not installed, too old or buggy, then follow these steps... and assuming you already have the necessary utilities for building C and C++ source code, then this should do the trick:
 +
<ol>
 +
<li>If not already there, go into swak4Foam's folder:
 +
<bash>cd swak4Foam</bash>
 +
</li>
 +
 +
<li>Download, unpack, compile and install {{tt|m4}}, by running:
 +
<bash>wget http://ftpmirror.gnu.org/m4/m4-1.4.17.tar.gz
 +
tar -xf m4-1.4.17.tar.gz
 +
cd m4-1.4.17
 +
./configure --prefix $PWD/../m4
 +
make
 +
make install
 +
cd ..</bash>
 +
</li>
 +
 +
<li>Now, before running swak4Foam's script {{tt|Allwmake}} or before building [[#Bison|Bison]], run this command:
 +
<bash>export PATH=$PWD/m4/bin:$PATH</bash>
 +
</li>
 +
</ol>
 +
 +
'''Note''': If you are not curious about seeing the instructions for building Bison, then check which version you have installed:
 +
<bash>bison --version</bash>
 +
because versions of Bison 3 and newer are not yet supported for building swak4Foam.
  
 
= Bison =
 
= Bison =
 +
 +
If you already have Bison installed, then check which version you have installed:
 +
<bash>bison --version</bash>
 +
If not, keep in mind that versions of Bison 3 and newer are not yet supported for building swak4Foam.
  
 
There are currently 2 ways to build Bison from source code:
 
There are currently 2 ways to build Bison from source code:
# Manually, when using [[#swak4Foam 0.3.0 and older]].
+
# Manually, when using [[#swak4Foam 0.3.0 and older|swak4Foam 0.3.0 and older]].
# Nearly automatically, using the script provided in swak4Foam. '''TODO''': This is present in the development version, but has not yet been released in a stable version.
+
# Nearly automatically, using the script provided in [[#swak4Foam 0.3.1 and newer|swak4Foam 0.3.1 and newer]].
  
  
Line 30: Line 63:
 
make install
 
make install
 
cd ..</bash>
 
cd ..</bash>
 +
'''Note:''' If you have problems during the configure step, check the following link: [[Installation/swak4Foam/Understanding_Error_Messages#m4 is not present, too old or buggy|m4 is not present, too old or buggy]]
 
</li>
 
</li>
  
Line 36: Line 70:
 
</li>
 
</li>
 
</ol>
 
</ol>
 +
 +
 +
== swak4Foam 0.3.1 and newer ==
 +
Assuming you already have the necessary utilities for building C and C++ source code, then this should do the trick:
 +
<ol>
 +
<li>If not already there, go into swak4Foam's folder:
 +
<bash>cd swak4Foam</bash>
 +
</li>
 +
 +
<li>Download, unpack, compile and install Bison, simply by running:
 +
<bash>./maintainanceScripts/compileRequirements.sh</bash>
 +
'''Note:''' If you have problems during the configure step, check the following link: [[Installation/swak4Foam/Understanding_Error_Messages#m4 is not present, too old or buggy|m4 is not present, too old or buggy]]
 +
</li>
 +
 +
<li>Now you can simply go on with the installation of swak4Foam, since the missing requirements should have been built with success.</li>
 +
</ol>
 +
 +
 +
= Specific fixes in OpenFOAM technology source code =
 +
 +
== OpenFOAM 4.0 ==
 +
{{VersionInfo}}{{Version4.0}}
 +
 +
Quoting the README file:
 +
<pre>**** Support for OpenFOAM 4.0
 +
    This version is supported in this version of OpenFOAM. There is
 +
    one problem: the released version has two problems that mean that
 +
    =swak4foam= will *never* compile on the released version.
 +
 +
    Patches fixing these issues are found in the directory
 +
    =distroPatches/OpenFOAM-4.0=
 +
</pre>
 +
 +
 +
== OpenFOAM+ v1606+ ==
 +
{{VersionInfo}}{{Version1606+}}
 +
 +
Quoting the README file:
 +
<pre>**** Support for OpenFOAM v1606+ version
 +
    This version is supported in the this version of
 +
    =swak4Foam=. There is only one problem: there were changes to the
 +
    =tmp=-template. These changes have been taken care of in the
 +
    =swak4Foam=-sources. *But* there are two source files in the
 +
    distro that need to be modified (basically adding =.ref()=
 +
    instead of =()= in three places:
 +
: src/finiteVolume/finiteVolume/fvc/fvcD2dt2.C
 +
: src/finiteVolume/fvMatrices/fvMatrix/fvMatrixSolve.C
 +
    Therefor the officially released version will *never* compile
 +
    with =swak4Foam= but this is nothing that can be fixed in
 +
    =swak4Foam= (the patch is found in the directory
 +
    =distroPatches/OpenFOAM-v1606+=)
 +
</pre>
 +
  
  
 
[[Category:Installing swak4Foam]]
 
[[Category:Installing swak4Foam]]

Latest revision as of 20:40, 15 October 2016

1 Introduction

This page is dedicated to explaining how to build certain dependencies from source code, which swak4Foam might specifically need, in case the system's default versions are incompatible. For example:

  1. If your system provides Bison 3.0 by default.
  2. And swak4Foam needs a version of Bison between 2.5 and 2.8.
  3. Then you'll need to follow the instructions provided in section Bison.


2 m4

Note: m4 is only needed for building bison from source code.

If m4 is not installed, too old or buggy, then follow these steps... and assuming you already have the necessary utilities for building C and C++ source code, then this should do the trick:

  1. If not already there, go into swak4Foam's folder:
    cd swak4Foam
  2. Download, unpack, compile and install m4, by running:
    wget http://ftpmirror.gnu.org/m4/m4-1.4.17.tar.gz
    tar -xf m4-1.4.17.tar.gz
    cd m4-1.4.17
    ./configure --prefix $PWD/../m4
    make
    make install
    cd ..
  3. Now, before running swak4Foam's script Allwmake or before building Bison, run this command:
    export PATH=$PWD/m4/bin:$PATH

Note: If you are not curious about seeing the instructions for building Bison, then check which version you have installed:

bison --version

because versions of Bison 3 and newer are not yet supported for building swak4Foam.

3 Bison

If you already have Bison installed, then check which version you have installed:

bison --version

If not, keep in mind that versions of Bison 3 and newer are not yet supported for building swak4Foam.

There are currently 2 ways to build Bison from source code:

  1. Manually, when using swak4Foam 0.3.0 and older.
  2. Nearly automatically, using the script provided in swak4Foam 0.3.1 and newer.


3.1 swak4Foam 0.3.0 and older

Assuming you already have the necessary utilities for building C and C++ source code, then this should do the trick:

  1. If not already there, go into swak4Foam's folder:
    cd swak4Foam
  2. Download, unpack, compile and install Bison, by running:
    wget http://ftpmirror.gnu.org/bison/bison-2.7.tar.gz
    tar -xf bison-2.7.tar.gz
    cd bison-2.7
    ./configure --prefix $PWD/../bison
    make
    make install
    cd ..

    Note: If you have problems during the configure step, check the following link: m4 is not present, too old or buggy

  3. Now, before running swak4Foam's script Allwmake, run this command:
    export PATH=$PWD/bison/bin:$PATH


3.2 swak4Foam 0.3.1 and newer

Assuming you already have the necessary utilities for building C and C++ source code, then this should do the trick:

  1. If not already there, go into swak4Foam's folder:
    cd swak4Foam
  2. Download, unpack, compile and install Bison, simply by running:
    ./maintainanceScripts/compileRequirements.sh

    Note: If you have problems during the configure step, check the following link: m4 is not present, too old or buggy

  3. Now you can simply go on with the installation of swak4Foam, since the missing requirements should have been built with success.


4 Specific fixes in OpenFOAM technology source code

4.1 OpenFOAM 4.0

Valid versions: OF Version 40.png

Quoting the README file:

**** Support for OpenFOAM 4.0
     This version is supported in this version of OpenFOAM. There is
     one problem: the released version has two problems that mean that
     =swak4foam= will *never* compile on the released version.

     Patches fixing these issues are found in the directory
     =distroPatches/OpenFOAM-4.0=


4.2 OpenFOAM+ v1606+

Valid versions: OF Version 1606plus.png

Quoting the README file:

**** Support for OpenFOAM v1606+ version
     This version is supported in the this version of
     =swak4Foam=. There is only one problem: there were changes to the
     =tmp=-template. These changes have been taken care of in the
     =swak4Foam=-sources. *But* there are two source files in the
     distro that need to be modified (basically adding =.ref()=
     instead of =()= in three places:
: src/finiteVolume/finiteVolume/fvc/fvcD2dt2.C
: src/finiteVolume/fvMatrices/fvMatrix/fvMatrixSolve.C
     Therefor the officially released version will *never* compile
     with =swak4Foam= but this is nothing that can be fixed in
     =swak4Foam= (the patch is found in the directory
     =distroPatches/OpenFOAM-v1606+=)