/usr/bin/dune-mpi-config is in libdune-common-dev 2.2.1-2.
This file is owned by root:root, with mode 0o755.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 | #!/bin/bash
set -e
canonicalname(){
if test $# -ne 1; then
echo Usage: canonicalname path >&2
return 1
fi
name="$1"
while test -L "$name"; do
if ! test -e "$name"; then
echo $name: file not found >&2
return 1
fi
if newname="`readlink $name`"; then
name="$newname"
else
echo "$(dirname $name)/$(basename $name)"
fi
done
echo $name
}
canonicalpath(){
if test $# -ne 1; then
echo Usage: canonicalpath path >&2
return 1
fi
(cd $(dirname $(canonicalname $1)) && pwd)
}
findm4dir() {
BINDIR="$(canonicalpath $0)"
# source-build
M4DIR="$BINDIR/../m4"
if test -f "$M4DIR/mpi-config.m4"; then
echo "$M4DIR"
return
fi
# installed
M4DIR="$BINDIR/../share/aclocal"
if test -f "$M4DIR/mpi-config.m4"; then
echo "$M4DIR"
return
fi
# downloaded
M4DIR="$BINDIR"
if test -f "$M4DIR/mpi-config.m4"; then
echo "$M4DIR"
return
fi
echo "ERROR: could not find mpi-config.m4! Incomplete installation?" >&2
exit 1
}
version=0.1
verbose=0
usage()
{
cat <<EOF
mpi-config is a tool to help you determine the compiler and linker flags that
you need in order to build your code with MPI. It is very similar to pkg-config,
but doesn't rely on help from your MPI installation. If/when MPI implementations
start supporting pkg-config then mpi-config will become obsolete.
Usage: mpi-config [OPTIONS] [LIBRARIES]
Options:
[--mpicc[=COMPILER]]
[--disable-cxx]
[--verbose]
[--version]
[--mpiversion]
[--libs]
[--cflags]
EOF
exit $1
}
if test $# -eq 0 ; then
usage 1 1>&2
fi
while test $# -gt 0 ; do
case "$1" in
-*=*) optarg=`echo "$1" | sed 's/[-_a-zA-Z0-9]*=//'` ;;
*) optarg= ;;
esac
case $1 in
--mpicc=*)
MPICC=$optarg
;;
--version)
echo $version
exit 0
;;
--verbose)
verbose=1
;;
--disable-cxx)
disablecxx=yes
;;
--mpiversion)
tasks="$tasks print_mpiversion"
;;
--cflags)
tasks="$tasks print_cflags"
;;
--ldflags)
tasks="$tasks print_ldflags"
;;
--libs)
tasks="$tasks print_libs"
;;
*)
usage 1 1>&2
;;
esac
shift
done
if test x$MPICC = x ; then
MPICC=mpicc
fi
#
# LIB
#
# load mpi-config.m4
#
# find m4 file
M4DIR=`findm4dir`
eval "$(
m4 -I$M4DIR <<EOF
changequote([, ])
define([AC_DEFUN],[define([\$1],[\$2])])
define([AC_MSG_CHECKING],[
if test $verbose -gt 0; then
echo -n "checking \$@..."
fi
])
define([AC_MSG_RESULT],[
if test $verbose -gt 0; then
echo " \$@"
fi
])
define([AC_MSG_NOTICE],[
if test $verbose -gt 0; then
echo "\$@"
fi
])
define([AC_MSG_ERROR],[
if test $verbose -gt 0; then
echo "Error: \$@"
exit 1
fi
])
include([mpi-config.m4])
MPI_CONFIG_HELPER
EOF
)"
#
# output methods
#
print_mpiversion() {
get_mpiparameters
echo $MPI_VERSION
}
print_cflags() {
get_mpiparameters
if test x$disablecxx = xyes; then
DUNEMPICPPFLAGS="$DUNEMPICPPFLAGS $MPI_NOCXXFLAGS"
fi
echo $DUNEMPICPPFLAGS
}
print_ldflags() {
get_mpiparameters
echo $DUNEMPILDFLAGS
}
print_libs() {
get_mpiparameters
echo $DUNEMPILIBS
}
for task in $tasks; do
eval $task
done
|