From a5a5397de5057899778f23081ed5eb5b76ed6842 Mon Sep 17 00:00:00 2001 From: Henry Weller Date: Tue, 23 Jun 2015 11:17:42 +0100 Subject: [PATCH] Added support for the PPC64le architecture Resolves feature request http://www.openfoam.org/mantisbt/view.php?id=1759 --- etc/config/settings.csh | 15 +++++++-------- etc/config/settings.sh | 21 ++++++++++----------- wmake/rules/linuxPPC64leGcc/X | 3 +++ wmake/rules/linuxPPC64leGcc/c | 16 ++++++++++++++++ wmake/rules/linuxPPC64leGcc/c++ | 21 +++++++++++++++++++++ wmake/rules/linuxPPC64leGcc/c++Debug | 2 ++ wmake/rules/linuxPPC64leGcc/c++Opt | 2 ++ wmake/rules/linuxPPC64leGcc/c++Prof | 2 ++ wmake/rules/linuxPPC64leGcc/cDebug | 2 ++ wmake/rules/linuxPPC64leGcc/cOpt | 2 ++ wmake/rules/linuxPPC64leGcc/cProf | 2 ++ wmake/rules/linuxPPC64leGcc/general | 10 ++++++++++ wmake/rules/linuxPPC64leGcc/mplibHPMPI | 3 +++ 13 files changed, 82 insertions(+), 19 deletions(-) create mode 100644 wmake/rules/linuxPPC64leGcc/X create mode 100644 wmake/rules/linuxPPC64leGcc/c create mode 100644 wmake/rules/linuxPPC64leGcc/c++ create mode 100644 wmake/rules/linuxPPC64leGcc/c++Debug create mode 100644 wmake/rules/linuxPPC64leGcc/c++Opt create mode 100644 wmake/rules/linuxPPC64leGcc/c++Prof create mode 100644 wmake/rules/linuxPPC64leGcc/cDebug create mode 100644 wmake/rules/linuxPPC64leGcc/cOpt create mode 100644 wmake/rules/linuxPPC64leGcc/cProf create mode 100644 wmake/rules/linuxPPC64leGcc/general create mode 100644 wmake/rules/linuxPPC64leGcc/mplibHPMPI diff --git a/etc/config/settings.csh b/etc/config/settings.csh index 30c907f6..d6d50277 100644 --- a/etc/config/settings.csh +++ b/etc/config/settings.csh @@ -85,19 +85,18 @@ case Linux: setenv WM_COMPILER I64 breaksw - case mips64: - setenv WM_ARCH SiCortex64 - setenv WM_MPLIB MPI + case ppc64: + setenv WM_ARCH linuxPPC64 setenv WM_COMPILER_LIB_ARCH 64 setenv WM_CC 'gcc' setenv WM_CXX 'g++' - setenv WM_CFLAGS '-mabi=64 -fPIC' - setenv WM_CXXFLAGS '-mabi=64 -fPIC' - setenv WM_LDFLAGS '-mabi=64 -G0' + setenv WM_CFLAGS '-m64 -fPIC' + setenv WM_CXXFLAGS '-m64 -fPIC' + setenv WM_LDFLAGS '-m64' breaksw - case ppc64: - setenv WM_ARCH linuxPPC64 + case ppc64le: + setenv WM_ARCH linuxPPC64le setenv WM_COMPILER_LIB_ARCH 64 setenv WM_CC 'gcc' setenv WM_CXX 'g++' diff --git a/etc/config/settings.sh b/etc/config/settings.sh index ea2b03b4..8baec492 100644 --- a/etc/config/settings.sh +++ b/etc/config/settings.sh @@ -104,17 +104,6 @@ Linux) export WM_COMPILER=I64 ;; - mips64) - WM_ARCH=SiCortex64 - WM_MPLIB=MPI - export WM_COMPILER_LIB_ARCH=64 - export WM_CC='gcc' - export WM_CXX='g++' - export WM_CFLAGS='-mabi=64 -fPIC' - export WM_CXXFLAGS='-mabi=64 -fPIC' - export WM_LDFLAGS='-mabi=64 -G0' - ;; - armv7l) WM_ARCH=linuxARM7 export WM_COMPILER_LIB_ARCH=32 @@ -135,6 +124,16 @@ Linux) export WM_LDFLAGS='-m64' ;; + ppc64le) + WM_ARCH=linuxPPC64le + export WM_COMPILER_LIB_ARCH=64 + export WM_CC='gcc' + export WM_CXX='g++' + export WM_CFLAGS='-m64 -fPIC' + export WM_CXXFLAGS='-m64 -fPIC' + export WM_LDFLAGS='-m64' + ;; + *) echo Unknown processor type `uname -m` for Linux 1>&2 ;; diff --git a/wmake/rules/linuxPPC64leGcc/X b/wmake/rules/linuxPPC64leGcc/X new file mode 100644 index 00000000..5d1f9c5c --- /dev/null +++ b/wmake/rules/linuxPPC64leGcc/X @@ -0,0 +1,3 @@ +XFLAGS = +XINC = $(XFLAGS) -I/usr/X11R6/include +XLIBS = -L/usr/X11R6/lib64 -lXext -lX11 diff --git a/wmake/rules/linuxPPC64leGcc/c b/wmake/rules/linuxPPC64leGcc/c new file mode 100644 index 00000000..245b3b06 --- /dev/null +++ b/wmake/rules/linuxPPC64leGcc/c @@ -0,0 +1,16 @@ +.SUFFIXES: .c .h + +cWARN = -Wall + +cc = gcc -m64 -mcpu=power8 + +include $(RULES)/c$(WM_COMPILE_OPTION) + +cFLAGS = $(GFLAGS) $(cWARN) $(cOPT) $(cDBUG) $(LIB_HEADER_DIRS) -fPIC + +ctoo = $(WM_SCHEDULER) $(cc) $(cFLAGS) -c $$SOURCE -o $@ + +LINK_LIBS = $(cDBUG) + +LINKLIBSO = $(cc) -shared +LINKEXE = $(cc) -Xlinker --add-needed -Xlinker -z -Xlinker nodefs diff --git a/wmake/rules/linuxPPC64leGcc/c++ b/wmake/rules/linuxPPC64leGcc/c++ new file mode 100644 index 00000000..c22ae3a2 --- /dev/null +++ b/wmake/rules/linuxPPC64leGcc/c++ @@ -0,0 +1,21 @@ +.SUFFIXES: .C .cxx .cc .cpp + +c++WARN = -Wall -Wextra -Wno-unused-parameter -Wold-style-cast + +CC = g++ -m64 -mcpu=power8 + +include $(RULES)/c++$(WM_COMPILE_OPTION) + +ptFLAGS = -DNoRepository -ftemplate-depth-100 + +c++FLAGS = $(GFLAGS) $(c++WARN) $(c++OPT) $(c++DBUG) $(ptFLAGS) $(LIB_HEADER_DIRS) -fPIC + +Ctoo = $(WM_SCHEDULER) $(CC) $(c++FLAGS) -c $$SOURCE -o $@ +cxxtoo = $(Ctoo) +cctoo = $(Ctoo) +cpptoo = $(Ctoo) + +LINK_LIBS = $(c++DBUG) + +LINKLIBSO = $(CC) $(c++FLAGS) -shared +LINKEXE = $(CC) $(c++FLAGS) -Xlinker --add-needed diff --git a/wmake/rules/linuxPPC64leGcc/c++Debug b/wmake/rules/linuxPPC64leGcc/c++Debug new file mode 100644 index 00000000..19bdb9c3 --- /dev/null +++ b/wmake/rules/linuxPPC64leGcc/c++Debug @@ -0,0 +1,2 @@ +c++DBUG = -ggdb3 -DFULLDEBUG +c++OPT = -O0 -fdefault-inline diff --git a/wmake/rules/linuxPPC64leGcc/c++Opt b/wmake/rules/linuxPPC64leGcc/c++Opt new file mode 100644 index 00000000..2aedabd6 --- /dev/null +++ b/wmake/rules/linuxPPC64leGcc/c++Opt @@ -0,0 +1,2 @@ +c++DBUG = +c++OPT = -O3 diff --git a/wmake/rules/linuxPPC64leGcc/c++Prof b/wmake/rules/linuxPPC64leGcc/c++Prof new file mode 100644 index 00000000..3bda4dad --- /dev/null +++ b/wmake/rules/linuxPPC64leGcc/c++Prof @@ -0,0 +1,2 @@ +c++DBUG = -pg +c++OPT = -O2 diff --git a/wmake/rules/linuxPPC64leGcc/cDebug b/wmake/rules/linuxPPC64leGcc/cDebug new file mode 100644 index 00000000..72b638f4 --- /dev/null +++ b/wmake/rules/linuxPPC64leGcc/cDebug @@ -0,0 +1,2 @@ +cDBUG = -ggdb -DFULLDEBUG +cOPT = -O1 -fdefault-inline -finline-functions diff --git a/wmake/rules/linuxPPC64leGcc/cOpt b/wmake/rules/linuxPPC64leGcc/cOpt new file mode 100644 index 00000000..17318709 --- /dev/null +++ b/wmake/rules/linuxPPC64leGcc/cOpt @@ -0,0 +1,2 @@ +cDBUG = +cOPT = -O3 diff --git a/wmake/rules/linuxPPC64leGcc/cProf b/wmake/rules/linuxPPC64leGcc/cProf new file mode 100644 index 00000000..ca3ac9bf --- /dev/null +++ b/wmake/rules/linuxPPC64leGcc/cProf @@ -0,0 +1,2 @@ +cDBUG = -pg +cOPT = -O2 diff --git a/wmake/rules/linuxPPC64leGcc/general b/wmake/rules/linuxPPC64leGcc/general new file mode 100644 index 00000000..f800e09a --- /dev/null +++ b/wmake/rules/linuxPPC64leGcc/general @@ -0,0 +1,10 @@ +CPP = cpp -traditional-cpp $(GFLAGS) +LD = ld -m elf64lppc + +PROJECT_LIBS = -l$(WM_PROJECT) -ldl + +include $(GENERAL_RULES)/standard + +include $(RULES)/X +include $(RULES)/c +include $(RULES)/c++ diff --git a/wmake/rules/linuxPPC64leGcc/mplibHPMPI b/wmake/rules/linuxPPC64leGcc/mplibHPMPI new file mode 100644 index 00000000..574492a2 --- /dev/null +++ b/wmake/rules/linuxPPC64leGcc/mplibHPMPI @@ -0,0 +1,3 @@ +PFLAGS = +PINC = -I$(MPI_ARCH_PATH)/include -D_MPICC_H +PLIBS = -L$(MPI_ARCH_PATH)/lib/linux_amd64 -lmpi