diff options
author | John Ericson <git@JohnEricson.me> | 2020-08-03 11:48:27 -0400 |
---|---|---|
committer | John Ericson <git@JohnEricson.me> | 2020-08-03 11:48:27 -0400 |
commit | eaf6343c065842b9719793066e765b2e5f1c2f3b (patch) | |
tree | 1bfeac5297ba489721e704e63c28f33d0fb98990 /mesonbuild/dependencies/cuda.py | |
parent | 87aa98c1787d800145853a8e84654e4c54ee1078 (diff) | |
parent | 70edf82c6c77902cd64f44848302bbac92d611d8 (diff) | |
download | meson-lang-enum.zip meson-lang-enum.tar.gz meson-lang-enum.tar.bz2 |
Merge remote-tracking branch 'upstream/master' into lang-enumlang-enum
Diffstat (limited to 'mesonbuild/dependencies/cuda.py')
-rw-r--r-- | mesonbuild/dependencies/cuda.py | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/mesonbuild/dependencies/cuda.py b/mesonbuild/dependencies/cuda.py index 063fa6d..d197f8c 100644 --- a/mesonbuild/dependencies/cuda.py +++ b/mesonbuild/dependencies/cuda.py @@ -158,11 +158,15 @@ class CudaDependency(ExternalDependency): mlog.debug('Falling back to extracting version from path') path_version_regex = self.path_version_win_regex if self._is_windows() else self.path_version_nix_regex - m = path_version_regex.match(os.path.basename(path)) - if m: - return m[1] + try: + m = path_version_regex.match(os.path.basename(path)) + if m: + return m.group(1) + else: + mlog.warning('Could not detect CUDA Toolkit version for {}'.format(path)) + except Exception as e: + mlog.warning('Could not detect CUDA Toolkit version for {}: {}'.format(path, str(e))) - mlog.warning('Could not detect CUDA Toolkit version for {}'.format(path)) return '0.0' def _read_toolkit_version_txt(self, path): @@ -173,7 +177,7 @@ class CudaDependency(ExternalDependency): version_str = version_file.readline() # e.g. 'CUDA Version 10.1.168' m = self.toolkit_version_regex.match(version_str) if m: - return self._strip_patch_version(m[1]) + return self._strip_patch_version(m.group(1)) except Exception as e: mlog.debug('Could not read CUDA Toolkit\'s version file {}: {}'.format(version_file_path, str(e))) @@ -193,7 +197,7 @@ class CudaDependency(ExternalDependency): raise DependencyException(msg.format(arch, 'Windows')) return os.path.join('lib', libdirs[arch]) elif machine.is_linux(): - libdirs = {'x86_64': 'lib64', 'ppc64': 'lib'} + libdirs = {'x86_64': 'lib64', 'ppc64': 'lib', 'aarch64': 'lib64'} if arch not in libdirs: raise DependencyException(msg.format(arch, 'Linux')) return libdirs[arch] |