@@ -38,10 +38,16 @@ prepare_fbgemm_gpu_build () {
38
38
git submodule sync
39
39
git submodule update --init --recursive
40
40
41
+ # shellcheck disable=SC2155
42
+ local env_prefix=$( env_name_or_prefix " ${env_name} " )
43
+
41
44
echo " [BUILD] Installing other build dependencies ..."
42
- (exec_with_retries conda run --no-capture-output -n " ${env_name} " python -m pip install -r requirements.txt) || return 1
45
+ # shellcheck disable=SC2086
46
+ (exec_with_retries conda run --no-capture-output ${env_prefix} python -m pip install -r requirements.txt) || return 1
43
47
48
+ # shellcheck disable=SC2086
44
49
(test_python_import_package " ${env_name} " numpy) || return 1
50
+ # shellcheck disable=SC2086
45
51
(test_python_import_package " ${env_name} " skbuild) || return 1
46
52
47
53
echo " [BUILD] Successfully ran git submodules update"
@@ -76,7 +82,8 @@ __configure_fbgemm_gpu_build_rocm () {
76
82
fi
77
83
78
84
echo " [BUILD] Setting the following ROCm targets: ${arch_list} "
79
- print_exec conda env config vars set -n " ${env_name} " PYTORCH_ROCM_ARCH=" ${arch_list} "
85
+ # shellcheck disable=SC2086
86
+ print_exec conda env config vars set ${env_prefix} PYTORCH_ROCM_ARCH=" ${arch_list} "
80
87
81
88
echo " [BUILD] Setting ROCm build args ..."
82
89
build_args=()
@@ -121,8 +128,8 @@ __configure_fbgemm_gpu_build_cuda () {
121
128
122
129
# Build only CUDA 7.0 and 8.0 (i.e. V100 and A100) because of 100 MB binary size limits from PyPI.
123
130
echo " [BUILD] Setting CUDA build args ..."
124
- # shellcheck disable=SC2155
125
- local nvml_lib_path=$( conda run --no-capture-output -n " ${env_name} " printenv NVML_LIB_PATH)
131
+ # shellcheck disable=SC2155,SC2086
132
+ local nvml_lib_path=$( conda run --no-capture-output ${env_prefix} printenv NVML_LIB_PATH)
126
133
build_args=(
127
134
--nvml_lib_path=" ${nvml_lib_path} "
128
135
-DTORCH_CUDA_ARCH_LIST=" '${arch_list} '"
@@ -192,16 +199,17 @@ __build_fbgemm_gpu_common_pre_steps () {
192
199
echo " [BUILD] Determined Python package name to use: ${package_name} "
193
200
194
201
# Extract the Python tag
195
- # shellcheck disable=SC2207
196
- python_version=($( conda run --no-capture-output -n " ${env_name} " python --version) )
202
+ # shellcheck disable=SC2207,SC2086
203
+ python_version=($( conda run --no-capture-output ${env_prefix} python --version) )
197
204
# shellcheck disable=SC2206
198
205
python_version_arr=(${python_version[1]// ./ } )
199
206
python_tag=" py${python_version_arr[0]}${python_version_arr[1]} "
200
207
echo " [BUILD] Extracted Python tag: ${python_tag} "
201
208
202
209
echo " [BUILD] Running pre-build cleanups ..."
203
210
print_exec rm -rf dist
204
- print_exec conda run --no-capture-output -n " ${env_name} " python setup.py clean
211
+ # shellcheck disable=SC2086
212
+ print_exec conda run --no-capture-output ${env_prefix} python setup.py clean
205
213
206
214
echo " [BUILD] Printing git status ..."
207
215
print_exec git status
@@ -290,6 +298,9 @@ build_fbgemm_gpu_package () {
290
298
return 1
291
299
fi
292
300
301
+ # shellcheck disable=SC2155
302
+ local env_prefix=$( env_name_or_prefix " ${env_name} " )
303
+
293
304
# Set up and configure the build
294
305
__build_fbgemm_gpu_common_pre_steps || return 1
295
306
__configure_fbgemm_gpu_build " ${fbgemm_variant} " " ${fbgemm_variant_targets} " || return 1
@@ -320,7 +331,8 @@ build_fbgemm_gpu_package () {
320
331
321
332
# Distribute Python extensions as wheels on Linux
322
333
echo " [BUILD] Building FBGEMM-GPU wheel (VARIANT=${fbgemm_variant} ) ..."
323
- print_exec conda run --no-capture-output -n " ${env_name} " \
334
+ # shellcheck disable=SC2086
335
+ print_exec conda run --no-capture-output ${env_prefix} \
324
336
python setup.py " ${run_multicore} " bdist_wheel \
325
337
--package_name=" ${package_name} " \
326
338
--python-tag=" ${python_tag} " \
@@ -356,6 +368,9 @@ build_fbgemm_gpu_install () {
356
368
return 1
357
369
fi
358
370
371
+ # shellcheck disable=SC2155
372
+ local env_prefix=$( env_name_or_prefix " ${env_name} " )
373
+
359
374
# Set up and configure the build
360
375
__build_fbgemm_gpu_common_pre_steps || return 1
361
376
__configure_fbgemm_gpu_build " ${fbgemm_variant} " " ${fbgemm_variant_targets} " || return 1
@@ -370,7 +385,8 @@ build_fbgemm_gpu_install () {
370
385
# Parallelism may need to be limited to prevent the build from being
371
386
# canceled for going over ulimits
372
387
echo " [BUILD] Building + installing FBGEMM-GPU (VARIANT=${fbgemm_variant} ) ..."
373
- print_exec conda run --no-capture-output -n " ${env_name} " \
388
+ # shellcheck disable=SC2086
389
+ print_exec conda run --no-capture-output ${env_prefix} \
374
390
python setup.py install " ${build_args[@]} "
375
391
376
392
# Run checks on the built libraries
@@ -400,6 +416,9 @@ build_fbgemm_gpu_develop () {
400
416
return 1
401
417
fi
402
418
419
+ # shellcheck disable=SC2155
420
+ local env_prefix=$( env_name_or_prefix " ${env_name} " )
421
+
403
422
# Set up and configure the build
404
423
__build_fbgemm_gpu_common_pre_steps || return 1
405
424
__configure_fbgemm_gpu_build " ${fbgemm_variant} " " ${fbgemm_variant_targets} " || return 1
@@ -414,7 +433,8 @@ build_fbgemm_gpu_develop () {
414
433
# Parallelism may need to be limited to prevent the build from being
415
434
# canceled for going over ulimits
416
435
echo " [BUILD] Building (develop) FBGEMM-GPU (VARIANT=${fbgemm_variant} ) ..."
417
- print_exec conda run --no-capture-output -n " ${env_name} " \
436
+ # shellcheck disable=SC2086
437
+ print_exec conda run --no-capture-output ${env_prefix} \
418
438
python setup.py build develop " ${build_args[@]} "
419
439
420
440
# Run checks on the built libraries
0 commit comments