pkgsrc-WIP-changes archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

blas64, lapack64, cblas*, lapacke*, openblas*, mk/blas64.bl3: fixup and 64 bit BLAS



Module Name:	pkgsrc-wip
Committed By:	Dr. Thomas Orgis <thomas.orgis%uni-hamburg.de@localhost>
Pushed By:	thor
Date:		Thu Jun 10 19:51:22 2021 +0200
Changeset:	f3668144b0bdad5f5f3e3dc3aef000d6716d5264

Modified Files:
	Makefile
Added Files:
	blas64/DESCR
	blas64/Makefile
	blas64/PLIST
	blas64/buildlink3.mk
	cblas/DESCR
	cblas/Makefile
	cblas/PLIST
	cblas/buildlink3.mk
	cblas64/DESCR
	cblas64/Makefile
	cblas64/PLIST
	cblas64/buildlink3.mk
	lapack64/DESCR
	lapack64/Makefile
	lapack64/Makefile.common
	lapack64/PLIST
	lapack64/buildlink3.mk
	lapack64/version.mk
	lapacke/DESCR
	lapacke/Makefile
	lapacke/PLIST
	lapacke/buildlink3.mk
	lapacke64/DESCR
	lapacke64/Makefile
	lapacke64/PLIST
	lapacke64/buildlink3.mk
	mk/blas64.buildlink3.mk
	openblas/DESCR
	openblas/Makefile
	openblas/Makefile.common
	openblas/PLIST
	openblas/buildlink3.mk
	openblas/distinfo
	openblas/options.mk
	openblas/patches/patch-Makefile
	openblas/patches/patch-Makefile.install
	openblas/patches/patch-Makefile.rule
	openblas/patches/patch-Makefile.system
	openblas/patches/patch-common__arm.h
	openblas/patches/patch-cpuid__arm.c
	openblas/patches/patch-cpuid_ia64.c
	openblas/patches/patch-f_check
	openblas/patches/patch-getarch.c
	openblas/patches/patch-interface__ztrmv.c
	openblas/version.mk
	openblas64/DESCR
	openblas64/Makefile
	openblas64/buildlink3.mk
	openblas64_openmp/DESCR
	openblas64_openmp/Makefile
	openblas64_openmp/buildlink3.mk
	openblas64_pthread/DESCR
	openblas64_pthread/Makefile
	openblas64_pthread/buildlink3.mk
	openblas_openmp/DESCR
	openblas_openmp/Makefile
	openblas_openmp/buildlink3.mk
	openblas_pthread/DESCR
	openblas_pthread/Makefile
	openblas_pthread/buildlink3.mk

Log Message:
blas64, lapack64, cblas*, lapacke*, openblas*, mk/blas64.bl3: fixup and 64 bit BLAS

This prepares for 64 bit index BLAS libraries alongside 32 bit ones. In preparation
of better support for vendor BLAS libraries, I had to realize that you better
use the C interfaces supplied by them, not the netlib one strapped on. A simple
reason of practicability: The vendor blas libraries, like openblas, like to
ship all symbols in one library, so you get them whether you want it or not.

The netlib reference pacakges are still all separate packages for the separate
libraries, since this is instructive and helps keeping things small when you
do not need all of them. The installation location of the headers is now in
a subdirectory to be able to have 32 and 64 bit variants independent. The 32 bit
ones are linked to ${PREFIX}/include to keep the old picture. We could be brave
and remove those, but there is some value in a build just trying -lcblas and

to be happy.

The blas64.buildlink3.mk conflicts with blas.buildlink3.mk to avoid hazardous
combination of the same symbols with differing ABI. The contents of blas.bl3
will be updated to behave the same way on merging in. One might consider merging
the identical parts of the files, but then, this might be not worth it.

Another idea is to have it all on one blas.bl3 and have a variable to switch
between 32 and 64 bits. BLAS_INTERFACE64=yes, perhaps? BLAS_ILP64 seems to
confuse people a lot;-) That way, a mix of differing settings would also not
be possible.

I would like to merge this before the next branch … let's see. The 64 bit stuff
is pretty safe right now as nothing else uses it, but I intend to make
py-numpy, octave, R etal. use the 64 bit CBLAS on 64 bit platforms.
That switch itself will need some time to settle, I guess, but having the 64 bit
BLAS in main is a prerequisite to do that without too much hassle.

To see a diff of this commit:
https://wip.pkgsrc.org/cgi-bin/gitweb.cgi?p=pkgsrc-wip.git;a=commitdiff;h=f3668144b0bdad5f5f3e3dc3aef000d6716d5264

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

diffstat:
 Makefile                                  |  12 +++
 blas64/DESCR                              |   9 ++
 blas64/Makefile                           |  13 +++
 blas64/PLIST                              |   6 ++
 blas64/buildlink3.mk                      |  13 +++
 cblas/DESCR                               |   2 +
 cblas/Makefile                            |  14 +++
 cblas/PLIST                               |  14 +++
 cblas/buildlink3.mk                       |  14 +++
 cblas64/DESCR                             |   2 +
 cblas64/Makefile                          |  14 +++
 cblas64/PLIST                             |  10 ++
 cblas64/buildlink3.mk                     |  14 +++
 lapack64/DESCR                            |  22 +++++
 lapack64/Makefile                         |  17 ++++
 lapack64/Makefile.common                  |  73 ++++++++++++++
 lapack64/PLIST                            |   6 ++
 lapack64/buildlink3.mk                    |  16 ++++
 lapack64/version.mk                       |   3 +
 lapacke/DESCR                             |   2 +
 lapacke/Makefile                          |  17 ++++
 lapacke/PLIST                             |  16 ++++
 lapacke/buildlink3.mk                     |  14 +++
 lapacke64/DESCR                           |   2 +
 lapacke64/Makefile                        |  16 ++++
 lapacke64/PLIST                           |  11 +++
 lapacke64/buildlink3.mk                   |  14 +++
 mk/blas64.buildlink3.mk                   | 152 ++++++++++++++++++++++++++++++
 openblas/DESCR                            |   6 ++
 openblas/Makefile                         |   8 ++
 openblas/Makefile.common                  | 126 +++++++++++++++++++++++++
 openblas/PLIST                            |  16 ++++
 openblas/buildlink3.mk                    |  12 +++
 openblas/distinfo                         |  24 +++++
 openblas/options.mk                       |  18 ++++
 openblas/patches/patch-Makefile           |  83 ++++++++++++++++
 openblas/patches/patch-Makefile.install   |  86 +++++++++++++++++
 openblas/patches/patch-Makefile.rule      |  17 ++++
 openblas/patches/patch-Makefile.system    |  35 +++++++
 openblas/patches/patch-common__arm.h      |  20 ++++
 openblas/patches/patch-cpuid__arm.c       |  16 ++++
 openblas/patches/patch-cpuid_ia64.c       |  16 ++++
 openblas/patches/patch-f_check            |  24 +++++
 openblas/patches/patch-getarch.c          |  26 +++++
 openblas/patches/patch-interface__ztrmv.c |  15 +++
 openblas/version.mk                       |   3 +
 openblas64/DESCR                          |   6 ++
 openblas64/Makefile                       |   7 ++
 openblas64/buildlink3.mk                  |  12 +++
 openblas64_openmp/DESCR                   |   6 ++
 openblas64_openmp/Makefile                |   7 ++
 openblas64_openmp/buildlink3.mk           |  12 +++
 openblas64_pthread/DESCR                  |   6 ++
 openblas64_pthread/Makefile               |   7 ++
 openblas64_pthread/buildlink3.mk          |  12 +++
 openblas_openmp/DESCR                     |   5 +
 openblas_openmp/Makefile                  |   8 ++
 openblas_openmp/buildlink3.mk             |  12 +++
 openblas_pthread/DESCR                    |   5 +
 openblas_pthread/Makefile                 |   8 ++
 openblas_pthread/buildlink3.mk            |  12 +++
 61 files changed, 1194 insertions(+)

diffs:
diff --git a/Makefile b/Makefile
index ec1aceb174..a9c51c093a 100644
--- a/Makefile
+++ b/Makefile
@@ -280,6 +280,7 @@ SUBDIR+=	bitkeeper
 SUBDIR+=	bitlbee-purple
 SUBDIR+=	bkchem
 SUBDIR+=	blad
+SUBDIR+=	blas64
 SUBDIR+=	blasr
 SUBDIR+=	blasr_libcpp
 SUBDIR+=	bleachbit
@@ -382,6 +383,8 @@ SUBDIR+=	castget
 SUBDIR+=	catfish
 SUBDIR+=	catpoint-git
 SUBDIR+=	cb2bib
+SUBDIR+=	cblas
+SUBDIR+=	cblas64
 SUBDIR+=	ccnet-server
 SUBDIR+=	ccrypt
 SUBDIR+=	cdbfasta
@@ -1948,6 +1951,9 @@ SUBDIR+=	lagrange
 SUBDIR+=	lambertw
 SUBDIR+=	lander
 SUBDIR+=	lanq
+SUBDIR+=	lapack64
+SUBDIR+=	lapacke
+SUBDIR+=	lapacke64
 SUBDIR+=	lasi
 SUBDIR+=	last.fm
 SUBDIR+=	laszip
@@ -2628,6 +2634,12 @@ SUBDIR+=	openafs-git
 SUBDIR+=	openaxiom-svn
 SUBDIR+=	openbgpd
 SUBDIR+=	openbgpd-as4byte
+SUBDIR+=	openblas
+SUBDIR+=	openblas64
+SUBDIR+=	openblas64_openmp
+SUBDIR+=	openblas64_pthread
+SUBDIR+=	openblas_openmp
+SUBDIR+=	openblas_pthread
 SUBDIR+=	openbox-themes-extra
 SUBDIR+=	openbsc
 SUBDIR+=	openbsd-input-usbtablet
