From d4a0dc631cea10f491b737d4452722d75be3a835 Mon Sep 17 00:00:00 2001 From: Mark Olesen Date: Wed, 7 Aug 2019 09:22:09 +0200 Subject: [PATCH] CONFIG: relax requirement on C compile option - with 1906, OpenFOAM is purely C++ code and the last toolchain bits C code have been avoided. Thus relax the wmake C rule for including WM_COMPILE_OPTION. This makes it much easier to add different compiler options with fewer files. For example, for Broadwell-specific options: cd wmake/rules/linux64Gcc cp c++Opt c++OptBdw edit this file and then use WM_COMPILE_OPTION=OptBdw - ensure that WM_COMPILE_OPTION is always non-empty --- etc/config.csh/settings | 2 +- etc/config.sh/settings | 2 +- wmake/rules/darwin64Clang/c | 3 ++- wmake/rules/linux64Clang/c | 3 ++- wmake/rules/linux64Cray/c | 3 ++- wmake/rules/linux64Gcc/c | 3 ++- wmake/rules/linux64Icc/c | 3 ++- wmake/rules/linux64Mingw/c | 3 ++- wmake/rules/linux64Pgi/c | 3 ++- wmake/rules/linuxARM64Arm/c | 3 ++- wmake/rules/linuxARM64Clang/c | 3 ++- wmake/rules/linuxARM64Gcc/c | 3 ++- wmake/rules/linuxARM7Gcc/c | 7 +++---- wmake/rules/linuxClang/c | 3 ++- wmake/rules/linuxGcc/c | 3 ++- wmake/rules/linuxIA64Gcc/c | 3 ++- wmake/rules/linuxIA64Icc/c | 3 ++- wmake/rules/linuxIcc/c | 3 ++- wmake/rules/linuxPPC64Gcc/c | 3 ++- wmake/rules/linuxPPC64leGcc/c | 3 ++- wmake/rules/solaris64Gcc/c | 3 ++- 21 files changed, 41 insertions(+), 24 deletions(-) diff --git a/etc/config.csh/settings b/etc/config.csh/settings index 7b5e5bd401..d8dbcc57c6 100644 --- a/etc/config.csh/settings +++ b/etc/config.csh/settings @@ -20,7 +20,7 @@ # #------------------------------------------------------------------------------ setenv WM_ARCH `uname -s` # System name -## if (! $?WM_OSTYPE ) setenv WM_OSTYPE POSIX # System type (POSIX is default) +if (! $?WM_COMPILE_OPTION ) setenv WM_COMPILE_OPTION Opt # Default: Optimize set archOption=64 if ($?WM_ARCH_OPTION) then diff --git a/etc/config.sh/settings b/etc/config.sh/settings index e9d4feb060..4590e0efa7 100644 --- a/etc/config.sh/settings +++ b/etc/config.sh/settings @@ -20,7 +20,7 @@ # #------------------------------------------------------------------------------ export WM_ARCH="$(uname -s)" # System name -## : ${WM_OSTYPE:=POSIX}; export WM_OSTYPE # System type (POSIX is default) +: ${WM_COMPILE_OPTION:=Opt}; export WM_COMPILE_OPTION # Default: Optimize archOption="${WM_ARCH_OPTION:-64}" unset WM_ARCH_OPTION # Compiling 32-bit on 64-bit system diff --git a/wmake/rules/darwin64Clang/c b/wmake/rules/darwin64Clang/c index 8be23429bb..fc943df2fc 100644 --- a/wmake/rules/darwin64Clang/c +++ b/wmake/rules/darwin64Clang/c @@ -2,7 +2,8 @@ include $(GENERAL_RULES)/Clang/c cARCH = -m64 -ftrapping-math -include $(DEFAULT_RULES)/c$(WM_COMPILE_OPTION) +# Compile option is non-mandatory, but must be non-empty +sinclude $(DEFAULT_RULES)/c$(WM_COMPILE_OPTION) cFLAGS = $(cARCH) $(GFLAGS) $(cWARN) $(cOPT) $(cDBUG) $(LIB_HEADER_DIRS) -fPIC diff --git a/wmake/rules/linux64Clang/c b/wmake/rules/linux64Clang/c index 38e5b92441..e5739136cc 100644 --- a/wmake/rules/linux64Clang/c +++ b/wmake/rules/linux64Clang/c @@ -2,7 +2,8 @@ include $(GENERAL_RULES)/Clang/c cARCH = -m64 -include $(DEFAULT_RULES)/c$(WM_COMPILE_OPTION) +# Compile option is non-mandatory, but must be non-empty +sinclude $(DEFAULT_RULES)/c$(WM_COMPILE_OPTION) cFLAGS = $(cARCH) $(GFLAGS) $(cWARN) $(cOPT) $(cDBUG) $(LIB_HEADER_DIRS) -fPIC diff --git a/wmake/rules/linux64Cray/c b/wmake/rules/linux64Cray/c index f61d9e038b..5415440004 100644 --- a/wmake/rules/linux64Cray/c +++ b/wmake/rules/linux64Cray/c @@ -6,7 +6,8 @@ cARCH = -m64 cWARN = -Wall -include $(DEFAULT_RULES)/c$(WM_COMPILE_OPTION) +# Compile option is non-mandatory, but must be non-empty +sinclude $(DEFAULT_RULES)/c$(WM_COMPILE_OPTION) cFLAGS = $(cARCH) $(GFLAGS) $(cWARN) $(cOPT) $(cDBUG) $(LIB_HEADER_DIRS) -fPIC diff --git a/wmake/rules/linux64Gcc/c b/wmake/rules/linux64Gcc/c index b820078e56..ed2b29c3d9 100644 --- a/wmake/rules/linux64Gcc/c +++ b/wmake/rules/linux64Gcc/c @@ -2,7 +2,8 @@ include $(GENERAL_RULES)/Gcc/c cARCH = -m64 -include $(DEFAULT_RULES)/c$(WM_COMPILE_OPTION) +# Compile option is non-mandatory, but must be non-empty +sinclude $(DEFAULT_RULES)/c$(WM_COMPILE_OPTION) cFLAGS = $(cARCH) $(GFLAGS) $(cWARN) $(cOPT) $(cDBUG) $(LIB_HEADER_DIRS) -fPIC diff --git a/wmake/rules/linux64Icc/c b/wmake/rules/linux64Icc/c index 6003b1f2f5..eb24804359 100644 --- a/wmake/rules/linux64Icc/c +++ b/wmake/rules/linux64Icc/c @@ -2,7 +2,8 @@ include $(GENERAL_RULES)/Icc/c cARCH = -include $(DEFAULT_RULES)/c$(WM_COMPILE_OPTION) +# Compile option is non-mandatory, but must be non-empty +sinclude $(DEFAULT_RULES)/c$(WM_COMPILE_OPTION) cFLAGS = $(cARCH) $(GFLAGS) $(cWARN) $(cOPT) $(cDBUG) $(LIB_HEADER_DIRS) -fPIC diff --git a/wmake/rules/linux64Mingw/c b/wmake/rules/linux64Mingw/c index 48013b3d7b..228fe6cae5 100644 --- a/wmake/rules/linux64Mingw/c +++ b/wmake/rules/linux64Mingw/c @@ -4,7 +4,8 @@ cARCH = -m64 cc = x86_64-w64-mingw32-gcc -include $(RULES)/c$(WM_COMPILE_OPTION) +# Compile option is non-mandatory, but must be non-empty +sinclude $(RULES)/c$(WM_COMPILE_OPTION) cFLAGS = $(cARCH) $(GFLAGS) $(cWARN) $(cOPT) $(cDBUG) $(LIB_HEADER_DIRS) diff --git a/wmake/rules/linux64Pgi/c b/wmake/rules/linux64Pgi/c index d1145645ab..ce30d9a1b8 100644 --- a/wmake/rules/linux64Pgi/c +++ b/wmake/rules/linux64Pgi/c @@ -2,7 +2,8 @@ include $(GENERAL_RULES)/Pgi/c cARCH = -m64 -include $(DEFAULT_RULES)/c$(WM_COMPILE_OPTION) +# Compile option is non-mandatory, but must be non-empty +sinclude $(DEFAULT_RULES)/c$(WM_COMPILE_OPTION) cFLAGS = $(cARCH) $(GFLAGS) $(cWARN) $(cOPT) $(cDBUG) $(LIB_HEADER_DIRS) -fPIC diff --git a/wmake/rules/linuxARM64Arm/c b/wmake/rules/linuxARM64Arm/c index 11263ff689..ae5590f068 100644 --- a/wmake/rules/linuxARM64Arm/c +++ b/wmake/rules/linuxARM64Arm/c @@ -5,7 +5,8 @@ cc = armclang cARCH = -mcpu=native -include $(DEFAULT_RULES)/c$(WM_COMPILE_OPTION) +# Compile option is non-mandatory, but must be non-empty +sinclude $(DEFAULT_RULES)/c$(WM_COMPILE_OPTION) cFLAGS = $(cARCH) $(GFLAGS) $(cWARN) $(cOPT) $(cDBUG) $(LIB_HEADER_DIRS) -fPIC diff --git a/wmake/rules/linuxARM64Clang/c b/wmake/rules/linuxARM64Clang/c index 52b8713382..54f507cede 100644 --- a/wmake/rules/linuxARM64Clang/c +++ b/wmake/rules/linuxARM64Clang/c @@ -2,7 +2,8 @@ include $(GENERAL_RULES)/Clang/c cARCH = -include $(DEFAULT_RULES)/c$(WM_COMPILE_OPTION) +# Compile option is non-mandatory, but must be non-empty +sinclude $(DEFAULT_RULES)/c$(WM_COMPILE_OPTION) cFLAGS = $(cARCH) $(GFLAGS) $(cWARN) $(cOPT) $(cDBUG) $(LIB_HEADER_DIRS) -fPIC diff --git a/wmake/rules/linuxARM64Gcc/c b/wmake/rules/linuxARM64Gcc/c index ab01c6bebe..7f9b260cc2 100644 --- a/wmake/rules/linuxARM64Gcc/c +++ b/wmake/rules/linuxARM64Gcc/c @@ -2,7 +2,8 @@ include $(GENERAL_RULES)/Gcc/c cARCH = -include $(DEFAULT_RULES)/c$(WM_COMPILE_OPTION) +# Compile option is non-mandatory, but must be non-empty +sinclude $(DEFAULT_RULES)/c$(WM_COMPILE_OPTION) cFLAGS = $(cARCH) $(GFLAGS) $(cWARN) $(cOPT) $(cDBUG) $(LIB_HEADER_DIRS) -fPIC diff --git a/wmake/rules/linuxARM7Gcc/c b/wmake/rules/linuxARM7Gcc/c index 92bfac77eb..df414c0196 100644 --- a/wmake/rules/linuxARM7Gcc/c +++ b/wmake/rules/linuxARM7Gcc/c @@ -1,10 +1,9 @@ -SUFFIXES += .c +include $(GENERAL_RULES)/Gcc/c cARCH = -mcpu=cortex-a9 -cWARN = -Wall - -include $(DEFAULT_RULES)/c$(WM_COMPILE_OPTION) +# Compile option is non-mandatory, but must be non-empty +sinclude $(DEFAULT_RULES)/c$(WM_COMPILE_OPTION) cFLAGS = $(cARCH) $(GFLAGS) $(cWARN) $(cOPT) $(cDBUG) $(LIB_HEADER_DIRS) -fPIC diff --git a/wmake/rules/linuxClang/c b/wmake/rules/linuxClang/c index 608a1ef564..3d39709935 100644 --- a/wmake/rules/linuxClang/c +++ b/wmake/rules/linuxClang/c @@ -2,7 +2,8 @@ include $(GENERAL_RULES)/Clang/c cARCH = -m32 -include $(DEFAULT_RULES)/c$(WM_COMPILE_OPTION) +# Compile option is non-mandatory, but must be non-empty +sinclude $(DEFAULT_RULES)/c$(WM_COMPILE_OPTION) cFLAGS = $(cARCH) $(GFLAGS) $(cWARN) $(cOPT) $(cDBUG) $(LIB_HEADER_DIRS) -fPIC diff --git a/wmake/rules/linuxGcc/c b/wmake/rules/linuxGcc/c index a85ced9183..cd26deb1a7 100644 --- a/wmake/rules/linuxGcc/c +++ b/wmake/rules/linuxGcc/c @@ -2,7 +2,8 @@ include $(GENERAL_RULES)/Gcc/c cARCH = -m32 -include $(DEFAULT_RULES)/c$(WM_COMPILE_OPTION) +# Compile option is non-mandatory, but must be non-empty +sinclude $(DEFAULT_RULES)/c$(WM_COMPILE_OPTION) cFLAGS = $(cARCH) $(GFLAGS) $(cWARN) $(cOPT) $(cDBUG) $(LIB_HEADER_DIRS) -fPIC diff --git a/wmake/rules/linuxIA64Gcc/c b/wmake/rules/linuxIA64Gcc/c index ab01c6bebe..7f9b260cc2 100644 --- a/wmake/rules/linuxIA64Gcc/c +++ b/wmake/rules/linuxIA64Gcc/c @@ -2,7 +2,8 @@ include $(GENERAL_RULES)/Gcc/c cARCH = -include $(DEFAULT_RULES)/c$(WM_COMPILE_OPTION) +# Compile option is non-mandatory, but must be non-empty +sinclude $(DEFAULT_RULES)/c$(WM_COMPILE_OPTION) cFLAGS = $(cARCH) $(GFLAGS) $(cWARN) $(cOPT) $(cDBUG) $(LIB_HEADER_DIRS) -fPIC diff --git a/wmake/rules/linuxIA64Icc/c b/wmake/rules/linuxIA64Icc/c index d895b081f6..93087d39db 100644 --- a/wmake/rules/linuxIA64Icc/c +++ b/wmake/rules/linuxIA64Icc/c @@ -2,7 +2,8 @@ include $(GENERAL_RULES)/Icc/c cARCH = -include $(DEFAULT_RULES)/c$(WM_COMPILE_OPTION) +# Compile option is non-mandatory, but must be non-empty +sinclude $(DEFAULT_RULES)/c$(WM_COMPILE_OPTION) cFLAGS = $(cARCH) $(GFLAGS) $(cWARN) $(cOPT) $(cDBUG) $(LIB_HEADER_DIRS) -fPIC diff --git a/wmake/rules/linuxIcc/c b/wmake/rules/linuxIcc/c index cfbf5ba25d..a69c8f24eb 100644 --- a/wmake/rules/linuxIcc/c +++ b/wmake/rules/linuxIcc/c @@ -2,7 +2,8 @@ include $(GENERAL_RULES)/Icc/c cARCH = -gcc-version=400 -include $(DEFAULT_RULES)/c$(WM_COMPILE_OPTION) +# Compile option is non-mandatory, but must be non-empty +sinclude $(DEFAULT_RULES)/c$(WM_COMPILE_OPTION) cFLAGS = $(cARCH) $(GFLAGS) $(cWARN) $(cOPT) $(cDBUG) $(LIB_HEADER_DIRS) -fPIC diff --git a/wmake/rules/linuxPPC64Gcc/c b/wmake/rules/linuxPPC64Gcc/c index 743965975c..41778b239f 100644 --- a/wmake/rules/linuxPPC64Gcc/c +++ b/wmake/rules/linuxPPC64Gcc/c @@ -2,7 +2,8 @@ include $(GENERAL_RULES)/Gcc/c cARCH = -m64 -mcpu=power5+ -include $(DEFAULT_RULES)/c$(WM_COMPILE_OPTION) +# Compile option is non-mandatory, but must be non-empty +sinclude $(DEFAULT_RULES)/c$(WM_COMPILE_OPTION) cFLAGS = $(cARCH) $(GFLAGS) $(cWARN) $(cOPT) $(cDBUG) $(LIB_HEADER_DIRS) -fPIC diff --git a/wmake/rules/linuxPPC64leGcc/c b/wmake/rules/linuxPPC64leGcc/c index 56998e95c5..cba2958583 100644 --- a/wmake/rules/linuxPPC64leGcc/c +++ b/wmake/rules/linuxPPC64leGcc/c @@ -2,7 +2,8 @@ include $(GENERAL_RULES)/Gcc/c cARCH = -m64 -mcpu=power8 -include $(DEFAULT_RULES)/c$(WM_COMPILE_OPTION) +# Compile option is non-mandatory, but must be non-empty +sinclude $(DEFAULT_RULES)/c$(WM_COMPILE_OPTION) cFLAGS = $(cARCH) $(GFLAGS) $(cWARN) $(cOPT) $(cDBUG) $(LIB_HEADER_DIRS) -fPIC diff --git a/wmake/rules/solaris64Gcc/c b/wmake/rules/solaris64Gcc/c index b820078e56..ed2b29c3d9 100644 --- a/wmake/rules/solaris64Gcc/c +++ b/wmake/rules/solaris64Gcc/c @@ -2,7 +2,8 @@ include $(GENERAL_RULES)/Gcc/c cARCH = -m64 -include $(DEFAULT_RULES)/c$(WM_COMPILE_OPTION) +# Compile option is non-mandatory, but must be non-empty +sinclude $(DEFAULT_RULES)/c$(WM_COMPILE_OPTION) cFLAGS = $(cARCH) $(GFLAGS) $(cWARN) $(cOPT) $(cDBUG) $(LIB_HEADER_DIRS) -fPIC