diff --git a/etc/bashrc b/etc/bashrc index fb4db6f80..b4ae0ee26 100644 --- a/etc/bashrc +++ b/etc/bashrc @@ -310,38 +310,66 @@ Darwin) case $WM_COMPILER in Gcc42) export WM_MACPORT_VERSION=4.2 + export WM_BASE_COMPILER=Gcc ;; Gcc43) export WM_MACPORT_VERSION=4.3 + export WM_BASE_COMPILER=Gcc ;; Gcc44) export WM_MACPORT_VERSION=4.4 + export WM_BASE_COMPILER=Gcc ;; Gcc45) export WM_MACPORT_VERSION=4.5 + export WM_BASE_COMPILER=Gcc ;; Gcc46) export WM_MACPORT_VERSION=4.6 + export WM_BASE_COMPILER=Gcc ;; Gcc47) export WM_MACPORT_VERSION=4.7 + export WM_BASE_COMPILER=Gcc ;; Gcc48) export WM_MACPORT_VERSION=4.8 + export WM_BASE_COMPILER=Gcc ;; + Clang32) + export WM_BASE_COMPILER=Clang + export WM_MACPORT_VERSION=3.2 + ;; + Clang33) + export WM_BASE_COMPILER=Clang + export WM_MACPORT_VERSION=3.3 + ;; + Clang34) + export WM_BASE_COMPILER=Clang + export WM_MACPORT_VERSION=3.4 + ;; Gcc) ;; *) echo "Unsupported MacPorts-Compiler $WM_COMPILER" ;; esac - if [ "$WM_COMPILER" != "Gcc" ] + if [ "$WM_MACPORT_VERSION" != "" ] then - export WM_CC="gcc-mp-$WM_MACPORT_VERSION" - export WM_CXX="g++-mp-$WM_MACPORT_VERSION" - export WM_FC="gfortran-mp-$WM_MACPORT_VERSION" + if [ "$WM_BASE_COMPILER" == "Gcc" ] + then + export WM_CC="gcc-mp-$WM_MACPORT_VERSION" + export WM_CXX="g++-mp-$WM_MACPORT_VERSION" + export WM_FC="gfortran-mp-$WM_MACPORT_VERSION" + else + export WM_CC="clang-mp-$WM_MACPORT_VERSION" + export WM_CXX="clang++-mp-$WM_MACPORT_VERSION" - ruleDirBase=$WM_PROJECT_DIR/wmake/rules/${WM_ARCH}Gcc + # hardcoded. Needed for ThirdParty + export WM_FC="gfortran-mp-4.5" + fi + + ruleDirBase=$WM_PROJECT_DIR/wmake/rules/$WM_ARCH$WM_BASE_COMPILER ruleDir=$WM_PROJECT_DIR/wmake/rules/$WM_ARCH$WM_COMPILER if [ ! -e $ruleDir ] then diff --git a/wmake/rules/darwinIntel64Clang/ARCHITECTURE_TESTED b/wmake/rules/darwinIntel64Clang/ARCHITECTURE_TESTED new file mode 100644 index 000000000..e7c190c0c --- /dev/null +++ b/wmake/rules/darwinIntel64Clang/ARCHITECTURE_TESTED @@ -0,0 +1 @@ +by bgschaid. 2010-10-05 diff --git a/wmake/rules/darwinIntel64Clang/X b/wmake/rules/darwinIntel64Clang/X new file mode 100644 index 000000000..bed8bfedd --- /dev/null +++ b/wmake/rules/darwinIntel64Clang/X @@ -0,0 +1,3 @@ +XFLAGS = +XINC = $(XFLAGS) -I/usr/X11R6/include +XLIBS = -L/usr/X11R6/lib -lXext -lX11 diff --git a/wmake/rules/darwinIntel64Clang/c b/wmake/rules/darwinIntel64Clang/c new file mode 100644 index 000000000..86f1e14df --- /dev/null +++ b/wmake/rules/darwinIntel64Clang/c @@ -0,0 +1,17 @@ +.SUFFIXES: .c .h + +cWARN = -Wall + +cc = $(WM_CC) -m64 -ftrapping-math +# -fsignaling-nans + +include $(RULES)/c$(WM_COMPILE_OPTION) + +cFLAGS = $(GFLAGS) $(cWARN) $(cOPT) $(cDBUG) $(LIB_HEADER_DIRS) -fPIC -Ddarwin + +ctoo = $(WM_SCHEDULER) $(cc) $(cFLAGS) -c $$SOURCE -o $@ + +LINK_LIBS = $(cDBUG) + +LINKLIBSO = $(cc) -dynamiclib -flat_namespace -undefined suppress +LINKEXE = $(cc) -Xlinker -z -Xlinker nodefs diff --git a/wmake/rules/darwinIntel64Clang/c++ b/wmake/rules/darwinIntel64Clang/c++ new file mode 100644 index 000000000..e43b41940 --- /dev/null +++ b/wmake/rules/darwinIntel64Clang/c++ @@ -0,0 +1,23 @@ +.SUFFIXES: .C .cxx .cc .cpp + +c++WARN = -Wall -Wextra -Wno-unused-parameter -Wold-style-cast -Wnon-virtual-dtor -Wno-overloaded-virtual -Wno-unused-comparison + +CC = $(WM_CXX) -m64 -ftrapping-math +# -fsignaling-nans + +include $(RULES)/c++$(WM_COMPILE_OPTION) + +ptFLAGS = -DNoRepository -ftemplate-depth-200 + +c++FLAGS = $(GFLAGS) $(c++WARN) $(c++OPT) $(c++DBUG) $(ptFLAGS) $(LIB_HEADER_DIRS) -fPIC -Ddarwin + +Ctoo = $(WM_SCHEDULER) $(CC) $(c++FLAGS) -c $$SOURCE -o $@ +cxxtoo = $(Ctoo) +cctoo = $(Ctoo) +cpptoo = $(Ctoo) + +LINK_LIBS = $(c++DBUG) -lpthread + +LINKLIBSO = $(CC) $(c++FLAGS) -lpthread -dynamiclib -undefined dynamic_lookup +# LINKEXE = $(CC) $(c++FLAGS) -lpthread -L$(FOAM_LIBBIN) -lOpenFOAM -L$(FOAM_MPI_LIBBIN) -lPstream +LINKEXE = $(CC) $(c++FLAGS) -lpthread -L$(FOAM_MPI_LIBBIN) -lPstream diff --git a/wmake/rules/darwinIntel64Clang/c++Debug b/wmake/rules/darwinIntel64Clang/c++Debug new file mode 100644 index 000000000..cf8e236f2 --- /dev/null +++ b/wmake/rules/darwinIntel64Clang/c++Debug @@ -0,0 +1,4 @@ +# c++DBUG = -ggdb2 -DFULLDEBUG +c++DBUG = -g -DFULLDEBUG +# c++OPT = -O0 -fdefault-inline +c++OPT = -O0 diff --git a/wmake/rules/darwinIntel64Clang/c++Opt b/wmake/rules/darwinIntel64Clang/c++Opt new file mode 100644 index 000000000..120b1006d --- /dev/null +++ b/wmake/rules/darwinIntel64Clang/c++Opt @@ -0,0 +1,5 @@ +c++DBUG = +# c++OPT = -O4 +c++OPT = -O3 +#c++OPT = -march=nocona -O3 +# -ftree-vectorize -ftree-vectorizer-verbose=3 diff --git a/wmake/rules/darwinIntel64Clang/c++Prof b/wmake/rules/darwinIntel64Clang/c++Prof new file mode 100644 index 000000000..3bda4dad5 --- /dev/null +++ b/wmake/rules/darwinIntel64Clang/c++Prof @@ -0,0 +1,2 @@ +c++DBUG = -pg +c++OPT = -O2 diff --git a/wmake/rules/darwinIntel64Clang/cDebug b/wmake/rules/darwinIntel64Clang/cDebug new file mode 100644 index 000000000..a1a6a649c --- /dev/null +++ b/wmake/rules/darwinIntel64Clang/cDebug @@ -0,0 +1,4 @@ +cDBUG = -g -DFULLDEBUG +cOPT = -O0 +# cDBUG = -ggdb -DFULLDEBUG +# cOPT = -O1 -fdefault-inline -finline-functions diff --git a/wmake/rules/darwinIntel64Clang/cOpt b/wmake/rules/darwinIntel64Clang/cOpt new file mode 100644 index 000000000..17318709f --- /dev/null +++ b/wmake/rules/darwinIntel64Clang/cOpt @@ -0,0 +1,2 @@ +cDBUG = +cOPT = -O3 diff --git a/wmake/rules/darwinIntel64Clang/cProf b/wmake/rules/darwinIntel64Clang/cProf new file mode 100644 index 000000000..ca3ac9bf5 --- /dev/null +++ b/wmake/rules/darwinIntel64Clang/cProf @@ -0,0 +1,2 @@ +cDBUG = -pg +cOPT = -O2 diff --git a/wmake/rules/darwinIntel64Clang/general b/wmake/rules/darwinIntel64Clang/general new file mode 100644 index 000000000..3903ac741 --- /dev/null +++ b/wmake/rules/darwinIntel64Clang/general @@ -0,0 +1,11 @@ +CPP = cpp --traditional-cpp $(GFLAGS) +LD = ld +# LD = /opt/local/libexec/llvm-3.3/bin/ld + +PROJECT_LIBS = -l$(WM_PROJECT) -ldl + +include $(GENERAL_RULES)/standard + +include $(RULES)/X +include $(RULES)/c +include $(RULES)/c++ diff --git a/wmake/rules/darwinIntel64Clang/mplib b/wmake/rules/darwinIntel64Clang/mplib new file mode 100644 index 000000000..294bd8615 --- /dev/null +++ b/wmake/rules/darwinIntel64Clang/mplib @@ -0,0 +1,3 @@ +PFLAGS = +PINC = +PLIBS = diff --git a/wmake/rules/darwinIntel64Clang/mplibMACPORTOPENMPI b/wmake/rules/darwinIntel64Clang/mplibMACPORTOPENMPI new file mode 100644 index 000000000..aaa50f9f5 --- /dev/null +++ b/wmake/rules/darwinIntel64Clang/mplibMACPORTOPENMPI @@ -0,0 +1,3 @@ +PFLAGS = -DOMPI_SKIP_MPICXX +PINC = -I$(MPI_ARCH_PATH)/include/openmpi +PLIBS = -L$(MPI_ARCH_PATH)/lib -lmpi diff --git a/wmake/rules/darwinIntel64Clang/mplibOPENMPI b/wmake/rules/darwinIntel64Clang/mplibOPENMPI new file mode 100644 index 000000000..834d2d3e2 --- /dev/null +++ b/wmake/rules/darwinIntel64Clang/mplibOPENMPI @@ -0,0 +1,3 @@ +PFLAGS = -DOMPI_SKIP_MPICXX +PINC = -I$(MPI_ARCH_PATH)/include +PLIBS = -L$(MPI_ARCH_PATH)/lib -lmpi diff --git a/wmake/rules/darwinIntel64Clang/mplibSYSTEMOPENMPI b/wmake/rules/darwinIntel64Clang/mplibSYSTEMOPENMPI new file mode 100644 index 000000000..98fa814ce --- /dev/null +++ b/wmake/rules/darwinIntel64Clang/mplibSYSTEMOPENMPI @@ -0,0 +1 @@ +PFLAGS = -DOMPI_SKIP_MPICXX