aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorjonathanmist <jonathanmist@users.noreply.github.com>2020-05-30 17:37:58 +0100
committerNirbheek Chauhan <nirbheek@centricular.com>2020-06-11 12:10:06 +0530
commit4d82cfffc5c2adae2cabff8d49557a206de0830b (patch)
tree0419f3e741d5d8e06c3af307bd99611d10ac5e9e
parent2f359ca5f54a9749d7f111af595be579031fe6b3 (diff)
downloadmeson-4d82cfffc5c2adae2cabff8d49557a206de0830b.zip
meson-4d82cfffc5c2adae2cabff8d49557a206de0830b.tar.gz
meson-4d82cfffc5c2adae2cabff8d49557a206de0830b.tar.bz2
dependencies/cuda: Add support for ARM linux
-rw-r--r--mesonbuild/dependencies/cuda.py16
1 files changed, 10 insertions, 6 deletions
diff --git a/mesonbuild/dependencies/cuda.py b/mesonbuild/dependencies/cuda.py
index 9c189be..c962cae 100644
--- a/mesonbuild/dependencies/cuda.py
+++ b/mesonbuild/dependencies/cuda.py
@@ -157,11 +157,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):
@@ -172,7 +176,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)))
@@ -192,7 +196,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]