Commit 2e32ac0a authored by Mark Olesen's avatar Mark Olesen

Merge branch 'develop' into 'master'

Update master to match develop

See merge request !2
parents c0aae671 0454b4be
......@@ -34,6 +34,7 @@ and package versions, it may not work for all users and environments.
* 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
* openmp-x.y.z.src TarFile must be moved to llvm-x.y.z/tools/openmp
* 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
......@@ -52,18 +53,17 @@ and package versions, it may not work for all users and environments.
---
## Script Configuration
## 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
section `[software]`, 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).
# USER INPUT (2)
# ~~~~~~~~~~~~~~
[software]
# Preferred software versions etc. Use 'third' for ThirdParty.
#---------------------+-------------------+-------------------+
# package | default | user-preference |
......@@ -95,23 +95,21 @@ tar/zip file with packageName-versionNumber needs to be placed under subdir
## Usage
./legacyCompile [OPTION] OPERATION [...OPERATION]
./legacyCompile [OPTIONS] OPERATION [...OPERATION] configFile
options:
-purge Purge old directories before unpacking (CAUTION)
-int32 | -int64 Label width
-SP | -DP Precision
-sigfpe | -no-sigfpe Activate/deactivate FOAM_SIGFPE handling
-help
operations:
-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
options:
-purge Purge old directories before unpacking (CAUTION)
-help
Config options:
-int32 | -int64 Label width (default: 32)
-SP | -DP Precision (default: DP)
-sigfpe |-no-sigfpe Activate/deactivate FOAM_SIGFPE handling
-all Alias for -unpack -third -foam
-rebuild Alias for -third -foam
The script contains the three essential operations:
......@@ -127,43 +125,43 @@ unpack stage).
* To compile first time (from scratch) with default label size and precision:
./legacyCompile -all
./legacyCompile -all configFile
* To repeat the same, **overwriting** any existing installation:
./legacyCompile -all -purge
./legacyCompile -all -purge configFile
* To unpack all packages and configure some OpenFOAM settings without
compiling:
./legacyCompile -unpack
./legacyCompile -unpack -purge # caution: removes existing installation
./legacyCompile -unpack configFile
./legacyCompile -unpack -purge configFile # Caution: removes existing installation
To compile with 64 bit label size in single precission:
./legacyCompile -all -int64 -SP
./legacyCompile -all -int64 -SP configFile
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
./legacyCompile -unpack configFile
To (re)compile ThirdParty and OpenFOAM individually:
./legacyCompile -unpack -third -purge
./legacyCompile -unpack -third -purge configFile
(to compile ThirdParty from scratch)
./legacyCompile -foam
./legacyCompile -foam configFile
(to compile OpenFOAM from existing ThirdParty)
To compile with 32 bit label size in single precission:
./legacyCompile -all -int64 -SP
./legacyCompile -all -int64 -SP configFile
---
......@@ -183,4 +181,4 @@ building Clang), you should remove the corrsponding logfile(s) before
recompiling with the '-unpack -third` options.
---
2016-12-21
2017-06-29
This diff is collapsed.
#------------------------------------------------------------------------------
# File
# v1612.cfg
#
# Description
# Configuration file for legacyCompile
#------------------------------------------------------------------------------
# Top-level package information
[package]
FoamVersion=v1612+
OFdirName=OpenFOAM-v1612+
TPdirName=ThirdParty-v1612+
# If source packages differ from the directory names, uncomment and adjust
# OFsource=OpenFOAM-plus
# TPsource=ThirdParty-plus
# Architecture
[arch]
label=32
scalar=64
sigfpe=false
[software]
# 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 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
ompiType system third
compilerType system third
compiler Gcc Clang
# -----------------------------------------------------------------------------
#------------------------------------------------------------------------------
# File
# v1706.cfg
#
# Description
# Configuration file for legacyCompile
#------------------------------------------------------------------------------
# Top-level package information
[package]
FoamVersion=v1706
OFdirName=OpenFOAM-v1706
TPdirName=ThirdParty-v1706
# If source packages differ from the directory names, uncomment and adjust
# OFsource=OpenFOAM-plus
# TPsource=ThirdParty-plus
# Architecture
[arch]
label=32
scalar=32
sigfpe=false
[software]
# Preferred software versions etc. Use 'third' for ThirdParty.
#---------------------+-------------------+-------------------+
# package | default | user-preference |
#---------------------+-------------------+-------------------+
boost boost_1_64_0
cgal CGAL-4.9.1
fftw fftw-3.3.6-pl1
openmpi openmpi-1.10.4
scotch scotch_6.0.3
paraview ParaView-5.4.0
cmake cmake-system cmake-3.5.2
vtk none VTK-8.1.0
mesa none mesa-17.1.1
qt 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
ompiType system third
compilerType system third
compiler Gcc Clang
# -----------------------------------------------------------------------------
#------------------------------------------------------------------------------
# File
# v1712.cfg
#
# Description
# Configuration file for legacyCompile
#------------------------------------------------------------------------------
# Top-level package information
[package]
FoamVersion=v1712
OFdirName=OpenFOAM-v1712
TPdirName=ThirdParty-v1712
# If source packages differ from the directory names, uncomment and adjust
# OFsource=OpenFOAM-plus
# TPsource=ThirdParty-plus
# Architecture
[arch]
label=32
scalar=32
[software]
# Preferred software versions etc. Use 'third' for ThirdParty.
#---------------------+-------------------+-------------------+
# package | default | user-preference |
#---------------------+-------------------+-------------------+
boost boost_1_64_0
cgal CGAL-4.9.1
fftw fftw-3.3.7
openmpi openmpi-1.10.4
scotch scotch_6.0.3
kahip kahip-2.00
paraview ParaView-5.4.1
cmake cmake-system cmake-3.6.0
vtk none VTK-8.1.0
mesa none mesa-17.1.1
qt qt-system qt-5.9.3
llvm llvm-3.7.1
gcc system gcc-4.8.5
gmp system gmp-6.1.1
mpfr system mpfr-3.1.5
mpc system mpc-1.0.3
ompiType system third
compilerType system third
compiler Gcc Clang
# -----------------------------------------------------------------------------
......@@ -73,7 +73,7 @@ do
'')
# Ignore empty args
;;
-h | -help)
-h | -help*)
usage
;;
-debug)
......@@ -178,11 +178,38 @@ else
fi
# Snapshot of aliases - sorted
printAlias()
{
alias | sort -f
}
# Snapshot of environment - without functions
# Sorted as non-OpenFOAM, WM_*, FOAM_*
printEnv()
{
# Non FOAM_*, WM_* settings
echo "# non-OpenFOAM"
env | sed -n -e '\@^FOAM_@d' -e '\@^WM_@d' -e '\@^[^ {}]@p' \
| sort -f
# WM_* settings
echo "# OpenFOAM"
env | sed -n -e '\@^WM_@p' \
| sort -f
# FOAM_* settings
echo "# OpenFOAM"
env | sed -n -e '\@^FOAM_@p' \
| sort -f
}
#
# Initial snapshot of the environment, without any functions
# Initial snapshot of the environment (without functions)
#
env | sed -n -e '/^[^ {}]/p' | sort -f > $tmpFiles.env.pre.log
alias | sort -f > $tmpFiles.alias.pre.log
printEnv > $tmpFiles.env.pre.log
printAlias > $tmpFiles.alias.pre.log
# OpenFOAM settings
. $projectDir/etc/bashrc ''
......@@ -195,6 +222,9 @@ unset FOAM_JOB_DIR FOAM_RUN FOAM_SETTINGS FOAM_INST_DIR
unset WM_PROJECT_USER_DIR WM_THIRD_PARTY_DIR
unset SCOTCH_VERSION
# Also remove user directories as being unreliable
foamOldDirs="$CEI_HOME $BOOST_ARCH_PATH $CGAL_ARCH_PATH $FFTW_ARCH_PATH $MPI_ARCH_PATH $SCOTCH_ARCH_PATH \
$FOAM_SITE_APPBIN $FOAM_SITE_LIBBIN $WM_PROJECT_SITE \
$FOAM_USER_APPBIN $FOAM_USER_LIBBIN"
......@@ -222,11 +252,6 @@ unset ENSIGHT10_INPUT ENSIGHT10_READER
# Always consider site to be bogus. If needed, should be done elsewhere.
unset FOAM_SITE_APPBIN FOAM_SITE_LIBBIN WM_PROJECT_SITE
# Make user directories more generic.
export FOAM_USER_APPBIN='$env(HOME)/OpenFOAM/$env(USER)-'"$WM_PROJECT_VERSION/platforms/$WM_OPTIONS/bin"
export FOAM_USER_LIBBIN='$env(HOME)/OpenFOAM/$env(USER)-'"$WM_PROJECT_VERSION/platforms/$WM_OPTIONS/lib"
# Remove non-essential aliases
unalias wmDP 2>/dev/null
unalias wmInt32 2>/dev/null
......@@ -247,11 +272,22 @@ unalias util 2>/dev/null
#------------------------------------------------
# Generalize environment.
# This needs rethinking since it largely duplicates logic from the etc/config.sh/settings
rewriteEnv()
{
sed \
-e 's@^\(FOAM_USER_APPBIN=\).*@\1$env(HOME)/OpenFOAM/$env(USER)-$env(WM_PROJECT_VERSION)/platforms/$env(WM_OPTIONS)/bin@' \
-e 's@^\(FOAM_USER_LIBBIN=\).*@\1$env(HOME)/OpenFOAM/$env(USER)-$env(WM_PROJECT_VERSION)/platforms/$env(WM_OPTIONS)/lib@' \
;
}
#
# Updated snapshot of the environment, without any functions
# Updated snapshot of the environment (without functions)
#
env | sed -n -e '/^[^ {}]/p' | sort -f > $tmpFiles.env.post.log
alias | sort -f > $tmpFiles.alias.post.log
printEnv | rewriteEnv > $tmpFiles.env.post.log
printAlias > $tmpFiles.alias.post.log
# Create a diff of the environment and aliases
diff $tmpFiles.env.pre.log $tmpFiles.env.post.log > $tmpFiles.env.diff.log
......@@ -259,7 +295,7 @@ diff $tmpFiles.alias.pre.log $tmpFiles.alias.post.log > $tmpFiles.alias.diff.lo
echo "# -------------------" > $moduleOutput
# -------------------
# --------------------------------------------------
# Environment other than PATH, LD_LIBRARY_PATH
echo "# Environment" >> $moduleOutput
grep '> ' $tmpFiles.env.diff.log | \
......@@ -270,7 +306,7 @@ sed \
-e 's/=/ "/' -e 's/$/\"/' >> $moduleOutput
# -------------------
# --------------------------------------------------
# Changes in PATH - without junk and system directories
echo "# PATH" >> $moduleOutput
......@@ -290,9 +326,9 @@ sed \
-e 's/^/append-path PATH "/' \
-e 's/$/\"/' \
$tmpFiles.path.diff.log >> $moduleOutput
# -------------------
# --------------------------------------------------
# -------------------
# --------------------------------------------------
# Changes in LD_LIBRARY_PATH - without junk and system directories
echo "# LD_LIBRARY_PATH" >> $moduleOutput
......
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