Commit c9c2fbcf authored by mark's avatar mark

ENH: handle source packs that unpack to 'OpenFOAM-plus'

- This may occur with some frequency.

- Add some comments and reduce the number of variable at the top.
parent ac4ed6d2
...@@ -50,10 +50,6 @@ and package versions, it may not work for all users and environments. ...@@ -50,10 +50,6 @@ and package versions, it may not work for all users and environments.
5) If you use `clang` as compiler, it must be the same version as `llvm`. 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 ## Script Configuration
......
...@@ -8,10 +8,16 @@ ...@@ -8,10 +8,16 @@
# Use ThirdParty compiler, but retain most default software versions. # Use ThirdParty compiler, but retain most default software versions.
# #
# Adjust the relevant USER INPUT sections below prior to running. # Adjust the relevant USER INPUT sections below prior to running.
#
# - INPUT (1) has the top-level packaging # - INPUT (1) has the top-level packaging
# - INPUT (2) has version preferences # - INPUT (2) has version preferences
# #
# Input Directory:
# - ./packages # Contains the tar files
#
# Output Directories
# - ./install # The compiled installation
# - ./log # Log files from the build scripts
#
# License # License
# GPL v3 or later # GPL v3 or later
# Copyright (C) 2016 Roger Almenar, ESI GmbH. # Copyright (C) 2016 Roger Almenar, ESI GmbH.
...@@ -24,19 +30,14 @@ FoamVersion=v1612+ ...@@ -24,19 +30,14 @@ FoamVersion=v1612+
OFdirName=OpenFOAM-$FoamVersion OFdirName=OpenFOAM-$FoamVersion
TPdirName=ThirdParty-$FoamVersion TPdirName=ThirdParty-$FoamVersion
# Source package names may differ from the directory names # Source package names may differ from the directory names above
OFsource=$OFdirName # uncomment and change if needed)
TPsource=$TPdirName # OFsource=OpenFOAM-plus
# TPsource=ThirdParty-plus
# Local directories
INSTALL_DIR=$PWD/install
PACKAGE_DIR=$PWD/packages
LOGFILE_DIR=$PWD/log
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# User input continues below at USER INPUT (2) # User input continues below at USER INPUT (2)
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
_preferences() _preferences()
{ {
...@@ -90,9 +91,14 @@ _preferences <<-USER_INPUT ...@@ -90,9 +91,14 @@ _preferences <<-USER_INPUT
# ----------------------------------------------------------------------------- # -----------------------------------------------------------------------------
USER_INPUT USER_INPUT
# #
# NO FURTHER EDITING BELOW THIS LINE # NO NORMAL EDITING BELOW THIS LINE
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
# Local directories
INSTALL_DIR=$PWD/install
PACKAGE_DIR=$PWD/packages
LOGFILE_DIR=$PWD/log
# Special treatment for gcc sub-components (needs rethinking) # Special treatment for gcc sub-components (needs rethinking)
case "$compilerVersion" in case "$compilerVersion" in
Gcc | Gcc48) Gcc | Gcc48)
...@@ -484,9 +490,17 @@ unpackAllFiles() ...@@ -484,9 +490,17 @@ unpackAllFiles()
exit 1 exit 1
} }
# Unpack OpenFOAM and ThirdParty (names may differ) # Unpack OpenFOAM and ThirdParty
_unpack $OFsource; _mvdir "$OFsource" "$OFdirName" # Source package names may differ from the directory names
_unpack $TPsource; _mvdir "$TPsource" "$TPdirName" # Also handle '-plus' extensions (common problem?)
_unpack "${OFsource:=$OFdirName}"
_mvdir "$OFsource" "$OFdirName"
_mvdir OpenFOAM-plus "$OFdirName"
_unpack "${TPsource:=$TPdirName}";
_mvdir "$TPsource" "$TPdirName"
_mvdir ThirdParty-plus "$TPdirName"
cd $INSTALL_DIR/$OFdirName || { cd $INSTALL_DIR/$OFdirName || {
echo "Error: cannot change to $INSTALL_DIR/$OFdirName" echo "Error: cannot change to $INSTALL_DIR/$OFdirName"
...@@ -952,13 +966,23 @@ compileOpenFOAM() ...@@ -952,13 +966,23 @@ compileOpenFOAM()
_listSettings _listSettings
[ "$optList" = true ] && exit 0 [ "$optList" = true ] && exit 0
if [ "${purgeOLDFILES:-false}" = true ]
then
commentUNPACK="(purge old files)"
else
commentUNPACK="(keep old files)"
fi
commentTHIRD=""
commentFOAM=""
/bin/cat<<SUMMARY /bin/cat<<SUMMARY
Build stages selected Build stages selected
--------------------- ---------------------
-unpack ${runUNPACK:-false} -unpack ${runUNPACK:-false} $commentUNPACK
-third ${runTHIRD:-false} -third ${runTHIRD:-false} $commentTHIRD
-foam ${runFOAM:-false} -foam ${runFOAM:-false} $commentFOAM
--------------------- ---------------------
SUMMARY SUMMARY
......
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