ARM8 Gcc and Clang port

This commit is contained in:
Hrvoje Jasak 2018-03-20 10:54:16 +00:00
parent 28e6b2de20
commit 7a2032c3fa
16 changed files with 118 additions and 8 deletions

1
.gitignore vendored
View file

@ -45,6 +45,7 @@ lnInclude
linux*Gcc*/ linux*Gcc*/
linux*Icc*/ linux*Icc*/
mingw*Gcc*/ mingw*Gcc*/
linuxARM*/
darwin*Gcc*/ darwin*Gcc*/
darwin*Intel*/ darwin*Intel*/
linuxming*/ linuxming*/

View file

@ -91,6 +91,7 @@ export WM_THIRD_PARTY_DIR=$WM_PROJECT_DIR/ThirdParty
# Use 'set' and 'unset' to adjust for your environent # Use 'set' and 'unset' to adjust for your environent
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# For AllMake.stage1 # For AllMake.stage1
export WM_THIRD_PARTY_USE_BISON_27=1
#export WM_THIRD_PARTY_USE_CMAKE_322=1 #export WM_THIRD_PARTY_USE_CMAKE_322=1
# #
@ -165,6 +166,7 @@ done
: ${WM_COMPILER:=Gcc}; export WM_COMPILER : ${WM_COMPILER:=Gcc}; export WM_COMPILER
#: ${WM_COMPILER:=Icc}; export WM_COMPILER #: ${WM_COMPILER:=Icc}; export WM_COMPILER
#: ${WM_COMPILER:=Clang}; export WM_COMPILER #: ${WM_COMPILER:=Clang}; export WM_COMPILER
#: ${WM_COMPILER:=Arm}; export WM_COMPILER
export WM_COMPILER_ARCH= export WM_COMPILER_ARCH=
export WM_COMPILER_LIB_ARCH= export WM_COMPILER_LIB_ARCH=
@ -325,12 +327,28 @@ Linux)
# This command will provide more details for your specific processor # This command will provide more details for your specific processor
# gcc -c -Q -march=native -mtune=native --help=target # gcc -c -Q -march=native -mtune=native --help=target
WM_ARCH=linuxARM8 WM_ARCH=linuxARM8
if [ "$WM_COMPILER" = "Gcc" ]
then
# https://gcc.gnu.org/onlinedocs/gcc/AArch64-Options.html
# This command will provide more details for your specific processor
# gcc -c -Q -march=native -mtune=native --help=target
export WM_COMPILER_LIB_ARCH=64 export WM_COMPILER_LIB_ARCH=64
export WM_CC='gcc' export WM_CC='gcc'
export WM_CXX='g++' export WM_CXX='g++'
export WM_CFLAGS='-fPIC -march=native -mtune=native' export WM_CFLAGS='-fPIC -march=native -mtune=native'
export WM_CXXFLAGS='-fPIC -march=native -mtune=native' export WM_CXXFLAGS='-fPIC -march=native -mtune=native'
export WM_LDFLAGS='' export WM_LDFLAGS=''
elif [ "$WM_COMPILER" = "Arm" ]
then
export WM_LDFLAGS=''
export WM_COMPILER_LIB_ARCH=64
export WM_CC='armclang'
export WM_CXX='armclang++'
export WM_CFLAGS='-fPIC'
export WM_CXXFLAGS='-fPIC'
else
echo "Unknown WM_COMPILER" $WM_COMPILER
fi
;; ;;
*) *)

View file

