Adding support for ARM7 group of processors. Tested on a Raspberry Pi 2.
This commit is contained in:
parent
92ee146344
commit
5366bc60de
15 changed files with 86 additions and 2 deletions
10
etc/bashrc
10
etc/bashrc
|
@ -288,6 +288,16 @@ Linux)
|
||||||
export WM_LDFLAGS='-m64'
|
export WM_LDFLAGS='-m64'
|
||||||
;;
|
;;
|
||||||
|
|
||||||
|
armv7l)
|
||||||
|
WM_ARCH=linuxARM7
|
||||||
|
export WM_COMPILER_LIB_ARCH=32
|
||||||
|
export WM_CC='gcc'
|
||||||
|
export WM_CXX='g++'
|
||||||
|
export WM_CFLAGS='-fPIC -mfloat-abi=hard'
|
||||||
|
export WM_CXXFLAGS='-fPIC -mfloat-abi=hard'
|
||||||
|
export WM_LDFLAGS='-mfloat-abi=hard'
|
||||||
|
;;
|
||||||
|
|
||||||
*)
|
*)
|
||||||
echo Unknown processor type `uname -m` for Linux
|
echo Unknown processor type `uname -m` for Linux
|
||||||
;;
|
;;
|
||||||
|
|
10
etc/cshrc
10
etc/cshrc
|
@ -228,6 +228,16 @@ case Linux:
|
||||||
setenv WM_LDFLAGS '-m64'
|
setenv WM_LDFLAGS '-m64'
|
||||||
breaksw
|
breaksw
|
||||||
|
|
||||||
|
armv7l)
|
||||||
|
setenv WM_ARCH linuxARM7
|
||||||
|
setenv WM_COMPILER_LIB_ARCH 32
|
||||||
|
setenv WM_CC 'gcc'
|
||||||
|
setenv WM_CXX 'g++'
|
||||||
|
setenv WM_CFLAGS '-fPIC -mfloat-abi=hard'
|
||||||
|
setenv WM_CXXFLAGS '-fPIC -mfloat-abi=hard'
|
||||||
|
setenv WM_LDFLAGS '-mfloat-abi=hard'
|
||||||
|
;;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
echo Unknown processor type `uname -m` for Linux
|
echo Unknown processor type `uname -m` for Linux
|
||||||
breaksw
|
breaksw
|
||||||
|
|
|
@ -46,7 +46,7 @@ SourceFiles
|
||||||
#include "OSspecific.H"
|
#include "OSspecific.H"
|
||||||
#include <signal.h>
|
#include <signal.h>
|
||||||
|
|
||||||
#if defined(linux) || defined(linuxAMD64) || defined(linuxIA64)
|
#if defined(linux) || defined(linuxAMD64) || defined(linuxIA64) || defined(linuxARM7)
|
||||||
# define LINUX
|
# define LINUX
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
|
@ -90,7 +90,7 @@ inline void Foam::UList<T>::checkStart(const label start) const
|
||||||
if (start<0 || (start && start>=size_))
|
if (start<0 || (start && start>=size_))
|
||||||
{
|
{
|
||||||
FatalErrorIn("UList<T>::checkStart(const label)")
|
FatalErrorIn("UList<T>::checkStart(const label)")
|
||||||
<< "start " << start << " out of range 0 ... " << max(size_-1, 0)
|
<< "start " << start << " out of range 0 ... " << max(label(size_-1), label(0))
|
||||||
<< abort(FatalError);
|
<< abort(FatalError);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
16
wmake/rules/linuxARM7Gcc/c
Normal file
16
wmake/rules/linuxARM7Gcc/c
Normal file
|
@ -0,0 +1,16 @@
|
||||||
|
.SUFFIXES: .c .h
|
||||||
|
|
||||||
|
cWARN = -Wall
|
||||||
|
|
||||||
|
cc = gcc
|
||||||
|
|
||||||
|
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
|
21
wmake/rules/linuxARM7Gcc/c++
Normal file
21
wmake/rules/linuxARM7Gcc/c++
Normal file
|
@ -0,0 +1,21 @@
|
||||||
|
.SUFFIXES: .C .cxx .cc .cpp
|
||||||
|
|
||||||
|
c++WARN = -Wall -Wextra -Wno-unused-parameter -Wold-style-cast
|
||||||
|
|
||||||
|
CC = g++
|
||||||
|
|
||||||
|
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
|
2
wmake/rules/linuxARM7Gcc/c++Debug
Normal file
2
wmake/rules/linuxARM7Gcc/c++Debug
Normal file
|
@ -0,0 +1,2 @@
|
||||||
|
c++DBUG = -ggdb3 -DFULLDEBUG
|
||||||
|
c++OPT = -O0 -fdefault-inline
|
2
wmake/rules/linuxARM7Gcc/c++Opt
Normal file
2
wmake/rules/linuxARM7Gcc/c++Opt
Normal file
|
@ -0,0 +1,2 @@
|
||||||
|
c++DBUG =
|
||||||
|
c++OPT = -O3 -floop-optimize -falign-loops -falign-labels -falign-functions -falign-jumps -fprefetch-loop-arrays -mcpu=cortex-a7 -mfpu=neon-vfpv4 -mfloat-abi=hard
|
2
wmake/rules/linuxARM7Gcc/c++Prof
Normal file
2
wmake/rules/linuxARM7Gcc/c++Prof
Normal file
|
@ -0,0 +1,2 @@
|
||||||
|
c++DBUG = -pg
|
||||||
|
c++OPT = -O2
|
2
wmake/rules/linuxARM7Gcc/cDebug
Normal file
2
wmake/rules/linuxARM7Gcc/cDebug
Normal file
|
@ -0,0 +1,2 @@
|
||||||
|
cDBUG = -ggdb -DFULLDEBUG
|
||||||
|
cOPT = -O1 -fdefault-inline -finline-functions
|
2
wmake/rules/linuxARM7Gcc/cOpt
Normal file
2
wmake/rules/linuxARM7Gcc/cOpt
Normal file
|
@ -0,0 +1,2 @@
|
||||||
|
cDBUG =
|
||||||
|
cOPT = -O3 -floop-optimize -falign-loops -falign-labels -falign-functions -falign-jumps -fprefetch-loop-arrays -mcpu=cortex-a7 -mfpu=neon-vfpv4 -mfloat-abi=hard
|
2
wmake/rules/linuxARM7Gcc/cProf
Normal file
2
wmake/rules/linuxARM7Gcc/cProf
Normal file
|
@ -0,0 +1,2 @@
|
||||||
|
cDBUG = -pg
|
||||||
|
cOPT = -O2
|
9
wmake/rules/linuxARM7Gcc/general
Normal file
9
wmake/rules/linuxARM7Gcc/general
Normal 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++
|
3
wmake/rules/linuxARM7Gcc/mplibOPENMPI
Normal file
3
wmake/rules/linuxARM7Gcc/mplibOPENMPI
Normal file
|
@ -0,0 +1,3 @@
|
||||||
|
PFLAGS = -DOMPI_SKIP_MPICXX
|
||||||
|
PINC = -I$(MPI_ARCH_PATH)/include
|
||||||
|
PLIBS = -L$(MPI_ARCH_PATH)/lib -lmpi
|
3
wmake/rules/linuxARM7Gcc/mplibSYSTEMOPENMPI
Normal file
3
wmake/rules/linuxARM7Gcc/mplibSYSTEMOPENMPI
Normal file
|
@ -0,0 +1,3 @@
|
||||||
|
PFLAGS = -DOMPI_SKIP_MPICXX
|
||||||
|
PINC = $(OPENMPI_COMPILE_FLAGS)
|
||||||
|
PLIBS = -L$(MPI_ARCH_PATH)/lib/openmpi -lmpi
|
Reference in a new issue