diff --git a/legacyCompile/README.md b/legacyCompile/README.md index c46263fcf3e66fb229595b8ccbd6e0a41d5b4395..791f64900ae3d0765b3d2f8ad24a830f8af1e181 100644 --- a/legacyCompile/README.md +++ b/legacyCompile/README.md @@ -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`. -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 diff --git a/legacyCompile/legacyCompile b/legacyCompile/legacyCompile index 566db9a5030df2602ac7257ec8abfe864f235983..62556700d3a2b073e6359e14dffce9a0d1f160f1 100755 --- a/legacyCompile/legacyCompile +++ b/legacyCompile/legacyCompile @@ -8,10 +8,16 @@ # Use ThirdParty compiler, but retain most default software versions. # # Adjust the relevant USER INPUT sections below prior to running. -# # - INPUT (1) has the top-level packaging # - 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 # GPL v3 or later # Copyright (C) 2016 Roger Almenar, ESI GmbH. @@ -24,19 +30,14 @@ FoamVersion=v1612+ OFdirName=OpenFOAM-$FoamVersion TPdirName=ThirdParty-$FoamVersion -# Source package names may differ from the directory names -OFsource=$OFdirName -TPsource=$TPdirName - -# Local directories -INSTALL_DIR=$PWD/install -PACKAGE_DIR=$PWD/packages -LOGFILE_DIR=$PWD/log +# Source package names may differ from the directory names above +# uncomment and change if needed) +# OFsource=OpenFOAM-plus +# TPsource=ThirdParty-plus # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ # User input continues below at USER INPUT (2) # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - #------------------------------------------------------------------------------ _preferences() { @@ -90,9 +91,14 @@ _preferences <<-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) case "$compilerVersion" in Gcc | Gcc48) @@ -484,9 +490,17 @@ unpackAllFiles() exit 1 } - # Unpack OpenFOAM and ThirdParty (names may differ) - _unpack $OFsource; _mvdir "$OFsource" "$OFdirName" - _unpack $TPsource; _mvdir "$TPsource" "$TPdirName" + # Unpack OpenFOAM and ThirdParty + # Source package names may differ from the directory names + # 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 || { echo "Error: cannot change to $INSTALL_DIR/$OFdirName" @@ -952,13 +966,23 @@ compileOpenFOAM() _listSettings [ "$optList" = true ] && exit 0 +if [ "${purgeOLDFILES:-false}" = true ] +then + commentUNPACK="(purge old files)" +else + commentUNPACK="(keep old files)" +fi + +commentTHIRD="" +commentFOAM="" + /bin/cat<<SUMMARY Build stages selected --------------------- - -unpack ${runUNPACK:-false} - -third ${runTHIRD:-false} - -foam ${runFOAM:-false} + -unpack ${runUNPACK:-false} $commentUNPACK + -third ${runTHIRD:-false} $commentTHIRD + -foam ${runFOAM:-false} $commentFOAM --------------------- SUMMARY