@ -77,6 +77,7 @@ setenv WM_THIRD_PARTY_DIR $WM_PROJECT_DIR/ThirdParty
# This can be overriden in prefs.sh # This can be overriden in prefs.sh
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# For AllMake.stage1 # For AllMake.stage1
setenv WM_THIRD_PARTY_USE_BISON_27 1
#setenv WM_THIRD_PARTY_USE_CMAKE_322 1 #setenv WM_THIRD_PARTY_USE_CMAKE_322 1
# #
@ -137,6 +138,8 @@ if ( ! $?WM_OSTYPE ) setenv WM_OSTYPE POSIX
if ( ! $?WM_COMPILER ) setenv WM_COMPILER Gcc if ( ! $?WM_COMPILER ) setenv WM_COMPILER Gcc
#setenv WM_COMPILER Gcc #setenv WM_COMPILER Gcc
#setenv WM_COMPILER Icc #setenv WM_COMPILER Icc
#setenv WM_COMPILER Clang
#setenv WM_COMPILER Arm
setenv WM_COMPILER_ARCH setenv WM_COMPILER_ARCH
setenv WM_COMPILER_LIB_ARCH setenv WM_COMPILER_LIB_ARCH
@ -245,6 +248,29 @@ case Linux:
echo Unknown processor type `uname -m` for Linux echo Unknown processor type `uname -m` for Linux
breaksw breaksw
aarch64)
WM_ARCH=linuxARM8
if ( $WM_COMPILER == "Gcc" )
then
setenv WM_COMPILER_LIB_ARCH 64
setenv WM_CC 'gcc'
setenv WM_CXX 'g++'
setenv WM_CFLAGS '-fPIC -march=native -mtune=native'
setenv WM_CXXFLAGS '-fPIC -march=native -mtune=native'
setenv WM_LDFLAGS ''
else if ( $WM_COMPILER == "Arm" )
then
setenv WM_LDFLAGS ''
setenv WM_COMPILER_LIB_ARCH 64
setenv WM_CC 'armclang'
setenv WM_CXX 'armclang++'
setenv WM_CFLAGS '-fPIC'
setenv WM_CXXFLAGS '-fPIC'
else
echo "Unknown WM_COMPILER" $WM_COMPILER
fi
;;
endsw endsw
breaksw breaksw

View file

@ -101,7 +101,7 @@ operator=(const GeoField& gf)
template<class Type> template<class Type>
template<class GeoField> template<class GeoField>
CrankNicolsonDdtScheme<Type>::DDt0Field<GeoField>& typename CrankNicolsonDdtScheme<Type>::template DDt0Field<GeoField>&
CrankNicolsonDdtScheme<Type>::ddt0_ CrankNicolsonDdtScheme<Type>::ddt0_
( (
const word& name, const word& name,

View file

@ -38,7 +38,7 @@ SourceFiles
#include "refCount.H" #include "refCount.H"
#include <cstddef> #include <cstddef>
#if defined(__GNUC__) && !defined(__INTEL_COMPILER) && !defined(darwin) #if defined(__GNUC__) && !defined(__INTEL_COMPILER) && !defined(darwin) && !defined(ARM_CLANG)
# define ConstructFromTmp # define ConstructFromTmp
#endif #endif

View file

@ -0,0 +1,16 @@
.SUFFIXES: .c .h
cWARN = -Wall
cc = armclang
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

View file

@ -0,0 +1,21 @@
.SUFFIXES: .C .cxx .cc .cpp
c++WARN = -Wall -Wextra -Wno-unused-parameter -Wold-style-cast -Wno-undefined-var-template -Wno-deprecated-register -Wno-overloaded-virtual -Wno-null-dereference
CC = armclang++ -std=c++11 -DARM_CLANG
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 -Xlinker --add-needed -Xlinker --no-as-needed
LINKEXE = $(CC) $(c++FLAGS) -Xlinker --add-needed -Xlinker --no-as-needed

View file

@ -0,0 +1,2 @@
c++DBUG = -ggdb3 -DFULLDEBUG
c++OPT = -O0 -fdefault-inline

View file

@ -0,0 +1,2 @@
c++DBUG =
c++OPT = -O3 -march=armv8.1-a -mtune=thunderx2t99

View file

@ -0,0 +1,2 @@
c++DBUG = -pg
c++OPT = -O2

View file

@ -0,0 +1,2 @@
cDBUG = -ggdb -DFULLDEBUG
cOPT = -O1 -fdefault-inline -finline-functions

View file

@ -0,0 +1,2 @@
cDBUG =
cOPT = -O3 -march=armv8.1-a -mtune=thunderx2t99

View file

@ -0,0 +1,2 @@
cDBUG = -pg
cOPT = -O2

View file

@ -0,0 +1,9 @@
CPP = cpp -traditional-cpp $(GFLAGS)
LD = ld
PROJECT_LIBS = -l$(WM_PROJECT) -ldl
include $(GENERAL_RULES)/standard
include $(RULES)/c
include $(RULES)/c++

View file

@ -0,0 +1,3 @@
PFLAGS = -DOMPI_SKIP_MPICXX
PINC = -I$(MPI_ARCH_PATH)/include
PLIBS = -L$(MPI_ARCH_PATH)/lib -lmpi

View file

@ -0,0 +1,4 @@
PFLAGS = -DOMPI_SKIP_MPICXX
PINC = -I$(MPI_ARCH_PATH)/include
PLIBS = -L$(MPI_ARCH_PATH)/lib -lmpi