-
Notifications
You must be signed in to change notification settings - Fork 17
/
Copy pathrun_ibs_test.sh
executable file
·33 lines (30 loc) · 1.05 KB
/
run_ibs_test.sh
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
#!/bin/bash
# Copyright (c) 2015-2017 Advanced Micro Devices, Inc. All rights reserved.
#
# This file is made available under a 3-clause BSD license.
# See tools/LICENSE for licensing details.
BASE_DIR=$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)
if [ ! -f ${BASE_DIR}/ibs_test ]; then
echo -e "${BASE_DIR}/ibs_test does not exist. Exiting."
exit -1
fi
if ldd ${BASE_DIR}/ibs_test | grep -q "libibs.so => not found"; then
echo -e "libibs.so is not in the LD_LIBRARY_PATH. Trying to add it.."
if [ ! -f ${BASE_DIR}/../../lib/libibs.so ]; then
echo -e "${BASE_DIR}/../../lib/libibs.so does not exist. Trying to build it.."
pushd ${BASE_DIR}/../../lib/
make
if [ $? -ne 0 ]; then
echo -e "Failed to build libibs.so. Exiting."
exit -1
fi
popd
fi
export LD_LIBRARY_PATH=${BASE_DIR}/../../lib/:$LD_LIBRARY_PATH
fi
if [ ! -f ${BASE_DIR}/../../lib/libibs.so ]; then
echo -e "Cannot find ${BASE_DIR}/../../lib/libibs.so. Exiting."
exit -1
else
${BASE_DIR}/ibs_test
fi