pkgsrc-WIP-changes archive

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

OpenBLAS: update to 0.2.20, enhance/fix build with options



Module Name:	pkgsrc-wip
Committed By:	Dr. Thomas Orgis <thomas.orgis%uni-hamburg.de@localhost>
Pushed By:	thor
Date:		Wed Sep 27 22:33:17 2017 +0200
Changeset:	b16a3dee840a0f66246a4e17b1e442245a8615b8

Modified Files:
	OpenBLAS/Makefile
	OpenBLAS/PLIST
	OpenBLAS/distinfo
Added Files:
	OpenBLAS/buildlink3.mk
	OpenBLAS/options.mk
	OpenBLAS/patches/patch-fixedlibname
Removed Files:
	OpenBLAS/patches/patch-driver_others_memory.c

Log Message:
OpenBLAS: update to 0.2.20, enhance/fix build with options

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

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

diffstat:
 OpenBLAS/Makefile                             | 16 +++++++++-------
 OpenBLAS/PLIST                                |  6 ++++--
 OpenBLAS/buildlink3.mk                        | 12 ++++++++++++
 OpenBLAS/distinfo                             | 11 ++++++-----
 OpenBLAS/options.mk                           | 24 ++++++++++++++++++++++++
 OpenBLAS/patches/patch-driver_others_memory.c | 15 ---------------
 OpenBLAS/patches/patch-fixedlibname           | 19 +++++++++++++++++++
 7 files changed, 74 insertions(+), 29 deletions(-)

diffs:
diff --git a/OpenBLAS/Makefile b/OpenBLAS/Makefile
index 384d2b5f47..eb56c2d899 100644
--- a/OpenBLAS/Makefile
+++ b/OpenBLAS/Makefile
@@ -1,6 +1,6 @@
 # $NetBSD$
 
-DISTNAME=	OpenBLAS-0.2.19
+DISTNAME=	OpenBLAS-0.2.20
 CATEGORIES=	math
 MASTER_SITES=	${MASTER_SITE_GITHUB:=xianyi/}
 GITHUB_TAG=	v${PKGVERSION_NOREV}
@@ -20,9 +20,17 @@ GCC_REQD+=	6.2
 
 NO_CONFIGURE=	yes
 
+# You may override the autodetected thread count limit.
+# Default is detected from build host.
+BUILD_DEFS+=    OPENBLAS_THREAD_LIMIT
+
 MAKE_ENV=	PREFIX=${PREFIX}
 MAKE_ENV+=	CC=${CCPATH}
 MAKE_ENV+=	FC=${FCPATH}
+MAKE_ENV+=     NUM_THREADS=${OPENBLAS_THREAD_LIMIT:Q}
+
+# Those work further on MAKE_ENV.
+.include "options.mk"
 
 .if (${MACHINE_ARCH} == "i386")
 MAKE_ENV+=	BINARY=32
@@ -30,12 +38,6 @@ MAKE_ENV+=	BINARY=32
 MAKE_ENV+=	BINARY=64
 .endif
 
-# Choose the processor kernel dynamically at runtime
-MAKE_ENV+=	DYNAMIC_ARCH=1
-
-# NO_AFFINITY=1 recommended for use in OpenMP codes
-MAKE_ENV+=	USE_OPENMP=1 NO_AFFINITY=1
-
 INSTALL_MAKE_FLAGS+=	PREFIX=${PREFIX}
 
 .include "../../mk/bsd.pkg.mk"
diff --git a/OpenBLAS/PLIST b/OpenBLAS/PLIST
index 72baceb646..edff0aa4b3 100644
--- a/OpenBLAS/PLIST
+++ b/OpenBLAS/PLIST
@@ -10,6 +10,8 @@ lib/cmake/openblas/OpenBLASConfig.cmake
 lib/cmake/openblas/OpenBLASConfigVersion.cmake
 lib/libopenblas.a
 lib/libopenblas.so
-lib/libopenblasp-r${PKGVERSION}.a
-lib/libopenblasp-r${PKGVERSION}.so
+lib/libopenblas.so.0
+lib/libopenblas_pkg-r${PKGVERSION}.a
+lib/libopenblas_pkg-r${PKGVERSION}.so
+lib/pkgconfig/openblas.pc
 @pkgdir bin
diff --git a/OpenBLAS/buildlink3.mk b/OpenBLAS/buildlink3.mk
new file mode 100644
index 0000000000..7253c502b5
--- /dev/null
+++ b/OpenBLAS/buildlink3.mk
@@ -0,0 +1,12 @@
+# $NetBSD$
+
+BUILDLINK_TREE+=	OpenBLAS
+
+.if !defined(OPENBLAS_BUILDLINK3_MK)
+OPENBLAS_BUILDLINK3_MK:=
+
+BUILDLINK_API_DEPENDS.OpenBLAS+=	OpenBLAS>=0.2.19
+BUILDLINK_PKGSRCDIR.OpenBLAS?=	../../wip/OpenBLAS
+.endif	# OPENBLAS_BUILDLINK3_MK
+
+BUILDLINK_TREE+=	-OpenBLAS
diff --git a/OpenBLAS/distinfo b/OpenBLAS/distinfo
index f8cdb4d26b..f83349c74e 100644
--- a/OpenBLAS/distinfo
+++ b/OpenBLAS/distinfo
@@ -1,7 +1,8 @@
 $NetBSD$
 
