Adapt for the new location of the MPI-implementations in MacPort

--HG--
rename : wmake/rules/darwinIntel64Gcc/ARCHITECTURE_TESTED => wmake/rules/darwinIntel64Dragonegg/ARCHITECTURE_TESTED
rename : wmake/rules/darwinIntel64Gcc/X => wmake/rules/darwinIntel64Dragonegg/X
rename : wmake/rules/darwinIntel64Gcc/c => wmake/rules/darwinIntel64Dragonegg/c
rename : wmake/rules/darwinIntel64Gcc/c++ => wmake/rules/darwinIntel64Dragonegg/c++
rename : wmake/rules/darwinIntel64Gcc/c++Debug => wmake/rules/darwinIntel64Dragonegg/c++Debug
rename : wmake/rules/darwinIntel64Gcc/c++Opt => wmake/rules/darwinIntel64Dragonegg/c++Opt
rename : wmake/rules/darwinIntel64Gcc/c++Prof => wmake/rules/darwinIntel64Dragonegg/c++Prof
rename : wmake/rules/darwinIntel64Gcc/cDebug => wmake/rules/darwinIntel64Dragonegg/cDebug
rename : wmake/rules/darwinIntel64Gcc/cOpt => wmake/rules/darwinIntel64Dragonegg/cOpt
rename : wmake/rules/darwinIntel64Gcc/cProf => wmake/rules/darwinIntel64Dragonegg/cProf
rename : wmake/rules/darwinIntel64Gcc/general => wmake/rules/darwinIntel64Dragonegg/general
rename : wmake/rules/darwinIntel64Gcc/mplib => wmake/rules/darwinIntel64Dragonegg/mplib
rename : wmake/rules/darwinIntel64Gcc/mplibMACPORTOPENMPI => wmake/rules/darwinIntel64Dragonegg/mplibMACPORTOPENMPI
rename : wmake/rules/darwinIntel64Gcc/mplibOPENMPI => wmake/rules/darwinIntel64Dragonegg/mplibOPENMPI
rename : wmake/rules/darwinIntel64Gcc/mplibSYSTEMOPENMPI => wmake/rules/darwinIntel64Dragonegg/mplibSYSTEMOPENMPI
This commit is contained in:
Bernhard F.W. Gschaider 2014-02-20 19:23:16 +01:00
parent 9c6ac6dc5f
commit e299d0feab
22 changed files with 217 additions and 111 deletions

View file

