11#! /usr/bin/env bash
2- params=" $( getopt -o d:ictpg -l directory:,install, clean,torch,python,global,no -cuda,no -deps --name " $( basename " $0 " ) " -- " $@ " ) "
2+ params=" $( getopt -o d:ctpg -l directory:,clean,torch,python,global,with -cuda,with -deps --name " $( basename " $0 " ) " -- " $@ " ) "
33
44if [ $? -ne 0 ]
55then
66 print_usage
77fi
88
99print_usage () {
10- printf " bash $0 [-d|--directory <workspace directory>] [-i|--install] [- c|--clean] [-t|--torch <build with libtorch>] [-p|--python <install python bindings>] [-g|--global] [--no -cuda <cpu only>] [--no -deps <do not install dependencies>]\n"
10+ printf " bash $0 [-d|--directory <workspace directory>] [-c|--clean] [-t|--torch <build with libtorch>] [-p|--python <install python bindings>] [-g|--global] [--with -cuda <cpu only>] [--with -deps <install dependencies>]\n"
1111}
1212
1313# Get directory of script
@@ -18,16 +18,17 @@ WITH_TORCH=0
1818eval set -- " $params "
1919unset params
2020
21+ INSTALL=true
2122while true ; do
2223 case ${1} in
2324 -i|--install) INSTALL=true; shift ;;
24- -c|--clean) CLEAN=true; shift ;;
25+ -c|--clean) CLEAN=true; INSTALL=false ; shift ;;
2526 -t|--torch) WITH_TORCH=ON; shift ;;
2627 -p|--python) WITH_PYTHON=true; shift ;;
2728 -d|--directory) WS_DIR+=(" ${2} " ); shift 2;;
2829 -g|--global) GLOBAL=true; shift ;;
29- --no -cuda) NOCUDA=true ; shift ;;
30- --no -deps) WITH_DEPS=false ; shift ;;
30+ --with -cuda) WITH_CUDA=ON ; shift ;;
31+ --with -deps) WITH_DEPS=true ; shift ;;
3132 --) shift ; break ;;
3233 * ) print_usage
3334 exit 1 ;;
4041 # If not global then install to workspace
4142 if [[ ! ${GLOBAL} ]]
4243 then
43- INSTALL_DIR=${WS_DIR} /install/CoverageControl/
44+ INSTALL_DIR=${WS_DIR} /install/
4445 CMAKE_END_FLAGS=" ${CMAKE_END_FLAGS} -DCMAKE_INSTALL_PREFIX=${INSTALL_DIR} "
4546 fi
4647else
4748 TMP_DIR=$( mktemp -d)
4849 BUILD_DIR=${TMP_DIR} /build
4950fi
5051
51- if [[ ${NOCUDA} ]]
52+ # Check WITH_CUDA
53+ if [[ ${WITH_CUDA} == " ON" ]]
5254then
55+ CMAKE_END_FLAGS=" ${CMAKE_END_FLAGS} -DWITH_CUDA=ON"
56+ else
5357 CMAKE_END_FLAGS=" ${CMAKE_END_FLAGS} -DWITH_CUDA=OFF"
5458fi
59+
5560if [[ ${WITH_TORCH} == " ON" ]]
5661then
5762 CMAKE_END_FLAGS=" ${CMAKE_END_FLAGS} -DCMAKE_PREFIX_PATH=${Torch_DIR} "
5863fi
5964
60- InstallCoverageControlCore () {
61- cmake -S ${DIR} /core -B ${BUILD_DIR} /CoverageControlCore ${CMAKE_END_FLAGS}
62- cmake --build ${BUILD_DIR} /CoverageControlCore -j$( nproc)
65+ InstallCoverageControl () {
66+ cmake -S ${DIR} /core -B ${BUILD_DIR} /CoverageControl ${CMAKE_END_FLAGS}
67+ cmake --build ${BUILD_DIR} /CoverageControl -j$( nproc)
6368 if [ $? -ne 0 ]; then
64- echo " CoverageControlCore build failed"
69+ echo " CoverageControl build failed"
6570 exit 1
6671 fi
67- cmake --install ${BUILD_DIR} /CoverageControlCore
72+ cmake --install ${BUILD_DIR} /CoverageControl
6873 if [ $? -ne 0 ]; then
69- echo " CoverageControlCore install failed"
74+ echo " CoverageControl install failed"
7075 fi
7176
72- echo " Successfully built and installed CoverageControlCore "
77+ echo " Successfully built and installed CoverageControl "
7378}
7479
7580InstallCoverageControlTorch () {
@@ -121,15 +126,15 @@ InstallCoverageControlMain () {
121126
122127if [[ ${INSTALL} ]]
123128then
124- echo " Installing CoverageControlCore "
125- InstallCoverageControlCore
129+ echo " Installing CoverageControl "
130+ InstallCoverageControl
126131 if [[ ${WITH_TORCH} == " ON" ]]
127132 then
128133 echo " Installing CoverageControlTorch"
129134 InstallCoverageControlTorch
130135 fi
131136 # echo "Installing CoverageControlTests"
132- InstallCoverageControlTests
137+ # InstallCoverageControlTests
133138 echo " Installing CoverageControlMain"
134139 InstallCoverageControlMain
135140fi
0 commit comments