From e2e018b68f84599734875ba1230334136a4731ca Mon Sep 17 00:00:00 2001 From: g-mathias <40861554+g-mathias@users.noreply.github.com> Date: Tue, 6 Oct 2020 14:45:27 +0200 Subject: package cuda: fix for chmod error (#17596) * fix if cached cuda is only rx * use shell to install; rm chmod commands * flake8 fix * flake8 fix Co-authored-by: lu64bag3 --- var/spack/repos/builtin/packages/cuda/package.py | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/var/spack/repos/builtin/packages/cuda/package.py b/var/spack/repos/builtin/packages/cuda/package.py index 10d439187d..bcbc6cf689 100644 --- a/var/spack/repos/builtin/packages/cuda/package.py +++ b/var/spack/repos/builtin/packages/cuda/package.py @@ -97,7 +97,7 @@ class Cuda(Package): def setup_build_environment(self, env): if self.spec.satisfies('@10.1.243:'): - libxml2_home = self.spec['libxml2'].prefix + libxml2_home = self.spec['libxml2'].prefix env.set('LIBXML2HOME', libxml2_home) env.append_path('LD_LIBRARY_PATH', libxml2_home.lib) @@ -117,9 +117,6 @@ class Cuda(Package): "presence of /tmp/cuda-installer.log " "please remove the file and try again ") runfile = glob(join_path(self.stage.source_path, 'cuda*_linux*'))[0] - chmod = which('chmod') - chmod('+x', runfile) - runfile = which(runfile) # Note: NVIDIA does not officially support many newer versions of # compilers. For example, on CentOS 6, you must use GCC 4.4.7 or @@ -130,6 +127,7 @@ class Cuda(Package): # CUDA 10.1+ has different cmdline options for the installer arguments = [ + runfile, # the install script '--silent', # disable interactive prompts '--override', # override compiler version checks '--toolkit', # install CUDA Toolkit @@ -139,8 +137,8 @@ class Cuda(Package): else: arguments.append('--verbose') # Verbose log file arguments.append('--toolkitpath=%s' % prefix) # Where to install - - runfile(*arguments) + install_shell = which('sh') + install_shell(*arguments) try: os.remove('/tmp/cuda-installer.log') except OSError: -- cgit v1.2.3-60-g2f50