summaryrefslogtreecommitdiff
path: root/var
diff options
context:
space:
mode:
authorkuramoto-fj <72247780+kuramoto-fj@users.noreply.github.com>2020-12-26 00:16:38 +0900
committerGitHub <noreply@github.com>2020-12-25 09:16:38 -0600
commitd86c345413cdfb1aaa7e5b746d2d311a9b57754e (patch)
tree1e94352663781cbfe5be654d1d3f5a72eeb25c8c /var
parentb56d1a77adb3551ee8b51436fee62f4dbd4eff20 (diff)
downloadspack-d86c345413cdfb1aaa7e5b746d2d311a9b57754e.tar.gz
spack-d86c345413cdfb1aaa7e5b746d2d311a9b57754e.tar.bz2
spack-d86c345413cdfb1aaa7e5b746d2d311a9b57754e.tar.xz
spack-d86c345413cdfb1aaa7e5b746d2d311a9b57754e.zip
PFAPACK: Add new package (#20365)
* PFAPACK: Add new package * PFAPACK : fix flake8 errors * add type=(build, run) to the recipe
Diffstat (limited to 'var')
-rw-r--r--var/spack/repos/builtin/packages/pfapack/package.py64
1 files changed, 64 insertions, 0 deletions
diff --git a/var/spack/repos/builtin/packages/pfapack/package.py b/var/spack/repos/builtin/packages/pfapack/package.py
new file mode 100644
index 0000000000..e225add627
--- /dev/null
+++ b/var/spack/repos/builtin/packages/pfapack/package.py
@@ -0,0 +1,64 @@
+# Copyright 2013-2020 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 import *
+
+
+class Pfapack(MakefilePackage):
+ """A library for numerically computing the Pfaffian of
+ a real or complex skew-symmetric matrix. This is based on
+ computing the tridiagonal form of the matrix under
+ unitary congruence transformations."""
+
+ homepage = "https://michaelwimmer.org/downloads.html"
+ url = "https://michaelwimmer.org/pfapack.tgz"
+
+ version('2014-09-17', sha256='b68fc35dda23ee24c358641b1a92ef701c4ffa0b3f0b0808b24e68afeb58ef07')
+
+ depends_on('lapack')
+ depends_on('blas')
+ depends_on('python', type=('build', 'run'))
+ depends_on('py-numpy', type=('build', 'run'))
+ depends_on('py-scipy', type=('build', 'run'))
+
+ def edit(self, spec, prefix):
+ filter_file('FORT =.*', 'FORT = {0}'.format(spack_fc),
+ join_path('fortran', 'makefile'))
+ filter_file('CC =.*', 'CC = {0}'.format(spack_cc),
+ join_path('c_interface', 'makefile'))
+
+ def build(self, spec, prefix):
+ source_directory = self.stage.source_path
+ with working_dir(join_path(source_directory, 'fortran')):
+ make()
+ with working_dir(join_path(source_directory, 'c_interface')):
+ make()
+
+ def install(self, spec, prefix):
+ source_directory = self.stage.source_path
+ mkdirp(prefix.fortran)
+ install(join_path(source_directory, 'fortran', 'libpfapack.a'),
+ prefix.fortran)
+ install(join_path(source_directory, 'fortran', '*.mod'),
+ prefix.fortran)
+ install_tree(join_path(source_directory, 'fortran', 'EXAMPLES'),
+ prefix.fortran.EXAMPLES)
+ install_tree(join_path(source_directory, 'fortran', 'TESTING'),
+ prefix.fortran.TESTING)
+ mkdirp(prefix.c_interface)
+ install(join_path(source_directory, 'c_interface', 'libcpfapack.a'),
+ prefix.c_interface)
+ install(join_path(source_directory, 'c_interface', 'fortran.h'),
+ prefix.c_interface)
+ install(join_path(source_directory, 'c_interface',
+ 'fortran_pfapack.h'),
+ prefix.c_interface)
+ install(join_path(source_directory, 'c_interface', 'pfapack.h'),
+ prefix.c_interface)
+ install_tree(join_path(source_directory, 'c_interface', 'EXAMPLES'),
+ prefix.c_interface.EXAMPLES)
+ install_tree(join_path(source_directory, 'c_interface', 'TESTING'),
+ prefix.c_interface.TESTING)
+ install_tree(join_path(source_directory, 'python'), prefix.python)