@@ -16,9 +16,7 @@ ARGS=$*
16
16
17
17
# NOTE: ensure all dir changes are relative to the location of this
18
18
# script, and that this script resides in the repo dir!
19
- REPODIR=$( cd $( dirname $0 ) ; pwd)
20
-
21
- RAPIDS_VERSION=" $( sed -E -e ' s/^([0-9]{2})\.([0-9]{2})\.([0-9]{2}).*$/\1.\2/' VERSION) "
19
+ REPODIR=$( cd " $( dirname " $0 " ) " ; pwd)
22
20
23
21
# Valid args to this script (all possible targets and options) - only one per line
24
22
VALIDARGS="
@@ -88,40 +86,40 @@ BUILD_DIRS="${LIBCUGRAPH_BUILD_DIR}
88
86
89
87
# Set defaults for vars modified by flags to this script
90
88
VERBOSE_FLAG=" "
91
- CMAKE_VERBOSE_OPTION=" "
89
+ CMAKE_VERBOSE_OPTION=()
92
90
BUILD_TYPE=Release
93
- INSTALL_TARGET=" --target install"
91
+ INSTALL_TARGET=( --target install)
94
92
BUILD_CPP_TESTS=ON
95
93
BUILD_CPP_MG_TESTS=OFF
96
94
BUILD_CPP_MTMG_TESTS=OFF
97
95
BUILD_ALL_GPU_ARCH=0
98
- CMAKE_GENERATOR_OPTION=" -G Ninja"
99
- PYTHON_ARGS_FOR_INSTALL=" -m pip install --no-build-isolation --no-deps --config-settings rapidsai.disable-cuda=true"
96
+ CMAKE_GENERATOR_OPTION=( -G Ninja)
97
+ PYTHON_ARGS_FOR_INSTALL=( -m pip install --no-build-isolation --no-deps --config-settings rapidsai.disable-cuda=true)
100
98
101
99
# Set defaults for vars that may not have been defined externally
102
100
# FIXME: if PREFIX is not set, check CONDA_PREFIX, but there is no fallback
103
101
# from there!
104
102
INSTALL_PREFIX=${PREFIX:= ${CONDA_PREFIX} }
105
- PARALLEL_LEVEL=${PARALLEL_LEVEL:= ` nproc` }
103
+ PARALLEL_LEVEL=${PARALLEL_LEVEL:= $( nproc) }
106
104
BUILD_ABI=${BUILD_ABI:= ON}
107
105
108
106
function hasArg {
109
- (( ${ NUMARGS} != 0 )) && (echo " ${ARGS} " | grep -q " $1 " )
107
+ (( NUMARGS != 0 )) && (echo " ${ARGS} " | grep -q " $1 " )
110
108
}
111
109
112
110
function buildDefault {
113
- (( ${ NUMARGS} == 0 )) || ! (echo " ${ARGS} " | grep -q " [^-][a-zA-Z0-9\_\-]\+ " )
111
+ (( NUMARGS == 0 )) || ! (echo " ${ARGS} " | grep -q " [^-][a-zA-Z0-9\_\-]\+ " )
114
112
}
115
113
116
114
function cleanPythonDir {
117
- pushd $1 > /dev/null
118
- rm -rf dist dask-worker-space cugraph/raft * .egg-info
119
- find . -type d -name __pycache__ -print | xargs rm -rf
120
- find . -type d -name build -print | xargs rm -rf
121
- find . -type d -name dist -print | xargs rm -rf
115
+ pushd " $1 " > /dev/null
116
+ rm -rf dist dask-worker-space cugraph/raft ./ * .egg-info
117
+ find . -type d -name __pycache__ -print0 | xargs -0 rm -rf
118
+ find . -type d -name build -print0 | xargs -0 rm -rf
119
+ find . -type d -name dist -print0 | xargs -0 rm -rf
122
120
find . -type f -name " *.cpp" -delete
123
121
find . -type f -name " *.cpython*.so" -delete
124
- find . -type d -name _external_repositories -print | xargs rm -rf
122
+ find . -type d -name _external_repositories -print0 | xargs -0 rm -rf
125
123
popd > /dev/null
126
124
}
127
125
@@ -131,7 +129,7 @@ if hasArg -h || hasArg --help; then
131
129
fi
132
130
133
131
# Check for valid usage
134
- if (( ${ NUMARGS} != 0 )) ; then
132
+ if (( NUMARGS != 0 )) ; then
135
133
for a in ${ARGS} ; do
136
134
if ! (echo " ${VALIDARGS} " | grep -q " ^[[:blank:]]*${a} $" ); then
137
135
echo " Invalid option: ${a} "
143
141
# Process flags
144
142
if hasArg -v; then
145
143
VERBOSE_FLAG=" -v"
146
- CMAKE_VERBOSE_OPTION=" --log-level=VERBOSE"
144
+ CMAKE_VERBOSE_OPTION=( --log-level=VERBOSE)
147
145
fi
148
146
if hasArg -g; then
149
147
BUILD_TYPE=Debug
150
148
fi
151
149
if hasArg -n; then
152
- INSTALL_TARGET=" "
150
+ INSTALL_TARGET=()
153
151
fi
154
152
if hasArg --allgpuarch; then
155
153
BUILD_ALL_GPU_ARCH=1
@@ -164,33 +162,33 @@ if hasArg cpp-mgtests || hasArg all; then
164
162
BUILD_CPP_MG_TESTS=ON
165
163
fi
166
164
if hasArg --cmake_default_generator; then
167
- CMAKE_GENERATOR_OPTION=" "
165
+ CMAKE_GENERATOR_OPTION=()
168
166
fi
169
167
if hasArg --pydevelop; then
170
- PYTHON_ARGS_FOR_INSTALL= " ${PYTHON_ARGS_FOR_INSTALL} -e "
168
+ PYTHON_ARGS_FOR_INSTALL+=(-e)
171
169
fi
172
170
173
171
SKBUILD_EXTRA_CMAKE_ARGS=" ${EXTRA_CMAKE_ARGS} "
174
172
175
173
# Replace spaces with semicolons in SKBUILD_EXTRA_CMAKE_ARGS
176
- SKBUILD_EXTRA_CMAKE_ARGS=$( echo $ {SKBUILD_EXTRA_CMAKE_ARGS} | sed ' s/ /;/g ' )
174
+ SKBUILD_EXTRA_CMAKE_ARGS=${SKBUILD_EXTRA_CMAKE_ARGS// / ;}
177
175
178
176
# If clean or uninstall targets given, run them prior to any other steps
179
177
if hasArg uninstall; then
180
178
if [[ " $INSTALL_PREFIX " != " " ]]; then
181
- rm -rf ${INSTALL_PREFIX} /include/cugraph
182
- rm -f ${INSTALL_PREFIX} /lib/libcugraph.so
183
- rm -rf ${INSTALL_PREFIX} /include/cugraph_c
184
- rm -f ${INSTALL_PREFIX} /lib/libcugraph_c.so
185
- rm -rf ${INSTALL_PREFIX} /include/cugraph_etl
186
- rm -f ${INSTALL_PREFIX} /lib/libcugraph_etl.so
187
- rm -rf ${INSTALL_PREFIX} /lib/cmake/cugraph
188
- rm -rf ${INSTALL_PREFIX} /lib/cmake/cugraph_etl
179
+ rm -rf " ${INSTALL_PREFIX} /include/cugraph"
180
+ rm -f " ${INSTALL_PREFIX} /lib/libcugraph.so"
181
+ rm -rf " ${INSTALL_PREFIX} /include/cugraph_c"
182
+ rm -f " ${INSTALL_PREFIX} /lib/libcugraph_c.so"
183
+ rm -rf " ${INSTALL_PREFIX} /include/cugraph_etl"
184
+ rm -f " ${INSTALL_PREFIX} /lib/libcugraph_etl.so"
185
+ rm -rf " ${INSTALL_PREFIX} /lib/cmake/cugraph"
186
+ rm -rf " ${INSTALL_PREFIX} /lib/cmake/cugraph_etl"
189
187
fi
190
188
# This may be redundant given the above, but can also be used in case
191
189
# there are other installed files outside of the locations above.
192
- if [ -e ${LIBCUGRAPH_BUILD_DIR} /install_manifest.txt ]; then
193
- xargs rm -f < ${LIBCUGRAPH_BUILD_DIR} /install_manifest.txt > /dev/null 2>&1
190
+ if [ -e " ${LIBCUGRAPH_BUILD_DIR} /install_manifest.txt" ]; then
191
+ xargs rm -f < " ${LIBCUGRAPH_BUILD_DIR} /install_manifest.txt" > /dev/null 2>&1
194
192
fi
195
193
# uninstall cugraph and pylibcugraph installed from a prior install
196
194
# FIXME: if multiple versions of these packages are installed, this only
@@ -204,17 +202,17 @@ if hasArg clean; then
204
202
set +e
205
203
# remove artifacts generated inplace
206
204
if [[ -d ${REPODIR} /python ]]; then
207
- cleanPythonDir ${REPODIR} /python
205
+ cleanPythonDir " ${REPODIR} /python"
208
206
fi
209
207
210
208
# If the dirs to clean are mounted dirs in a container, the contents should
211
209
# be removed but the mounted dirs will remain. The find removes all
212
210
# contents but leaves the dirs, the rmdir attempts to remove the dirs but
213
211
# can fail safely.
214
212
for bd in ${BUILD_DIRS} ; do
215
- if [ -d ${bd} ]; then
216
- find ${bd} -mindepth 1 -delete
217
- rmdir ${bd} || true
213
+ if [ -d " ${bd} " ]; then
214
+ find " ${bd} " -mindepth 1 -delete
215
+ rmdir " ${bd} " || true
218
216
fi
219
217
done
220
218
# Go back to failing on first error for all other operations
@@ -225,128 +223,117 @@ fi
225
223
# Configure, build, and install libcugraph
226
224
if buildDefault || hasArg libcugraph || hasArg all; then
227
225
if hasArg --clean; then
228
- if [ -d ${LIBCUGRAPH_BUILD_DIR} ]; then
229
- find ${LIBCUGRAPH_BUILD_DIR} -mindepth 1 -delete
230
- rmdir ${LIBCUGRAPH_BUILD_DIR} || true
226
+ if [ -d " ${LIBCUGRAPH_BUILD_DIR} " ]; then
227
+ find " ${LIBCUGRAPH_BUILD_DIR} " -mindepth 1 -delete
228
+ rmdir " ${LIBCUGRAPH_BUILD_DIR} " || true
231
229
fi
232
230
else
233
- if (( ${ BUILD_ALL_GPU_ARCH} == 0 )) ; then
231
+ if (( BUILD_ALL_GPU_ARCH == 0 )) ; then
234
232
CUGRAPH_CMAKE_CUDA_ARCHITECTURES=" NATIVE"
235
233
echo " Building for the architecture of the GPU in the system..."
236
234
else
237
235
CUGRAPH_CMAKE_CUDA_ARCHITECTURES=" RAPIDS"
238
236
echo " Building for *ALL* supported GPU architectures..."
239
237
fi
240
- mkdir -p ${LIBCUGRAPH_BUILD_DIR}
241
- cd ${LIBCUGRAPH_BUILD_DIR}
238
+ mkdir -p " ${LIBCUGRAPH_BUILD_DIR} "
239
+ cd " ${LIBCUGRAPH_BUILD_DIR} "
242
240
cmake -B " ${LIBCUGRAPH_BUILD_DIR} " -S " ${REPODIR} /cpp" \
243
- -DCMAKE_INSTALL_PREFIX=${INSTALL_PREFIX} \
241
+ -DCMAKE_INSTALL_PREFIX=" ${INSTALL_PREFIX} " \
244
242
-DCMAKE_CUDA_ARCHITECTURES=${CUGRAPH_CMAKE_CUDA_ARCHITECTURES} \
245
243
-DCMAKE_BUILD_TYPE=${BUILD_TYPE} \
246
244
-DBUILD_TESTS=${BUILD_CPP_TESTS} \
247
245
-DBUILD_CUGRAPH_MG_TESTS=${BUILD_CPP_MG_TESTS} \
248
- -DBUILD_CUGRAPH_MTMG_TESTS=${BUILD_CPP_MTMG_TESTS} \
249
- ${CMAKE_GENERATOR_OPTION} \
250
- ${CMAKE_VERBOSE_OPTION}
251
- cmake --build " ${LIBCUGRAPH_BUILD_DIR} " -j${PARALLEL_LEVEL} ${INSTALL_TARGET} ${VERBOSE_FLAG}
246
+ -DBUILD_CUGRAPH_MTMG_TESTS=${BUILD_CPP_MTMG_TESTS} \
247
+ " ${CMAKE_GENERATOR_OPTION[@]} " \
248
+ " ${CMAKE_VERBOSE_OPTION[@]} "
249
+
250
+ cmake --build " ${LIBCUGRAPH_BUILD_DIR} " " -j${PARALLEL_LEVEL} " " ${INSTALL_TARGET[@]} " " ${VERBOSE_FLAG} "
252
251
fi
253
252
fi
254
253
255
254
# Configure, build, and install libcugraph_etl
256
255
if buildDefault || hasArg libcugraph_etl || hasArg all; then
257
256
if hasArg --clean; then
258
- if [ -d ${LIBCUGRAPH_ETL_BUILD_DIR} ]; then
259
- find ${LIBCUGRAPH_ETL_BUILD_DIR} -mindepth 1 -delete
260
- rmdir ${LIBCUGRAPH_ETL_BUILD_DIR} || true
257
+ if [ -d " ${LIBCUGRAPH_ETL_BUILD_DIR} " ]; then
258
+ find " ${LIBCUGRAPH_ETL_BUILD_DIR} " -mindepth 1 -delete
259
+ rmdir " ${LIBCUGRAPH_ETL_BUILD_DIR} " || true
261
260
fi
262
261
else
263
- if (( ${ BUILD_ALL_GPU_ARCH} == 0 )) ; then
262
+ if (( BUILD_ALL_GPU_ARCH == 0 )) ; then
264
263
CUGRAPH_CMAKE_CUDA_ARCHITECTURES=" NATIVE"
265
264
echo " Building for the architecture of the GPU in the system..."
266
265
else
267
266
CUGRAPH_CMAKE_CUDA_ARCHITECTURES=" RAPIDS"
268
267
echo " Building for *ALL* supported GPU architectures..."
269
268
fi
270
- mkdir -p ${LIBCUGRAPH_ETL_BUILD_DIR}
271
- cd ${LIBCUGRAPH_ETL_BUILD_DIR}
272
- cmake -DCMAKE_INSTALL_PREFIX=${INSTALL_PREFIX} \
273
- -DCMAKE_CUDA_ARCHITECTURES=${CUGRAPH_CMAKE_CUDA_ARCHITECTURES} \
274
- -DDISABLE_DEPRECATION_WARNING=${BUILD_DISABLE_DEPRECATION_WARNING} \
269
+ mkdir -p " ${LIBCUGRAPH_ETL_BUILD_DIR} "
270
+ cd " ${LIBCUGRAPH_ETL_BUILD_DIR} "
271
+ cmake -DCMAKE_INSTALL_PREFIX=" ${INSTALL_PREFIX} " \
272
+ -DCMAKE_CUDA_ARCHITECTURES=" ${CUGRAPH_CMAKE_CUDA_ARCHITECTURES} " \
273
+ -DDISABLE_DEPRECATION_WARNING=" ${BUILD_DISABLE_DEPRECATION_WARNING} " \
275
274
-DCMAKE_BUILD_TYPE=${BUILD_TYPE} \
276
275
-DBUILD_TESTS=${BUILD_CPP_TESTS} \
277
276
-DBUILD_CUGRAPH_MG_TESTS=${BUILD_CPP_MG_TESTS} \
278
277
-DBUILD_CUGRAPH_MTMG_TESTS=${BUILD_CPP_MTMG_TESTS} \
279
- -DCMAKE_PREFIX_PATH=${LIBCUGRAPH_BUILD_DIR} \
280
- ${CMAKE_GENERATOR_OPTION} \
281
- ${CMAKE_VERBOSE_OPTION} \
282
- ${REPODIR} /cpp/libcugraph_etl
283
- cmake --build " ${LIBCUGRAPH_ETL_BUILD_DIR} " -j${PARALLEL_LEVEL} ${INSTALL_TARGET} ${VERBOSE_FLAG}
278
+ -DCMAKE_PREFIX_PATH=" ${LIBCUGRAPH_BUILD_DIR} " \
279
+ " ${CMAKE_GENERATOR_OPTION[@]} " \
280
+ " ${CMAKE_VERBOSE_OPTION[@]} " \
281
+ " ${REPODIR} /cpp/libcugraph_etl"
282
+ cmake --build " ${LIBCUGRAPH_ETL_BUILD_DIR} " " -j${PARALLEL_LEVEL} " " ${INSTALL_TARGET[@]} " " ${VERBOSE_FLAG} "
284
283
fi
285
284
fi
286
285
287
286
# Build, and install pylibcugraph
288
287
if buildDefault || hasArg pylibcugraph || hasArg all; then
289
288
if hasArg --clean; then
290
- cleanPythonDir ${REPODIR} /python/pylibcugraph
289
+ cleanPythonDir " ${REPODIR} /python/pylibcugraph"
291
290
else
292
291
SKBUILD_CMAKE_ARGS=" ${SKBUILD_EXTRA_CMAKE_ARGS} " \
293
- python ${PYTHON_ARGS_FOR_INSTALL} ${REPODIR} /python/pylibcugraph
292
+ python " ${PYTHON_ARGS_FOR_INSTALL[@]} " " ${REPODIR} /python/pylibcugraph"
294
293
fi
295
294
fi
296
295
297
296
# Build and install the cugraph Python package
298
297
if buildDefault || hasArg cugraph || hasArg all; then
299
298
if hasArg --clean; then
300
- cleanPythonDir ${REPODIR} /python/cugraph
299
+ cleanPythonDir " ${REPODIR} /python/cugraph"
301
300
else
302
301
SKBUILD_CMAKE_ARGS=" ${SKBUILD_EXTRA_CMAKE_ARGS} " \
303
- python ${PYTHON_ARGS_FOR_INSTALL} ${REPODIR} /python/cugraph
302
+ python " ${PYTHON_ARGS_FOR_INSTALL[@]} " " ${REPODIR} /python/cugraph"
304
303
fi
305
304
fi
306
305
307
306
# Install the cugraph-service-client and cugraph-service-server Python packages
308
307
if hasArg cugraph-service || hasArg all; then
309
308
if hasArg --clean; then
310
- cleanPythonDir ${REPODIR} /python/cugraph-service
309
+ cleanPythonDir " ${REPODIR} /python/cugraph-service"
311
310
else
312
- python ${PYTHON_ARGS_FOR_INSTALL} ${REPODIR} /python/cugraph-service/client
313
- python ${PYTHON_ARGS_FOR_INSTALL} ${REPODIR} /python/cugraph-service/server
311
+ python " ${PYTHON_ARGS_FOR_INSTALL[@]} " " ${REPODIR} /python/cugraph-service/client"
312
+ python " ${PYTHON_ARGS_FOR_INSTALL[@]} " " ${REPODIR} /python/cugraph-service/server"
314
313
fi
315
314
fi
316
315
317
316
# Build the docs
318
317
if hasArg docs || hasArg all; then
319
- if [ ! -d ${LIBCUGRAPH_BUILD_DIR} ]; then
320
- mkdir -p ${LIBCUGRAPH_BUILD_DIR}
321
- cd ${LIBCUGRAPH_BUILD_DIR}
318
+ if [ ! -d " ${LIBCUGRAPH_BUILD_DIR} " ]; then
319
+ mkdir -p " ${LIBCUGRAPH_BUILD_DIR} "
320
+ cd " ${LIBCUGRAPH_BUILD_DIR} "
322
321
cmake -B " ${LIBCUGRAPH_BUILD_DIR} " -S " ${REPODIR} /cpp" \
323
- -DCMAKE_INSTALL_PREFIX=${INSTALL_PREFIX} \
324
- -DCMAKE_BUILD_TYPE=${BUILD_TYPE} \
325
- ${CMAKE_GENERATOR_OPTION} \
326
- ${CMAKE_VERBOSE_OPTION}
322
+ -DCMAKE_INSTALL_PREFIX=" ${INSTALL_PREFIX} " \
323
+ -DCMAKE_BUILD_TYPE=" ${BUILD_TYPE} " \
324
+ " ${CMAKE_GENERATOR_OPTION[@]} " \
325
+ " ${CMAKE_VERBOSE_OPTION[@]} "
327
326
fi
328
327
329
- # for PROJECT in libwholegraph; do
330
- # XML_DIR="${REPODIR}/docs/cugraph/${PROJECT}"
331
- # rm -rf "${XML_DIR}"
332
- # mkdir -p "${XML_DIR}"
333
- # export XML_DIR_${PROJECT^^}="$XML_DIR"
334
-
335
- # echo "downloading xml for ${PROJECT} into ${XML_DIR}. Environment variable XML_DIR_${PROJECT^^} is set to ${XML_DIR}"
336
- # curl -O "https://d1664dvumjb44w.cloudfront.net/${PROJECT}/xml_tar/${RAPIDS_VERSION}/xml.tar.gz"
337
- # tar -xzf xml.tar.gz -C "${XML_DIR}"
338
- # rm "./xml.tar.gz"
339
- # done
340
-
341
- cd ${LIBCUGRAPH_BUILD_DIR}
342
- cmake --build " ${LIBCUGRAPH_BUILD_DIR} " -j${PARALLEL_LEVEL} --target docs_cugraph ${VERBOSE_FLAG}
328
+ cd " ${LIBCUGRAPH_BUILD_DIR} "
329
+ cmake --build " ${LIBCUGRAPH_BUILD_DIR} " " -j${PARALLEL_LEVEL} " --target docs_cugraph ${VERBOSE_FLAG}
343
330
344
331
echo " making libcugraph doc dir"
345
- rm -rf ${REPODIR} /docs/cugraph/libcugraph
346
- mkdir -p ${REPODIR} /docs/cugraph/libcugraph
332
+ rm -rf " ${REPODIR} /docs/cugraph/libcugraph"
333
+ mkdir -p " ${REPODIR} /docs/cugraph/libcugraph"
347
334
348
335
export XML_DIR_LIBCUGRAPH=" ${REPODIR} /cpp/doxygen/xml"
349
336
350
- cd ${REPODIR} /docs/cugraph
337
+ cd " ${REPODIR} /docs/cugraph"
351
338
make html
352
339
fi
0 commit comments