-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathbuild_doc.sh
More file actions
executable file
·60 lines (51 loc) · 1.3 KB
/
build_doc.sh
File metadata and controls
executable file
·60 lines (51 loc) · 1.3 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
#!/bin/bash
# Define directoriesi
CURRENT_DIR=$(pwd)
INSTALL_PATH="${INSTALL_PATH:-$HOME}"
# Default values
NUM_JOBS=1 # Default number of jobs
BUILD_DOCS=OFF # Default: Do not build documentation
BUILD_TYPE="Release" # Default: Release mode
# Parse command-line arguments
while [[ $# -gt 0 ]]; do
case $1 in
-j|--jobs)
NUM_JOBS="$2"
shift 2
;;
--debug)
BUILD_TYPE="Debug"
shift
;;
--install-dir)
INSTALL_DIR="$2"
shift 2
;;
--build-docs)
BUILD_DOCS=ON
shift
;;
*)
echo "Unknown option: $1"
exit 1
;;
esac
done
BUILD_DIR=${CURRENT_DIR}"/build"
# Create directories if they don't exist
mkdir -p "${BUILD_DIR}"
cd "${BUILD_DIR}" || { echo "Failed to navigate back to the original directory."; exit 1; }
echo "Configuring the MQSS CudaQ Adapter repository CMake..."
cmake .. \
-DCMAKE_C_COMPILER=gcc \
-DCMAKE_CXX_COMPILER=g++ \
-DBUILD_CUDAQ_ADAPTER_DOCS="${BUILD_DOCS}"\
-DCMAKE_INSTALL_PREFIX=${INSTALL_PATH}\
-DCMAKE_BUILD_TYPE="${BUILD_TYPE}"
if [ $? -ne 0 ]; then
echo "CMake configuration failed."
exit 1
fi
echo "Building the MQSS CudaQ Adapter documentation with ${NUM_JOBS} jobs..."
make -j"${NUM_JOBS}"
echo "Build of the MQSS CudaQ Adapter documentation completed successfully!..."