diff options
author | Olexa Bilaniuk <obilaniu@gmail.com> | 2019-01-28 04:29:50 -0500 |
---|---|---|
committer | Olexa Bilaniuk <obilaniu@gmail.com> | 2019-01-31 04:26:37 -0500 |
commit | 4199e6138970e5919c297085d6f904e9ae3dbeff (patch) | |
tree | 5c21a13f034d99a39394fe0049680d371d025c80 /mesonbuild/environment.py | |
parent | d28b75a500e0478deea0a4089c2d4bd334f197c8 (diff) | |
download | meson-4199e6138970e5919c297085d6f904e9ae3dbeff.zip meson-4199e6138970e5919c297085d6f904e9ae3dbeff.tar.gz meson-4199e6138970e5919c297085d6f904e9ae3dbeff.tar.bz2 |
Better NVCC version detection.
Diffstat (limited to 'mesonbuild/environment.py')
-rw-r--r-- | mesonbuild/environment.py | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/mesonbuild/environment.py b/mesonbuild/environment.py index 30d5912..cedbc7e 100644 --- a/mesonbuild/environment.py +++ b/mesonbuild/environment.py @@ -766,7 +766,22 @@ class Environment: except OSError as e: popen_exceptions[' '.join(compiler + [arg])] = e continue - version = search_version(out) + # Example nvcc printout: + # + # nvcc: NVIDIA (R) Cuda compiler driver + # Copyright (c) 2005-2018 NVIDIA Corporation + # Built on Sat_Aug_25_21:08:01_CDT_2018 + # Cuda compilation tools, release 10.0, V10.0.130 + # + # search_version() first finds the "10.0" after "release", + # rather than the more precise "10.0.130" after "V". + # The patch version number is occasionally important; For + # instance, on Linux, + # - CUDA Toolkit 8.0.44 requires NVIDIA Driver 367.48 + # - CUDA Toolkit 8.0.61 requires NVIDIA Driver 375.26 + # Luckily, the "V" also makes it very simple to extract + # the full version: + version = out.strip().split('V')[-1] cls = CudaCompiler return cls(ccache + compiler, version, is_cross, exe_wrap) raise EnvironmentException('Could not find suitable CUDA compiler: "' + ' '.join(compilers) + '"') |