summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHarmen Stoppels <harmenstoppels@gmail.com>2021-11-15 11:15:42 +0100
committerGitHub <noreply@github.com>2021-11-15 11:15:42 +0100
commit9573eb531569263422ebeb46ac5ae15d1c840b71 (patch)
tree678218d57fd2e612796e1d011d198a3ae7764e50
parentd1df044b4214cb2efa0055a1724667f30d68a744 (diff)
downloadspack-9573eb531569263422ebeb46ac5ae15d1c840b71.tar.gz
spack-9573eb531569263422ebeb46ac5ae15d1c840b71.tar.bz2
spack-9573eb531569263422ebeb46ac5ae15d1c840b71.tar.xz
spack-9573eb531569263422ebeb46ac5ae15d1c840b71.zip
dsfmt: new package (#27415)
-rw-r--r--var/spack/repos/builtin/packages/dsfmt/package.py31
-rw-r--r--var/spack/repos/builtin/packages/dsfmt/targets.patch28
2 files changed, 59 insertions, 0 deletions
diff --git a/var/spack/repos/builtin/packages/dsfmt/package.py b/var/spack/repos/builtin/packages/dsfmt/package.py
new file mode 100644
index 0000000000..80a19bad5f
--- /dev/null
+++ b/var/spack/repos/builtin/packages/dsfmt/package.py
@@ -0,0 +1,31 @@
+# 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 import *
+
+
+class Dsfmt(MakefilePackage):
+ """Double precision SIMD-oriented Fast Mersenne Twister"""
+
+ homepage = "http://www.math.sci.hiroshima-u.ac.jp/m-mat/MT/SFMT/"
+ url = "http://www.math.sci.hiroshima-u.ac.jp/m-mat/MT/SFMT/dSFMT-src-2.2.3.tar.gz"
+
+ maintainers = ['haampie']
+
+ # This package does not have a target to build a library nor a make install target,
+ # so we add it for them.
+ patch('targets.patch')
+
+ version('2.2.3', sha256='82344874522f363bf93c960044b0a6b87b651c9565b6312cf8719bb8e4c26a0e')
+
+ @property
+ def libs(self):
+ return find_libraries('libdSFMT', root=self.prefix, recursive=True)
+
+ def make(self, spec, prefix):
+ make('library')
+
+ def install(self, spec, prefix):
+ make('PREFIX={0}'.format(prefix), 'install')
diff --git a/var/spack/repos/builtin/packages/dsfmt/targets.patch b/var/spack/repos/builtin/packages/dsfmt/targets.patch
new file mode 100644
index 0000000000..88f37c12f1
--- /dev/null
+++ b/var/spack/repos/builtin/packages/dsfmt/targets.patch
@@ -0,0 +1,28 @@
+From a78e6df557b1dfaead886fdac9fda0a3a9086493 Mon Sep 17 00:00:00 2001
+From: Harmen Stoppels <harmenstoppels@gmail.com>
+Date: Mon, 8 Nov 2021 10:18:54 +0100
+Subject: [PATCH] Add a library/install target
+
+---
+ Makefile | 7 +++++++
+ 1 file changed, 7 insertions(+)
+
+diff --git a/Makefile b/Makefile
+index 5cc4ed6..a9dcd99 100644
+--- a/Makefile
++++ b/Makefile
+@@ -196,3 +196,10 @@ test-sse2-M216091: test.c dSFMT.c dSFMT.h
+
+ clean:
+ rm -f *.o *~ test-*-M*
++
++library: dSFMT.c
++ $(CC) $(CCFLAGS) -shared -fPIC dSFMT.c -o libdSFMT.so
++
++install: library
++ install -d $(PREFIX)/lib/
++ install -m 644 libdSFMT.so $(PREFIX)/lib/
+\ No newline at end of file
+--
+2.25.1
+