From 1540c582c1ebedd5ca25f7d1ce79c03a5a320649 Mon Sep 17 00:00:00 2001 From: Lucas Gandel Date: Mon, 11 Apr 2022 14:15:19 +0200 Subject: [PATCH] ENH: Configure wheel name when CUDA is used Parse CMake arguments in setup.py to extract CUDA version from CUDAToolkit_ROOT. WARNING: This works only on Linux when users keep the default installation path for CUDA. Future commits should use a more robust approach that works on Windows too. --- setup.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/setup.py b/setup.py index f93dffbf5..238632251 100644 --- a/setup.py +++ b/setup.py @@ -10,8 +10,15 @@ print(' python -m pip install scikit-build') sys.exit(1) +# Configure wheel name if CUDA is used +wheel_name='itk-rtk' +# Extract cuda version from the last folder name in CUDAToolkit_ROOT path. +for arg in sys.argv: + if "CUDAToolkit_ROOT" in str(arg): + wheel_name += ('-' + arg.rsplit('/', 1)[-1]) + setup( - name='itk-rtk', + name=wheel_name, version='2.3.0', author='RTK Consortium', author_email='rtk-users@openrtk.org',