-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild.sh
More file actions
executable file
·64 lines (57 loc) · 1.2 KB
/
build.sh
File metadata and controls
executable file
·64 lines (57 loc) · 1.2 KB
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
#!/usr/bin/env bash
#
# Copyright (c) 2024, Scitix Tech PTE. LTD. All rights reserved.
#
ROOT_DIR=$(cd $(dirname $0) && pwd)
BUILD_DIR=$ROOT_DIR/build
usage() {
echo " Usage: ./build.sh [OPTIONS]"
echo
echo " OPTIONS:"
echo " --release Build in release mode, default: ON"
echo " --debug Build in debug mode, default: OFF"
echo " --verbose Verbose build"
echo
exit 0
}
CMAKEARGS=""
ARGS=$(getopt -l \
release,\
debug,\
verbose,\
help -o h -- "$@") || usage
eval set -- "$ARGS"
while [ -n "$1" ]; do
case "$1" in
--release)
CMAKEARGS+="-DCMAKE_BUILD_TYPE=Release "
shift
;;
--debug)
CMAKEARGS+="-DCMAKE_BUILD_TYPE=Debug "
shift
;;
--verbose)
CMAKEARGS+="-DCMAKE_VERBOSE_MAKEFILE=ON "
shift
;;
-h|--help)
usage
;;
--)
shift
break
;;
esac
done
[ x$1 != "x" ] && usage
[ -z "$CMAKEARGS" ] || echo "CMake arguments: $CMAKEARGS"
rm -rf $BUILD_DIR && mkdir -p $BUILD_DIR
cmake $CMAKEARGS -B$BUILD_DIR -S$ROOT_DIR && make -C$BUILD_DIR -j8
if [ $? -ne 0 ]; then
echo "failed to build SiCL extensions for NCCL ..."
exit 1
else
echo "SiCL extensions for NCCL: construction completed :-p"
exit 0
fi