git: 173683a2d0f4 - main - math/dsfmt: new port, double precision SIMD-oriented Fast Mersenne Twister

From: Thierry Thomas <thierry_at_FreeBSD.org>
Date: Sun, 12 Nov 2023 13:48:21 UTC
The branch main has been updated by thierry:

URL: https://cgit.FreeBSD.org/ports/commit/?id=173683a2d0f477fd7457a3b3d2e1d065dd252bda

commit 173683a2d0f477fd7457a3b3d2e1d065dd252bda
Author:     Thierry Thomas <thierry@FreeBSD.org>
AuthorDate: 2023-11-10 21:38:00 +0000
Commit:     Thierry Thomas <thierry@FreeBSD.org>
CommitDate: 2023-11-12 13:47:23 +0000

    math/dsfmt: new port, double precision SIMD-oriented Fast Mersenne Twister
    
    ATM it is bundled in Julia.
---
 math/Makefile        |  1 +
 math/dsfmt/Makefile  | 55 ++++++++++++++++++++++++++++++++++++++++++++++++++++
 math/dsfmt/distinfo  |  3 +++
 math/dsfmt/pkg-descr |  7 +++++++
 math/dsfmt/pkg-plist | 36 ++++++++++++++++++++++++++++++++++
 5 files changed, 102 insertions(+)

diff --git a/math/Makefile b/math/Makefile
index bd3acc4964e2..66a8ad132edf 100644
--- a/math/Makefile
+++ b/math/Makefile
@@ -276,6 +276,7 @@
     SUBDIR += dionysus
     SUBDIR += disco
     SUBDIR += dqfun
+    SUBDIR += dsfmt
     SUBDIR += drgeo
     SUBDIR += dsdp
     SUBDIR += dune-alugrid
