summaryrefslogtreecommitdiff
path: root/var/spack/repos/builtin/packages/mumax/package.py
diff options
context:
space:
mode:
Diffstat (limited to 'var/spack/repos/builtin/packages/mumax/package.py')
-rw-r--r--var/spack/repos/builtin/packages/mumax/package.py69
1 files changed, 35 insertions, 34 deletions
diff --git a/var/spack/repos/builtin/packages/mumax/package.py b/var/spack/repos/builtin/packages/mumax/package.py
index b80d1ff25e..7089403d7b 100644
--- a/var/spack/repos/builtin/packages/mumax/package.py
+++ b/var/spack/repos/builtin/packages/mumax/package.py
@@ -13,39 +13,41 @@ class Mumax(MakefilePackage, CudaPackage):
"""GPU accelerated micromagnetic simulator."""
homepage = "https://mumax.github.io"
- url = "https://github.com/mumax/3/archive/v3.10.tar.gz"
+ url = "https://github.com/mumax/3/archive/v3.10.tar.gz"
- maintainers = ['glennpj']
+ maintainers = ["glennpj"]
- version('3.10',
- sha256='42c858661cec3896685ff4babea11e711f71fd6ea37d20c2bed7e4a918702caa',
- preferred=True)
- version('3.10beta',
- sha256='f20fbd90a4b531fe5a0d8acc3d4505a092a5e426f5f53218a22a87d445daf0e9',
- url='https://github.com/mumax/3/archive/3.10beta.tar.gz')
+ version(
+ "3.10",
+ sha256="42c858661cec3896685ff4babea11e711f71fd6ea37d20c2bed7e4a918702caa",
+ preferred=True,
+ )
+ version(
+ "3.10beta",
+ sha256="f20fbd90a4b531fe5a0d8acc3d4505a092a5e426f5f53218a22a87d445daf0e9",
+ url="https://github.com/mumax/3/archive/3.10beta.tar.gz",
+ )
- variant('cuda', default=True,
- description='Use CUDA; must be true')
- variant('gnuplot', default=False,
- description='Use gnuplot for graphs')
+ variant("cuda", default=True, description="Use CUDA; must be true")
+ variant("gnuplot", default=False, description="Use gnuplot for graphs")
- depends_on('cuda')
- depends_on('go@:1.15', type='build')
- depends_on('gnuplot', type='run', when='+gnuplot')
+ depends_on("cuda")
+ depends_on("go@:1.15", type="build")
+ depends_on("gnuplot", type="run", when="+gnuplot")
- conflicts('~cuda', msg='mumax requires cuda')
+ conflicts("~cuda", msg="mumax requires cuda")
- patch('https://github.com/mumax/3/commit/2cf5c9a6985c9eb16a124c6bd96aed75b4a30c24.patch?full_index=1',
- sha256='4bbb95aacdac7e2cbcb37ee8adcfb9464e69965f984c264ff094dc1cca10589b',
- when='@3.10beta')
+ patch(
+ "https://github.com/mumax/3/commit/2cf5c9a6985c9eb16a124c6bd96aed75b4a30c24.patch?full_index=1",
+ sha256="4bbb95aacdac7e2cbcb37ee8adcfb9464e69965f984c264ff094dc1cca10589b",
+ when="@3.10beta",
+ )
@property
def cuda_arch(self):
- cuda_arch = ' '.join(self.spec.variants['cuda_arch'].value)
- if cuda_arch == 'none':
- raise InstallError(
- 'Must select at least one value for cuda_arch'
- )
+ cuda_arch = " ".join(self.spec.variants["cuda_arch"].value)
+ if cuda_arch == "none":
+ raise InstallError("Must select at least one value for cuda_arch")
return cuda_arch
@property
@@ -54,7 +56,7 @@ class Mumax(MakefilePackage, CudaPackage):
@property
def mumax_gopath_dir(self):
- return join_path(self.gopath, 'src/github.com/mumax/3')
+ return join_path(self.gopath, "src/github.com/mumax/3")
def do_stage(self, mirror_only=False):
super(Mumax, self).do_stage(mirror_only)
@@ -66,20 +68,19 @@ class Mumax(MakefilePackage, CudaPackage):
# filter out targets that do not exist
def edit(self, spec, prefix):
- filter_file(r'(^all: cudakernels) hooks$', r'\1', 'Makefile')
+ filter_file(r"(^all: cudakernels) hooks$", r"\1", "Makefile")
- @when('@3.10beta')
+ @when("@3.10beta")
def edit(self, spec, prefix):
- filter_file(r'(^ln -sf .*)', r'#\1', 'make.bash')
- filter_file(r'(^\(cd test)', r'#\1', 'make.bash')
- filter_file(r'(for cc in ).*(; do)', r'\1{0}\2'.format(self.cuda_arch),
- 'cuda/make.bash')
+ filter_file(r"(^ln -sf .*)", r"#\1", "make.bash")
+ filter_file(r"(^\(cd test)", r"#\1", "make.bash")
+ filter_file(r"(for cc in ).*(; do)", r"\1{0}\2".format(self.cuda_arch), "cuda/make.bash")
def setup_build_environment(self, env):
- env.prepend_path('GOPATH', self.gopath)
- env.set('CUDA_CC', self.cuda_arch)
+ env.prepend_path("GOPATH", self.gopath)
+ env.set("CUDA_CC", self.cuda_arch)
def install(self, spec, prefix):
make()
with working_dir(self.gopath):
- install_tree('bin', prefix.bin)
+ install_tree("bin", prefix.bin)