mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
ENH: add settings/rules for clang-2.8
This commit is contained in:
@ -108,6 +108,12 @@ case OpenFOAM:
|
|||||||
set gmp_version=gmp-4.2.4
|
set gmp_version=gmp-4.2.4
|
||||||
set mpfr_version=mpfr-2.4.1
|
set mpfr_version=mpfr-2.4.1
|
||||||
breaksw
|
breaksw
|
||||||
|
case Clang:
|
||||||
|
# using clang - not gcc
|
||||||
|
setenv WM_CC 'clang'
|
||||||
|
setenv WM_CXX 'clang++'
|
||||||
|
set clang_version=llvm-2.8
|
||||||
|
breaksw
|
||||||
default:
|
default:
|
||||||
echo
|
echo
|
||||||
echo "Warning in $WM_PROJECT_DIR/etc/settings.csh:"
|
echo "Warning in $WM_PROJECT_DIR/etc/settings.csh:"
|
||||||
@ -159,6 +165,25 @@ case OpenFOAM:
|
|||||||
endif
|
endif
|
||||||
unset gcc_version gccDir
|
unset gcc_version gccDir
|
||||||
unset gmp_version gmpDir mpfr_version mpfrDir mpc_version mpcDir
|
unset gmp_version gmpDir mpfr_version mpfrDir mpc_version mpcDir
|
||||||
|
|
||||||
|
if ( $?clang_version ) then
|
||||||
|
set clangDir=$WM_THIRD_PARTY_DIR/platforms/$WM_ARCH$WM_COMPILER_ARCH/$clang_version
|
||||||
|
|
||||||
|
# Check that the compiler directory can be found
|
||||||
|
if ( ! -d "$clangDir" ) then
|
||||||
|
echo
|
||||||
|
echo "Warning in $WM_PROJECT_DIR/etc/settings.csh:"
|
||||||
|
echo " Cannot find $clangDir installation."
|
||||||
|
echo " Please install this compiler version or if you wish to use the system compiler,"
|
||||||
|
echo " change the 'compilerInstall' setting to 'system' in this file"
|
||||||
|
echo
|
||||||
|
endif
|
||||||
|
|
||||||
|
_foamAddMan $clangDir/man
|
||||||
|
_foamAddPath $clangDir/bin
|
||||||
|
endif
|
||||||
|
unset clang_version clangDir
|
||||||
|
|
||||||
breaksw
|
breaksw
|
||||||
endsw
|
endsw
|
||||||
|
|
||||||
|
|||||||
@ -131,6 +131,12 @@ OpenFOAM)
|
|||||||
gmp_version=gmp-4.2.4
|
gmp_version=gmp-4.2.4
|
||||||
mpfr_version=mpfr-2.4.1
|
mpfr_version=mpfr-2.4.1
|
||||||
;;
|
;;
|
||||||
|
Clang)
|
||||||
|
# using clang - not gcc
|
||||||
|
export WM_CC='clang'
|
||||||
|
export WM_CXX='clang++'
|
||||||
|
clang_version=llvm-2.8
|
||||||
|
;;
|
||||||
*)
|
*)
|
||||||
echo
|
echo
|
||||||
echo "Warning in $WM_PROJECT_DIR/etc/settings.sh:"
|
echo "Warning in $WM_PROJECT_DIR/etc/settings.sh:"
|
||||||
@ -183,6 +189,25 @@ OpenFOAM)
|
|||||||
fi
|
fi
|
||||||
unset gcc_version gccDir
|
unset gcc_version gccDir
|
||||||
unset gmp_version gmpDir mpfr_version mpfrDir mpc_version mpcDir
|
unset gmp_version gmpDir mpfr_version mpfrDir mpc_version mpcDir
|
||||||
|
|
||||||
|
if [ -n "$clang_version" ]
|
||||||
|
then
|
||||||
|
clangDir=$WM_THIRD_PARTY_DIR/platforms/$WM_ARCH$WM_COMPILER_ARCH/$clang_version
|
||||||
|
|
||||||
|
# Check that the compiler directory can be found
|
||||||
|
[ -d "$clangDir" ] || {
|
||||||
|
echo
|
||||||
|
echo "Warning in $WM_PROJECT_DIR/etc/settings.sh:"
|
||||||
|
echo " Cannot find $clangDir installation."
|
||||||
|
echo " Please install this compiler version or if you wish to use the system compiler,"
|
||||||
|
echo " change the 'compilerInstall' setting to 'system' in this file"
|
||||||
|
echo
|
||||||
|
}
|
||||||
|
|
||||||
|
_foamAddMan $clangDir/share/man
|
||||||
|
_foamAddPath $clangDir/bin
|
||||||
|
fi
|
||||||
|
unset clang_version clangDir
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
|
|
||||||
|
|||||||
16
wmake/rules/linux64Clang/c
Normal file
16
wmake/rules/linux64Clang/c
Normal file
@ -0,0 +1,16 @@
|
|||||||
|
.SUFFIXES: .c .h
|
||||||
|
|
||||||
|
cWARN = -Wall
|
||||||
|
|
||||||
|
cc = clang -m64
|
||||||
|
|
||||||
|
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/linux64Clang/c++
Normal file
21
wmake/rules/linux64Clang/c++
Normal file
@ -0,0 +1,21 @@
|
|||||||
|
.SUFFIXES: .C .cxx .cc .cpp
|
||||||
|
|
||||||
|
c++WARN = -Wall -Wextra -Wno-unused-parameter -Wold-style-cast -Wnon-virtual-dtor
|
||||||
|
|
||||||
|
CC = clang++ -m64
|
||||||
|
|
||||||
|
include $(RULES)/c++$(WM_COMPILE_OPTION)
|
||||||
|
|
||||||
|
ptFLAGS = -DNoRepository -ftemplate-depth-60
|
||||||
|
|
||||||
|
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
|
||||||
2
wmake/rules/linux64Clang/c++Debug
Normal file
2
wmake/rules/linux64Clang/c++Debug
Normal file
@ -0,0 +1,2 @@
|
|||||||
|
c++DBUG = -ggdb3 -DFULLDEBUG
|
||||||
|
c++OPT = -O0 -fdefault-inline
|
||||||
3
wmake/rules/linux64Clang/c++Opt
Normal file
3
wmake/rules/linux64Clang/c++Opt
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
#c++DBUG = -O0 -DFULLDEBUG -g
|
||||||
|
c++DBUG =
|
||||||
|
c++OPT = -O3
|
||||||
2
wmake/rules/linux64Clang/c++Prof
Normal file
2
wmake/rules/linux64Clang/c++Prof
Normal file
@ -0,0 +1,2 @@
|
|||||||
|
c++DBUG = -pg
|
||||||
|
c++OPT = -O2
|
||||||
2
wmake/rules/linux64Clang/cDebug
Normal file
2
wmake/rules/linux64Clang/cDebug
Normal file
@ -0,0 +1,2 @@
|
|||||||
|
cDBUG = -ggdb -DFULLDEBUG
|
||||||
|
cOPT = -O1 -fdefault-inline -finline-functions
|
||||||
2
wmake/rules/linux64Clang/cOpt
Normal file
2
wmake/rules/linux64Clang/cOpt
Normal file
@ -0,0 +1,2 @@
|
|||||||
|
cDBUG =
|
||||||
|
cOPT = -O3
|
||||||
2
wmake/rules/linux64Clang/cProf
Normal file
2
wmake/rules/linux64Clang/cProf
Normal file
@ -0,0 +1,2 @@
|
|||||||
|
cDBUG = -pg
|
||||||
|
cOPT = -O2
|
||||||
8
wmake/rules/linux64Clang/general
Normal file
8
wmake/rules/linux64Clang/general
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
CPP = cpp -traditional-cpp $(GFLAGS)
|
||||||
|
|
||||||
|
PROJECT_LIBS = -l$(WM_PROJECT) -liberty -ldl
|
||||||
|
|
||||||
|
include $(GENERAL_RULES)/standard
|
||||||
|
|
||||||
|
include $(RULES)/c
|
||||||
|
include $(RULES)/c++
|
||||||
3
wmake/rules/linux64Clang/mplibHPMPI
Normal file
3
wmake/rules/linux64Clang/mplibHPMPI
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
PFLAGS =
|
||||||
|
PINC = -I$(MPI_ARCH_PATH)/include -D_MPICC_H
|
||||||
|
PLIBS = -L$(MPI_ARCH_PATH)/lib/linux_amd64 -lmpi
|
||||||
16
wmake/rules/linuxClang/c
Normal file
16
wmake/rules/linuxClang/c
Normal file
@ -0,0 +1,16 @@
|
|||||||
|
.SUFFIXES: .c .h
|
||||||
|
|
||||||
|
cWARN = -Wall
|
||||||
|
|
||||||
|
cc = clang -m32
|
||||||
|
|
||||||
|
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/linuxClang/c++
Normal file
21
wmake/rules/linuxClang/c++
Normal file
@ -0,0 +1,21 @@
|
|||||||
|
.SUFFIXES: .C .cxx .cc .cpp
|
||||||
|
|
||||||
|
c++WARN = -Wall -Wextra -Wno-unused-parameter -Wold-style-cast
|
||||||
|
|
||||||
|
CC = clang++ -m32
|
||||||
|
|
||||||
|
include $(RULES)/c++$(WM_COMPILE_OPTION)
|
||||||
|
|
||||||
|
ptFLAGS = -DNoRepository -ftemplate-depth-60
|
||||||
|
|
||||||
|
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
|
||||||
2
wmake/rules/linuxClang/c++Debug
Normal file
2
wmake/rules/linuxClang/c++Debug
Normal file
@ -0,0 +1,2 @@
|
|||||||
|
c++DBUG = -ggdb3 -DFULLDEBUG
|
||||||
|
c++OPT = -O0 -fdefault-inline
|
||||||
2
wmake/rules/linuxClang/c++Opt
Normal file
2
wmake/rules/linuxClang/c++Opt
Normal file
@ -0,0 +1,2 @@
|
|||||||
|
c++DBUG =
|
||||||
|
c++OPT = -O3
|
||||||
2
wmake/rules/linuxClang/c++Prof
Normal file
2
wmake/rules/linuxClang/c++Prof
Normal file
@ -0,0 +1,2 @@
|
|||||||
|
c++DBUG = -pg
|
||||||
|
c++OPT = -O2
|
||||||
2
wmake/rules/linuxClang/cDebug
Normal file
2
wmake/rules/linuxClang/cDebug
Normal file
@ -0,0 +1,2 @@
|
|||||||
|
cDBUG = -ggdb -DFULLDEBUG
|
||||||
|
cOPT = -O1 -fdefault-inline -finline-functions
|
||||||
2
wmake/rules/linuxClang/cOpt
Normal file
2
wmake/rules/linuxClang/cOpt
Normal file
@ -0,0 +1,2 @@
|
|||||||
|
cDBUG =
|
||||||
|
cOPT = -O3
|
||||||
2
wmake/rules/linuxClang/cProf
Normal file
2
wmake/rules/linuxClang/cProf
Normal file
@ -0,0 +1,2 @@
|
|||||||
|
cDBUG = -pg
|
||||||
|
cOPT = -O2
|
||||||
9
wmake/rules/linuxClang/general
Normal file
9
wmake/rules/linuxClang/general
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
CPP = cpp -traditional-cpp $(GFLAGS)
|
||||||
|
LD = ld -melf_i386
|
||||||
|
|
||||||
|
PROJECT_LIBS = -l$(WM_PROJECT) -liberty -ldl
|
||||||
|
|
||||||
|
include $(GENERAL_RULES)/standard
|
||||||
|
|
||||||
|
include $(RULES)/c
|
||||||
|
include $(RULES)/c++
|
||||||
3
wmake/rules/linuxClang/mplibHPMPI
Normal file
3
wmake/rules/linuxClang/mplibHPMPI
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
PFLAGS =
|
||||||
|
PINC = -I$(MPI_ARCH_PATH)/include -D_MPICC_H
|
||||||
|
PLIBS = -L$(MPI_ARCH_PATH)/lib/linux_ia32 -lmpi
|
||||||
Reference in New Issue
Block a user