diff options
author | Weston Ortiz <weston@wortiz.com> | 2020-08-26 20:02:16 -0600 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-08-26 21:02:16 -0500 |
commit | 1a17921fa5d6820a822058c35ef0ebbf31eb3cd7 (patch) | |
tree | 581e970a60243e8e55db336cce2a4edcea9ef2db | |
parent | 273a158f1bf4de9aa85f366483e187e457f65e93 (diff) | |
download | spack-1a17921fa5d6820a822058c35ef0ebbf31eb3cd7.tar.gz spack-1a17921fa5d6820a822058c35ef0ebbf31eb3cd7.tar.bz2 spack-1a17921fa5d6820a822058c35ef0ebbf31eb3cd7.tar.xz spack-1a17921fa5d6820a822058c35ef0ebbf31eb3cd7.zip |
Add new package: sparse (#18264)
* Add new package: sparse
* flake8 fixes
-rw-r--r-- | var/spack/repos/builtin/packages/sparse/package.py | 44 |
1 files changed, 44 insertions, 0 deletions
diff --git a/var/spack/repos/builtin/packages/sparse/package.py b/var/spack/repos/builtin/packages/sparse/package.py new file mode 100644 index 0000000000..86ebc71ba9 --- /dev/null +++ b/var/spack/repos/builtin/packages/sparse/package.py @@ -0,0 +1,44 @@ +# 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 * +import glob + + +class Sparse(MakefilePackage): + """An open source sparse linear equation solver.""" + + homepage = "http://sparse.sourceforge.net/" + url = "http://downloads.sourceforge.net/project/sparse/sparse/sparse1.4b/sparse1.4b.tar.gz" + + maintainers = ['wortiz'] + + version('1.4b', sha256='63e6646244fd8f4d89f7f70fbf4cfd46b7688d21b22840a0ce57d294a7496d28') + + variant('pic', default=True, + description='Build with position independent code') + + def edit(self, spec, prefix): + with working_dir('./src'): + makefile = FileFilter('Makefile') + if '+pic' in self.spec: + makefile.filter('CFLAGS = .*', + 'CFLAGS = -O2 {0}'.format( + self.compiler.cc_pic_flag)) + else: + makefile.filter('CFLAGS = .*', 'CFLAGS = -O2') + makefile.filter('CC = .*', 'CC = {0}'.format(spack_cc)) + makefile.filter('LIBRARY = .*', 'LIBRARY = ../lib/libsparse.a') + + def build(self, spec, prefix): + with working_dir('./src'): + make() + + def install(self, spec, prefix): + headers = glob.glob('src/*.h') + install_tree('lib', prefix.lib) + install_tree('bin', prefix.bin) + mkdir(prefix.include) + for h in headers: + install(h, prefix.include) |