@ -224,9 +224,6 @@ Darwin)
# this makes certain things easier
export WM_ARCH_BASE=darwin
# Remove limit of open files
ulimit -n 1000
case `uname -p` in
powerpc)
export WM_ARCH=darwinPpc
@ -257,109 +254,113 @@ Darwin)
;;
esac
# Make sure that binaries use the best features of the used OS-Version
# We need to get rid of the revision number from this string. eg turn "10.7.5" into "10.7"
export MACOSX_DEPLOYMENT_TARGET=`sw_vers -productVersion | sed -e "s/\([0-9][0-9]*\)\.\([0-9][0-9]*\)\.\([0-9][0-9]*\)/\1.\2/g"`
which -s port >/dev/null
if [ $? -eq "0" -a -d '/opt/local/etc/macports' ]
then
if [ "$FOAM_VERBOSE" -a "$PS1" ]
then
echo "Using Macports binaries"
fi
if [ "$FOAM_VERBOSE" -a "$PS1" ]
then
echo "Using Macports binaries"
fi
export WM_USE_MACPORT=1
export WM_USE_MACPORT=1
export WM_BASE_COMPILER=`echo $WM_COMPILER | tr -d "[:digit:]"`
export WM_MACPORT_MPI_VERSION=`echo $WM_COMPILER | tr "[:upper:]" "[:lower:]"`
export WM_MACPORT_VERSION=`echo $WM_MACPORT_MPI_VERSION | tr -d "[:alpha:]" | sed -e "s/\(.\)\(.\)/\1\.\2/"`
if [ -e '/opt/local/bin/openmpicc' ]
then
export WM_MPLIB=MACPORTOPENMPI
else
if [ -z "$WM_CHOSEN_MAC_MPI" ]
then
echo "WM_CHOSEN_MAC_MPI unset. Using OPENMPI"
export WM_MPLIB=OPENMPI
else
export WM_MPLIB=$WM_CHOSEN_MAC_MPI
fi
fi
if [ -z "$WM_CHOSEN_MAC_MPI" ]
then
if [ -e '/opt/local/bin/mpicc' ]
then
readlink /opt/local/bin/mpicc | grep openmpi >/dev/null
if [ $? -eq "0" ]
then
export WM_MPLIB=MACPORTOPENMPI
if [ "$FOAM_VERBOSE" -a "$PS1" ]
then
echo "Using OpenMPI from MacPorts"
fi
else
readlink /opt/local/bin/mpicc | grep mpich >/dev/null
if [ $? -eq "0" ]
then
export WM_MPLIB=MACPORTMPICH
if [ "$FOAM_VERBOSE" -a "$PS1" ]
then
echo "Using MPICH from MacPorts"
fi
else
echo "/opt/local/bin/mpicc neither OpenMPI nor MPICH. Confused. Defaulting to OPENMPI"
export WM_MPLIB=OPENMPI
fi
fi
fi
else
export WM_MPLIB=$WM_CHOSEN_MAC_MPI
if [ "$FOAM_VERBOSE" -a "$PS1" ]
then
echo "User chose WM_CHOSEN_MAC_MPI=$WM_CHOSEN_MAC_MPI"
fi
fi
if [ "$compilerInstall" == "System" ]
then
# Use Mac-Ports-Compiler instead of Apple-gcc-4.2
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_MACPORT_VERSION" != "" ]
then
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"
if [ "$WM_MPLIB" == "MACPORTOPENMPI" ]
then
if [ ! -e "/opt/local/lib/openmpi-$WM_MACPORT_MPI_VERSION" ]
then
export WM_MACPORT_MPI_VERSION=mp
if [ ! -e "/opt/local/lib/openmpi-$WM_MACPORT_MPI_VERSION" ]
then
echo "Proper OpenMPI not installed. Either do 'port install openmpi-$WM_MACPORT_MPI_VERSION' or 'port install openmpi-default'"
fi
fi
else
if [ "$WM_MPLIB" == "MACPORTMPICH" ]
then
if [ ! -e "/opt/local/lib/mpich-$WM_MACPORT_MPI_VERSION" ]
then
echo "MPICH wants the same version as the used compiler. Do 'port install mpich-$WM_MACPORT_MPI_VERSION'"
fi
fi
fi
# hardcoded. Needed for ThirdParty
export WM_FC="gfortran-mp-4.5"
fi
if [ "$WM_COMPILER" != "Gcc" ]
then
if [ "$WM_BASE_COMPILER" == "Gcc" ]
then
export WM_CC="gcc-mp-$WM_MACPORT_VERSION"
export WM_CXX="g++-mp-$WM_MACPORT_VERSION"
elif [ "$WM_BASE_COMPILER" == "Clang" ]
then
export WM_CC="clang-mp-$WM_MACPORT_VERSION"
export WM_CXX="clang++-mp-$WM_MACPORT_VERSION"
elif [ "$WM_BASE_COMPILER" == "Dragonegg" ]
then
export WM_CC="dragonegg-$WM_MACPORT_VERSION-gcc"
export WM_CXX="dragonegg-$WM_MACPORT_VERSION-g++"
else
echo "Unknown base compiler $WM_BASE_COMPILER"
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
echo "Rule directory $ruleDir not existing. Linking to $ruleDirBase"
ln -s $ruleDirBase $ruleDir
fi
unset ruleDir ruleDirBase
fi
fi
ruleDirBase=$WM_PROJECT_DIR/wmake/rules/$WM_ARCH
ruleDirTarget=$ruleDirBase$WM_BASE_COMPILER
ruleDir=$ruleDirBase$WM_COMPILER
if [ ! -e $ruleDir ]
then
echo "Rule directory $ruleDir not existing. Linking to $ruleDirTarget"
ln -s $ruleDirTarget $ruleDir
fi
unset ruleDir ruleDirBase
fi
else
echo "Seems you're not using MacPorts. This is currently not supported/tested. Find this line in 'etc/config/settings.sh', modify it accordingly and send patches to Bernhard"
export WM_COMPILER=
export WM_MPLIB=OPENMPI
fi
# Make sure that binaries use the best features of the used OS-Version
# We need to get rid of the revision number from this string. eg turn "10.7.5" into "10.7"
# v=(`sw_vers -productVersion | sed 's/\./ /g'`)
# export MACOSX_DEPLOYMENT_TARGET="${v[1]}.${v[2]}"
export MACOSX_DEPLOYMENT_TARGET=`sw_vers -productVersion | sed -e "s/\([0-9][0-9]*\)\.\([0-9][0-9]*\)\.\([0-9][0-9]*\)/\1.\2/g"`
;;
SunOS)
@ -437,6 +438,14 @@ then
export LD_PRELOAD
fi
if [[ `uname -s` == "Darwin" ]]
then
if [[ `ulimit -n` == "unlimited" || `ulimit -n` < 8192 ]]
then
# higher limit needed for wmkdeps
ulimit -n 8192
fi
fi
# cleanup environment:
# ~~~~~~~~~~~~~~~~~~~~

