summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorjonathanmist <jonathanmist@users.noreply.github.com>2020-05-30 17:37:58 +0100
committerJussi Pakkanen <jpakkane@gmail.com>2020-06-02 20:39:49 +0300
commit9ada7e18a898118bcf177ec4d39c677acaee1606 (patch)
treebb8fe9893816fbbb6fcd500dec5bf836bc37d2a2
parent647f19b5aa977e63933bb19b77be97f2a9349934 (diff)
downloadmeson-9ada7e18a898118bcf177ec4d39c677acaee1606.tar.gz
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 9c189be7b..c962cae60 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]