-SHA1 (OpenBLAS-0.2.19.tar.gz) = df4ceb25d2529748ad0f2715e62fefb348477edd
-RMD160 (OpenBLAS-0.2.19.tar.gz) = 8472d90075a8c1d357b896eba7ce293be508bca0
-SHA512 (OpenBLAS-0.2.19.tar.gz) = 7081a8540b8037c0d4d6db0ec4b51277856c0e0f4e2575671984e5deb3482102da8936c43691087c8475d67070f89ac6925e4867ead60802aa2a29e8517e7495
-Size (OpenBLAS-0.2.19.tar.gz) = 10834034 bytes
-SHA1 (patch-driver_others_memory.c) = 3f0d6014782810cc89c6fe0d0c1684e5ffdc2000
+SHA1 (OpenBLAS-0.2.20.tar.gz) = a186074145a24823e82c65672dad1cd1ca6fe89c
+RMD160 (OpenBLAS-0.2.20.tar.gz) = 2b9728cd227894d7378b0f3686b90d0e7e7975d9
+SHA512 (OpenBLAS-0.2.20.tar.gz) = 8dfc8e8c8d456b834d2e9544c8eadd9f4770e30db8b8dd76af601ec0735fd86c9cf63dd6a03ccd23fc02ec2e05069a09875b9073dfe29f99aadab3a958ae2634
+Size (OpenBLAS-0.2.20.tar.gz) = 11637301 bytes
+Size (patch-fixedlibname) = 662 bytes
+SHA1 (patch-fixedlibname) = 17d35f09aedcddfb8f20bb888fa134cdf0b3bd2b
diff --git a/OpenBLAS/options.mk b/OpenBLAS/options.mk
new file mode 100644
index 0000000000..e2d9a40ac8
--- /dev/null
+++ b/OpenBLAS/options.mk
@@ -0,0 +1,24 @@
+PKG_OPTIONS_VAR= PKG_OPTIONS.openblas
+# Choose dynamic target/processor choice at runtime or
+# fixed build with build host CPU.
+PKG_OPTIONS_GROUP.target= dynamic fixed
+# Threading model. Pthread seems more robust e.g. with numpy usage.
+PKG_OPTIONS_GROUP.threading = single pthread openmp
+PKG_OPTIONS_REQUIRED_GROUPS= target threading
+PKG_SUGGESTED_OPTIONS= dynamic pthread
+
+.include "../../mk/bsd.options.mk"
+
+.if !empty(PKG_OPTIONS:Mdynamic)
+MAKE_ENV+=      DYNAMIC_ARCH=1
+.else
+MAKE_ENV+=      DYNAMIC_ARCH=0
+.endif
+
+.if   !empty(PKG_OPTIONS:Mopenmp)
+MAKE_ENV+=      USE_OPENMP=1 NO_AFFINITY=1
+.elif !empty(PKG_OPTIONS:Mpthread)
+MAKE_ENV+=      USE_OPENMP=0 USE_THREAD=1
+.else
+MAKE_ENV+=      USE_OPENMP=0 USE_THREAD=0
+.endif
diff --git a/OpenBLAS/patches/patch-driver_others_memory.c b/OpenBLAS/patches/patch-driver_others_memory.c
deleted file mode 100644
index ace100de18..0000000000
--- a/OpenBLAS/patches/patch-driver_others_memory.c
+++ /dev/null
@@ -1,15 +0,0 @@
-$NetBSD$
-
-Patch for NO_AFFINITY=1. Sent upstream as issue #979.
-
---- driver/others/memory.c.orig	2016-10-11 14:00:54.030387184 +0000
-+++ driver/others/memory.c
-@@ -169,7 +169,7 @@ void goto_set_num_threads(int num_thread
- 
- #else
- 
--#if defined(OS_LINUX) || defined(OS_SUNOS)
-+#if defined(OS_LINUX) || defined(OS_SUNOS) || defined(OS_NETBSD)
- #ifndef NO_AFFINITY
- int get_num_procs(void);
- #else
diff --git a/OpenBLAS/patches/patch-fixedlibname b/OpenBLAS/patches/patch-fixedlibname
new file mode 100644
index 0000000000..ac0cc60565
--- /dev/null
+++ b/OpenBLAS/patches/patch-fixedlibname
@@ -0,0 +1,19 @@
+$NetBSD$
+
+Patch to have one predictable library name, not depending on build configuration.
+There is only one install of OpenBLAS in pkgsrc at a given time. Funny how
+the LIBDLLNAME was not differing ...
+
+--- Makefile.system.orig	2017-02-09 21:15:17.079845857 +0100
++++ Makefile.system	2017-02-09 21:16:54.915105356 +0100
+@@ -1061,6 +1061,10 @@
+ endif
+ endif
+ 
++# Override the library name madness to have one predictable
++# name to put into PLIST for pkgsrc.
++LIBNAME         = $(LIBPREFIX)_pkg$(REVISION).$(LIBSUFFIX)
++LIBNAME_P       = $(LIBPREFIX)_pkg$(REVISION)_p.$(LIBSUFFIX)
+ 
+ LIBDLLNAME   = $(LIBPREFIX).dll
+ LIBSONAME    = $(LIBNAME:.$(LIBSUFFIX)=.so)


Home | Main Index | Thread Index | Old Index