View file

@ -236,20 +236,28 @@ OPENMPI)
;;
MACPORTOPENMPI)
unset OPAL_PREFIX
unset OPAL_PREFIX
export FOAM_MPI=openmpi-macport
libDir=`openmpicc --showme:link | sed -e 's/.*-L\([^ ]*\).*/\1/'`
export FOAM_MPI=openmpi-macport-$WM_MACPORT_MPI_VERSION
# Bit of a hack: strip off 'lib' and hope this is the path to openmpi
# include files and libraries.
export MPI_ARCH_PATH="${libDir%/*}"
# Currently not correctly working on MacPorts
# libDir=`mpicc-openmpi-$WM_MACPORT_MPI_VERSION --showme:libdirs`
libDir=/opt/local/lib/openmpi-$WM_MACPORT_MPI_VERSION
export FOAM_MPI_LIBBIN=$FOAM_LIBBIN/$mpi_version
_foamAddLib $libDir
unset libDir
;;
_foamAddLib $libDir
unset libDir
;;
MACPORTMPICH)
export FOAM_MPI=mpich-macports-$WM_MACPORT_MPI_VERSION
export MPI_HOME=$WM_THIRD_PARTY_DIR/$FOAM_MPI
libDir=/opt/local/lib/mpich-$WM_MACPORT_MPI_VERSION
_foamAddLib $libDir
unset libDir
;;
SYSTEMOPENMPI)
mpi_version=openmpi-system

View file

@ -0,0 +1,3 @@
PFLAGS = -DOMPI_SKIP_MPICXX
PINC = -I/opt/local/include/mpich-$(WM_MACPORT_MPI_VERSION)
PLIBS = -L/opt/local/lib/mpich-$(WM_MACPORT_MPI_VERSION) -lmpich -lpmpich

View file

@ -1,3 +1,3 @@
PFLAGS = -DOMPI_SKIP_MPICXX
PINC = -I$(MPI_ARCH_PATH)/include/openmpi
PLIBS = -L$(MPI_ARCH_PATH)/lib -lmpi
PINC = $(shell mpicc-openmpi-mp --showme:compile)
PLIBS = $(shell mpicc-openmpi-mp --showme:link)

View file

@ -0,0 +1 @@
by bgschaid. 2010-10-05

View file

@ -0,0 +1,3 @@
XFLAGS =
XINC = $(XFLAGS) -I/usr/X11R6/include
XLIBS = -L/usr/X11R6/lib -lXext -lX11

View file

@ -0,0 +1,16 @@
.SUFFIXES: .c .h
cWARN = -Wall
cc = $(WM_CC) $(WM_CXXFLAGS) -ftrapping-math
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

View file

