blob: 05f955db208df86cd6417c61e9bf03af8160d5ca [file] [log] [blame]
#!/bin/sh
# This script uses MESOS_SOURCE_DIR and MESOS_BUILD_DIR which come
# from configuration substitutions.
MESOS_SOURCE_DIR=@abs_top_srcdir@
MESOS_BUILD_DIR=@abs_top_builddir@
# Use colors for errors.
. ${MESOS_SOURCE_DIR}/support/colors.sh
# Force the use of the Python interpreter configured during building.
test ! -z "${PYTHON}" && \
echo "${RED}Ignoring PYTHON environment variable (using @PYTHON@)${NORMAL}"
PYTHON=@PYTHON@
DISTRIBUTE_EGG=`echo ${MESOS_BUILD_DIR}/third_party/distribute-*/dist/*.egg`
test ! -e ${DISTRIBUTE_EGG} && \
echo "${RED}Failed to find ${DISTRIBUTE_EGG}${NORMAL}" && \
exit 1
PROTOBUF=${MESOS_BUILD_DIR}/third_party/protobuf-2.4.1
PROTOBUF_EGG=`echo ${PROTOBUF}/python/dist/protobuf*.egg`
test ! -e ${PROTOBUF_EGG} && \
echo "${RED}Failed to find ${PROTOBUF_EGG}${NORMAL}" && \
exit 1
MESOS_EGG=`echo ${MESOS_BUILD_DIR}/src/python/dist/mesos*.egg`
test ! -e ${MESOS_EGG} && \
echo "${RED}Failed to find ${MESOS_EGG}${NORMAL}" && \
exit 1
SCRIPT=`dirname ${0}`/mpiexec-mesos.py
test ! -e ${SCRIPT} && \
echo "${RED}Failed to find ${SCRIPT}${NORMAL}" && \
exit 1
PYTHONPATH="${DISTRIBUTE_EGG}:${MESOS_EGG}:${PROTOBUF_EGG}" \
exec ${PYTHON} ${SCRIPT} "${@}"