Octopus: refactor AutotoolsPackage (#33526)
This commit is contained in:
parent
49d7aa21fd
commit
bde4d1e38c
@ -5,12 +5,13 @@
|
|||||||
|
|
||||||
import os
|
import os
|
||||||
|
|
||||||
|
import llnl.util.filesystem as fs
|
||||||
import llnl.util.tty as tty
|
import llnl.util.tty as tty
|
||||||
|
|
||||||
from spack.package import *
|
from spack.package import *
|
||||||
|
|
||||||
|
|
||||||
class Octopus(Package, CudaPackage):
|
class Octopus(AutotoolsPackage, CudaPackage):
|
||||||
"""A real-space finite-difference (time-dependent) density-functional
|
"""A real-space finite-difference (time-dependent) density-functional
|
||||||
theory code."""
|
theory code."""
|
||||||
|
|
||||||
@ -55,10 +56,10 @@ class Octopus(Package, CudaPackage):
|
|||||||
variant("nlopt", default=False, description="Compile with nlopt")
|
variant("nlopt", default=False, description="Compile with nlopt")
|
||||||
variant("debug", default=False, description="Compile with debug flags")
|
variant("debug", default=False, description="Compile with debug flags")
|
||||||
|
|
||||||
depends_on("autoconf", type="build")
|
depends_on("autoconf", type="build", when="@develop")
|
||||||
depends_on("automake", type="build")
|
depends_on("automake", type="build", when="@develop")
|
||||||
depends_on("libtool", type="build")
|
depends_on("libtool", type="build", when="@develop")
|
||||||
depends_on("m4", type="build")
|
depends_on("m4", type="build", when="@develop")
|
||||||
|
|
||||||
depends_on("blas")
|
depends_on("blas")
|
||||||
depends_on("gsl@1.9:")
|
depends_on("gsl@1.9:")
|
||||||
@ -90,7 +91,8 @@ class Octopus(Package, CudaPackage):
|
|||||||
# TODO: etsf-io, sparskit,
|
# TODO: etsf-io, sparskit,
|
||||||
# feast, libfm, pfft, isf, pnfft, poke
|
# feast, libfm, pfft, isf, pnfft, poke
|
||||||
|
|
||||||
def install(self, spec, prefix):
|
def configure_args(self):
|
||||||
|
spec = self.spec
|
||||||
lapack = spec["lapack"].libs
|
lapack = spec["lapack"].libs
|
||||||
blas = spec["blas"].libs
|
blas = spec["blas"].libs
|
||||||
args = []
|
args = []
|
||||||
@ -211,12 +213,7 @@ def install(self, spec, prefix):
|
|||||||
args.append(fcflags)
|
args.append(fcflags)
|
||||||
args.append(fflags)
|
args.append(fflags)
|
||||||
|
|
||||||
autoreconf("-i")
|
return args
|
||||||
configure(*args)
|
|
||||||
make()
|
|
||||||
# short tests take forever...
|
|
||||||
# make('check-short')
|
|
||||||
make("install")
|
|
||||||
|
|
||||||
@run_after("install")
|
@run_after("install")
|
||||||
@on_package_attributes(run_tests=True)
|
@on_package_attributes(run_tests=True)
|
||||||
@ -279,7 +276,7 @@ def smoke_tests(self):
|
|||||||
purpose = "Run Octopus recipe example"
|
purpose = "Run Octopus recipe example"
|
||||||
with working_dir("example-recipe", create=True):
|
with working_dir("example-recipe", create=True):
|
||||||
print("Current working directory (in example-recipe)")
|
print("Current working directory (in example-recipe)")
|
||||||
copy(join_path(os.path.dirname(__file__), "test", "recipe.inp"), "inp")
|
fs.copy(join_path(os.path.dirname(__file__), "test", "recipe.inp"), "inp")
|
||||||
self.run_test(
|
self.run_test(
|
||||||
exe,
|
exe,
|
||||||
options=options,
|
options=options,
|
||||||
@ -305,7 +302,7 @@ def smoke_tests(self):
|
|||||||
purpose = "Run tiny calculation for He"
|
purpose = "Run tiny calculation for He"
|
||||||
with working_dir("example-he", create=True):
|
with working_dir("example-he", create=True):
|
||||||
print("Current working directory (in example-he)")
|
print("Current working directory (in example-he)")
|
||||||
copy(join_path(os.path.dirname(__file__), "test", "he.inp"), "inp")
|
fs.copy(join_path(os.path.dirname(__file__), "test", "he.inp"), "inp")
|
||||||
self.run_test(
|
self.run_test(
|
||||||
exe,
|
exe,
|
||||||
options=options,
|
options=options,
|
||||||
|
Loading…
Reference in New Issue
Block a user