From 62600559894aaf8f8762884f7faa5d7ccaa87130 Mon Sep 17 00:00:00 2001 From: Mark Olesen Date: Wed, 17 Nov 2010 11:15:23 +0100 Subject: [PATCH] ENH: add in C++0x support for linux64Gcc - for testing purposes --- etc/settings.csh | 15 +++++++++++++++ etc/settings.sh | 19 ++++++++++++++++--- wmake/rules/linux64Gcc++0x/c | 16 ++++++++++++++++ wmake/rules/linux64Gcc++0x/c++ | 21 +++++++++++++++++++++ wmake/rules/linux64Gcc++0x/c++Debug | 2 ++ wmake/rules/linux64Gcc++0x/c++Opt | 3 +++ wmake/rules/linux64Gcc++0x/c++Prof | 2 ++ wmake/rules/linux64Gcc++0x/cDebug | 2 ++ wmake/rules/linux64Gcc++0x/cOpt | 2 ++ wmake/rules/linux64Gcc++0x/cProf | 2 ++ wmake/rules/linux64Gcc++0x/general | 8 ++++++++ wmake/rules/linux64Gcc++0x/mplibHPMPI | 3 +++ 12 files changed, 92 insertions(+), 3 deletions(-) create mode 100644 wmake/rules/linux64Gcc++0x/c create mode 100644 wmake/rules/linux64Gcc++0x/c++ create mode 100644 wmake/rules/linux64Gcc++0x/c++Debug create mode 100644 wmake/rules/linux64Gcc++0x/c++Opt create mode 100644 wmake/rules/linux64Gcc++0x/c++Prof create mode 100644 wmake/rules/linux64Gcc++0x/cDebug create mode 100644 wmake/rules/linux64Gcc++0x/cOpt create mode 100644 wmake/rules/linux64Gcc++0x/cProf create mode 100644 wmake/rules/linux64Gcc++0x/general create mode 100644 wmake/rules/linux64Gcc++0x/mplibHPMPI diff --git a/etc/settings.csh b/etc/settings.csh index e1884cd1c3..f3bec0d915 100644 --- a/etc/settings.csh +++ b/etc/settings.csh @@ -90,17 +90,20 @@ switch ("$compilerInstall") case OpenFOAM: switch ("$WM_COMPILER") case Gcc: + case Gcc++0x: set gcc_version=gcc-4.4.3 set gmp_version=gmp-5.0.1 set mpfr_version=mpfr-2.4.2 breaksw case Gcc45: + case Gcc45++0x: set gcc_version=gcc-4.5.0 set gmp_version=gmp-5.0.1 set mpfr_version=mpfr-2.4.2 set mpc_version=mpc-0.8.1 breaksw case Gcc44: + case Gcc44++0x: set gcc_version=gcc-4.4.3 set gmp_version=gmp-5.0.1 set mpfr_version=mpfr-2.4.2 @@ -190,6 +193,18 @@ case OpenFOAM: endsw +# +# add c++0x flags for external programs +# +if ( $?WM_CXXFLAGS ) then + switch ("$WM_COMPILER") + case Gcc*++0x: + setenv WM_CXXFLAGS "$WM_CXXFLAGS -std=c++0x" + breaksw + endsw +endif + + # boost and CGAL # ~~~~~~~~~~~~~~ diff --git a/etc/settings.sh b/etc/settings.sh index 5b2f516505..785c3f97dd 100644 --- a/etc/settings.sh +++ b/etc/settings.sh @@ -111,18 +111,18 @@ unset MPFR_ARCH_PATH case "${compilerInstall:-OpenFOAM}" in OpenFOAM) case "$WM_COMPILER" in - Gcc) + Gcc | Gcc++0x) gcc_version=gcc-4.4.3 gmp_version=gmp-5.0.1 mpfr_version=mpfr-2.4.2 ;; - Gcc45) + Gcc45 | Gcc45++0x) gcc_version=gcc-4.5.0 gmp_version=gmp-5.0.1 mpfr_version=mpfr-2.4.2 mpc_version=mpc-0.8.1 ;; - Gcc44) + Gcc44 | Gcc44++0x) gcc_version=gcc-4.4.3 gmp_version=gmp-5.0.1 mpfr_version=mpfr-2.4.2 @@ -213,6 +213,19 @@ OpenFOAM) esac +# +# add c++0x flags for external programs +# +if [ -n "$WM_CXXFLAGS" ] +then + case "$WM_COMPILER" in + Gcc*++0x) + WM_CXXFLAGS="$WM_CXXFLAGS -std=c++0x" + ;; + esac +fi + + # boost and CGAL # ~~~~~~~~~~~~~~ diff --git a/wmake/rules/linux64Gcc++0x/c b/wmake/rules/linux64Gcc++0x/c new file mode 100644 index 0000000000..f4114be314 --- /dev/null +++ b/wmake/rules/linux64Gcc++0x/c @@ -0,0 +1,16 @@ +.SUFFIXES: .c .h + +cWARN = -Wall + +cc = gcc -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 diff --git a/wmake/rules/linux64Gcc++0x/c++ b/wmake/rules/linux64Gcc++0x/c++ new file mode 100644 index 0000000000..4f858ff338 --- /dev/null +++ b/wmake/rules/linux64Gcc++0x/c++ @@ -0,0 +1,21 @@ +.SUFFIXES: .C .cxx .cc .cpp + +c++WARN = -Wall -Wextra -Wno-unused-parameter -Wold-style-cast -Wnon-virtual-dtor + +CC = g++ -m64 -std=c++0x + +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 diff --git a/wmake/rules/linux64Gcc++0x/c++Debug b/wmake/rules/linux64Gcc++0x/c++Debug new file mode 100644 index 0000000000..19bdb9c334 --- /dev/null +++ b/wmake/rules/linux64Gcc++0x/c++Debug @@ -0,0 +1,2 @@ +c++DBUG = -ggdb3 -DFULLDEBUG +c++OPT = -O0 -fdefault-inline diff --git a/wmake/rules/linux64Gcc++0x/c++Opt b/wmake/rules/linux64Gcc++0x/c++Opt new file mode 100644 index 0000000000..3363be8090 --- /dev/null +++ b/wmake/rules/linux64Gcc++0x/c++Opt @@ -0,0 +1,3 @@ +#c++DBUG = -O0 -DFULLDEBUG -g +c++DBUG = +c++OPT = -O3 diff --git a/wmake/rules/linux64Gcc++0x/c++Prof b/wmake/rules/linux64Gcc++0x/c++Prof new file mode 100644 index 0000000000..3bda4dad55 --- /dev/null +++ b/wmake/rules/linux64Gcc++0x/c++Prof @@ -0,0 +1,2 @@ +c++DBUG = -pg +c++OPT = -O2 diff --git a/wmake/rules/linux64Gcc++0x/cDebug b/wmake/rules/linux64Gcc++0x/cDebug new file mode 100644 index 0000000000..72b638f458 --- /dev/null +++ b/wmake/rules/linux64Gcc++0x/cDebug @@ -0,0 +1,2 @@ +cDBUG = -ggdb -DFULLDEBUG +cOPT = -O1 -fdefault-inline -finline-functions diff --git a/wmake/rules/linux64Gcc++0x/cOpt b/wmake/rules/linux64Gcc++0x/cOpt new file mode 100644 index 0000000000..17318709f1 --- /dev/null +++ b/wmake/rules/linux64Gcc++0x/cOpt @@ -0,0 +1,2 @@ +cDBUG = +cOPT = -O3 diff --git a/wmake/rules/linux64Gcc++0x/cProf b/wmake/rules/linux64Gcc++0x/cProf new file mode 100644 index 0000000000..ca3ac9bf5f --- /dev/null +++ b/wmake/rules/linux64Gcc++0x/cProf @@ -0,0 +1,2 @@ +cDBUG = -pg +cOPT = -O2 diff --git a/wmake/rules/linux64Gcc++0x/general b/wmake/rules/linux64Gcc++0x/general new file mode 100644 index 0000000000..809751cd0a --- /dev/null +++ b/wmake/rules/linux64Gcc++0x/general @@ -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++ diff --git a/wmake/rules/linux64Gcc++0x/mplibHPMPI b/wmake/rules/linux64Gcc++0x/mplibHPMPI new file mode 100644 index 0000000000..574492a236 --- /dev/null +++ b/wmake/rules/linux64Gcc++0x/mplibHPMPI @@ -0,0 +1,3 @@ +PFLAGS = +PINC = -I$(MPI_ARCH_PATH)/include -D_MPICC_H +PLIBS = -L$(MPI_ARCH_PATH)/lib/linux_amd64 -lmpi