wmake: added rules for linuxArm64Gcc to compile on aarch64 (Arm-based) processors.
No code change was required to compile OpenFOAM on Arm using the Gcc compiler.
This commit is contained in:
@ -2,7 +2,7 @@
|
||||
# ========= |
|
||||
# \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
# \\ / O peration | Website: https://openfoam.org
|
||||
# \\ / A nd | Copyright (C) 2011-2019 OpenFOAM Foundation
|
||||
# \\ / A nd | Copyright (C) 2011-2020 OpenFOAM Foundation
|
||||
# \\/ M anipulation |
|
||||
#------------------------------------------------------------------------------
|
||||
# License
|
||||
@ -81,6 +81,16 @@ case Linux:
|
||||
endsw
|
||||
breaksw
|
||||
|
||||
case aarch64:
|
||||
setenv WM_ARCH linuxArm64
|
||||
setenv WM_COMPILER_LIB_ARCH 64
|
||||
setenv WM_CC 'gcc'
|
||||
setenv WM_CXX 'g++'
|
||||
setenv WM_CFLAGS '-fPIC'
|
||||
setenv WM_CXXFLAGS '-fPIC -std=c++0x'
|
||||
setenv WM_LDFLAGS ''
|
||||
;;
|
||||
|
||||
case ppc64:
|
||||
setenv WM_ARCH linuxPPC64
|
||||
setenv WM_COMPILER_LIB_ARCH 64
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
# ========= |
|
||||
# \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
# \\ / O peration | Website: https://openfoam.org
|
||||
# \\ / A nd | Copyright (C) 2011-2018 OpenFOAM Foundation
|
||||
# \\ / A nd | Copyright (C) 2011-2020 OpenFOAM Foundation
|
||||
# \\/ M anipulation |
|
||||
#------------------------------------------------------------------------------
|
||||
# License
|
||||
@ -74,6 +74,16 @@ Linux)
|
||||
esac
|
||||
;;
|
||||
|
||||
aarch64)
|
||||
WM_ARCH=linuxArm64
|
||||
export WM_COMPILER_LIB_ARCH=64
|
||||
export WM_CC='gcc'
|
||||
export WM_CXX='g++'
|
||||
export WM_CFLAGS='-fPIC'
|
||||
export WM_CXXFLAGS='-fPIC -std=c++0x'
|
||||
export WM_LDFLAGS=
|
||||
;;
|
||||
|
||||
armv7l)
|
||||
WM_ARCH=linuxARM7
|
||||
export WM_ARCH_OPTION=32
|
||||
|
||||
16
wmake/rules/linuxArm64Gcc/c
Normal file
16
wmake/rules/linuxArm64Gcc/c
Normal file
@ -0,0 +1,16 @@
|
||||
SUFFIXES += .c
|
||||
|
||||
cWARN = -Wall
|
||||
|
||||
cc = gcc
|
||||
|
||||
include $(DEFAULT_RULES)/c$(WM_COMPILE_OPTION)
|
||||
|
||||
cFLAGS = $(GFLAGS) $(cWARN) $(cOPT) $(cDBUG) $(LIB_HEADER_DIRS) -fPIC
|
||||
|
||||
ctoo = $(WM_SCHEDULER) $(cc) $(cFLAGS) -c $< -o $@
|
||||
|
||||
LINK_LIBS = $(cDBUG)
|
||||
|
||||
LINKLIBSO = $(cc) -fuse-ld=bfd -shared
|
||||
LINKEXE = $(cc) -fuse-ld=bfd -Xlinker --add-needed -Xlinker -z -Xlinker nodefs
|
||||
25
wmake/rules/linuxArm64Gcc/c++
Normal file
25
wmake/rules/linuxArm64Gcc/c++
Normal file
@ -0,0 +1,25 @@
|
||||
SUFFIXES += .C
|
||||
|
||||
c++WARN = -Wall -Wextra -Wold-style-cast -Wnon-virtual-dtor -Wno-unused-parameter \
|
||||
-Wno-invalid-offsetof -Wno-attributes
|
||||
|
||||
# Suppress some warnings for flex++ and CGAL
|
||||
c++LESSWARN = -Wno-old-style-cast -Wno-unused-local-typedefs -Wno-array-bounds
|
||||
|
||||
CC = g++ -std=c++11
|
||||
|
||||
include $(DEFAULT_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 $< -o $@
|
||||
cxxtoo = $(Ctoo)
|
||||
cctoo = $(Ctoo)
|
||||
cpptoo = $(Ctoo)
|
||||
|
||||
LINK_LIBS = $(c++DBUG)
|
||||
|
||||
LINKLIBSO = $(CC) $(c++FLAGS) -fuse-ld=bfd -shared -Xlinker --add-needed -Xlinker --no-as-needed
|
||||
LINKEXE = $(CC) $(c++FLAGS) -fuse-ld=bfd -Xlinker --add-needed -Xlinker --no-as-needed
|
||||
2
wmake/rules/linuxArm64Gcc/c++Debug
Normal file
2
wmake/rules/linuxArm64Gcc/c++Debug
Normal file
@ -0,0 +1,2 @@
|
||||
c++DBUG = -ggdb3 -DFULLDEBUG
|
||||
c++OPT = -O0 -fdefault-inline
|
||||
4
wmake/rules/linuxArm64Gcc/c++Opt
Normal file
4
wmake/rules/linuxArm64Gcc/c++Opt
Normal file
@ -0,0 +1,4 @@
|
||||
c++DBUG =
|
||||
c++OPT = -O3 -mcpu=native
|
||||
|
||||
ROUNDING_MATH = -frounding-math
|
||||
2
wmake/rules/linuxArm64Gcc/c++Prof
Normal file
2
wmake/rules/linuxArm64Gcc/c++Prof
Normal file
@ -0,0 +1,2 @@
|
||||
c++DBUG = -pg
|
||||
c++OPT = -O2
|
||||
2
wmake/rules/linuxArm64Gcc/cDebug
Normal file
2
wmake/rules/linuxArm64Gcc/cDebug
Normal file
@ -0,0 +1,2 @@
|
||||
cDBUG = -ggdb -DFULLDEBUG
|
||||
cOPT = -O1 -fdefault-inline -finline-functions
|
||||
2
wmake/rules/linuxArm64Gcc/cOpt
Normal file
2
wmake/rules/linuxArm64Gcc/cOpt
Normal file
@ -0,0 +1,2 @@
|
||||
cDBUG =
|
||||
cOPT = -O3
|
||||
2
wmake/rules/linuxArm64Gcc/cProf
Normal file
2
wmake/rules/linuxArm64Gcc/cProf
Normal file
@ -0,0 +1,2 @@
|
||||
cDBUG = -pg
|
||||
cOPT = -O2
|
||||
8
wmake/rules/linuxArm64Gcc/general
Normal file
8
wmake/rules/linuxArm64Gcc/general
Normal file
@ -0,0 +1,8 @@
|
||||
CPP = cpp -traditional-cpp $(GFLAGS)
|
||||
|
||||
PROJECT_LIBS = -l$(WM_PROJECT) -ldl
|
||||
|
||||
include $(GENERAL_RULES)/standard
|
||||
|
||||
include $(DEFAULT_RULES)/c
|
||||
include $(DEFAULT_RULES)/c++
|
||||
Reference in New Issue
Block a user