@ -0,0 +1,22 @@
.SUFFIXES: .C .cxx .cc .cpp
c++WARN = -Wall -Wextra -Wno-unused-parameter -Wold-style-cast -Wno-overloaded-virtual -Wno-unsequenced -Wno-c++11-extensions -Wno-unused-comparison
CC = $(WM_CXX) $(WM_CXXFLAGS) -ftrapping-math
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) -lfoam -L$(FOAM_MPI_LIBBIN) -lPstream
LINKEXE = $(CC) $(c++FLAGS) -lpthread -L$(FOAM_MPI_LIBBIN) -lPstream

View file

@ -0,0 +1,2 @@
c++DBUG = -ggdb2 -DFULLDEBUG
c++OPT = -O0 -fdefault-inline

View file

@ -0,0 +1,4 @@
c++DBUG =
c++OPT = -O3
#c++OPT = -march=nocona -O3
# -ftree-vectorize -ftree-vectorizer-verbose=3

View file

@ -0,0 +1,2 @@
c++DBUG = -pg
c++OPT = -O2

View file

@ -0,0 +1,2 @@
cDBUG = -ggdb -DFULLDEBUG
cOPT = -O1 -fdefault-inline -finline-functions

View file

@ -0,0 +1,2 @@
cDBUG =
cOPT = -O3

View file

@ -0,0 +1,2 @@
cDBUG = -pg
cOPT = -O2

View file

@ -0,0 +1,10 @@
CPP = cpp $(GFLAGS)
LD = ld
PROJECT_LIBS = -l$(WM_PROJECT)
include $(GENERAL_RULES)/standard
include $(RULES)/X
include $(RULES)/c
include $(RULES)/c++

View file

@ -0,0 +1,3 @@
PFLAGS =
PINC =
PLIBS =

View file

@ -0,0 +1,3 @@
PFLAGS = -DOMPI_SKIP_MPICXX
PINC = -I/opt/local/include/mpich-$(WM_MACPORT_MPI_VERSION)
PLIBS = -L/opt/local/lib/mpich-$(WM_MACPORT_MPI_VERSION) -lmpich -lpmpich

View file

@ -0,0 +1,5 @@
PFLAGS = -DOMPI_SKIP_MPICXX
# PINC = $(shell mpicc-openmpi-$(WM_MACPORT_MPI_VERSION) --showme:compile)
# PLIBS = $(shell mpicc-openmpi-$(WM_MACPORT_MPI_VERSION) --showme:link)
PINC = -I/opt/local/include/openmpi-$(WM_MACPORT_MPI_VERSION)
PLIBS = -L/opt/local/lib/openmpi-$(WM_MACPORT_MPI_VERSION) -lmpi

View file

@ -0,0 +1,3 @@
PFLAGS = -DOMPI_SKIP_MPICXX
PINC = -I$(MPI_ARCH_PATH)/include
PLIBS = -L$(MPI_ARCH_PATH)/lib -lmpi

View file

@ -0,0 +1 @@
PFLAGS = -DOMPI_SKIP_MPICXX

View file

@ -0,0 +1,3 @@
PFLAGS = -DOMPI_SKIP_MPICXX
PINC = -I/opt/local/include/mpich-$(WM_MACPORT_MPI_VERSION)
PLIBS = -L/opt/local/lib/mpich-$(WM_MACPORT_MPI_VERSION) -lmpich -lpmpich

View file

@ -1,3 +1,5 @@
PFLAGS = -DOMPI_SKIP_MPICXX
PINC = -I$(MPI_ARCH_PATH)/include/openmpi
PLIBS = -L$(MPI_ARCH_PATH)/lib -lmpi
# PINC = $(shell mpicc-openmpi-$(WM_MACPORT_MPI_VERSION) --showme:compile)
# PLIBS = $(shell mpicc-openmpi-$(WM_MACPORT_MPI_VERSION) --showme:link)
PINC = -I/opt/local/include/openmpi-$(WM_MACPORT_MPI_VERSION)
PLIBS = -L/opt/local/lib/openmpi-$(WM_MACPORT_MPI_VERSION) -lmpi