--- b/science/py-scipy/Makefile +++ b/science/py-scipy/Makefile @@ -20,8 +20,6 @@ LICENSE_FILE= ${WRKSRC}/LICENSE.txt BUILD_DEPENDS= ${PYNUMPY} \ ${PYTHON_PKGNAMEPREFIX}pip>0:devel/py-pip@${PY_FLAVOR} \ ${PYTHON_PKGNAMEPREFIX}pybind11>0:devel/py-pybind11@${PY_FLAVOR} -LIB_DEPENDS= libblas.so:math/blas \ - libopenblas.so:math/openblas RUN_DEPENDS= ${PYNUMPY} USES= compiler:c++14-lang fortran python:3.7+ shebangfix @@ -35,13 +33,30 @@ PYDISTUTILS_CONFIGUREARGS= --fcompiler=gnu95 PORTDOCS= scipy-ref-${PORTVERSION}.pdf SHEBANG_FILES= scipy/sparse/linalg/isolve/tests/test_gcrotmk.py +GCCLIBDIR_CMDS= ${FC} -print-file-name=libgfortran.so | ${SED} -e s/libgfortran.so// OPTIONS_DEFINE= DOCS +OPTIONS_DEFAULT= OPENBLAS +OPTIONS_SINGLE= BLASLIB +OPTIONS_SINGLE_BLASLIB= ATLAS OPENBLAS +ATLAS_USES= blaslapack:atlas +ATLAS_VARS= BLASLIBS="ptf77blas, ptcblas" BLASNAME=atlas LAPACKLIBS=alapack LIBRARIES=atlas_libs +OPENBLAS_USES= blaslapack:openblas +OPENBLAS_LIB_DEPENDS= libblas.so:math/blas +OPENBLAS_VARS= BLASLIBS="openblas, gfortran" BLASNAME=openblas LAPACKLIBS="openblas, gfortran" LIBRARIES=libraries post-patch: # This line help fix the plist error because autoplist list it as a file but it is a directory @${TOUCH} ${WRKSRC}/scipy/stats/tests/data/tmp + @${CP} ${FILESDIR}/site.cfg ${WRKSRC}/site.cfg +pre-configure: + ${REINPLACE_CMD} -e 's|%%LOCALBASE%%|${LOCALBASE}|g' \ + -e 's|%%BLASLIBS%%|${BLASLIBS}|; s|%%BLASNAME%%|${BLASNAME}|' \ + -e 's|%%LAPACKLIBS%%|${LAPACKLIBS}|; s|%%LIBRARIES%%|${LIBRARIES}|' \ + ${WRKSRC}/site.cfg + @${REINPLACE_CMD} -e "s|%%GCCLIBDIR%%|$$(${GCCLIBDIR_CMDS})|" ${WRKSRC}/site.cfg + post-install: ${FIND} ${STAGEDIR}${PYTHON_SITELIBDIR}/scipy/ -name '*.so' | ${XARGS} ${STRIP_CMD} @@ -49,4 +64,5 @@ post-install-DOCS-on: @${MKDIR} ${STAGEDIR}${DOCSDIR} ${INSTALL_DATA} ${DISTDIR}/${PORTDOCS} ${STAGEDIR}${DOCSDIR} + .include --- /dev/null +++ b/science/py-scipy/files/site.cfg @@ -0,0 +1,10 @@ +[DEFAULT] +library_dirs = /usr/lib:%%LOCALBASE%%/lib:%%GCCLIBDIR%% +include_dirs = /usr/include:%%LOCALBASE%%/include +src_dirs = %%LOCALBASE%%/src +# search static libraries (.a) in preference to shared ones (.so) +search_static_first = 0 + +[%%BLASNAME%%] +%%LIBRARIES%% = %%BLASLIBS%% +lapack_libs = %%LAPACKLIBS%%