forked from facebookresearch/habitat-sim
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.sh
executable file
·53 lines (46 loc) · 1.12 KB
/
build.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
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
#!/usr/bin/env bash
# Copyright (c) Facebook, Inc. and its affiliates.
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
builder_args=()
while [[ $# -gt 0 ]]
do
key="$1"
case $key in
--run-tests)
shift
RUN_TESTS=true
builder_args+=("--build-tests")
;;
*) # Forward unknown args to builder
shift
builder_args+=("$key")
;;
esac
done
# devfair/learnfair custom stuff: EGL path, and module loads
my_hostname=`hostname`
if [[ $my_hostname =~ "fair" ]]; then
module purge
module load cuda/9.0
module load cudnn/v7.0-cuda.9.0
module load gcc/7.1.0
module load cmake/3.10.1/gcc.5.4.0
fi
python setup.py build_ext --inplace "${builder_args[@]}"
if [ "$RUN_TESTS" = true ] ; then
cd ..
echo "Running tests..."
TEST_SCRIPTS=$(find "build/tests" -type f -perm +111)
declare -i RET_VAL=0
for test_script in $TEST_SCRIPTS ; do
echo "Running $test_script"
$test_script
RET_VAL+=$?
done
if [ "$RET_VAL" -ne 0 ] ; then
echo "Some tests failed."
else
echo "All tests passed."
fi
fi