CONFIG: update c++ standard, some compiler rules (partially addresses #2209)

- migrate to c++14 for most compilers *except* gcc.
  There are still many systems in use with gcc-4.8.5, which does not
  support c++14.

- initial rules for nvidia compilers (pgi is will soon be defunct).
  Not fully tested...

CONFIG: provide fallback value for the user directory name

- in containers may have an unset USER env variable.
  Default to 'user' to prevent ugly looking directory names.
This commit is contained in:
Mark Olesen
2021-10-19 20:09:31 +02:00
parent 8eab653117
commit c2697f466d
31 changed files with 204 additions and 43 deletions

View File

@ -81,17 +81,19 @@ SYSTEMOPENMPI | SYSTEMOPENMPI[1-9])
unset MPI_ARCH_PATH
fi
# Use <orte-info> (openmpi only command) to query configuration
# Use <orte-info> (openmpi only command) to query configuration.
# Parse "path:prefix:<pathname>" type of output
if [ -z "$MPI_ARCH_PATH" ] && _foamFoundCmd="$(command -v orte-info)"
then
# prefix
_foamFoundDir="$("$_foamFoundCmd" --path prefix --parsable | sed -e 's/^.*:prefix://')"
_foamFoundDir="$("$_foamFoundCmd" --path prefix --parsable | sed -e 's#^path:[^:]*:##')"
if [ -d "$_foamFoundDir" ]
then
MPI_ARCH_PATH="${_foamFoundDir}"
# libdir
_foamFoundDir="$("$_foamFoundCmd" --path libdir --parsable | sed -e 's/^.*:libdir://')"
_foamFoundDir="$("$_foamFoundCmd" --path libdir --parsable | sed -e 's#^path:[^:]*:##')"
if [ -d "$_foamFoundDir" ]
then
_foamAddLib "$_foamFoundDir"
@ -106,7 +108,7 @@ SYSTEMOPENMPI | SYSTEMOPENMPI[1-9])
# strip off 'lib' to get the prefix directory
if [ -z "$MPI_ARCH_PATH" ] && _foamFoundCmd="$(command -v mpicc)"
then
_foamFoundDir="$("$_foamFoundCmd" --showme:link | sed -e 's/.*-L\([^ ]*\).*/\1/')"
_foamFoundDir="$("$_foamFoundCmd" --showme:link | sed -e 's#.*-L\([^ ]*\).*#\1#')"
MPI_ARCH_PATH="${_foamFoundDir%/*}" # Prefix from libdir
_foamAddLib "$_foamFoundDir"