#!/bin/sh
# Intel(R) Application Debugger for Linux
# -----------------------------------------------------------------------------
#        Copyright (C) 2000-2013 Intel Corporation. All rights reserved.
#
# This file is owned by Intel Corporation or its suppliers or licensors,
# and is furnished under license.  It may only be used or copied in accordance
# with the terms of that license.  Unless otherwise provided in that license,
# it is provided AS IS, with no warranties of any kind, express or implied.
# Except as expressly permitted by that license, neither Intel Corporation nor
# its suppliers assumes any responsibility or liability for any errors or
# inaccuracies that may appear herein. Except as expressly permitted by that
# license, no part of the Software may be reproduced, stored in a retrieval
# system, transmitted in any form, or distributed by any means without the
# express written consent of Intel Corporation. Title to this material remains
# with Intel Corporation or its suppliers and licensors.
# -----------------------------------------------------------------------------
INSTALLDIR=/opt/intel/composer_xe_2013.2.146

export IDBC_HOST=$INSTALLDIR/bin/intel64/idbc
export IDBC_MIC=$INSTALLDIR/bin/intel64_mic/idbc_mic

export LD_LIBRARY_PATH=$INSTALLDIR/debugger/lib/intel64:$INSTALLDIR/debugger/mic/lib/intel64:$LD_LIBRARY_PATH

which $IDBC_HOST &> /dev/null
if [ $? -ne 0 ]; then
    echo "Cannot find IDB's host engine."
    exit 1
fi

which $IDBC_MIC &> /dev/null
if [ $? -ne 0 ]; then
    echo "Cannot find IDB's MIC engine."
    exit 1;
fi

$INSTALLDIR/bin/intel64_mic/mpm $@