diff --git a/math/dsfmt/Makefile b/math/dsfmt/Makefile
new file mode 100644
index 000000000000..6db9b98c10ef
--- /dev/null
+++ b/math/dsfmt/Makefile
@@ -0,0 +1,55 @@
+PORTNAME=	dSFMT
+PORTVERSION=	2.2.5
+DISTVERSIONPREFIX=	v
+CATEGORIES=	math
+
+MAINTAINER=	thierry@FreeBSD.org
+COMMENT=	Double precision SIMD-oriented Fast Mersenne Twister
+WWW=		http://www.math.sci.hiroshima-u.ac.jp/m-mat/MT/SFMT/
+
+LICENSE=	BSD3CLAUSE
+LICENSE_FILE=	${WRKSRC}/LICENSE.txt
+
+USES=		compiler
+
+USE_GITHUB=	yes
+GH_ACCOUNT=	MersenneTwister-Lab
+
+CSTD=		c99
+CFLAGS+=	-DDSFMT_MEXP=19937 -fPIC -DDSFMT_SHLIB ${OPTCFLAGS}	\
+		-finline-functions -fomit-frame-pointer -fno-strict-aliasing	\
+		-Wall -shared
+OPTCFLAGS?=	-O3
+CFLAGS_amd64=	-msse2 -DHAVE_SSE2
+LDFLAGS+=	-Wl,-soname,libdSFMT.so.0
+USE_LDCONFIG=	yes
+
+OPTIONS_DEFINE=	DOCS
+
+.include <bsd.port.pre.mk>
+
+.if ${ARCH} == amd64
+TEST_TARGET=	sse2-check
+.else
+TEST_TARGET=	std-check
+.endif
+
+do-build:
+	(cd ${WRKSRC} &&	\
+	${CC} ${CFLAGS} ${LDFLAGS} dSFMT.c -o libdSFMT.so.0)
+
+do-install:
+	${INSTALL_DATA} ${WRKSRC}/dSFMT.h ${STAGEDIR}${PREFIX}/include/
+	${INSTALL_LIB} ${WRKSRC}/libdSFMT.so.0 ${STAGEDIR}${PREFIX}/lib
+	(cd ${STAGEDIR}${PREFIX}/lib && ${LN} -s libdSFMT.so.0 libdSFMT.so)
+
+do-install-DOCS-on:
+	${MKDIR} ${STAGEDIR}${DOCSDIR}/html
+	${INSTALL_DATA} ${WRKSRC}/README.* ${STAGEDIR}${DOCSDIR}
+	cd ${WRKSRC}/html && ${COPYTREE_SHARE} . ${STAGEDIR}${DOCSDIR}/html
+
+do-test:
+	${REINPLACE_CMD} -e '/^CC =/d;/^CCFLAGS =/d' ${WRKSRC}/Makefile
+	(cd ${WRKSRC} && ${DO_MAKE_BUILD} ${TEST_TARGET})
+
+.include <bsd.port.post.mk>
diff --git a/math/dsfmt/distinfo b/math/dsfmt/distinfo
new file mode 100644
index 000000000000..558e14376a48
--- /dev/null
+++ b/math/dsfmt/distinfo
@@ -0,0 +1,3 @@
+TIMESTAMP = 1699641017
+SHA256 (MersenneTwister-Lab-dSFMT-v2.2.5_GH0.tar.gz) = b7bc498cd140b4808963b1ff9f33b42a491870f54775c1060ecad0e02bcaffb4
+SIZE (MersenneTwister-Lab-dSFMT-v2.2.5_GH0.tar.gz) = 4984272
diff --git a/math/dsfmt/pkg-descr b/math/dsfmt/pkg-descr
new file mode 100644
index 000000000000..e9b6d9d39fae
--- /dev/null
+++ b/math/dsfmt/pkg-descr
@@ -0,0 +1,7 @@
+The purpose of dSFMT is to speed up the generation by avoiding the expensive
+conversion of integer to double (floating point). dSFMT directly generates
+double precision floating point pseudorandom numbers which have the IEEE
+Standard for Binary Floating-Point Arithmetic (ANSI/IEEE Std 754-1985) format.
+
+dSFMT is only available on the CPUs which use IEEE 754 format double precision
+floating point numbers.
diff --git a/math/dsfmt/pkg-plist b/math/dsfmt/pkg-plist
new file mode 100644
index 000000000000..e8b13a274d64
--- /dev/null
+++ b/math/dsfmt/pkg-plist
@@ -0,0 +1,36 @@
+include/dSFMT.h
+lib/libdSFMT.so
+lib/libdSFMT.so.0
+%%PORTDOCS%%%%DOCSDIR%%/README.jp.txt
+%%PORTDOCS%%%%DOCSDIR%%/README.txt
+%%PORTDOCS%%%%DOCSDIR%%/html/annotated.html
+%%PORTDOCS%%%%DOCSDIR%%/html/bc_s.png
+%%PORTDOCS%%%%DOCSDIR%%/html/classes.html
+%%PORTDOCS%%%%DOCSDIR%%/html/closed.png
+%%PORTDOCS%%%%DOCSDIR%%/html/d_s_f_m_t_8c.html
+%%PORTDOCS%%%%DOCSDIR%%/html/d_s_f_m_t_8h.html
+%%PORTDOCS%%%%DOCSDIR%%/html/d_s_f_m_t_8h_source.html
+%%PORTDOCS%%%%DOCSDIR%%/html/doxygen.css
+%%PORTDOCS%%%%DOCSDIR%%/html/doxygen.png
+%%PORTDOCS%%%%DOCSDIR%%/html/files.html
+%%PORTDOCS%%%%DOCSDIR%%/html/functions.html
+%%PORTDOCS%%%%DOCSDIR%%/html/functions_vars.html
+%%PORTDOCS%%%%DOCSDIR%%/html/globals.html
+%%PORTDOCS%%%%DOCSDIR%%/html/globals_defs.html
+%%PORTDOCS%%%%DOCSDIR%%/html/globals_func.html
+%%PORTDOCS%%%%DOCSDIR%%/html/globals_type.html
+%%PORTDOCS%%%%DOCSDIR%%/html/globals_vars.html
+%%PORTDOCS%%%%DOCSDIR%%/html/howto-compile.html
+%%PORTDOCS%%%%DOCSDIR%%/html/index.html
+%%PORTDOCS%%%%DOCSDIR%%/html/jquery.js
+%%PORTDOCS%%%%DOCSDIR%%/html/mainpage_8txt.html
+%%PORTDOCS%%%%DOCSDIR%%/html/nav_f.png
+%%PORTDOCS%%%%DOCSDIR%%/html/nav_h.png
+%%PORTDOCS%%%%DOCSDIR%%/html/open.png
+%%PORTDOCS%%%%DOCSDIR%%/html/struct_d_s_f_m_t___t.html
+%%PORTDOCS%%%%DOCSDIR%%/html/tab_a.png
+%%PORTDOCS%%%%DOCSDIR%%/html/tab_b.png
+%%PORTDOCS%%%%DOCSDIR%%/html/tab_h.png
+%%PORTDOCS%%%%DOCSDIR%%/html/tab_s.png
+%%PORTDOCS%%%%DOCSDIR%%/html/tabs.css
+%%PORTDOCS%%%%DOCSDIR%%/html/union_w128___t.html