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>
This commit is contained in:
		| @@ -97,7 +97,7 @@ def determine_version(cls, exe): | ||||
| 
 | ||||
|     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 @@ def install(self, spec, prefix): | ||||
|                             "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 @@ def install(self, spec, prefix): | ||||
| 
 | ||||
|         # 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 @@ def install(self, spec, prefix): | ||||
|         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: | ||||
|   | ||||
		Reference in New Issue
	
	Block a user
	 g-mathias
					g-mathias