namd: added cuda support (#20143)

This commit is contained in:
fcannini 2020-12-02 16:22:12 -03:00 committed by GitHub
parent 651bd50d86
commit 007ff2a6b0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -10,7 +10,7 @@
import llnl.util.tty as tty import llnl.util.tty as tty
class Namd(MakefilePackage): class Namd(MakefilePackage, CudaPackage):
"""NAMDis a parallel molecular dynamics code designed for """NAMDis a parallel molecular dynamics code designed for
high-performance simulation of large biomolecular systems.""" high-performance simulation of large biomolecular systems."""
@ -54,6 +54,12 @@ class Namd(MakefilePackage):
depends_on('tcl', when='interface=python') depends_on('tcl', when='interface=python')
depends_on('python', when='interface=python') depends_on('python', when='interface=python')
# https://www.ks.uiuc.edu/Research/namd/2.12/features.html
# https://www.ks.uiuc.edu/Research/namd/2.13/features.html
# https://www.ks.uiuc.edu/Research/namd/2.14/features.html
depends_on('cuda@6.5.14:7.5.18', when='@2.12 +cuda')
depends_on('cuda@8.0.61:', when='@2.13: +cuda')
def _copy_arch_file(self, lib): def _copy_arch_file(self, lib):
config_filename = 'arch/{0}.{1}'.format(self.arch, lib) config_filename = 'arch/{0}.{1}'.format(self.arch, lib)
copy('arch/Linux-x86_64.{0}'.format(lib), copy('arch/Linux-x86_64.{0}'.format(lib),
@ -216,6 +222,12 @@ def edit(self, spec, prefix):
'--without-python' '--without-python'
]) ])
if '+cuda' in spec:
self._append_option(opts, 'cuda')
filter_file('^CUDADIR=.*$',
'CUDADIR={0}'.format(spec['cuda'].prefix),
self.arch + '.cuda')
config = Executable('./config') config = Executable('./config')
config(self.build_directory, *opts) config(self.build_directory, *opts)