Commit 8db517bf authored by Mark Olesen's avatar Mark Olesen
Browse files

CONFIG: provide Clang38, Clang39 compiler settings

- easier to test or use different versions

- change WM_CXXFLAGS to -std=c++11 instead of -std=c++0x
parent f760352c
......@@ -15,6 +15,12 @@ cd ${0%/*} && wmakeCheckPwd "$WM_PROJECT_DIR" 2>/dev/null || {
. $WM_PROJECT_DIR/wmake/scripts/AllwmakeParseArguments
#------------------------------------------------------------------------------
echo "========================================"
date "+%Y-%m-%d %H:%M:%S %z" 2>/dev/null || echo "date is unknown"
echo "Starting ${WM_PROJECT_DIR##*/} ${0##*}"
echo " $WM_COMPILER $WM_COMPILER_TYPE compiler"
echo " ${WM_OPTIONS}, with ${WM_MPLIB} ${FOAM_MPI}"
echo
# Compile wmake support applications
(cd wmake/src && make)
......
......@@ -57,18 +57,19 @@ export FOAM_INST_DIR
# $FOAM_INST_DIR/site/$WM_PROJECT_VERSION or $FOAM_INST_DIR/site
#- Compiler location:
# WM_COMPILER_TYPE= system | ThirdParty
# WM_COMPILER_TYPE = system | ThirdParty
export WM_COMPILER_TYPE=system
#- Compiler:
# WM_COMPILER= Gcc | Gcc4[8-9] | Gcc5[1-4] | Gcc6[1-3] | Clang | Icc | IccKNL
# WM_COMPILER = Gcc | Gcc4[8-9] | Gcc5[1-4] | Gcc6[1-3] | GccKNL
# | Clang | Clang3[8-9] | Icc | IccKNL
export WM_COMPILER=Gcc
unset WM_COMPILER_ARCH WM_COMPILER_LIB_ARCH
#- Memory addressing:
# On a 64bit OS this can be 32bit or 64bit
# On a 32bit OS addressing is 32bit and this option is not used
# WM_ARCH_OPTION = 32 | 64
# - on a 64-bit OS this can be 32 or 64
# - on a 32-bit OS addressing is 32-bit and this option is not used
export WM_ARCH_OPTION=64
#- Precision:
......
......@@ -31,6 +31,7 @@
#------------------------------------------------------------------------------
switch ("$WM_COMPILER_TYPE")
case OpenFOAM:
case ThirdParty:
# Default versions of GMP, MPFR and MPC, override as necessary
set gmp_version=gmp-system
......@@ -67,22 +68,36 @@ case ThirdParty:
set gcc_version=gcc-6.3.0
breaksw
case Clang:
set clang_version=llvm-3.7.0
# set clang_version=llvm-3.8.0
set clang_version=llvm-3.7.1
breaksw
case Clang38:
set clang_version=llvm-3.8.1
breaksw
case Clang39:
set clang_version=llvm-3.9.1
breaksw
case Clang40:
set clang_version=llvm-4.0.0
breaksw
default:
echo
echo "Warning in $WM_PROJECT_DIR/etc/config.csh/compiler:"
echo " Unknown OpenFOAM compiler type '$WM_COMPILER'"
echo " Please check your settings"
echo
/bin/cat << UNKNOWN_COMPILER
===============================================================================
Warning in $WM_PROJECT_DIR/etc/config.csh/compiler:
Unknown ThirdParty compiler type/version - '$WM_COMPILER'
Please check your settings
===============================================================================
UNKNOWN_COMPILER
breaksw
endsw
setenv WM_COMPILER_TYPE ThirdParty # Canonical name
breaksw
endsw
# common settings (system or ThirdParty)
# Common settings (system or ThirdParty)
switch ("$WM_COMPILER")
case Clang:
case Clang*:
# Using clang - not gcc
setenv WM_CC 'clang'
setenv WM_CXX 'clang++'
......
......@@ -76,7 +76,7 @@ case SYSTEMMPI:
if ( ! ($?MPI_ROOT) ) then
echo
echo "Warning in $WM_PROJECT_DIR/etc/config.csh/settings:"
echo "Warning in $WM_PROJECT_DIR/etc/config.csh/mpi:"
echo " Please set the environment variable MPI_ROOT to point to" \
" the base folder for the system MPI in use."
echo " Example:"
......@@ -88,7 +88,7 @@ case SYSTEMMPI:
if ( ! ($?MPI_ARCH_FLAGS) ) then
echo
echo "Warning in $WM_PROJECT_DIR/etc/config.csh/settings:"
echo "Warning in $WM_PROJECT_DIR/etc/config.csh/mpi:"
echo " MPI_ARCH_FLAGS is not set. Example:"
echo
echo ' setenv MPI_ARCH_FLAGS "-DOMPI_SKIP_MPICXX"'
......@@ -97,7 +97,7 @@ case SYSTEMMPI:
if ( ! ($?MPI_ARCH_INC) ) then
echo
echo "Warning in $WM_PROJECT_DIR/etc/config.csh/settings:"
echo "Warning in $WM_PROJECT_DIR/etc/config.csh/mpi:"
echo " MPI_ARCH_INC is not set. Example:"
echo
echo ' setenv MPI_ARCH_INC "-isystem $MPI_ROOT/include"'
......@@ -106,7 +106,7 @@ case SYSTEMMPI:
if ( ! ($?MPI_ARCH_LIBS) ) then
echo
echo "Warning in $WM_PROJECT_DIR/etc/config.csh/settings:"
echo "Warning in $WM_PROJECT_DIR/etc/config.csh/mpi:"
echo " MPI_ARCH_LIBS is not set. Example:"
echo
echo ' setenv MPI_ARCH_LIBS "-L$MPI_ROOT/lib -lmpi"'
......@@ -194,7 +194,7 @@ case SGIMPI:
if ( ! $?MPI_ROOT) setenv MPI_ROOT /dummy
if ( ! -d "$MPI_ROOT" ) then
echo "Warning in $WM_PROJECT_DIR/etc/config.csh/settings:"
echo "Warning in $WM_PROJECT_DIR/etc/config.csh/mpi:"
echo " MPI_ROOT not a valid mpt installation directory."
echo " Please set MPI_ROOT to the mpt installation directory."
echo " (usually done by loading the mpt module)"
......@@ -208,14 +208,12 @@ case SGIMPI:
setenv FOAM_MPI ${MPI_ROOT:t}
setenv MPI_ARCH_PATH $MPI_ROOT
if ($?FOAM_VERBOSE && $?prompt) then
echo "Using SGI MPT:"
echo " MPI_ROOT : $MPI_ROOT"
echo " FOAM_MPI : $FOAM_MPI"
endif
_foamAddPath $MPI_ARCH_PATH/bin
_foamAddLib $MPI_ARCH_PATH/lib
breaksw
......@@ -224,7 +222,7 @@ case INTELMPI:
if ( ! $?MPI_ROOT) setenv MPI_ROOT /dummy
if ( ! -d "$MPI_ROOT" ) then
echo "Warning in $WM_PROJECT_DIR/etc/config.csh/settings:"
echo "Warning in $WM_PROJECT_DIR/etc/config.csh/mpi:"
echo " MPI_ROOT not a valid mpt installation directory."
echo " Please set MPI_ROOT to the mpt installation directory."
echo " (usually done by loading the mpt module)"
......@@ -238,14 +236,12 @@ case INTELMPI:
setenv FOAM_MPI ${MPI_ROOT:t}
setenv MPI_ARCH_PATH $MPI_ROOT
if ($?FOAM_VERBOSE && $?prompt) then
echo "Using INTEL MPT:"
echo " MPI_ROOT : $MPI_ROOT"
echo " FOAM_MPI : $FOAM_MPI"
endif
_foamAddPath $MPI_ARCH_PATH/bin64
_foamAddLib $MPI_ARCH_PATH/lib64
breaksw
......
......@@ -54,13 +54,14 @@ case Linux:
breaksw
case x86_64:
if ( ! $?WM_ARCH_OPTION ) setenv WM_ARCH_OPTION 64 # Default to 64-bit
switch ($WM_ARCH_OPTION)
case 32:
setenv WM_COMPILER_ARCH 64
setenv WM_CC 'gcc'
setenv WM_CXX 'g++'
setenv WM_CFLAGS '-m32 -fPIC'
setenv WM_CXXFLAGS '-m32 -fPIC -std=c++0x'
setenv WM_CXXFLAGS '-m32 -fPIC -std=c++11'
setenv WM_LDFLAGS '-m32'
breaksw
......@@ -70,7 +71,7 @@ case Linux:
setenv WM_CC 'gcc'
setenv WM_CXX 'g++'
setenv WM_CFLAGS '-m64 -fPIC'
setenv WM_CXXFLAGS '-m64 -fPIC -std=c++0x'
setenv WM_CXXFLAGS '-m64 -fPIC -std=c++11'
setenv WM_LDFLAGS '-m64'
breaksw
......@@ -92,7 +93,7 @@ case Linux:
setenv WM_CC 'gcc'
setenv WM_CXX 'g++'
setenv WM_CFLAGS '-m64 -fPIC'
setenv WM_CXXFLAGS '-m64 -fPIC -std=c++0x'
setenv WM_CXXFLAGS '-m64 -fPIC -std=c++11'
setenv WM_LDFLAGS '-m64'
breaksw
......@@ -102,7 +103,7 @@ case Linux:
setenv WM_CC 'gcc'
setenv WM_CXX 'g++'
setenv WM_CFLAGS '-m64 -fPIC'
setenv WM_CXXFLAGS '-m64 -fPIC -std=c++0x'
setenv WM_CXXFLAGS '-m64 -fPIC -std=c++11'
setenv WM_LDFLAGS '-m64'
breaksw
......@@ -120,17 +121,17 @@ case SunOS:
setenv WM_CC 'gcc'
setenv WM_CXX 'g++'
setenv WM_CFLAGS '-mabi=64 -fPIC'
setenv WM_CXXFLAGS '-mabi=64 -fPIC -std=c++0x'
setenv WM_CXXFLAGS '-mabi=64 -fPIC -std=c++11'
setenv WM_LDFLAGS '-mabi=64 -G0'
breaksw
default: # An unsupported operating system
/bin/cat <<USAGE
Your "$WM_ARCH" operating system is unsupported by this OpenFOAM release.
default:
/bin/cat << UNSUPPORTED_OS
===============================================================================
Your '$WM_ARCH' operating system is unsupported by this OpenFOAM release.
For further assistance, please contact www.OpenFOAM.com
USAGE
===============================================================================
UNSUPPORTED_OS
breaksw
endsw
......@@ -219,7 +220,6 @@ case system:
# Use system compiler
breaksw
case OpenFOAM:
case ThirdParty:
if ( $?gcc_version ) then
if ( ! $?gmp_version ) set gmp_version=gmp-system
......@@ -301,9 +301,15 @@ CLANG_NOT_FOUND
breaksw
default:
echo "Warn: WM_COMPILER_TYPE='$WM_COMPILER_TYPE' is unsupported"
echo " treating as 'system' instead"
/bin/cat << UNKNOWN_TYPE
===============================================================================
Unknown WM_COMPILER_TYPE="$WM_COMPILER_TYPE" - treating as 'system'
Please check your settings
===============================================================================
UNKNOWN_TYPE
setenv WM_COMPILER_TYPE system
breaksw
endsw
......
......@@ -31,7 +31,7 @@
#------------------------------------------------------------------------------
case "$WM_COMPILER_TYPE" in
ThirdParty)
OpenFOAM | ThirdParty)
# Default versions of GMP, MPFR and MPC, override as necessary
gmp_version=gmp-system
mpfr_version=mpfr-system
......@@ -66,23 +66,35 @@ ThirdParty)
gcc_version=gcc-6.3.0
;;
Clang)
clang_version=llvm-3.7.0
# clang_version=llvm-3.8.0
clang_version=llvm-3.7.1
;;
Clang38)
clang_version=llvm-3.8.1
;;
Clang39)
clang_version=llvm-3.9.1
;;
Clang40)
clang_version=llvm-4.0.0
;;
*)
echo 1>&2
echo "Warning in $WM_PROJECT_DIR/etc/config.sh/compiler:" 1>&2
echo " Unknown OpenFOAM compiler type '$WM_COMPILER'" 1>&2
echo " Please check your settings" 1>&2
echo 1>&2
/bin/cat << UNKNOWN_COMPILER 1>&2
===============================================================================
Warning in $WM_PROJECT_DIR/etc/config.sh/compiler:
Unknown ThirdParty compiler type/version - '$WM_COMPILER'
Please check your settings
===============================================================================
UNKNOWN_COMPILER
;;
esac
WM_COMPILER_TYPE=ThirdParty # Canonical name
;;
esac
# common settings (system or ThirdParty)
# Common settings (system or ThirdParty)
case "$WM_COMPILER" in
Clang)
Clang*)
# Using clang - not gcc
export WM_CC='clang'
export WM_CXX='clang++'
......
......@@ -81,7 +81,7 @@ SYSTEMMPI)
if [ -z "$MPI_ROOT" ]
then
echo 1>&2
echo "Warning in $WM_PROJECT_DIR/etc/config.sh/settings:" 1>&2
echo "Warning in $WM_PROJECT_DIR/etc/config.sh/mpi:" 1>&2
echo " Please set the environment variable MPI_ROOT to point to" \
" the base folder for the system MPI in use." 1>&2
echo " Example:" 1>&2
......@@ -94,7 +94,7 @@ SYSTEMMPI)
if [ -z "$MPI_ARCH_FLAGS" ]
then
echo 1>&2
echo "Warning in $WM_PROJECT_DIR/etc/config.sh/settings:" 1>&2
echo "Warning in $WM_PROJECT_DIR/etc/config.sh/mpi:" 1>&2
echo " MPI_ARCH_FLAGS is not set. Example:" 1>&2
echo 1>&2
echo " export MPI_ARCH_FLAGS=\"-DOMPI_SKIP_MPICXX\"" 1>&2
......@@ -104,7 +104,7 @@ SYSTEMMPI)
if [ -z "$MPI_ARCH_INC" ]
then
echo 1>&2
echo "Warning in $WM_PROJECT_DIR/etc/config.sh/settings:" 1>&2
echo "Warning in $WM_PROJECT_DIR/etc/config.sh/mpi:" 1>&2
echo " MPI_ARCH_INC is not set. Example:" 1>&2
echo 1>&2
echo " export MPI_ARCH_INC=\"-isystem \$MPI_ROOT/include\"" 1>&2
......@@ -114,7 +114,7 @@ SYSTEMMPI)
if [ -z "$MPI_ARCH_LIBS" ]
then
echo 1>&2
echo "Warning in $WM_PROJECT_DIR/etc/config.sh/settings:" 1>&2
echo "Warning in $WM_PROJECT_DIR/etc/config.sh/mpi:" 1>&2
echo " MPI_ARCH_LIBS is not set. Example:" 1>&2
echo 1>&2
echo " export MPI_ARCH_LIBS=\"-L\$MPI_ROOT/lib -lmpi\"" 1>&2
......@@ -208,7 +208,7 @@ SGIMPI)
if [ ! -d "$MPI_ROOT" -o -z "$MPI_ARCH_PATH" ]
then
echo "Warning in $WM_PROJECT_DIR/etc/config.sh/settings:" 1>&2
echo "Warning in $WM_PROJECT_DIR/etc/config.sh/mpi:" 1>&2
echo " MPI_ROOT not a valid mpt installation directory or ending" \
" in a '/'." 1>&2
echo " Please set MPI_ROOT to the mpt installation directory." 1>&2
......@@ -235,7 +235,7 @@ INTELMPI)
if [ ! -d "$MPI_ROOT" -o -z "$MPI_ARCH_PATH" ]
then
echo "Warning in $WM_PROJECT_DIR/etc/config.sh/settings:" 1>&2
echo "Warning in $WM_PROJECT_DIR/etc/config.sh/mpi:" 1>&2
echo " MPI_ROOT not a valid mpt installation directory or ending" \
" in a '/'." 1>&2
echo " Please set MPI_ROOT to the mpt installation directory." 1>&2
......
......@@ -44,18 +44,19 @@ Linux)
export WM_CC='gcc'
export WM_CXX='g++'
export WM_CFLAGS='-fPIC'
export WM_CXXFLAGS='-fPIC -std=c++0x'
export WM_CXXFLAGS='-fPIC -std=c++11'
export WM_LDFLAGS=
;;
x86_64)
: ${WM_ARCH_OPTION:=64}; export WM_ARCH_OPTION # Default to 64-bit
case "$WM_ARCH_OPTION" in
32)
export WM_COMPILER_ARCH=64
export WM_CC='gcc'
export WM_CXX='g++'
export WM_CFLAGS='-m32 -fPIC'
export WM_CXXFLAGS='-m32 -fPIC -std=c++0x'
export WM_CXXFLAGS='-m32 -fPIC -std=c++11'
export WM_LDFLAGS='-m32'
;;
64)
......@@ -64,7 +65,7 @@ Linux)
export WM_CC='gcc'
export WM_CXX='g++'
export WM_CFLAGS='-m64 -fPIC'
export WM_CXXFLAGS='-m64 -fPIC -std=c++0x'
export WM_CXXFLAGS='-m64 -fPIC -std=c++11'
export WM_LDFLAGS='-m64'
;;
*)
......@@ -85,7 +86,7 @@ Linux)
export WM_CC='gcc'
export WM_CXX='g++'
export WM_CFLAGS='-fPIC'
export WM_CXXFLAGS='-fPIC -std=c++0x'
export WM_CXXFLAGS='-fPIC -std=c++11'
export WM_LDFLAGS=
;;
......@@ -95,7 +96,7 @@ Linux)
export WM_CC='gcc'
export WM_CXX='g++'
export WM_CFLAGS='-m64 -fPIC'
export WM_CXXFLAGS='-m64 -fPIC -std=c++0x'
export WM_CXXFLAGS='-m64 -fPIC -std=c++11'
export WM_LDFLAGS='-m64'
;;
......@@ -105,7 +106,7 @@ Linux)
export WM_CC='gcc'
export WM_CXX='g++'
export WM_CFLAGS='-m64 -fPIC'
export WM_CXXFLAGS='-m64 -fPIC -std=c++0x'
export WM_CXXFLAGS='-m64 -fPIC -std=c++11'
export WM_LDFLAGS='-m64'
;;
......@@ -122,17 +123,17 @@ SunOS)
export WM_CC='gcc'
export WM_CXX='g++'
export WM_CFLAGS='-mabi=64 -fPIC'
export WM_CXXFLAGS='-mabi=64 -fPIC -std=c++0x'
export WM_CXXFLAGS='-mabi=64 -fPIC -std=c++11'
export WM_LDFLAGS='-mabi=64 -G0'
;;
*) # An unsupported operating system
/bin/cat <<USAGE 1>&2
Your "$WM_ARCH" operating system is unsupported by this OpenFOAM release.
/bin/cat << UNSUPPORTED_OS 1>&2
===============================================================================
Your '$WM_ARCH' operating system is unsupported by this OpenFOAM release.
For further assistance, please contact www.OpenFOAM.com
USAGE
===============================================================================
UNSUPPORTED_OS
;;
esac
......@@ -217,7 +218,8 @@ case "$WM_COMPILER_TYPE" in
system)
# Use system compiler
;;
OpenFOAM | ThirdParty)
ThirdParty)
if [ -n "$gcc_version" ]
then
gccDir=$WM_THIRD_PARTY_DIR/platforms/$WM_ARCH$WM_COMPILER_ARCH/$gcc_version
......@@ -297,9 +299,15 @@ CLANG_NOT_FOUND
unset clang_version clangDir
;;
*)
echo "Warn: WM_COMPILER_TYPE='$WM_COMPILER_TYPE' is unsupported" 1>&2
echo " treating as 'system' instead" 1>&2
/bin/cat << UNKNOWN_TYPE 1>&2
===============================================================================
Unknown WM_COMPILER_TYPE="$WM_COMPILER_TYPE" - treating as 'system'
Please check your settings
===============================================================================
UNKNOWN_TYPE
export WM_COMPILER_TYPE=system
;;
esac
#------------------------------------------------------------------------------
......@@ -60,15 +60,16 @@ setenv FOAM_INST_DIR `lsof +p $$ |& grep -oE '/.*'$WM_PROJECT'[^/]*/etc/cshrc' |
setenv WM_COMPILER_TYPE system
#- Compiler:
# WM_COMPILER= Gcc | Gcc4[8-9] | Gcc5[1-4] | Gcc6[1-3] | Clang | Icc | IccKNL
# WM_COMPILER = Gcc | Gcc4[8-9] | Gcc5[1-4] | Gcc6[1-3] | GccKNL
# | Clang | Clang3[8-9] | Icc | IccKNL
setenv WM_COMPILER Gcc
setenv WM_COMPILER_ARCH # defined but empty
unsetenv WM_COMPILER_LIB_ARCH
#- Memory addressing:
# On a 64bit OS this can be 32bit or 64bit
# On a 32bit OS addressing is 32bit and this option is not used
# WM_ARCH_OPTION = 32 | 64
# - on a 64-bit OS this can be 32 or 64
# - on a 32-bit OS addressing is 32-bit and this option is not used
setenv WM_ARCH_OPTION 64
#- Precision:
......
SUFFIXES += .C
c++WARN = -Wall -Wextra -Wold-style-cast -Wnon-virtual-dtor -Wno-unused-parameter -Wno-invalid-offsetof -Wno-c++11-extensions
c++WARN = -Wall -Wextra -Wold-style-cast -Wnon-virtual-dtor -Wno-unused-parameter -Wno-invalid-offsetof -Wno-undefined-var-template
# Suppress some warnings for flex++ and CGAL
c++LESSWARN = -Wno-old-style-cast -Wno-unused-local-typedefs -Wno-tautological-undefined-compare -Wno-shift-negative-value
......
SUFFIXES += .C
c++WARN = -Wall -Wextra -Wold-style-cast -Wnon-virtual-dtor -Wno-unused-parameter -Wno-invalid-offsetof -Wno-c++11-extensions
c++WARN = -Wall -Wextra -Wold-style-cast -Wnon-virtual-dtor -Wno-unused-parameter -Wno-invalid-offsetof -Wno-undefined-var-template
# Suppress some warnings for flex++ and CGAL
c++LESSWARN = -Wno-old-style-cast -Wno-unused-local-typedef -Wno-tautological-undefined-compare -Wno-shift-negative-value
c++LESSWARN = -Wno-old-style-cast -Wno-unused-local-typedefs -Wno-tautological-undefined-compare -Wno-shift-negative-value
CC = clang++ -std=c++11 -m32
......
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