From b3464d8afc60aab71c9ea166bb34b8f68a3b75ad Mon Sep 17 00:00:00 2001 From: Mark Olesen Date: Wed, 6 May 2020 10:34:42 +0200 Subject: [PATCH] COMP: wmake rules for AMD (clang-based) compiler (#1627) - not fully tested --- etc/bashrc | 2 +- etc/cshrc | 2 +- wmake/rules/General/Amd/link-c | 5 +++++ wmake/rules/General/Amd/link-c++ | 5 +++++ wmake/rules/linux64Amd/c | 13 +++++++++++++ wmake/rules/linux64Amd/c++ | 15 +++++++++++++++ wmake/rules/linux64Amd/c++Debug | 2 ++ wmake/rules/linux64Amd/c++Opt | 2 ++ wmake/rules/linux64Amd/c++Prof | 2 ++ wmake/rules/linux64Amd/cDebug | 2 ++ wmake/rules/linux64Amd/cOpt | 2 ++ wmake/rules/linux64Amd/cProf | 2 ++ wmake/rules/linux64Amd/general | 9 +++++++++ wmake/rules/linux64Amd/mplibHPMPI | 3 +++ wmake/rules/linux64Amd/mplibINTELMPI | 3 +++ 15 files changed, 67 insertions(+), 2 deletions(-) create mode 100644 wmake/rules/General/Amd/link-c create mode 100644 wmake/rules/General/Amd/link-c++ create mode 100644 wmake/rules/linux64Amd/c create mode 100644 wmake/rules/linux64Amd/c++ create mode 100644 wmake/rules/linux64Amd/c++Debug create mode 100644 wmake/rules/linux64Amd/c++Opt create mode 100644 wmake/rules/linux64Amd/c++Prof create mode 100644 wmake/rules/linux64Amd/cDebug create mode 100644 wmake/rules/linux64Amd/cOpt create mode 100644 wmake/rules/linux64Amd/cProf create mode 100644 wmake/rules/linux64Amd/general create mode 100644 wmake/rules/linux64Amd/mplibHPMPI create mode 100644 wmake/rules/linux64Amd/mplibINTELMPI diff --git a/etc/bashrc b/etc/bashrc index 955e5c0ef9..7067f2d226 100644 --- a/etc/bashrc +++ b/etc/bashrc @@ -66,7 +66,7 @@ export WM_PROJECT_VERSION=com export WM_COMPILER_TYPE=system # [WM_COMPILER] - Compiler: -# = Gcc | Clang | Icc | Cray | Arm | Pgi | Fujitsu | +# = Gcc | Clang | Icc | Cray | Amd | Arm | Pgi | Fujitsu | # Gcc | Clang export WM_COMPILER=Gcc diff --git a/etc/cshrc b/etc/cshrc index 9142cf0229..190f30c9da 100644 --- a/etc/cshrc +++ b/etc/cshrc @@ -66,7 +66,7 @@ setenv WM_PROJECT_VERSION com setenv WM_COMPILER_TYPE system # [WM_COMPILER] - Compiler: -# = Gcc | Clang | Icc | Cray | Arm | Pgi | Fujitsu | +# = Gcc | Clang | Icc | Cray | Amd | Arm | Pgi | Fujitsu | # Gcc | Clang setenv WM_COMPILER Gcc diff --git a/wmake/rules/General/Amd/link-c b/wmake/rules/General/Amd/link-c new file mode 100644 index 0000000000..98428c321e --- /dev/null +++ b/wmake/rules/General/Amd/link-c @@ -0,0 +1,5 @@ +LINK_LIBS = $(cDBUG) + +LINKLIBSO = $(cc) $(cARCH) -shared + +LINKEXE = $(cc) $(cARCH) -Xlinker -z -Xlinker nodefs diff --git a/wmake/rules/General/Amd/link-c++ b/wmake/rules/General/Amd/link-c++ new file mode 100644 index 0000000000..7830b08d1e --- /dev/null +++ b/wmake/rules/General/Amd/link-c++ @@ -0,0 +1,5 @@ +LINK_LIBS = $(c++DBUG) -Wl,--as-needed + +LINKLIBSO = $(CC) $(c++FLAGS) -shared + +LINKEXE = $(CC) $(c++FLAGS) -L$(FOAM_LIBBIN)/dummy -lPstream diff --git a/wmake/rules/linux64Amd/c b/wmake/rules/linux64Amd/c new file mode 100644 index 0000000000..e85efc6cb9 --- /dev/null +++ b/wmake/rules/linux64Amd/c @@ -0,0 +1,13 @@ +# AMD compiler - a clang variant +include $(GENERAL_RULES)/Clang/c + +cARCH = -m64 + +# 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 + +ctoo = $(WM_SCHEDULER) $(cc) $(cFLAGS) -c $< -o $@ + +include $(GENERAL_RULES)/Amd/link-c diff --git a/wmake/rules/linux64Amd/c++ b/wmake/rules/linux64Amd/c++ new file mode 100644 index 0000000000..1ea2894bb3 --- /dev/null +++ b/wmake/rules/linux64Amd/c++ @@ -0,0 +1,15 @@ +# AMD compiler - a clang variant +include $(GENERAL_RULES)/Clang/c++ + +c++ARCH = -m64 + +include $(DEFAULT_RULES)/c++$(WM_COMPILE_OPTION) + +c++FLAGS = $(c++ARCH) $(GFLAGS) $(c++WARN) $(c++OPT) $(c++DBUG) $(ptFLAGS) $(LIB_HEADER_DIRS) -fPIC + +Ctoo = $(WM_SCHEDULER) $(CC) $(c++FLAGS) -c $< -o $@ +cxxtoo = $(Ctoo) +cctoo = $(Ctoo) +cpptoo = $(Ctoo) + +include $(GENERAL_RULES)/Amd/link-c++ diff --git a/wmake/rules/linux64Amd/c++Debug b/wmake/rules/linux64Amd/c++Debug new file mode 100644 index 0000000000..48f0b6643e --- /dev/null +++ b/wmake/rules/linux64Amd/c++Debug @@ -0,0 +1,2 @@ +c++DBUG = -g -DFULLDEBUG +c++OPT = -O0 diff --git a/wmake/rules/linux64Amd/c++Opt b/wmake/rules/linux64Amd/c++Opt new file mode 100644 index 0000000000..2aedabd628 --- /dev/null +++ b/wmake/rules/linux64Amd/c++Opt @@ -0,0 +1,2 @@ +c++DBUG = +c++OPT = -O3 diff --git a/wmake/rules/linux64Amd/c++Prof b/wmake/rules/linux64Amd/c++Prof new file mode 100644 index 0000000000..3bda4dad55 --- /dev/null +++ b/wmake/rules/linux64Amd/c++Prof @@ -0,0 +1,2 @@ +c++DBUG = -pg +c++OPT = -O2 diff --git a/wmake/rules/linux64Amd/cDebug b/wmake/rules/linux64Amd/cDebug new file mode 100644 index 0000000000..7b7adf10de --- /dev/null +++ b/wmake/rules/linux64Amd/cDebug @@ -0,0 +1,2 @@ +cDBUG = -g -DFULLDEBUG +cOPT = -O0 diff --git a/wmake/rules/linux64Amd/cOpt b/wmake/rules/linux64Amd/cOpt new file mode 100644 index 0000000000..17318709f1 --- /dev/null +++ b/wmake/rules/linux64Amd/cOpt @@ -0,0 +1,2 @@ +cDBUG = +cOPT = -O3 diff --git a/wmake/rules/linux64Amd/cProf b/wmake/rules/linux64Amd/cProf new file mode 100644 index 0000000000..ca3ac9bf5f --- /dev/null +++ b/wmake/rules/linux64Amd/cProf @@ -0,0 +1,2 @@ +cDBUG = -pg +cOPT = -O2 diff --git a/wmake/rules/linux64Amd/general b/wmake/rules/linux64Amd/general new file mode 100644 index 0000000000..b823785ea4 --- /dev/null +++ b/wmake/rules/linux64Amd/general @@ -0,0 +1,9 @@ +CPP = cpp -traditional-cpp $(GFLAGS) + +PROJECT_LIBS = -l$(WM_PROJECT) -ldl + +include $(GENERAL_RULES)/standard +include $(GENERAL_RULES)/no-openmp + +include $(DEFAULT_RULES)/c +include $(DEFAULT_RULES)/c++ diff --git a/wmake/rules/linux64Amd/mplibHPMPI b/wmake/rules/linux64Amd/mplibHPMPI new file mode 100644 index 0000000000..d7c4b0cf30 --- /dev/null +++ b/wmake/rules/linux64Amd/mplibHPMPI @@ -0,0 +1,3 @@ +PFLAGS = +PINC = -isystem $(MPI_ARCH_PATH)/include -D_MPICC_H +PLIBS = -L$(MPI_ARCH_PATH)/lib/linux_amd64 -lmpi diff --git a/wmake/rules/linux64Amd/mplibINTELMPI b/wmake/rules/linux64Amd/mplibINTELMPI new file mode 100644 index 0000000000..b3667bce26 --- /dev/null +++ b/wmake/rules/linux64Amd/mplibINTELMPI @@ -0,0 +1,3 @@ +PFLAGS = -DMPICH_SKIP_MPICXX -DOMPI_SKIP_MPICXX +PINC = -isystem $(MPI_ARCH_PATH)/intel64/include +PLIBS = -L$(MPI_ARCH_PATH)/intel64/lib -lmpi