From a4c378a31fe09a0d932b5b78880eca41f17f968b Mon Sep 17 00:00:00 2001 From: "Bernhard F.W. Gschaider" Date: Fri, 12 Jul 2013 01:12:50 +0200 Subject: [PATCH] On Mac: asume that we want to use the OpenMPI from MacPorts if it is present and the user doesn't say otherwise --HG-- branch : bgschaid/minorAdditionsBranch --- etc/bashrc | 13 +++++++++++++ etc/settings.sh | 14 ++++++++++++++ wmake/rules/darwinIntel64/mplibMACPORTOPENMPI | 3 +++ 3 files changed, 30 insertions(+) create mode 100644 wmake/rules/darwinIntel64/mplibMACPORTOPENMPI diff --git a/etc/bashrc b/etc/bashrc index f4d2541c0..b2df45323 100644 --- a/etc/bashrc +++ b/etc/bashrc @@ -275,6 +275,19 @@ Darwin) export WM_USE_MACPORT=1 + 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 [ "$compilerInstall" == "System" ] then # Use Mac-Ports-Compiler instead of Apple-gcc-4.2 diff --git a/etc/settings.sh b/etc/settings.sh index 01fe4ed2a..dd2df6a9c 100644 --- a/etc/settings.sh +++ b/etc/settings.sh @@ -240,6 +240,20 @@ OPENMPI) unset mpi_version ;; +MACPORTOPENMPI) + unset OPAL_PREFIX + + export FOAM_MPI=openmpi-macport + libDir=`openmpicc --showme:link | sed -e 's/.*-L\([^ ]*\).*/\1/'` + + # Bit of a hack: strip off 'lib' and hope this is the path to openmpi + # include files and libraries. + export MPI_ARCH_PATH="${libDir%/*}" + + _foamAddLib $libDir + unset libDir + ;; + SYSTEMOPENMPI) mpi_version=openmpi-system diff --git a/wmake/rules/darwinIntel64/mplibMACPORTOPENMPI b/wmake/rules/darwinIntel64/mplibMACPORTOPENMPI new file mode 100644 index 000000000..aaa50f9f5 --- /dev/null +++ b/wmake/rules/darwinIntel64/mplibMACPORTOPENMPI @@ -0,0 +1,3 @@ +PFLAGS = -DOMPI_SKIP_MPICXX +PINC = -I$(MPI_ARCH_PATH)/include/openmpi +PLIBS = -L$(MPI_ARCH_PATH)/lib -lmpi