Allow selection of optimised BLAS implementations via OPTIONs

PR:		213090
Submitted by:	elferdo@gmail.com
This commit is contained in:
Thomas Zander 2016-10-03 15:57:04 +00:00
parent ca6567feeb
commit 25b6f83eb5
Notes: svn2git 2021-03-31 03:12:20 +00:00
svn path=/head/; revision=423204

View File

@ -3,6 +3,7 @@
PORTNAME= mcmc-jags
PORTVERSION= 4.0.0
PORTREVISION= 1
CATEGORIES= math
MASTER_SITES= SF/mcmc-jags/JAGS/${S}.x/Source/:1 \
SF/mcmc-jags/Examples/${S}.x/:2 \
@ -24,6 +25,21 @@ USE_LDCONFIG= yes
WRKSRC= ${WRKDIR}/JAGS-${PORTVERSION}
OPTIONS_SINGLE= BLAS
OPTIONS_SINGLE_BLAS= ATLAS OPENBLAS NETLIB
OPTIONS_DEFAULT+= OPENBLAS
ATLAS_USES= blaslapack:atlas
ATLAS_VARS= MANUAL_PACKAGE_BUILD=\
"Choose a BLAS option other than ATLAS for package building."
NETLIB_USES= blaslapack:netlib
OPENBLAS_USES= blaslapack:openblas
CONFIGURE_ARGS+= --with-blas="-L${LOCALBASE}/lib ${BLASLIB}" \
--with-lapack="${LAPACKLIB}"
OPTIONS_SUB= YES
PLIST_SUB= MODULEVERSION=${S}
S= ${PORTVERSION:C|\..*||}
@ -41,23 +57,6 @@ DISTFILES+= classic-bugs.tar.gz:2
PORTEXAMPLES= *
.endif
.if exists(${LOCALBASE}/lib/libatlas.so)
WITH_BLAS?= atlas
.else
WITH_BLAS?= reference
.endif
.if ${WITH_BLAS} == "atlas"
LIB_DEPENDS+= libatlas.so:math/atlas
CONFIGURE_ARGS= --with-lapack="-lalapack -lptcblas" --with-blas="-lptf77blas"
.elif ${WITH_BLAS} == "reference"
LIB_DEPENDS+= libblas.so:math/blas
LIB_DEPENDS+= liblapack.so:math/lapack
CONFIGURE_ARGS= --with-lapack="-llapack" --with-blas="-lblas"
.else
IGNORE= invalid value for WITH_BLAS: ${WITH_BLAS}
.endif
post-patch:
@${REINPLACE_CMD} -e 's|[(]libdir[)]/pkgconfig|(prefix)/libdata/pkgconfig|g' \
${WRKSRC}/etc/Makefile.in