pkgsrc-WIP-changes archive

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

openblas: Add options.mk



Module Name:	pkgsrc-wip
Committed By:	Jason Bacon <bacon4000%gmail.com@localhost>
Pushed By:	outpaddling
Date:		Fri Sep 22 16:32:35 2017 -0500
Changeset:	179d2265806908ad8b2bdee12884d96be6083764

Modified Files:
	openblas/Makefile
Added Files:
	openblas/options.mk

Log Message:
openblas: Add options.mk

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

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

diffstat:
 openblas/Makefile   | 34 +---------------------------------
 openblas/options.mk | 36 ++++++++++++++++++++++++++++++++++++
 2 files changed, 37 insertions(+), 33 deletions(-)

diffs:
diff --git a/openblas/Makefile b/openblas/Makefile
index 6c91c4436c..0c3ad87765 100644
--- a/openblas/Makefile
+++ b/openblas/Makefile
@@ -43,38 +43,12 @@ OPENBLAS_SVER=	0
 TEST_TARGET=	tests
 MAXTHREADS?=	8
 
-# No openmp for now
-BUILDFLAGS_THREAD+=	NUM_THREADS=${MAXTHREADS} USE_THREAD=1
-BENCHMARK_THREADS_FLAG=		OPENBLAS_NUM_THREADS=${BENCHMARK_MAXTHREADS}
-
-# CPU-agnostic build for now.  Provide option for CPU-optimized build later.
-BUILDFLAGS+=	DYNAMIC_ARCH=1
-BUILDFLAGS+=	NO_AVX=1
-BUILDFLAGS+=	NO_AVX2=1
-
 .if ${MACHINE_ARCH:M*64} == ""
 BUILDFLAGS+=	BINARY32=1
 .else
 BUILDFLAGS+=	BINARY64=1
 .endif
 
-# Not yet implemented, from FreeBSD port
-#.if ${PORT_OPTIONS:MINTERFACE64}
-#BUILDFLAGS+=	INTERFACE64=1
-#.endif
-#.if ${PORT_OPTIONS:MOPENMP}
-#BUILDFLAGS_THREAD+=	USE_OPENMP=1
-#CFLAGS+=	-fopenmp
-#CXXFLAGS+=	-fopenmp
-#FFLAGS+=	-fopenmp
-#.endif
-#.if ! ${PORT_OPTIONS:MAVX}
-#BUILDFLAGS+=	NO_AVX=1
-#.endif
-#.if ! ${PORT_OPTIONS:MAVX2}
-#BUILDFLAGS+=	NO_AVX2=1
-#.endif
-
 SUBST_CLASSES+=		find
 SUBST_STAGE.find=	post-patch
 SUBST_SED.find+=	-e "s+%%FIND%%+${FIND}+"
@@ -149,13 +123,6 @@ do-build:
 	${CP} ${WRKSRC}/libopenblasp-${OPENBLAS_SUFX}.a ${WRKDIR}/lib/libopenblasp.a
 	${CP} ${WRKSRC}/libopenblasp-${OPENBLAS_SUFX}.so ${WRKDIR}/lib/libopenblasp.so.${OPENBLAS_SVER}
 
-BENCHMARK_MAXTHREADS?=	${MAXTHREADS}
-#.if ${PORT_OPTIONS:MOPENMP}
-#BENCHMARK_THREADS_FLAG=		OMP_NUM_THREADS=${BENCHMARK_MAXTHREADS}
-#.else
-BENCHMARK_THREADS_FLAG=		OPENBLAS_NUM_THREADS=${BENCHMARK_MAXTHREADS}
-#.endif
-
 .PHONY: benchmark
 benchmark: build
 	cd ${WRKSRC} ; ${SETENV} ${BUILDFLAGS} NUM_THREADS=${MAXTHREADS} \
@@ -170,4 +137,5 @@ do-install:
 	${LN} -sf ${l}.so.${OPENBLAS_SVER} ${DESTDIR}${PREFIX}/lib/${l}.so
 .endfor
 
+.include "options.mk"
 .include "../../mk/bsd.pkg.mk"
diff --git a/openblas/options.mk b/openblas/options.mk
new file mode 100644
index 0000000000..bc09428bb5
--- /dev/null
+++ b/openblas/options.mk
@@ -0,0 +1,36 @@
+PKG_OPTIONS_VAR=                PKG_OPTIONS.openblas
+PKG_SUPPORTED_OPTIONS=          avx avx2 openmp interface64 dynamic_arch
+PKG_SUGGESTED_OPTIONS=		dynamic_arch
+
+.include "../../mk/bsd.prefs.mk"
+.include "../../mk/bsd.options.mk"
+
+.if empty(PKG_OPTIONS:Mavx)
+BUILDFLAGS+=	NO_AVX=1
+.endif
+
+.if empty(PKG_OPTIONS:Mavx2)
+BUILDFLAGS+=	NO_AVX2=1
+.endif
+
+.if ! empty(PKG_OPTIONS:Mopenmp)
+BUILDFLAGS_THREAD+=	USE_OPENMP=1
+CFLAGS+=		-fopenmp
+CXXFLAGS+=		-fopenmp
+FFLAGS+=		-fopenmp
+BENCHMARK_THREADS_FLAG=	OMP_NUM_THREADS=${BENCHMARK_MAXTHREADS}
+.else
+BUILDFLAGS_THREAD+=	NUM_THREADS=${MAXTHREADS} USE_THREAD=1
+BENCHMARK_THREADS_FLAG=	OPENBLAS_NUM_THREADS=${BENCHMARK_MAXTHREADS}
+.endif
+
+BENCHMARK_MAXTHREADS?=	${MAXTHREADS}
+
+.if ! empty(PKG_OPTIONS:Minterface64)
+BUILDFLAGS+=	INTERFACE64=1
+.endif
+
+.if ! empty(PKG_OPTIONS:Mdynamic_arch)
+# CPU-agnostic build
+BUILDFLAGS+=	DYNAMIC_ARCH=1
+.endif


Home | Main Index | Thread Index | Old Index