diff --git a/blas64/DESCR b/blas64/DESCR
new file mode 100644
index 0000000000..c74df4a651
--- /dev/null
+++ b/blas64/DESCR
@@ -0,0 +1,9 @@
+The BLAS (Basic Linear Algebra Subprograms) are high quality "building
+block" routines for performing basic vector and matrix
+operations. Level 1 BLAS do vector-vector operations, Level 2 BLAS do
+matrix-vector operations, and Level 3 BLAS do matrix-matrix
+operations. Because the BLAS are efficient, portable, and widely
+available, they're commonly used in the development of high quality
+linear algebra software, LINPACK and LAPACK for example.
+
+This package contains the Fortran 77 reference implementation of BLAS.
diff --git a/blas64/Makefile b/blas64/Makefile
new file mode 100644
index 0000000000..da5bb7cca8
--- /dev/null
+++ b/blas64/Makefile
@@ -0,0 +1,13 @@
+# $NetBSD: Makefile,v 1.39 2021/05/12 14:32:52 thor Exp $
+
+.include "../../math/lapack/Makefile.common"
+
+COMMENT=	Basic Linear Algebra System (Netlib reference implementation)
+
+LAPACK_COMPONENT=	blas64
+LAPACK_COMPONENT_CMAKE_ARGS=	\
+	-DBUILD_INDEX64=ON \
+	-DUSE_OPTIMIZED_BLAS=OFF \
+	-DCBLAS=OFF -DLAPACKE=OFF -DLAPACK=OFF
+
+.include "../../mk/bsd.pkg.mk"
diff --git a/blas64/PLIST b/blas64/PLIST
new file mode 100644
index 0000000000..9eef485913
--- /dev/null
+++ b/blas64/PLIST
@@ -0,0 +1,6 @@
+@comment $NetBSD: PLIST,v 1.6 2020/10/12 21:51:57 bacon Exp $
+lib/libblas64.a
+lib/libblas64.so
+lib/libblas64.so.3
+lib/libblas64.so.${PKGVERSION}
+lib/pkgconfig/blas64.pc
diff --git a/blas64/buildlink3.mk b/blas64/buildlink3.mk
new file mode 100644
index 0000000000..fdf92ae9b7
--- /dev/null
+++ b/blas64/buildlink3.mk
@@ -0,0 +1,13 @@
+# $NetBSD: buildlink3.mk,v 1.10 2020/10/12 21:51:57 bacon Exp $
+
+BUILDLINK_TREE+=	blas64
+
+.if !defined(BLAS64_BUILDLINK3_MK)
+BLAS64_BUILDLINK3_MK:=
+
+BUILDLINK_API_DEPENDS.blas64+=	blas64>=3.9.0
+BUILDLINK_ABI_DEPENDS.blas64+=	blas64>=3.9.0nb1
+BUILDLINK_PKGSRCDIR.blas64?=	../../wip/blas64
+.endif # BLAS64_BUILDLINK3_MK
+
+BUILDLINK_TREE+=	-blas64
diff --git a/cblas/DESCR b/cblas/DESCR
new file mode 100644
index 0000000000..e3232c7f03
--- /dev/null
+++ b/cblas/DESCR
@@ -0,0 +1,2 @@
+This is the C wrapper to the Basic Linear Algebra Support library
+(CBLAS), extracted from the Netlib reference implementation of LAPACK.
diff --git a/cblas/Makefile b/cblas/Makefile
new file mode 100644
index 0000000000..e302510e20
--- /dev/null
+++ b/cblas/Makefile
@@ -0,0 +1,14 @@
+# $NetBSD: Makefile,v 1.1 2021/04/20 20:37:03 thor Exp $
+
+COMMENT=		C interface to a BLAS library
+PKGREVISION=		1
+LAPACK_COMPONENT=	cblas
+LAPACK_COMPONENT_CMAKE_ARGS=	\
+	-DUSE_OPTIMIZED_BLAS=ON \
+	-DBLAS_LIBRARIES=-lblas \
+	-DCBLAS=ON -DLAPACKE=OFF -DLAPACK=OFF \
+	-DCMAKE_VERBOSE=ON
+
+.include "../../math/blas/buildlink3.mk"
+.include "../../wip/lapack64/Makefile.common"
+.include "../../mk/bsd.pkg.mk"
diff --git a/cblas/PLIST b/cblas/PLIST
new file mode 100644
index 0000000000..e860b9a461
--- /dev/null
+++ b/cblas/PLIST
@@ -0,0 +1,14 @@
+@comment $NetBSD: PLIST,v 1.1 2021/04/20 20:37:03 thor Exp $
+include/cblas.h
+include/cblas_f77.h
+include/cblas_mangling.h
+include/cblas_test.h
+include/netlib/cblas.h
+include/netlib/cblas_f77.h
+include/netlib/cblas_mangling.h
+include/netlib/cblas_test.h
+lib/libcblas.a
+lib/libcblas.so
+lib/libcblas.so.3
+lib/libcblas.so.${PKGVERSION}
+lib/pkgconfig/cblas.pc
diff --git a/cblas/buildlink3.mk b/cblas/buildlink3.mk
new file mode 100644
index 0000000000..953bc089b6
--- /dev/null
+++ b/cblas/buildlink3.mk
@@ -0,0 +1,14 @@
+# $NetBSD: buildlink3.mk,v 1.1 2021/04/20 20:37:03 thor Exp $
+
+BUILDLINK_TREE+=	cblas
+
+.if !defined(CBLAS_BUILDLINK3_MK)
+CBLAS_BUILDLINK3_MK:=
+
+BUILDLINK_API_DEPENDS.cblas+=	cblas>=3.9.0
+BUILDLINK_PKGSRCDIR.cblas?=	../../wip/cblas
+
+.include	"../../math/blas/buildlink3.mk"
+.endif
+
+BUILDLINK_TREE+=	-cblas
diff --git a/cblas64/DESCR b/cblas64/DESCR
new file mode 100644
index 0000000000..e3232c7f03
--- /dev/null
+++ b/cblas64/DESCR
@@ -0,0 +1,2 @@
+This is the C wrapper to the Basic Linear Algebra Support library
+(CBLAS), extracted from the Netlib reference implementation of LAPACK.
diff --git a/cblas64/Makefile b/cblas64/Makefile
new file mode 100644
index 0000000000..6e2c2b76f6
--- /dev/null
+++ b/cblas64/Makefile
@@ -0,0 +1,14 @@
+# $NetBSD: Makefile,v 1.1 2021/04/20 20:37:03 thor Exp $
+
+COMMENT=		C interface to a BLAS library
+LAPACK_COMPONENT=	cblas64
+LAPACK_COMPONENT_CMAKE_ARGS=	\
+	-DBUILD_INDEX64=ON \
+	-DUSE_OPTIMIZED_BLAS=ON \
+	-DBLAS_LIBRARIES=-lblas64 \
+	-DCBLAS=ON -DLAPACKE=OFF -DLAPACK=OFF \
+	-DCMAKE_VERBOSE=ON
+
+.include "../../wip/blas64/buildlink3.mk"
+.include "../../wip/lapack64/Makefile.common"
+.include "../../mk/bsd.pkg.mk"
diff --git a/cblas64/PLIST b/cblas64/PLIST
new file mode 100644
index 0000000000..a6938eb3a6
--- /dev/null
+++ b/cblas64/PLIST
@@ -0,0 +1,10 @@
+@comment $NetBSD$
+include/netlib64/cblas.h
+include/netlib64/cblas_f77.h
+include/netlib64/cblas_mangling.h
+include/netlib64/cblas_test.h
+lib/libcblas64.a
+lib/libcblas64.so
+lib/libcblas64.so.3
+lib/libcblas64.so.${PKGVERSION}
+lib/pkgconfig/cblas64.pc
diff --git a/cblas64/buildlink3.mk b/cblas64/buildlink3.mk
new file mode 100644
index 0000000000..95ecb19024
--- /dev/null
+++ b/cblas64/buildlink3.mk
@@ -0,0 +1,14 @@
+# $NetBSD: buildlink3.mk,v 1.1 2021/04/20 20:37:03 thor Exp $
+
+BUILDLINK_TREE+=	cblas64
+
+.if !defined(CBLAS64_BUILDLINK3_MK)
+CBLAS64_BUILDLINK3_MK:=
+
+BUILDLINK_API_DEPENDS.cblas64+=	cblas64>=3.9.0
+BUILDLINK_PKGSRCDIR.cblas64?=	../../wip/cblas64
+
+.include	"../../wip/blas64/buildlink3.mk"
+.endif
+
+BUILDLINK_TREE+=	-cblas64
diff --git a/lapack64/DESCR b/lapack64/DESCR
new file mode 100644
index 0000000000..0ae2255372
--- /dev/null
+++ b/lapack64/DESCR
@@ -0,0 +1,22 @@
+The BLAS (Basic Linear Algebra Subprograms) are high quality "building
+block" routines for performing basic vector and matrix
+operations. Level 1 BLAS do vector-vector operations, Level 2 BLAS do
+matrix-vector operations, and Level 3 BLAS do matrix-matrix
+operations. Because the BLAS are efficient, portable, and widely
+available, they're commonly used in the development of high quality
+linear algebra software, LINPACK and LAPACK for example.
+
+LAPACK is a highly portable Fortran 77 library which provides routines
+for solving systems of simultaneous linear equations, least-squares
+solutions of linear systems of equations, eigenvalue problems, and
+singular value problems. The associated matrix factorizations (LU,
+Cholesky, QR, SVD, Schur, generalized Schur) are also provided, as are
+related computations such as reordering of the Schur factorizations
+and estimating condition numbers. Dense and banded matrices are
+handled, but not general sparse matrices. In all areas, similar
+functionality is provided for real and complex matrices, in both
+single and double precision.
+
+This package contains the Fortran 77 reference implementation of BLAS
+and LAPACK from Netlib. The C wrappers CBLAS and LAPACKE are provided
+in separate packages.
diff --git a/lapack64/Makefile b/lapack64/Makefile
new file mode 100644
index 0000000000..68920e7497
--- /dev/null
+++ b/lapack64/Makefile
@@ -0,0 +1,17 @@
+# $NetBSD: Makefile,v 1.43 2021/05/12 14:32:51 thor Exp $
+
+MAINTAINER=	thomas.orgis%uni-hamburg.de@localhost
+COMMENT=	Linear Algebra PACKage (Netlib reference implementation)
+
+LAPACK_COMPONENT=	lapack64
+LAPACK_COMPONENT_CMAKE_ARGS= \
+	-DBUILD_INDEX64=ON \
+	-DUSE_OPTIMIZED_BLAS=ON \
+	-DBLAS_LIBRARIES=-lblas64 \
+	-DUSE_OPTIMIZED_LAPACK=OFF \
+	-DCBLAS=OFF -DLAPACKE=OFF -DLAPACK=ON
+
+.include "../../wip/blas64/buildlink3.mk"
+
+.include "../../wip/lapack64/Makefile.common"
+.include "../../mk/bsd.pkg.mk"
diff --git a/lapack64/Makefile.common b/lapack64/Makefile.common
new file mode 100644
index 0000000000..24e6694bfc
--- /dev/null
+++ b/lapack64/Makefile.common
@@ -0,0 +1,73 @@
+# $NetBSD: Makefile.common,v 1.12 2020/10/12 21:51:57 bacon Exp $
+# used by math/blas/Makefile
+# used by math/cblas/Makefile
+# used by math/lapacke/Makefile
+# used by math/lapack/Makefile
+# used by math/blas64/Makefile
+# used by math/cblas64/Makefile
+# used by math/lapacke64/Makefile
+# used by math/lapack64/Makefile
+
+# Common Makefile for packages derived from the Netlib BLAS/LAPACK sources.
+# Package Makefile sets LAPACK_COMPONENT and LAPACK_COMPONENT_CMAKE_ARGS to
+# choose the library to install.
+# LAPACK_COMPONENT can be "lapack", "lapacke", or "cblas",
+# or any of those with 64 suffix for ILP64 mode (64 bit indexing).
+
+DISTNAME=	lapack-${NETLIB_BLAS_VERSION}
+PKGNAME=	${LAPACK_COMPONENT}-${NETLIB_BLAS_VERSION}
+CATEGORIES=	math
+MASTER_SITES=	${MASTER_SITE_GITHUB:=Reference-LAPACK/}
+GITHUB_PROJECT=	lapack
+GITHUB_TAG=	v${NETLIB_BLAS_VERSION}
+
+HOMEPAGE=	https://www.netlib.org/lapack/
+LICENSE=	modified-bsd
+
+# All parts are in the same section
+PATCHDIR=	${.CURDIR}/../../math/lapack/patches
+DISTINFO_FILE=	${.CURDIR}/../../math/lapack/distinfo
+
+USE_LANGUAGES=	c fortran
+USE_CMAKE=	yes
+
+WRKSRC=		${WRKDIR}/${DISTNAME}
+CONFIGURE_DIRS=	build
+CMAKE_ARG_PATH=	${WRKSRC}
+
+
+.if !empty(LAPACK_COMPONENT:M*64)
+.  if empty(MACHINE_ARCH:M*64)
+PKG_FAIL_REASON+=	"${LAPACK_COMPONENT} incompatible with non-64-bit platform"
+.  endif
+HEADERDIR=		netlib64
+.else
+HEADERDIR=		netlib
+.endif
+
+# Note: We patch the build to install both static and
+# shared libraries.
+CMAKE_ARGS=	-DBUILD_DEPRECATED=ON \
+		-DBUILD_SHARED_LIBS=ON \
+		-DBUILD_STATIC_LIBS=ON \
+		-DCMAKE_INSTALL_INCLUDEDIR=${PREFIX}/include/${HEADERDIR} \
+		${LAPACK_COMPONENT_CMAKE_ARGS}
+
+# The cmake files are not ready for prime time.
+post-install:
+	rm -rf "${DESTDIR}${PREFIX}/lib/cmake"
+.if ${HEADERDIR} == netlib
+# Install all headers into subdirectories netlib or netlib64, link
+# the default ones to include, so that simple #include <cblas.h> works
+# as before, as well as with matching -Iincludedir.
+# This also gives us the option of selecting a different symlinked
+# default on the next reworking of BLAS stuff.
+	if ${TEST} -e "${DESTDIR}${PREFIX}/include/${HEADERDIR}"; then \
+	  cd "${DESTDIR}${PREFIX}/include"; for f in ${HEADERDIR}/*.h; do ln -s $$f .; done \
+	fi
+.endif
+
+.include "../../math/lapack/version.mk"
+
+post-extract:
+	${RUN} ${MKDIR} ${WRKSRC}/build
diff --git a/lapack64/PLIST b/lapack64/PLIST
new file mode 100644
index 0000000000..0db5dee1d6
--- /dev/null
+++ b/lapack64/PLIST
@@ -0,0 +1,6 @@
+@comment $NetBSD: PLIST,v 1.5 2020/10/12 21:51:57 bacon Exp $
+lib/liblapack64.a
+lib/liblapack64.so
+lib/liblapack64.so.3
+lib/liblapack64.so.${PKGVERSION}
+lib/pkgconfig/lapack64.pc
diff --git a/lapack64/buildlink3.mk b/lapack64/buildlink3.mk
new file mode 100644
index 0000000000..705f079841
--- /dev/null
+++ b/lapack64/buildlink3.mk
@@ -0,0 +1,16 @@
+# $NetBSD: buildlink3.mk,v 1.10 2020/10/12 21:51:57 bacon Exp $
+
+BUILDLINK_TREE+=	lapack64
+
+.if !defined(LAPACK64_BUILDLINK3_MK)
+LAPACK64_BUILDLINK3_MK:=
+
+BUILDLINK_API_DEPENDS.lapack64+=	lapack64>=3.9.0
+BUILDLINK_ABI_DEPENDS.lapack64+=	lapack64>=3.9.0
+BUILDLINK_PKGSRCDIR.lapack64?=		../../wip/lapack64
+
+.include "../../wip/blas64/buildlink3.mk"
+
+.endif # LAPACK64_BUILDLINK3_MK
+
+BUILDLINK_TREE+=	-lapack64
diff --git a/lapack64/version.mk b/lapack64/version.mk
new file mode 100644
index 0000000000..d6516de9b2
--- /dev/null
+++ b/lapack64/version.mk
@@ -0,0 +1,3 @@
+# $NetBSD: version.mk,v 1.2 2021/05/12 14:32:51 thor Exp $
+
+NETLIB_BLAS_VERSION=	3.9.1
diff --git a/lapacke/DESCR b/lapacke/DESCR
new file mode 100644
index 0000000000..f362526309
--- /dev/null
+++ b/lapacke/DESCR
@@ -0,0 +1,2 @@
+This is the C wrapper to the Linear Algebra PACKage (LAPACKE),
+extracted from the Netlib reference implementation of LAPACK.
diff --git a/lapacke/Makefile b/lapacke/Makefile
new file mode 100644
index 0000000000..f901daf354
--- /dev/null
+++ b/lapacke/Makefile
@@ -0,0 +1,17 @@
+# $NetBSD: Makefile,v 1.2 2021/06/10 00:18:52 thor Exp $
+
+COMMENT=	C interface to a LAPACK library
+PKGREVISION=	1
+
+LAPACK_COMPONENT=	lapacke
+LAPACK_COMPONENT_CMAKE_ARGS=	\
+	-DUSE_OPTIMIZED_BLAS=ON \
+	-DBLAS_LIBRARIES=-lblas \
+	-DUSE_OPTIMIZED_LAPACK=ON \
+	-DLAPACK_LIBRARIES=-llapack \
+	-DCBLAS=OFF -DLAPACKE=ON
+
+.include "../../math/lapack/buildlink3.mk"
+
+.include "../../wip/lapack64/Makefile.common"
+.include "../../mk/bsd.pkg.mk"
diff --git a/lapacke/PLIST b/lapacke/PLIST
new file mode 100644
index 0000000000..a18fb9bddf
--- /dev/null
+++ b/lapacke/PLIST
@@ -0,0 +1,16 @@
+@comment $NetBSD: PLIST,v 1.2 2021/06/10 00:18:52 thor Exp $
+include/lapack.h
+include/lapacke.h
+include/lapacke_config.h
+include/lapacke_mangling.h
+include/lapacke_utils.h
+include/netlib/lapack.h
+include/netlib/lapacke.h
+include/netlib/lapacke_config.h
+include/netlib/lapacke_mangling.h
+include/netlib/lapacke_utils.h
+lib/liblapacke.a
+lib/liblapacke.so
+lib/liblapacke.so.3
+lib/liblapacke.so.${PKGVERSION}
+lib/pkgconfig/lapacke.pc
diff --git a/lapacke/buildlink3.mk b/lapacke/buildlink3.mk
new file mode 100644
index 0000000000..8a8c98210f
--- /dev/null
+++ b/lapacke/buildlink3.mk
@@ -0,0 +1,14 @@
+# $NetBSD: buildlink3.mk,v 1.1 2021/04/20 20:40:47 thor Exp $
+
+BUILDLINK_TREE+=	lapacke
+
+.if !defined(LAPACKE_BUILDLINK3_MK)
+LAPACKE_BUILDLINK3_MK:=
+
+BUILDLINK_API_DEPENDS.lapacke+=	lapacke>=3.9.0
+BUILDLINK_PKGSRCDIR.lapacke?=	../../wip/lapacke
+
+.include	"../../math/lapack/buildlink3.mk"
+.endif
+
+BUILDLINK_TREE+=	-lapacke
diff --git a/lapacke64/DESCR b/lapacke64/DESCR
new file mode 100644
index 0000000000..f362526309
--- /dev/null
+++ b/lapacke64/DESCR
@@ -0,0 +1,2 @@
+This is the C wrapper to the Linear Algebra PACKage (LAPACKE),
+extracted from the Netlib reference implementation of LAPACK.
diff --git a/lapacke64/Makefile b/lapacke64/Makefile
new file mode 100644
index 0000000000..6c6347a406
--- /dev/null
+++ b/lapacke64/Makefile
@@ -0,0 +1,16 @@
+# $NetBSD: Makefile,v 1.1 2021/04/20 20:40:47 thor Exp $
+
+COMMENT=		C interface to a LAPACK library
+LAPACK_COMPONENT=	lapacke64
+LAPACK_COMPONENT_CMAKE_ARGS=	\
+	-DBUILD_INDEX64=ON \
+	-DUSE_OPTIMIZED_BLAS=ON \
+	-DBLAS_LIBRARIES=-lblas64 \
+	-DUSE_OPTIMIZED_LAPACK=ON \
+	-DLAPACK_LIBRARIES=-llapack64 \
+	-DCBLAS=OFF -DLAPACKE=ON
+
+.include "../../wip/lapack64/buildlink3.mk"
+.include "../../wip/lapack64/Makefile.common"
+
+.include "../../mk/bsd.pkg.mk"
diff --git a/lapacke64/PLIST b/lapacke64/PLIST
new file mode 100644
index 0000000000..9469ef2be5
--- /dev/null
+++ b/lapacke64/PLIST
@@ -0,0 +1,11 @@
+@comment $NetBSD$
+include/netlib64/lapack.h
+include/netlib64/lapacke.h
+include/netlib64/lapacke_config.h
+include/netlib64/lapacke_mangling.h
+include/netlib64/lapacke_utils.h
+lib/liblapacke64.a
+lib/liblapacke64.so
+lib/liblapacke64.so.3
+lib/liblapacke64.so.${PKGVERSION}
+lib/pkgconfig/lapacke64.pc
diff --git a/lapacke64/buildlink3.mk b/lapacke64/buildlink3.mk
new file mode 100644
index 0000000000..b9f2b288e5
--- /dev/null
+++ b/lapacke64/buildlink3.mk
@@ -0,0 +1,14 @@
+# $NetBSD: buildlink3.mk,v 1.1 2021/04/20 20:40:47 thor Exp $
+
+BUILDLINK_TREE+=	lapacke64
+
+.if !defined(LAPACKE64_BUILDLINK3_MK)
+LAPACKE64_BUILDLINK3_MK:=
+
+BUILDLINK_API_DEPENDS.lapacke64+=	lapacke64>=3.9.0
+BUILDLINK_PKGSRCDIR.lapacke?=	../../wip/lapacke64
+
+.include	"../../wip/lapack64/buildlink3.mk"
+.endif
+
+BUILDLINK_TREE+=	-lapacke64
diff --git a/mk/blas64.buildlink3.mk b/mk/blas64.buildlink3.mk
new file mode 100644
index 0000000000..200633e5b4
--- /dev/null
+++ b/mk/blas64.buildlink3.mk
@@ -0,0 +1,152 @@
+# $NetBSD: blas.buildlink3.mk,v 1.1 2020/10/12 21:51:57 bacon Exp $
+#
+# This Makefile fragment is meant to be included by packages that use any
+# ILP64 BLAS (Basic Linear Algebra System with 64 bit indices) implementation
+# instead of one particular one.
+#
+# Since pkgsrc always ships BLAS and LAPACK together (as upstream
+# implementations do), this adds both BLAS_LIBS and LAPACK_LIBS to the linker
+# flags.  Often, they will be identical or at least redundant. It is a matter
+# of style to stay consistent in their use.
+#
+# Keywords: blas lapack netlib atlas openblas mkl
+#
+# === User-settable variables ===
+#
+# PKGSRC_BLAS_TYPES
+#  This value specifies an exhaustive list of BLAS implementations we wish to
+#  use in this pkgsrc installation, in descending order of preference.
+#  The implementation selected for a build will be the first one in
+#  PKGSRC_BLAS_TYPES that also appears in BLAS_ACCEPTED (see below).
+#  Typically set in mk.conf.
+#
+#  Possible: one or more of netlib, openblas, openblas_pthread,
+#    openblas_openmp, and maybe sometime Apple's accelerate.framework
+#    (to come: Intel MKL, other external optimized builds)
+#
+#  Default: All currently supported implementations (${_BLAS_TYPES})
+#
+# === Package-settable variables ===
+#
+# BLAS_ACCEPTED
+#   This is a list of blas packages that are compatible with the current
+#   package. If not set, any BLAS implementation is OK.
+#   Typically set in package Makefile.
+#
+# BLAS_C_INTERFACE
+#   Set to yes if the package requires CBLAS or LAPACKE. This defines
+#   BLAS_INCLUDES and pulls in additional packages for netlib. Optimized
+#   implementations include the C interfaces in the main library anyway,
+#   but you still have the effect on BLAS_INCLUDES.
+#
+# === Variables automatically set here for use in package builds ===
+# 
+# BLAS_TYPE
+#   This is the BLAS implementation chosen for a particular package build from
+#   PKGSRC_BLAS_TYPES and BLAS_ACCEPTED.  If PKGSRC_BLAS_TYPES and
+#   BLAS_ACCEPTED have no implementations in common, it defaults to none
+#   and the build fails.
+# BLAS_LIBS
+#   Linker flags used for linking to BLAS library
+# LAPACK_LIBS
+#   Linker flags used for linking to LAPACK library
+# CBLAS_LIBS
+#   Linker flags used for linking to CBLAS library
+# LAPACKE_LIBS
+#   Linker flags used for linking to LAPACKE library
+# BLAS_INCLUDES
+#   Preprocessor flags to locate/use C interfaces
+
+.if defined(MK_BLAS_BUILDLINK3_MK)
+
+PKG_FAIL_REASON+=	\
+	"Attempt to mix 32 and 64 bit indices in BLAS for ${PKGNAME}."
+
+.elif !defined(MK_BLAS_BUILDLINK3_MK)
+
+MK_BLAS_BUILDLINK3_MK=
+
+BUILD_DEFS+=		PKGSRC_BLAS_TYPES
+BUILD_DEFS_EFFECTS+=	BLAS_TYPE BLAS_LIBS LAPACK_LIBS
+
+.include "../../mk/bsd.prefs.mk"
+
+# List of all possible BLAS choices, in order of *DEFAULT* preference.
+# netlib is the reference implementation to which all others conform and
+# should come first by default for maximum compatibility.  It is also the
+# slowest and not desirable in many situations.  Users can override by setting
+# PKGSRC_BLAS_TYPES. (See comment above)
+_BLAS_TYPES=	netlib openblas openblas_pthread openblas_openmp
+# TODO: Check if ILP64 is available from the framework
+# Darwin
+#.if exists(/System/Library/Frameworks/Accelerate.framework)
+#_BLAS_TYPES+=	accelerate.framework
+#.endif
+
+BLAS_ACCEPTED?=	${_BLAS_TYPES}
+PKGSRC_BLAS_TYPES?= ${_BLAS_TYPES}
+
+_BLAS_MATCH=
+.for b in ${PKGSRC_BLAS_TYPES}
+_BLAS_MATCH+=	${BLAS_ACCEPTED:M${b}}
+.endfor
+.if !empty(_BLAS_MATCH)
+BLAS_TYPE=	${_BLAS_MATCH:[1]}
+.else
+BLAS_TYPE=	none
+.endif
+
+.if ${BLAS_TYPE} == "netlib"
+_BLAS_PKGPATH=		wip/lapack64
+_CBLAS_PKGPATH=		wip/cblas64
+_LAPACKE_PKGPATH=	wip/lapacke64
+BLAS_LIBS=	-lblas64
+LAPACK_LIBS=	-llapack64 ${BLAS_LIBS}
+CBLAS_LIBS=	-lcblas64 ${BLAS_LIBS}
+LAPACKE_LIBS=	-llapacke64 ${LAPACK_LIBS}
+BLAS_INCLUDES=	-I${PREFIX}/include/netlib64 -DWeirdNEC -DHAVE_LAPACK_CONFIG_H -DLAPACK_ILP64
+.elif ${BLAS_TYPE} == "openblas"
+_BLAS_PKGPATH=	wip/openblas64
+BLAS_LIBS=	-lopenblas64
+LAPACK_LIBS=	${BLAS_LIBS}
+CBLAS_LIBS=	${BLAS_LIBS}
+LAPACKE_LIBS=	${BLAS_LIBS}
+BLAS_INCLUDES=	-I${PREFIX}/include/openblas64
+.elif ${BLAS_TYPE} == "openblas_pthread"
+_BLAS_PKGPATH=	wip/openblas64_pthread
+BLAS_LIBS=	-lopenblas64_pthread
+LAPACK_LIBS=	${BLAS_LIBS}
+CBLAS_LIBS=	${BLAS_LIBS}
+LAPACKE_LIBS=	${BLAS_LIBS}
+BLAS_INCLUDES=	-I${PREFIX}/include/openblas64_pthread
+.elif ${BLAS_TYPE} == "openblas64_openmp"
+_BLAS_PKGPATH=	wip/openblas64_openmp
+BLAS_LIBS=	-lopenblas64_openmp
+LAPACK_LIBS=	${BLAS_LIBS}
+CBLAS_LIBS=	${BLAS_LIBS}
+LAPACKE_LIBS=	${BLAS_LIBS}
+BLAS_INCLUDES=	-I${PREFIX}/include/openblas64_openmp
+#.elif ${BLAS_TYPE} == "accelerate.framework"
+#BLAS_LIBS=	-framework Accelerate
+#LAPACK_LIBS=	${BLAS_LIBS}
+.else # invalid or unimplemented type
+PKG_FAIL_REASON+=	\
+	"There is no acceptable 64 bit BLAS for ${PKGNAME} in: ${PKGSRC_BLAS_TYPES}."
+.endif
+
+.if defined(_BLAS_PKGPATH)
+.include "../../${_BLAS_PKGPATH}/buildlink3.mk"
+.endif
+
+.if !empty(BLAS_C_INTERFACE:Myes)
+.  if defined(_CBLAS_PKGPATH)
+.    include "../../${_CBLAS_PKGPATH}/buildlink3.mk"
+.  endif
+.  if defined(_LAPACKE_PKGPATH)
+.    include "../../${_LAPACKE_PKGPATH}/buildlink3.mk"
+.  endif
+.else
+.  undef	BLAS_INCLUDES
+.endif
+
+.endif # BLAS_BUILDLINK3_MK
diff --git a/openblas/DESCR b/openblas/DESCR
new file mode 100644
index 0000000000..adbd300642
--- /dev/null
+++ b/openblas/DESCR
@@ -0,0 +1,6 @@
+OpenBLAS is an optimized BLAS library based on GotoBLAS2 1.13 BSD version.
+OpenBLAS is an open source project supported by
+Lab of Parallel Software and Computational Science, ISCAS.
+
+This package builds the serial library working with indices of 64 bits
+(INTERFACE64=1).
diff --git a/openblas/Makefile b/openblas/Makefile
new file mode 100644
index 0000000000..acd69612a2
--- /dev/null
+++ b/openblas/Makefile
@@ -0,0 +1,8 @@
+# $NetBSD: Makefile,v 1.3 2021/05/29 19:57:21 thor Exp $
+
+MAINTAINER=	thomas.orgis%uni-hamburg.de@localhost
+PKGREVISION=1
+
+OPENBLAS_VARIANT= openblas
+.include "../../wip/openblas/Makefile.common"
+.include "../../mk/bsd.pkg.mk"
diff --git a/openblas/Makefile.common b/openblas/Makefile.common
new file mode 100644
index 0000000000..78fd9dca3d
--- /dev/null
+++ b/openblas/Makefile.common
@@ -0,0 +1,126 @@
+# $NetBSD: Makefile.common,v 1.3 2021/05/29 19:57:21 thor Exp $
+#
+# used by math/openblas_pthread/Makefile
+# used by math/openblas_openmp/Makefile
+# used by math/openblas/Makefile
+# used by math/openblas64_pthread/Makefile
+# used by math/openblas64_openmp/Makefile
+# used by math/openblas64/Makefile
+#
+# This is the common Makefile for OpenBLAS builds. It depends on
+# OPENBLAS_VARIANT = (openblas|openblas_pthread|openblas_openmp)
+# being set.
+
+DISTNAME=	OpenBLAS-${OPENBLAS_VERSION}
+PKGNAME=	${OPENBLAS_VARIANT}-${OPENBLAS_VERSION}
+DIST_SUBDIR=	openblas-${OPENBLAS_VERSION}
+CATEGORIES=	math
+MASTER_SITES=	${MASTER_SITE_GITHUB:=xianyi/} \
+		http://www.netlib.org/lapack/timing/
+DISTFILES=	${DISTNAME}.tar.gz ${LARGE_FILE} ${TIMING_FILE}
+LARGE_FILE=	large.tgz
+TIMING_FILE=	timing.tgz
+GITHUB_PROJECT=	OpenBLAS
+GITHUB_TAG=	v${OPENBLAS_VERSION}
+
+DISTINFO_FILE=	${.CURDIR}/../../math/openblas/distinfo
+PATCHDIR=	${.CURDIR}/../../math/openblas/patches
+
+HOMEPAGE=	https://github.com/xianyi/OpenBLAS
+COMMENT=	Optimized BLAS library based on GotoBLAS2
+LICENSE=	modified-bsd
+
+# Darwin has a .so/.dylib PLIST issue
+# Untested on other platforms
+ONLY_FOR_PLATFORM=	Linux-*-* NetBSD-*-*
+
+USE_LANGUAGES=	c fortran
+USE_TOOLS+=	gmake perl:build
+
+NO_CONFIGURE=	yes
+
+TEST_TARGET=	tests
+
+# Also set compilers explicitly, overriding Makefile.rule
+MAKE_FLAGS+=	CC=${CC:Q}
+MAKE_FLAGS+=	CXX=${CXX:Q}
+MAKE_FLAGS+=	FC=${FC:Q}
+
+# You may override the autodetected thread count limit.
+# Default is detected from build host, which may differ from run host.
+BUILD_DEFS+=	OPENBLAS_THREAD_LIMIT
+
+.include "../../mk/bsd.prefs.mk"
+
+# Using conservative default of 32 threads as that matches the
+# limit for related stack arrays in OpenBLAS. Might raise it
+# in future, anyway. There some memory usage/efficiency tradeoff
+# when this number is excessively high.
+OPENBLAS_THREAD_LIMIT?=	32
+.if !empty(OPENBLAS_THREAD_LIMIT)
+MAKE_FLAGS+=		NUM_THREADS=${OPENBLAS_THREAD_LIMIT:Q}
+.endif
+BENCHMARK_MAXTHREADS?=	8
+
+.if ${MACHINE_ARCH:M*64} == ""
+MAKE_FLAGS+=		BINARY32=1
+.  if !empty(OPENBLAS_VARIANT:M*64*)
+PKG_FAIL_REASON+=       "${OPENBLAS_VARIANT} incompatible with non-64-bit platform"
+.  endif
+.else
+MAKE_FLAGS+=		BINARY64=1
+.endif
+
+# Build with the C APIs, as do other optimized libraries.
+#MAKE_FLAGS+=		NO_CBLAS=0 NO_LAPACKE=0
+
+# Separate headers and cmake stuff.
+MAKE_FLAGS+=	OPENBLAS_INCLUDE_DIR=${PREFIX}/include/${OPENBLAS_VARIANT}
+MAKE_FLAGS+=	OPENBLAS_CMAKE_DIR=${PREFIX}/lib/cmake/${OPENBLAS_VARIANT}
+
+# TODO: Set INTERFACE64=1 with additional OPENBLAS_VARIANTs.
+# Need to settle on a convention for SYMBOLSUFFIX first, see
+# https://github.com/xianyi/OpenBLAS/issues/646 .
+MAKE_FLAGS+=	FIXED_LIBNAME=1
+.if ${OPENBLAS_VARIANT} == openblas || ${OPENBLAS_VARIANT} == openblas64
+MAKE_FLAGS+=	USE_OPENMP=0 USE_THREAD=0 USE_LOCKING=1
+BENCHMARK_ENV=	USE_SIMPLE_THREADED_LEVEL3=1
+.elif !empty(OPENBLAS_VARIANT:Mopenblas*_pthread)
+MAKE_FLAGS+=	LIBNAMESUFFIX=pthread
+MAKE_FLAGS+=	USE_OPENMP=0 USE_THREAD=1
+BENCHMARK_ENV=	OPENBLAS_NUM_THREADS=${BENCHMARK_MAXTHREADS}
+.elif !empty(OPENBLAS_VARIANT:Mopenblas*_openmp)
+MAKE_FLAGS+=	LIBNAMESUFFIX=openmp
+MAKE_FLAGS+=	USE_OPENMP=1 NO_AFFINITY=1
+BENCHMARK_ENV=	OMP_NUM_THREADS=${BENCHMARK_MAXTHREADS}
+.endif
+
+.if !empty(OPENBLAS_VARIANT:M*64*)
+MAKE_FLAGS+=	INTERFACE64=1 LIBSONAMEBASE=openblas64
+.endif
+
+SUBST_CLASSES+=		threads
+SUBST_STAGE.threads=	pre-build
+SUBST_SED.threads+=	-e "s+OPENBLAS_NUM_THREADS+OMP_NUM_THREADS+g"
+SUBST_FILES.threads+=	test/Makefile
+SUBST_FILES.threads+=	ctest/Makefile
+
+PLIST_SRC=	${.CURDIR}/../../wip/openblas/PLIST
+PLIST_SUBST+=	OPENBLAS_VARIANT=${OPENBLAS_VARIANT}
+
+post-extract:
+	rm ${WRKSRC}/relapack/src/lapack_wrappers.c.orig
+	(cd ${DISTDIR}/${DIST_SUBDIR} && \
+		${CP} ${LARGE_FILE} ${TIMING_FILE} ${WRKSRC})
+
+# This builds some benchmark programs you can call from ${WRKSRC} afterwards.
+.PHONY: benchmark
+benchmark: build
+	(cd ${WRKSRC} && ${SETENV} ${MAKE_ENV} ${BENCHMARK_ENV} \
+		${MAKE_PROGRAM} ${MAKE_FLAGS} hpl)
+	(cd ${WRKSRC}/benchmark && ${SETENV} ${MAKE_ENV} \
+		${BENCHMARK_ENV} ${MAKE_PROGRAM} ${MAKE_FLAGS})
+
+.include "../../math/openblas/version.mk"
+
+.include "options.mk"
diff --git a/openblas/PLIST b/openblas/PLIST
new file mode 100644
index 0000000000..573e3f44c7
--- /dev/null
+++ b/openblas/PLIST
@@ -0,0 +1,16 @@
+@comment $NetBSD$
+include/${OPENBLAS_VARIANT}/cblas.h
+include/${OPENBLAS_VARIANT}/f77blas.h
+include/${OPENBLAS_VARIANT}/lapack.h
+include/${OPENBLAS_VARIANT}/lapacke.h
+include/${OPENBLAS_VARIANT}/lapacke_config.h
+include/${OPENBLAS_VARIANT}/lapacke_mangling.h
+include/${OPENBLAS_VARIANT}/lapacke_utils.h
+include/${OPENBLAS_VARIANT}/openblas_config.h
+lib/cmake/${OPENBLAS_VARIANT}/OpenBLASConfig.cmake
+lib/cmake/${OPENBLAS_VARIANT}/OpenBLASConfigVersion.cmake
+lib/lib${OPENBLAS_VARIANT}.a
+lib/lib${OPENBLAS_VARIANT}.so
+lib/lib${OPENBLAS_VARIANT}.so.0
+lib/pkgconfig/${OPENBLAS_VARIANT}.pc
+@pkgdir bin
diff --git a/openblas/buildlink3.mk b/openblas/buildlink3.mk
new file mode 100644
index 0000000000..39fcabde91
--- /dev/null
+++ b/openblas/buildlink3.mk
@@ -0,0 +1,12 @@
+# $NetBSD: buildlink3.mk,v 1.1 2020/11/05 16:31:45 bacon Exp $
+
+BUILDLINK_TREE+=	openblas64
+
+.if !defined(OPENBLAS64_BUILDLINK3_MK)
+OPENBLAS64_BUILDLINK3_MK:=
+
+BUILDLINK_API_DEPENDS.openblas64+=	openblas64>=0.3.5
+BUILDLINK_PKGSRCDIR.openblas64?=	../../wip/openblas64
+.endif	# OPENBLAS64_BUILDLINK3_MK
+
+BUILDLINK_TREE+=	-openblas64
diff --git a/openblas/distinfo b/openblas/distinfo
new file mode 100644
index 0000000000..aeeaf0d9b0
--- /dev/null
+++ b/openblas/distinfo
@@ -0,0 +1,24 @@
+$NetBSD: distinfo,v 1.3 2021/05/29 19:57:21 thor Exp $
+
+SHA1 (openblas-0.3.15/OpenBLAS-0.3.15.tar.gz) = d7d1f67c1ef0c14c93761bdf44f0da8d0dd4bc0f
+RMD160 (openblas-0.3.15/OpenBLAS-0.3.15.tar.gz) = b740a744c0405d036c39ee5224b7d18f542db788
+SHA512 (openblas-0.3.15/OpenBLAS-0.3.15.tar.gz) = c07964ead5ffe9cf088364697bfe5cb409170663e420bdcd08a6366a028625d2a3c23ee4ddbaf0e625860a9fd08cbbb39f97eb985c366c052696d6f8598a844f
+Size (openblas-0.3.15/OpenBLAS-0.3.15.tar.gz) = 12498434 bytes
+SHA1 (openblas-0.3.15/large.tgz) = a689e5b180595b40c5719b0f358b31b15b57a2db
+RMD160 (openblas-0.3.15/large.tgz) = 8010ff4002ef42cf22a9ee9345011d68fc27d855
+SHA512 (openblas-0.3.15/large.tgz) = e24db2b8a4253ccff9ca196815901c1fefd55e882f4fe1085715ac84b8f318e1842a91072130c17fdd144344ffc80233a77500da9349acb54e504b3935825965
+Size (openblas-0.3.15/large.tgz) = 2595 bytes
+SHA1 (openblas-0.3.15/timing.tgz) = fd47fc3f26d142a791df51e4a422a49662507252
+RMD160 (openblas-0.3.15/timing.tgz) = f0fe220e7ab611d4db8d8cab960361955e2ab093
+SHA512 (openblas-0.3.15/timing.tgz) = be0abfcfffdf0e118ed7e25a8451639833cf0ad6bb04d101bbe194c16f656b6ce509b2f76acf4ad626d1fb5b126bd5498cfea262f2946c2d077751112a2906af
+Size (openblas-0.3.15/timing.tgz) = 1059485 bytes
+SHA1 (patch-Makefile) = 6b1db300b5487fca53e7c41c27b64017658e6375
+SHA1 (patch-Makefile.install) = eadba533232b2bf7c6ab5e4efe0db9206f35011d
+SHA1 (patch-Makefile.rule) = 45b6b4576fb521fa093252c63b899d4178a516b6
+SHA1 (patch-Makefile.system) = 6dc9fd85731ca88cb1fdb9063ba3baa31edbcfb8
+SHA1 (patch-common__arm.h) = f08ec61bee8317daac267e90a79f46097b3431c9
+SHA1 (patch-cpuid__arm.c) = 20f95cede90cbe548c0cd09ed2e3d37d1d4aeabd
+SHA1 (patch-cpuid_ia64.c) = 39649319b8c0a37b8d494e3c03b1ddb6fb616603
+SHA1 (patch-f_check) = 9181958ddd7dca16f28b1144ce7f400b5ab36301
+SHA1 (patch-getarch.c) = 0cf098b7203586206df95b24d1e95b0b5b9fd500
+SHA1 (patch-interface__ztrmv.c) = 6038946f8fb9542e680178ece2bd0d0d5853baad
diff --git a/openblas/options.mk b/openblas/options.mk
new file mode 100644
index 0000000000..f43c5db6f1
--- /dev/null
+++ b/openblas/options.mk
@@ -0,0 +1,18 @@
+# $NetBSD: options.mk,v 1.1 2020/11/05 16:31:45 bacon Exp $
+
+PKG_OPTIONS_VAR=	PKG_OPTIONS.openblas
+# Auto-detect CPU features at runtime or use static features from build host
+PKG_SUPPORTED_OPTIONS=	dynamic-arch
+PKG_SUGGESTED_OPTIONS=	dynamic-arch
+
+.include "../../mk/bsd.prefs.mk"
+.include "../../mk/bsd.options.mk"
+
+.if !empty(PKG_OPTIONS:Mdynamic-arch)
+MAKE_FLAGS+=	DYNAMIC_ARCH=1
+.else
+MAKE_FLAGS+=	DYNAMIC_ARCH=0
+.endif
+
+# Other options create variants of the library, not configurations of one.
+# Especially INTERFACE64, which changes the API!
diff --git a/openblas/patches/patch-Makefile b/openblas/patches/patch-Makefile
new file mode 100644
index 0000000000..fdfebd9f97
--- /dev/null
+++ b/openblas/patches/patch-Makefile
@@ -0,0 +1,83 @@
+$NetBSD: patch-Makefile,v 1.3 2021/05/29 19:57:21 thor Exp $
+
+Remove special library names.
+
+--- Makefile.orig	2021-05-02 21:50:22.000000000 +0000
++++ Makefile
+@@ -120,18 +120,28 @@ shared :
+ ifneq ($(NO_SHARED), 1)
+ ifeq ($(OSNAME), $(filter $(OSNAME),Linux SunOS Android Haiku FreeBSD DragonFly))
+ 	@$(MAKE) -C exports so
++ifneq ($(LIBSONAME), $(LIBPREFIX).so)
+ 	@ln -fs $(LIBSONAME) $(LIBPREFIX).so
++endif
++ifneq ($(LIBSONAME), $(LIBPREFIX).so.$(MAJOR_VERSION))
+ 	@ln -fs $(LIBSONAME) $(LIBPREFIX).so.$(MAJOR_VERSION)
+ endif
++endif
+ ifeq ($(OSNAME), $(filter $(OSNAME),OpenBSD NetBSD))
+ 	@$(MAKE) -C exports so
++ifneq ($(LIBSONAME), $(LIBPREFIX).so)
+ 	@ln -fs $(LIBSONAME) $(LIBPREFIX).so
+ endif
++endif
+ ifeq ($(OSNAME), Darwin)
+ 	@$(MAKE) -C exports dyn
++ifneq ($(LIBDYNNAME), $(LIBPREFIX).dylib)
+ 	@ln -fs $(LIBDYNNAME) $(LIBPREFIX).dylib
++endif
++ifneq ($(LIBDYNNAME), $(LIBPREFIX).$(MAJOR_VERSION).dylib)
+ 	@ln -fs $(LIBDYNNAME) $(LIBPREFIX).$(MAJOR_VERSION).dylib
+ endif
++endif
+ ifeq ($(OSNAME), WINNT)
+ 	@$(MAKE) -C exports dll
+ endif
+@@ -195,13 +205,17 @@ endif
+ ifdef USE_THREAD
+ 	@echo USE_THREAD=$(USE_THREAD) >>  Makefile.conf_last
+ endif
++ifneq ($(LIBNAME), $(LIBPREFIX).$(LIBSUFFIX))
+ 	@-ln -fs $(LIBNAME) $(LIBPREFIX).$(LIBSUFFIX)
++endif
+ 	@touch lib.grd
+ 
+ prof : prof_blas prof_lapack
+ 
+ prof_blas :
++ifneq ($(LIBNAME_P), $(LIBPREFIX)_p.$(LIBSUFFIX))
+ 	ln -fs $(LIBNAME_P) $(LIBPREFIX)_p.$(LIBSUFFIX)
++endif
+ 	for d in $(SUBDIRS) ; \
+ 	do if test -d $$d; then \
+ 	  $(MAKE) -C $$d prof || exit 1 ; \
+@@ -212,7 +226,9 @@ ifeq ($(DYNAMIC_ARCH), 1)
+ endif
+ 
+ blas :
++ifneq ($(LIBNAME), $(LIBPREFIX).$(LIBSUFFIX))
+ 	ln -fs $(LIBNAME) $(LIBPREFIX).$(LIBSUFFIX)
++endif
+ 	for d in $(BLASDIRS) ; \
+ 	do if test -d $$d; then \
+ 	  $(MAKE) -C $$d libs || exit 1 ; \
+@@ -220,7 +236,9 @@ blas :
+ 	done
+ 
+ hpl :
++ifneq ($(LIBNAME), $(LIBPREFIX).$(LIBSUFFIX))
+ 	ln -fs $(LIBNAME) $(LIBPREFIX).$(LIBSUFFIX)
++endif
+ 	for d in $(BLASDIRS) ../laswp exports ; \
+ 	do if test -d $$d; then \
+ 	  $(MAKE) -C $$d $(@F) || exit 1 ; \
+@@ -234,7 +252,9 @@ ifeq ($(DYNAMIC_ARCH), 1)
+ endif
+ 
+ hpl_p :
++ifneq ($(LIBNAME_P), $(LIBPREFIX)_p.$(LIBSUFFIX))
+ 	ln -fs $(LIBNAME_P) $(LIBPREFIX)_p.$(LIBSUFFIX)
++endif
+ 	for d in $(SUBDIRS) ../laswp exports ; \
+ 	do if test -d $$d; then \
+ 	  $(MAKE) -C $$d $(@F) || exit 1 ; \
diff --git a/openblas/patches/patch-Makefile.install b/openblas/patches/patch-Makefile.install
new file mode 100644
index 0000000000..2cf3d89a2e
--- /dev/null
+++ b/openblas/patches/patch-Makefile.install
@@ -0,0 +1,86 @@
+$NetBSD: patch-Makefile.install,v 1.3 2021/05/29 19:57:21 thor Exp $
+
+Second part of removing the special library names.
+
+--- Makefile.install.orig	2021-05-02 21:50:22.000000000 +0000
++++ Makefile.install
+@@ -85,29 +85,35 @@ endif
+ ifneq ($(NO_STATIC),1)
+ 	@echo Copying the static library to $(DESTDIR)$(OPENBLAS_LIBRARY_DIR)
+ 	@install -pm644 $(LIBNAME) "$(DESTDIR)$(OPENBLAS_LIBRARY_DIR)"
++ifneq ($(LIBNAME), $(LIBPREFIX).$(LIBSUFFIX))
+ 	@cd "$(DESTDIR)$(OPENBLAS_LIBRARY_DIR)" ; \
+ 	ln -fs $(LIBNAME) $(LIBPREFIX).$(LIBSUFFIX)
+ endif
++endif
+ #for install shared library
+ ifneq ($(NO_SHARED),1)
+ 	@echo Copying the shared library to $(DESTDIR)$(OPENBLAS_LIBRARY_DIR)
+ ifeq ($(OSNAME), $(filter $(OSNAME),Linux SunOS Android Haiku FreeBSD DragonFly))
+ 	@install -pm755 $(LIBSONAME) "$(DESTDIR)$(OPENBLAS_LIBRARY_DIR)"
+ 	@cd "$(DESTDIR)$(OPENBLAS_LIBRARY_DIR)" ; \
+-	ln -fs $(LIBSONAME) $(LIBPREFIX).so ; \
+-	ln -fs $(LIBSONAME) $(LIBPREFIX).so.$(MAJOR_VERSION)
++	if ! test $(LIBSONAME) = $(LIBPREFIX).so; then \
++	ln -fs $(LIBSONAME) $(LIBPREFIX).so ; fi ; \
++	if ! test $(LIBSONAME) = $(LIBPREFIX).so.$(MAJOR_VERSION); then \
++	ln -fs $(LIBSONAME) $(LIBPREFIX).so.$(MAJOR_VERSION); fi
+ endif
+ 
+ ifeq ($(OSNAME), $(filter $(OSNAME),OpenBSD NetBSD))
+ 	@cp $(LIBSONAME) "$(DESTDIR)$(OPENBLAS_LIBRARY_DIR)"
++ifneq ($(LIBSONAME), $(LIBPREFIX).so)
+ 	@cd "$(DESTDIR)$(OPENBLAS_LIBRARY_DIR)" ; \
+ 	ln -fs $(LIBSONAME) $(LIBPREFIX).so
+ endif
++endif
+ ifeq ($(OSNAME), Darwin)
+ 	@-cp $(LIBDYNNAME) "$(DESTDIR)$(OPENBLAS_LIBRARY_DIR)"
+ 	@-install_name_tool -id "$(OPENBLAS_LIBRARY_DIR)/$(LIBPREFIX).$(MAJOR_VERSION).dylib" "$(DESTDIR)$(OPENBLAS_LIBRARY_DIR)/$(LIBDYNNAME)"
+ 	@cd "$(DESTDIR)$(OPENBLAS_LIBRARY_DIR)" ; \
+-	ln -fs $(LIBDYNNAME) $(LIBPREFIX).dylib ; \
++	if ! test $(LIBDYNNAME) = $(LIBPREFIX).dylib; then ln -fs $(LIBDYNNAME) $(LIBPREFIX).dylib; fi ; \
+ 	ln -fs $(LIBDYNNAME) $(LIBPREFIX).$(MAJOR_VERSION).dylib
+ endif
+ ifeq ($(OSNAME), WINNT)
+@@ -135,28 +141,32 @@ endif
+ ifneq ($(NO_STATIC),1)
+ 	@echo Copying the static library to $(DESTDIR)$(OPENBLAS_LIBRARY_DIR)
+ 	@installbsd -c -m 644 $(LIBNAME) "$(DESTDIR)$(OPENBLAS_LIBRARY_DIR)"
++ifneq ($(LIBNAME), $(LIBPREFIX).$(LIBSUFFIX))
+ 	@cd "$(DESTDIR)$(OPENBLAS_LIBRARY_DIR)" ; \
+ 	ln -fs $(LIBNAME) $(LIBPREFIX).$(LIBSUFFIX)
+ endif
++endif
+ #for install shared library
+ ifneq ($(NO_SHARED),1)
+ 	@echo Copying the shared library to $(DESTDIR)$(OPENBLAS_LIBRARY_DIR)
+ 	@installbsd -c -m 755 $(LIBSONAME) "$(DESTDIR)$(OPENBLAS_LIBRARY_DIR)"
+ 	@cd "$(DESTDIR)$(OPENBLAS_LIBRARY_DIR)" ; \
+-	ln -fs $(LIBSONAME) $(LIBPREFIX).so ; \
+-	ln -fs $(LIBSONAME) $(LIBPREFIX).so.$(MAJOR_VERSION)
++	if ! test $(LIBSONAME) = $(LIBPREFIX).so; then \
++	ln -fs $(LIBSONAME) $(LIBPREFIX).so ; fi ; \
++	if ! test $(LIBSONAME) = $(LIBPREFIX).so.$(MAJOR_VERSION); then \
++	ln -fs $(LIBSONAME) $(LIBPREFIX).so.$(MAJOR_VERSION) ; fi
+ endif
+ 
+ endif
+ 
+ #Generating openblas.pc
+ 	@echo Generating $(LIBSONAMEBASE).pc in "$(DESTDIR)$(OPENBLAS_PKGCONFIG_DIR)"
+-	@echo 'libdir='$(OPENBLAS_LIBRARY_DIR) > "$(DESTDIR)$(OPENBLAS_PKGCONFIG_DIR)/$(LIBSONAMEBASE).pc"
+-	@echo 'includedir='$(OPENBLAS_INCLUDE_DIR) >> "$(DESTDIR)$(OPENBLAS_PKGCONFIG_DIR)/$(LIBSONAMEBASE).pc"
+-	@echo 'openblas_config= USE_64BITINT='$(USE_64BITINT) 'DYNAMIC_ARCH='$(DYNAMIC_ARCH) 'DYNAMIC_OLDER='$(DYNAMIC_OLDER) 'NO_CBLAS='$(NO_CBLAS) 'NO_LAPACK='$(NO_LAPACK) 'NO_LAPACKE='$(NO_LAPACKE) 'NO_AFFINITY='$(NO_AFFINITY) 'USE_OPENMP='$(USE_OPENMP) $(CORE) 'MAX_THREADS='$(NUM_THREADS)>> "$(DESTDIR)$(OPENBLAS_PKGCONFIG_DIR)/$(LIBSONAMEBASE).pc"
+-	@echo 'version='$(VERSION) >> "$(DESTDIR)$(OPENBLAS_PKGCONFIG_DIR)/$(LIBSONAMEBASE).pc"
+-	@echo 'extralib='$(PKG_EXTRALIB) >> "$(DESTDIR)$(OPENBLAS_PKGCONFIG_DIR)/$(LIBSONAMEBASE).pc"
+-	@cat openblas.pc.in >> "$(DESTDIR)$(OPENBLAS_PKGCONFIG_DIR)/$(LIBSONAMEBASE).pc"
++	@echo 'libdir='$(OPENBLAS_LIBRARY_DIR) > "$(DESTDIR)$(OPENBLAS_PKGCONFIG_DIR)/$(LIBNAMEBASE).pc"
++	@echo 'includedir='$(OPENBLAS_INCLUDE_DIR) >> "$(DESTDIR)$(OPENBLAS_PKGCONFIG_DIR)/$(LIBNAMEBASE).pc"
++	@echo 'openblas_config= USE_64BITINT='$(USE_64BITINT) 'DYNAMIC_ARCH='$(DYNAMIC_ARCH) 'DYNAMIC_OLDER='$(DYNAMIC_OLDER) 'NO_CBLAS='$(NO_CBLAS) 'NO_LAPACK='$(NO_LAPACK) 'NO_LAPACKE='$(NO_LAPACKE) 'NO_AFFINITY='$(NO_AFFINITY) 'USE_OPENMP='$(USE_OPENMP) $(CORE) 'MAX_THREADS='$(NUM_THREADS)>> "$(DESTDIR)$(OPENBLAS_PKGCONFIG_DIR)/$(LIBNAMEBASE).pc"
++	@echo 'version='$(VERSION) >> "$(DESTDIR)$(OPENBLAS_PKGCONFIG_DIR)/$(LIBNAMEBASE).pc"
++	@echo 'extralib='$(PKG_EXTRALIB) >> "$(DESTDIR)$(OPENBLAS_PKGCONFIG_DIR)/$(LIBNAMEBASE).pc"
++	@cat openblas.pc.in | sed -e 's,-lopenblas$$,-l$(LIBNAMEBASE),' >> "$(DESTDIR)$(OPENBLAS_PKGCONFIG_DIR)/$(LIBNAMEBASE).pc"
+ 
+ 
+ #Generating OpenBLASConfig.cmake
diff --git a/openblas/patches/patch-Makefile.rule b/openblas/patches/patch-Makefile.rule
new file mode 100644
index 0000000000..fa90cf2613
--- /dev/null
+++ b/openblas/patches/patch-Makefile.rule
@@ -0,0 +1,17 @@
+$NetBSD: patch-Makefile.rule,v 1.1 2021/05/29 19:57:21 thor Exp $
+
+Stable library names, determined by our choice only.
+
+--- Makefile.rule.orig	2021-05-02 21:50:22.000000000 +0000
++++ Makefile.rule
+@@ -10,6 +10,10 @@ VERSION = 0.3.15
+ # is libopenblas_$(LIBNAMESUFFIX).so.0.
+ # LIBNAMESUFFIX = omp
+ 
++# Set this to cause the primary library name be actually ruled by the above,
++# not just a symlink to a library name determined by chosen CPU etc.
++# FIXED_LIBNAME = 1
++
+ # You can specify the target architecture, otherwise it's
+ # automatically detected.
+ # TARGET = PENRYN
diff --git a/openblas/patches/patch-Makefile.system b/openblas/patches/patch-Makefile.system
new file mode 100644
index 0000000000..572653900a
--- /dev/null
+++ b/openblas/patches/patch-Makefile.system
@@ -0,0 +1,35 @@
+$NetBSD: patch-Makefile.system,v 1.3 2021/05/29 19:57:21 thor Exp $
+
+Stable library names, determined by our choice only.
+
+--- Makefile.system.orig	2021-05-02 21:50:22.000000000 +0000
++++ Makefile.system
+@@ -1510,6 +1510,10 @@ ifndef LIBSUFFIX
+ LIBSUFFIX = a
+ endif
+ 
++ifeq ($(FIXED_LIBNAME), 1)
++LIBNAME		= $(LIBPREFIX).$(LIBSUFFIX)
++LIBNAME_P	= $(LIBPREFIX)_p.$(LIBSUFFIX)
++else
+ ifneq ($(DYNAMIC_ARCH), 1)
+ ifndef SMP
+ LIBNAME		= $(LIBPREFIX)_$(LIBCORE)$(REVISION).$(LIBSUFFIX)
+@@ -1527,12 +1531,16 @@ LIBNAME		= $(LIBPREFIX)p$(REVISION).$(LI
+ LIBNAME_P	= $(LIBPREFIX)p$(REVISION)_p.$(LIBSUFFIX)
+ endif
+ endif
+-
++endif
+ 
+ LIBDLLNAME   = $(LIBPREFIX).dll
+ IMPLIBNAME   = lib$(LIBNAMEBASE).dll.a
+ ifneq ($(OSNAME), AIX)
++ifeq ($(FIXED_LIBNAME), 1)
++LIBSONAME    = $(LIBNAME:.$(LIBSUFFIX)=.so).$(MAJOR_VERSION)
++else
+ LIBSONAME    = $(LIBNAME:.$(LIBSUFFIX)=.so)
++endif
+ else
+ LIBSONAME    = $(LIBNAME:.$(LIBSUFFIX)=.a)
+ endif
diff --git a/openblas/patches/patch-common__arm.h b/openblas/patches/patch-common__arm.h
new file mode 100644
index 0000000000..4da6de1233
--- /dev/null
+++ b/openblas/patches/patch-common__arm.h
@@ -0,0 +1,20 @@
+$NetBSD: patch-common__arm.h,v 1.1 2020/11/05 16:31:45 bacon Exp $
+
+Add clang support
+
+--- common_arm.h.orig	2016-09-01 03:58:42 UTC
++++ common_arm.h
+@@ -93,6 +93,13 @@ static inline int blas_quickdivide(blasi
+ 
+ #endif
+ 
++/* Translate pre-UAL asm to UAL equivalents */
++#if defined(__clang__)
++#define fnmacs vmls.f32
++#define fnmacd vmls.f64
++#define fnmuls vnmul.f32
++#define fnmuld vnmul.f64
++#endif
+ 
+ #ifndef F_INTERFACE
+ #define REALNAME ASMNAME
diff --git a/openblas/patches/patch-cpuid__arm.c b/openblas/patches/patch-cpuid__arm.c
new file mode 100644
index 0000000000..a3e4a8d833
--- /dev/null
+++ b/openblas/patches/patch-cpuid__arm.c
@@ -0,0 +1,16 @@
+$NetBSD: patch-cpuid__arm.c,v 1.1 2020/11/05 16:31:45 bacon Exp $
+
+Add default arm processor type
+
+--- cpuid_arm.c.orig	2016-09-01 03:58:42 UTC
++++ cpuid_arm.c
+@@ -181,7 +181,8 @@ int detect(void)
+ 	  }
+ 
+ 	}
+-
++#else
++	return CPU_ARMV6;
+ #endif
+ 
+ 	return CPU_UNKNOWN;
diff --git a/openblas/patches/patch-cpuid_ia64.c b/openblas/patches/patch-cpuid_ia64.c
new file mode 100644
index 0000000000..578b8ff7a2
--- /dev/null
+++ b/openblas/patches/patch-cpuid_ia64.c
@@ -0,0 +1,16 @@
+$NetBSD: patch-cpuid_ia64.c,v 1.1 2020/11/05 16:31:45 bacon Exp $
+
+FreeBSD does not have sysinfo in base
+
+--- cpuid_ia64.c.orig	2015-10-27 20:44:50 UTC
++++ cpuid_ia64.c
+@@ -38,7 +38,9 @@
+ 
+ #include <stdio.h>
+ #include <string.h>
++#ifdef linux
+ #include <sys/sysinfo.h>
++#endif
+ #include "cpuid.h"
+ 
+ #ifdef __ECC
diff --git a/openblas/patches/patch-f_check b/openblas/patches/patch-f_check
new file mode 100644
index 0000000000..c5592bd956
--- /dev/null
+++ b/openblas/patches/patch-f_check
@@ -0,0 +1,24 @@
+$NetBSD: patch-f_check,v 1.2 2021/05/29 19:57:21 thor Exp $
+
+Clean up link flags
+
+--- f_check.orig	2021-05-02 21:50:22.000000000 +0000
++++ f_check
+@@ -326,7 +326,7 @@ if ($link ne "") {
+ 
+     foreach $flags (@flags) {
+ 	if (
+-	    ($flags =~ /^\-L/)
++	    ($flags =~ /^\-L\S/)
+ 	    && ($flags !~ /^-LIST:/)
+ 	    && ($flags !~ /^-LANG:/)
+ 	    ) {
+@@ -358,7 +358,7 @@ if ($link ne "") {
+ 	}
+ 
+ 	if (
+-	    ($flags =~ /^\-l/)
++	    ($flags =~ /^\-l\S/)
+ 	    && ($flags !~ /ibrary/)
+ 	    && ($flags !~ /gfortranbegin/)
+ 	    && ($flags !~ /frtbegin/)
diff --git a/openblas/patches/patch-getarch.c b/openblas/patches/patch-getarch.c
new file mode 100644
index 0000000000..b9beaeb2d1
--- /dev/null
+++ b/openblas/patches/patch-getarch.c
@@ -0,0 +1,26 @@
+$NetBSD: patch-getarch.c,v 1.2 2021/03/25 23:22:35 thor Exp $
+
+Do not override our parallel make choice.
+
+--- getarch.c.orig	2020-11-11 22:35:05.756907595 +0000
++++ getarch.c
+@@ -1369,19 +1369,6 @@ printf("__BYTE_ORDER__=__ORDER_BIG_ENDIA
+ printf("ELF_VERSION=2\n");
+ #endif
+ 
+-#ifdef MAKE_NB_JOBS
+-  #if MAKE_NB_JOBS > 0
+-    printf("MAKE += -j %d\n", MAKE_NB_JOBS);
+-  #else
+-    // Let make use parent -j argument or -j1 if there
+-    // is no make parent
+-  #endif
+-#elif NO_PARALLEL_MAKE==1
+-    printf("MAKE += -j 1\n");
+-#else
+-    printf("MAKE += -j %d\n", get_num_cores());
+-#endif
+-
+     break;
+ 
+   case '1' : /* For config.h */
diff --git a/openblas/patches/patch-interface__ztrmv.c b/openblas/patches/patch-interface__ztrmv.c
new file mode 100644
index 0000000000..7ee1f48728
--- /dev/null
+++ b/openblas/patches/patch-interface__ztrmv.c
@@ -0,0 +1,15 @@
+$NetBSD: patch-interface__ztrmv.c,v 1.1 2020/11/05 16:31:45 bacon Exp $
+
+Avoid buffer overflow
+
+--- interface/ztrmv.c.orig	2016-09-01 03:58:42 UTC
++++ interface/ztrmv.c
+@@ -242,7 +242,7 @@ void CNAME(enum CBLAS_ORDER order, enum 
+   else
+ #endif
+   {
+-    buffer_size = ((n - 1) / DTB_ENTRIES) * 2 * DTB_ENTRIES + 32 / sizeof(FLOAT);
++    buffer_size = (((n - 1) / DTB_ENTRIES) * 2 * DTB_ENTRIES + 32 / sizeof(FLOAT)) + 8;
+     // It seems to be required for some K8 or Barcelona CPU
+     buffer_size += 8;
+     if(incx != 1)
diff --git a/openblas/version.mk b/openblas/version.mk
new file mode 100644
index 0000000000..2e0855b44c
--- /dev/null
+++ b/openblas/version.mk
@@ -0,0 +1,3 @@
+# $NetBSD: version.mk,v 1.3 2021/05/29 19:57:21 thor Exp $
+
+OPENBLAS_VERSION=	0.3.15
diff --git a/openblas64/DESCR b/openblas64/DESCR
new file mode 100644
index 0000000000..adbd300642
--- /dev/null
+++ b/openblas64/DESCR
@@ -0,0 +1,6 @@
+OpenBLAS is an optimized BLAS library based on GotoBLAS2 1.13 BSD version.
+OpenBLAS is an open source project supported by
+Lab of Parallel Software and Computational Science, ISCAS.
+
+This package builds the serial library working with indices of 64 bits
+(INTERFACE64=1).
diff --git a/openblas64/Makefile b/openblas64/Makefile
new file mode 100644
index 0000000000..66c309d793
--- /dev/null
+++ b/openblas64/Makefile
@@ -0,0 +1,7 @@
+# $NetBSD: Makefile,v 1.3 2021/05/29 19:57:21 thor Exp $
+
+MAINTAINER=	thomas.orgis%uni-hamburg.de@localhost
+
+OPENBLAS_VARIANT= openblas64
+.include "../../wip/openblas/Makefile.common"
+.include "../../mk/bsd.pkg.mk"
diff --git a/openblas64/buildlink3.mk b/openblas64/buildlink3.mk
new file mode 100644
index 0000000000..39fcabde91
--- /dev/null
+++ b/openblas64/buildlink3.mk
@@ -0,0 +1,12 @@
+# $NetBSD: buildlink3.mk,v 1.1 2020/11/05 16:31:45 bacon Exp $
+
+BUILDLINK_TREE+=	openblas64
+
+.if !defined(OPENBLAS64_BUILDLINK3_MK)
+OPENBLAS64_BUILDLINK3_MK:=
+
+BUILDLINK_API_DEPENDS.openblas64+=	openblas64>=0.3.5
+BUILDLINK_PKGSRCDIR.openblas64?=	../../wip/openblas64
+.endif	# OPENBLAS64_BUILDLINK3_MK
+
+BUILDLINK_TREE+=	-openblas64
diff --git a/openblas64_openmp/DESCR b/openblas64_openmp/DESCR
new file mode 100644
index 0000000000..6c751b4a45
--- /dev/null
+++ b/openblas64_openmp/DESCR
@@ -0,0 +1,6 @@
+OpenBLAS is an optimized BLAS library based on GotoBLAS2 1.13 BSD version.
+OpenBLAS is an open source project supported by
+Lab of Parallel Software and Computational Science, ISCAS.
+
+This package builds the parallel library using OpenMP and indices of
+64 bits (INTERFACE64=1).
diff --git a/openblas64_openmp/Makefile b/openblas64_openmp/Makefile
new file mode 100644
index 0000000000..669a44ddbb
--- /dev/null
+++ b/openblas64_openmp/Makefile
@@ -0,0 +1,7 @@
+# $NetBSD: Makefile,v 1.2 2020/11/05 17:06:10 bacon Exp $
+
+MAINTAINER=	thomas.orgis%uni-hamburg.de@localhost
+
+OPENBLAS_VARIANT= openblas64_openmp
+.include "../../wip/openblas/Makefile.common"
+.include "../../mk/bsd.pkg.mk"
diff --git a/openblas64_openmp/buildlink3.mk b/openblas64_openmp/buildlink3.mk
new file mode 100644
index 0000000000..792fc7e785
--- /dev/null
+++ b/openblas64_openmp/buildlink3.mk
@@ -0,0 +1,12 @@
+# $NetBSD: buildlink3.mk,v 1.2 2020/11/05 17:06:10 bacon Exp $
+
+BUILDLINK_TREE+=	openblas64_openmp
+
+.if !defined(OPENBLAS64_OPENMP_BUILDLINK3_MK)
+OPENBLAS64_OPENMP_BUILDLINK3_MK:=
+
+BUILDLINK_API_DEPENDS.openblas64_openmp+=	openblas64_openmp>=0.3.5
+BUILDLINK_PKGSRCDIR.openblas64_openmp?=		../../wip/openblas64_openmp
+.endif	# OPENBLAS64_OPENMP_BUILDLINK3_MK
+
+BUILDLINK_TREE+=	-openblas64_openmp
diff --git a/openblas64_pthread/DESCR b/openblas64_pthread/DESCR
new file mode 100644
index 0000000000..6ead0d908e
--- /dev/null
+++ b/openblas64_pthread/DESCR
@@ -0,0 +1,6 @@
+OpenBLAS is an optimized BLAS library based on GotoBLAS2 1.13 BSD version.
+OpenBLAS is an open source project supported by
+Lab of Parallel Software and Computational Science, ISCAS.
+
+This package builds the parallel library using pthreads and indices of
+64 bits (INTERFACE64=1).
diff --git a/openblas64_pthread/Makefile b/openblas64_pthread/Makefile
new file mode 100644
index 0000000000..58056c5885
--- /dev/null
+++ b/openblas64_pthread/Makefile
@@ -0,0 +1,7 @@
+# $NetBSD: Makefile,v 1.2 2020/11/05 17:06:10 bacon Exp $
+
+MAINTAINER=	thomas.orgis%uni-hamburg.de@localhost
+
+OPENBLAS_VARIANT= openblas64_pthread
+.include "../../wip/openblas/Makefile.common"
+.include "../../mk/bsd.pkg.mk"
diff --git a/openblas64_pthread/buildlink3.mk b/openblas64_pthread/buildlink3.mk
new file mode 100644
index 0000000000..4fbce25cb4
--- /dev/null
+++ b/openblas64_pthread/buildlink3.mk
@@ -0,0 +1,12 @@
+# $NetBSD: buildlink3.mk,v 1.2 2020/11/05 17:06:10 bacon Exp $
+
+BUILDLINK_TREE+=	openblas64_pthread
+
+.if !defined(OPENBLAS64_PTHREAD_BUILDLINK3_MK)
+OPENBLAS64_PTHREAD_BUILDLINK3_MK:=
+
+BUILDLINK_API_DEPENDS.openblas64_pthread+=	openblas64_pthread>=0.3.5
+BUILDLINK_PKGSRCDIR.openblas64_pthread?=	../../wip/openblas64_pthread
+.endif	# OPENBLAS64_PTHREAD_BUILDLINK3_MK
+
+BUILDLINK_TREE+=	-openblas64_pthread
diff --git a/openblas_openmp/DESCR b/openblas_openmp/DESCR
new file mode 100644
index 0000000000..a9b009e75e
--- /dev/null
+++ b/openblas_openmp/DESCR
@@ -0,0 +1,5 @@
+OpenBLAS is an optimized BLAS library based on GotoBLAS2 1.13 BSD version.
+OpenBLAS is an open source project supported by
+Lab of Parallel Software and Computational Science, ISCAS.
+
+This package builds the parallel library using OpenMP.
diff --git a/openblas_openmp/Makefile b/openblas_openmp/Makefile
new file mode 100644
index 0000000000..6c6a3c8491
--- /dev/null
+++ b/openblas_openmp/Makefile
@@ -0,0 +1,8 @@
+# $NetBSD: Makefile,v 1.2 2020/11/05 17:06:10 bacon Exp $
+
+MAINTAINER=	thomas.orgis%uni-hamburg.de@localhost
+PKGREVISION=	1
+
+OPENBLAS_VARIANT= openblas_openmp
+.include "../../wip/openblas/Makefile.common"
+.include "../../mk/bsd.pkg.mk"
diff --git a/openblas_openmp/buildlink3.mk b/openblas_openmp/buildlink3.mk
new file mode 100644
index 0000000000..3d0de5d973
--- /dev/null
+++ b/openblas_openmp/buildlink3.mk
@@ -0,0 +1,12 @@
+# $NetBSD: buildlink3.mk,v 1.2 2020/11/05 17:06:10 bacon Exp $
+
+BUILDLINK_TREE+=	openblas_openmp
+
+.if !defined(OPENBLAS_OPENMP_BUILDLINK3_MK)
+OPENBLAS_OPENMP_BUILDLINK3_MK:=
+
+BUILDLINK_API_DEPENDS.openblas_openmp+=	openblas_openmp>=0.3.5
+BUILDLINK_PKGSRCDIR.openblas_openmp?=	../../wip/openblas_openmp
+.endif	# OPENBLAS_OPENMP_BUILDLINK3_MK
+
+BUILDLINK_TREE+=	-openblas_openmp
diff --git a/openblas_pthread/DESCR b/openblas_pthread/DESCR
new file mode 100644
index 0000000000..7382cc614a
--- /dev/null
+++ b/openblas_pthread/DESCR
@@ -0,0 +1,5 @@
+OpenBLAS is an optimized BLAS library based on GotoBLAS2 1.13 BSD version.
+OpenBLAS is an open source project supported by
+Lab of Parallel Software and Computational Science, ISCAS.
+
+This package builds the parallel library using pthreads.
diff --git a/openblas_pthread/Makefile b/openblas_pthread/Makefile
new file mode 100644
index 0000000000..1184a6a057
--- /dev/null
+++ b/openblas_pthread/Makefile
@@ -0,0 +1,8 @@
+# $NetBSD: Makefile,v 1.2 2020/11/05 17:06:10 bacon Exp $
+
+MAINTAINER=	thomas.orgis%uni-hamburg.de@localhost
+PKGREVISION=	1
+
+OPENBLAS_VARIANT= openblas_pthread
+.include "../../wip/openblas/Makefile.common"
+.include "../../mk/bsd.pkg.mk"
diff --git a/openblas_pthread/buildlink3.mk b/openblas_pthread/buildlink3.mk
new file mode 100644
index 0000000000..1c2a513e29
--- /dev/null
+++ b/openblas_pthread/buildlink3.mk
@@ -0,0 +1,12 @@
+# $NetBSD: buildlink3.mk,v 1.2 2020/11/05 17:06:10 bacon Exp $
+
+BUILDLINK_TREE+=	openblas_pthread
+
+.if !defined(OPENBLAS_PTHREAD_BUILDLINK3_MK)
+OPENBLAS_PTHREAD_BUILDLINK3_MK:=
+
+BUILDLINK_API_DEPENDS.openblas_pthread+=	openblas_pthread>=0.3.5
+BUILDLINK_PKGSRCDIR.openblas_pthread?=		../../wip/openblas_pthread
+.endif	# OPENBLAS_PTHREAD_BUILDLINK3_MK
+
+BUILDLINK_TREE+=	-openblas_pthread


Home | Main Index | Thread Index | Old Index