
This PR removes [end of life](https://endoflife.date/python) versions of Python from Spack. Specifically, this includes all versions of Python older than 3.7. See https://github.com/spack/spack/discussions/31824 for rationale. Deprecated in #32615. And #28003. For anyone using software that relies on Python 2, you have a few options: * Upgrade the software to support Python 3. The `3to2` tool may get you most of the way there, although more complex libraries may need manual tweaking. * Add Python 2 as an [external package](https://spack.readthedocs.io/en/latest/build_settings.html#external-packages). Many Python libraries do not support Python 2, but you may be able to add older versions that did once upon a time. * Use Spack 0.19. Spack 0.19 is the last release to officially support Python 3.6 and older * Create and maintain your own [custom repository](https://spack.readthedocs.io/en/latest/repositories.html). Basically, you would need a package for Python 2 and any other Python 2-specific libraries you need.
81 lines
2.9 KiB
Python
81 lines
2.9 KiB
Python
# Copyright 2013-2021 Lawrence Livermore National Security, LLC and other
|
|
# Spack Project Developers. See the top-level COPYRIGHT file for details.
|
|
#
|
|
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
|
|
|
|
from spack.package import *
|
|
|
|
|
|
class BigdftAtlab(AutotoolsPackage):
|
|
"""BigDFT-atlab: library for ATomic related operations."""
|
|
|
|
homepage = "https://bigdft.org/"
|
|
url = "https://gitlab.com/l_sim/bigdft-suite/-/archive/1.9.2/bigdft-suite-1.9.2.tar.gz"
|
|
git = "https://gitlab.com/l_sim/bigdft-suite.git"
|
|
|
|
version("develop", branch="devel")
|
|
version("1.9.2", sha256="dc9e49b68f122a9886fa0ef09970f62e7ba21bb9ab1b86be9b7d7e22ed8fbe0f")
|
|
version("1.9.1", sha256="3c334da26d2a201b572579fc1a7f8caad1cbf971e848a3e10d83bc4dc8c82e41")
|
|
version("1.9.0", sha256="4500e505f5a29d213f678a91d00a10fef9dc00860ea4b3edf9280f33ed0d1ac8")
|
|
|
|
variant("mpi", default=True, description="Enable MPI support")
|
|
variant("openmp", default=True, description="Enable OpenMP support")
|
|
variant("openbabel", default=False, description="Enable detection of openbabel compilation")
|
|
|
|
depends_on("mpi", when="+mpi")
|
|
depends_on("openbabel", when="+openbabel")
|
|
|
|
for vers in ["1.9.0", "1.9.1", "1.9.2", "develop"]:
|
|
depends_on("bigdft-futile@{0}".format(vers), when="@{0}".format(vers))
|
|
|
|
build_directory = "atlab"
|
|
|
|
def autoreconf(self, spec, prefix):
|
|
autoreconf = which("autoreconf")
|
|
|
|
with working_dir(self.build_directory):
|
|
autoreconf("-fi")
|
|
|
|
def configure_args(self):
|
|
spec = self.spec
|
|
prefix = self.prefix
|
|
|
|
openmp_flag = []
|
|
if "+openmp" in spec:
|
|
openmp_flag.append(self.compiler.openmp_flag)
|
|
|
|
args = [
|
|
"FCFLAGS=%s" % " ".join(openmp_flag),
|
|
"--with-futile-libs=%s" % spec["bigdft-futile"].prefix.lib,
|
|
"--with-futile-incs=%s" % spec["bigdft-futile"].prefix.include,
|
|
"--with-moduledir=%s" % prefix.include,
|
|
"--prefix=%s" % prefix,
|
|
"--without-etsf-io",
|
|
]
|
|
|
|
if "+mpi" in spec:
|
|
args.append("CC=%s" % spec["mpi"].mpicc)
|
|
args.append("CXX=%s" % spec["mpi"].mpicxx)
|
|
args.append("FC=%s" % spec["mpi"].mpifc)
|
|
args.append("F90=%s" % spec["mpi"].mpifc)
|
|
args.append("F77=%s" % spec["mpi"].mpif77)
|
|
else:
|
|
args.append("--disable-mpi")
|
|
|
|
if "+openmp" in spec:
|
|
args.append("--with-openmp")
|
|
else:
|
|
args.append("--without-openmp")
|
|
|
|
if "+openbabel" in spec:
|
|
args.append("--enable-openbabel")
|
|
args.append("--with-openbabel-libs=%s" % spec["openbabel"].prefix.lib)
|
|
args.append("--with-openbabel-incs=%s" % spec["openbabel"].prefix.include)
|
|
|
|
return args
|
|
|
|
@property
|
|
def libs(self):
|
|
shared = "+shared" in self.spec
|
|
return find_libraries("libatlab-*", root=self.prefix, shared=shared, recursive=True)
|