1
0
mirror of https://git.FreeBSD.org/ports.git synced 2024-12-27 05:10:36 +00:00

Allow to use OpenBLAS implementation of BLAS.

Based on the work done by Eijiro Shibusawa <phd_kimberlite@yahoo.co.jp>,
OpenBLAS port maintainer.

Hide py-nose dependency under new TESTS option.
Convert to USES=blaslapack.

Differential Revision:	D2060
Reviewed by:	koobs, thierry
This commit is contained in:
Dmitry Sivachenko 2015-03-28 19:41:43 +00:00
parent 311219e8e1
commit 2d92e2e4e5
Notes: svn2git 2021-03-31 03:12:20 +00:00
svn path=/head/; revision=382547
2 changed files with 31 additions and 15 deletions

View File

@ -18,16 +18,16 @@ COMMENT= The New Numeric Extension to Python
LICENSE= BSD3CLAUSE
RUN_DEPENDS= nosetests:${PORTSDIR}/devel/py-nose
USES= fortran python
USE_PYTHON= concurrent distutils py3kplist
LDFLAGS+= -shared
OPTIONS_DEFINE= ATLAS SUITESPARSE DOCS
OPTIONS_DEFAULT= SUITESPARSE
ATLAS_DESC= Use optimized blas library
OPTIONS_DEFINE= DOCS SUITESPARSE TESTS
OPTIONS_SINGLE= BLASLIB
OPTIONS_DEFAULT= NETLIB SUITESPARSE
OPTIONS_SINGLE_BLASLIB= ATLAS NETLIB OPENBLAS
SUITESPARSE_DESC= Use AMD and UMFPACK in SuiteSparse
TESTS_DESC= Install test suite requirements
PYDISTUTILS_CONFIGUREARGS+= --fcompiler=gnu95
PYDISTUTILS_BUILDARGS+= --fcompiler=gnu95
@ -36,10 +36,11 @@ PORTDOCS= *
WRKSRC= ${WRKDIR}/${DISTNAME:S/r/rc/}
DOCVERSION= 1.9.1
ATLAS_LIB_DEPENDS= libatlas.so:${PORTSDIR}/math/atlas
ATLAS_LIB_DEPENDS_OFF= libblas.so:${PORTSDIR}/math/blas \
liblapack.so:${PORTSDIR}/math/lapack
ATLAS_USES= blaslapack:atlas
NETLIB_USES= blaslapack:netlib
OPENBLAS_USES= blaslapack:openblas
SUITESPARSE_LIB_DEPENDS=libumfpack.so:${PORTSDIR}/math/suitesparse
TESTS_RUN_DEPENDS= nosetests:${PORTSDIR}/devel/py-nose
.include <bsd.port.pre.mk>
@ -55,10 +56,25 @@ post-patch:
GCCLIBDIR_CMDS= ${FC} -print-file-name=libgfortran.so|${SED} -e s/libgfortran.so//
pre-configure:
.if ${PORT_OPTIONS:MATLAS}
@${REINPLACE_CMD} -e "s+%%ATLASLIBS%%+alapack, f77blas, cblas, atlas+" ${WRKSRC}/site.cfg
.if ${PORT_OPTIONS:MOPENBLAS}
@${REINPLACE_CMD} -e "s+%%BLASNAME%%+openblas+" \
-e "s+%%LIBRARIES%%+libraries+" \
-e "s+%%LAPACKLIBS%%+%%BLASLIBS%%+" \
-e "s+%%BLASLIBS%%+openblasp, gfortran+" \
${WRKSRC}/site.cfg
.elif ${PORT_OPTIONS:MATLAS}
@${REINPLACE_CMD} -e "s+%%BLASNAME%%+atlas+" \
-e "s+%%LIBRARIES%%+atlas_libs+" \
-e "s+%%BLASLIBS%%+%%ATLASLIBS%%+" \
-e "s+%%LAPACKLIBS%%+alapack+" \
-e "s+%%ATLASLIBS%%+ptf77blas, ptcblas+" \
${WRKSRC}/site.cfg
.else
@${REINPLACE_CMD} -e "s+%%ATLASLIBS%%+lapack, blas+" ${WRKSRC}/site.cfg
@${REINPLACE_CMD} -e "s+%%BLASNAME%%+atlas+" \
-e "s+%%LIBRARIES%%+atlas_libs+" \
-e "s+%%BLASLIBS%%+blas+" \
-e "s+%%LAPACKLIBS%%+lapack+" \
${WRKSRC}/site.cfg
.endif
.if !${PORT_OPTIONS:MSUITESPARSE}
@${REINPLACE_CMD} -e "s+:%%LOCALBASE%%/include/suitesparse++" ${WRKSRC}/site.cfg

View File

@ -1,10 +1,10 @@
[DEFAULT]
lapack_type=atlas
library_dirs = /usr/lib:%%LOCALBASE%%/lib:%%GCCLIBDIR%%
include_dirs = /usr/include:%%LOCALBASE%%/include:%%LOCALBASE%%/include/suitesparse
src_dirs = %%LOCALBASE%%/src
# search static libraries (.a) in preference to shared ones (.so)
search_static_first = 0
[atlas]
library_dirs = %%LOCALBASE%%/lib:%%GCCLIBDIR%%
atlas_libs = %%ATLASLIBS%%
[%%BLASNAME%%]
%%LIBRARIES%% = %%BLASLIBS%%
lapack_libs = %%LAPACKLIBS%%