summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorg-mathias <40861554+g-mathias@users.noreply.github.com>2020-10-06 14:45:27 +0200
committerGitHub <noreply@github.com>2020-10-06 07:45:27 -0500
commite2e018b68f84599734875ba1230334136a4731ca (patch)
treeea7d0609f13eb0e8accc3a3b893037ce2d97d34b
parent87ac0ae3e353160ab49c09df022fc6e0e53e6a24 (diff)
downloadspack-e2e018b68f84599734875ba1230334136a4731ca.tar.gz
spack-e2e018b68f84599734875ba1230334136a4731ca.tar.bz2
spack-e2e018b68f84599734875ba1230334136a4731ca.tar.xz
spack-e2e018b68f84599734875ba1230334136a4731ca.zip
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 <gerald.mathias@lrz.de>
-rw-r--r--var/spack/repos/builtin/packages/cuda/package.py10
1 files 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: