Commit ac4ed6d2 authored by Roger Almenar's avatar Roger Almenar Committed by mark

Initial commit of legacyCompile

Script for installation of OpenFOAM and related ThirdParty packages
This script has been created to ease compiling OpenFOAM with various
combinations of ThirdParty packages.
It is named legacyCompile, since this represents a common situation
in which the standard system toolchain is a bit out of date.
During the compilation, all output messages will be shown on screen as well
as saved in log files. You will find all log files under the `log/` folder.
Although the script has been tested with a variety of OS (mostly Linux)
and package versions, it may not work for all users and environments.
**So use it at your own risk**
## Prerequisites
1) The legacyCompile script needs to have execution rights and be
configured according to the package versions desired.
For configuration, please see below.
2) All packages, including OpenFOAM, ThirdParty, and those packs
related to ThirdParty need to be stored under the `packages/`
3) Names of all packaged files must be as defined under default or
under user-preference. For example, if under user-preference you
have mesa-10.3.2, the file name should NOT be MesaLib-10.3.2.tgz.
The same may apply to the following:
* MesaLib-x.y.z files (replace by mesa-x.y.z)
* llvm-x.y.z.src TarFile (remove .src part in filename and in subdir)
* cfe-x.y.z.src TarFile must be moved to llvm-x.y.z/tools/clang
* ParaView-v* TarFile (remove -source part in filename and in subdir)
Note: when unpacking ParaView, it may create a subdir with suffix
-source. Please remove this suffix as well and tar the package
* And potentially others, except QT files, which have a
completely different naming anyhow.
Please modify names by hand if required.
4) OpenFOAM and ThirdParty packs need to unpack to a subdirectory with
the same name as the file names (without extension). Hence if you
have ThirdParty-v1612+.tgz, it should not unpack to
ThirdParty-plus/ subdir.
5) If you use `clang` as compiler, it must be the same version as `llvm`.
6) Please make sure that the unpacked OpenFOAM `etc/bashrc` file
contains the correct version name
(if you download from other sources than the standard release files).
## Script Configuration
Users need to define the desired packages and versions to use for the
OpenFOAM compilation. The packages and versions need to be input under the
paragraph `USER INPUT (2)`, stating whether the default version is to be
used, or the user needs to use a different version. If both entries have
information, the user-preference will prevail. In any case, a suitable
tar/zip file with packageName-versionNumber needs to be placed under subdir
`packages/`. The value `ompiType` refers to the openmpi type (system|third).
# ~~~~~~~~~~~~~~
# Preferred software versions etc. Use 'third' for ThirdParty.
# package | default | user-preference |
boost boost_1_62_0
cgal CGAL-4.9
fftw fftw-3.3.5
openmpi openmpi-1.10.4
scotch scotch_6.0.3
paraview ParaView-5.0.1
cmake cmake-system cmake-3.5.2
vtk none VTK-7.1.0
mesa none mesa-13.0.1
qt system qt-4.8.7
llvm llvm-3.7.0
gcc system gcc-4.8.5
gmp system gmp-6.1.1
mpfr system mpfr-3.1.5
mpc system mpc-1.0.3
label 32
precision DP
ompiType system third
compilerType system third
compiler Gcc Gcc
## Usage
-unpack Unpack sources, configure
-third Compile ThirdParty
-foam Compile OpenFOAM
-list List configured versions only
-all Alias for -unpack -third -foam
-rebuild Alias for -third -foam
-purge Purge old directories before unpacking (CAUTION)
Config options:
-int32 | -int64 Label width (default: 32)
-SP | -DP Precision (default: DP)
-sigfpe |-no-sigfpe Activate/deactivate FOAM_SIGFPE handling
The script contains the three essential operations:
1) unpack (the `-unpack` option)
2) compile/recompile ThirdParty packages (the `-third` option)
3) compile/recompile OpenFOAM (the `-foam` option)
The `-all` shortcut is a simple way to do all three together.
The `-rebuild` shortcut just does `-third` and `-foam` (without the
unpack stage).
* To compile first time (from scratch) with default label size and precision:
./legacyCompile -all
* To repeat the same, **overwriting** any existing installation:
./legacyCompile -all -purge
* To unpack all packages and configure some OpenFOAM settings without
./legacyCompile -unpack
./legacyCompile -unpack -purge # caution: removes existing installation
To compile with 64 bit label size in single precission:
./legacyCompile -all -int64 -SP
If you change your third-party package selections or the preferred
configuration (SP, DP etc), you will need the `-unpack` operation,
which also includes some configuration operations.
./legacyCompile -unpack
To (re)compile ThirdParty and OpenFOAM individually:
./legacyCompile -unpack -third -purge
(to compile ThirdParty from scratch)
./legacyCompile -foam
(to compile OpenFOAM from existing ThirdParty)
To compile with 32 bit label size in single precission:
./legacyCompile -all -int64 -SP
## Notes
The standard compilation of OpenFOAM and ThirdParty (as done by
OpenFOAM itself) will only rebuild the out-of-date parts.
Since the building of individual ThirdParty infrastructure components
(eg, the compiler itself, paraview, etc) are all essentially *forced*
builds, the legacyCompile script uses the log files to detect if an
infrastructure component has already been built or not.
If you experience issues when building such a subcomponent (eg,
building Clang), you should remove the corrsponding logfile(s) before
recompiling with the '-unpack -third` options.
This diff is collapsed.
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment