3be3e90f93
- Switched to automake 1.11.6, see CVE-2012-3386. - #14669: Fixed extraction of CC from gmp.h. - Fixed case of intermediate zero real or imaginary part in mpc_fma, found by hydra with GMP_CHECK_RANDOMIZE=1346362345. This is on top of the following changes from version 1.0 - Licence change towards LGPLv3+ for the code and GFDLv1.3+ (with no invariant sections) for the documentation. - 100% of all lines are covered by tests - Renamed functions . mpc_mul_2exp to mpc_mul_2ui . mpc_div_2exp to mpc_div_2ui - 0^0, which returned (NaN,NaN) previously, now returns (1,+0). - Removed compatibility with K&R compilers, which was untestable due to lack of such compilers. - New functions . mpc_log10 . mpc_mul_2si, mpc_div_2si - Speed-ups . mpc_fma - Bug fixes . mpc_div and mpc_norm now return a value indicating the effective rounding direction, as the other functions. . mpc_mul, mpc_sqr and mpc_norm now return correct results even if there are over- or underflows during the computation. . mpc_asin, mpc_proj, mpc_sqr: Wrong result when input variable has infinite part and equals output variable is corrected. . mpc_fr_sub: Wrong return value for imaginary part is corrected. Convert to the new LIB_DEPENDS standard and remove hard-coded .so versions from a couple of dependent ports. Bump PORTREVISIONS of all dependent ports. PR: 183141 Approved by: portmgr (bdrewery)
172 lines
5 KiB
Makefile
172 lines
5 KiB
Makefile
# Created by: Eijiro Shibusawa <ej-sib@ice.uec.ac.jp>
|
|
# $FreeBSD$
|
|
|
|
PORTNAME= openblas
|
|
PORTVERSION= 0.2.8
|
|
PORTREVISION= 1
|
|
CATEGORIES= math
|
|
MASTER_SITES= https://codeload.github.com/${GH_ACCOUNT}/${GH_PROJECT}/legacy.tar.gz/${GH_TAGNAME}?dummy=/:${PORTNAME} \
|
|
NL:lapack_tmg
|
|
MASTER_SITE_SUBDIR= lapack/timing/:lapack_tmg
|
|
DISTFILES= ${PORTNAME}-${PORTVERSION}${EXTRACT_SUFX}:${PORTNAME} \
|
|
large.tgz:lapack_tmg timing.tgz:lapack_tmg
|
|
|
|
MAINTAINER= phd_kimberlite@yahoo.co.jp
|
|
COMMENT= Optimized BLAS library based on GotoBLAS2
|
|
|
|
LICENSE= BSD
|
|
|
|
DIST_SUBDIR= openblas
|
|
FETCH_ARGS= -Fpr
|
|
GH_ACCOUNT= xianyi
|
|
GH_PROJECT= OpenBLAS
|
|
GH_TAGNAME= ${GH_COMMIT}
|
|
GH_COMMIT= 835293c
|
|
LARGE_FILE= large.tgz
|
|
TIMING_FILE= timing.tgz
|
|
|
|
USES= gmake perl5
|
|
USE_GCC= 4.6+
|
|
USE_FORTRAN= yes
|
|
USE_LDCONFIG= yes
|
|
USE_FORTRAN= yes
|
|
USE_PERL5= build
|
|
|
|
OPENBLAS_SUFX= r${PORTVERSION}
|
|
OPENBLAS_LIBS= libopenblas libopenblasp
|
|
OPENBLAS_SVER= 0
|
|
OPENBLAS_FILES= ${OPENBLAS_LIBS:S|$|.so|} ${OPENBLAS_LIBS:S|$|.so.${OPENBLAS_SVER}|} ${OPENBLAS_LIBS:S|$|.a|}
|
|
PLIST_FILES= ${OPENBLAS_FILES:S|^|lib/|}
|
|
|
|
WRKSRC= ${WRKDIR}/${GH_ACCOUNT}-${GH_PROJECT}-${GH_TAGNAME}
|
|
|
|
OPTIONS_DEFINE= DYNAMIC_ARCH INTERFACE64 OPENMP AVX
|
|
|
|
DYNAMIC_ARCH_DESC= Support multiple CPU types on i386 and amd64
|
|
INTERFACE64_DESC= Use 8 byte integers on 64-bit architectures
|
|
OPENMP_DESC= Use OpenMP for threading
|
|
AVX_DESC= Support Advanced Vector Extensions (AVX)
|
|
|
|
.if defined(PACKAGE_BUILDING)
|
|
OPTIONS_DEFAULT= DYNAMIC_ARCH
|
|
.endif
|
|
|
|
NO_STAGE= yes
|
|
.include <bsd.port.options.mk>
|
|
|
|
.if defined(TARGET_CPU_ARCH)
|
|
BUILDFLAGS+= TARGET=${TARGET_CPU_ARCH}
|
|
.endif
|
|
|
|
MAXTHREADS?= 8
|
|
|
|
.if ${ARCH:M*64} == ""
|
|
BUILDFLAGS+= BINARY32=1
|
|
.else
|
|
BUILDFLAGS+= BINARY64=1
|
|
.endif
|
|
|
|
.if ! ( ${PORT_OPTIONS:MDYNAMIC_ARCH} && ( ${ARCH} == "amd64" || ${ARCH} == "i386" ) )
|
|
MANUAL_PACKAGE_BUILD= Optimizes for the build machine.
|
|
.endif
|
|
|
|
.if ${PORT_OPTIONS:MDYNAMIC_ARCH}
|
|
BUILDFLAGS+= DYNAMIC_ARCH=1
|
|
.endif
|
|
|
|
.if ${PORT_OPTIONS:MINTERFACE64}
|
|
BUILDFLAGS+= INTERFACE64=1
|
|
.endif
|
|
|
|
.if ${PORT_OPTIONS:MOPENMP}
|
|
BUILDFLAGS+= USE_OPENMP=1
|
|
.endif
|
|
|
|
.if ${PORT_OPTIONS:MQUAD_PRECISION}
|
|
BROKEN = QUAD_PRECISION is broken; please disable this option
|
|
BUILDFLAGS+= QUAD_PRECISION=1
|
|
.endif
|
|
|
|
.if ! ${PORT_OPTIONS:MAVX}
|
|
BUILDFLAGS+= NO_AVX=1
|
|
.endif
|
|
|
|
post-extract:
|
|
cd ${DISTDIR}/${DIST_SUBDIR} ; \
|
|
${CP} ${LARGE_FILE} ${TIMING_FILE} ${WRKSRC}
|
|
${MKDIR} ${WRKDIR}/lib
|
|
|
|
post-patch:
|
|
${REINPLACE_CMD} -e "s+%%FIND%%+${FIND}+" \
|
|
-e "s+%%XARGS%%+${XARGS}+" \
|
|
-e "s+%%REINPLACE_CMD%%+${REINPLACE_CMD}+" \
|
|
${WRKSRC}/Makefile
|
|
${REINPLACE_CMD} -e "s+%%FC%%+${FC}+" -e "s+%%CC%%+${CC}+" \
|
|
${WRKSRC}/Makefile.rule
|
|
${REINPLACE_CMD} -e "s+(ARCH)+(ARCH_)+" \
|
|
${WRKSRC}/Makefile.rule \
|
|
${WRKSRC}/Makefile.tail \
|
|
${WRKSRC}/driver/level3/Makefile \
|
|
${WRKSRC}/driver/others/Makefile \
|
|
${WRKSRC}/exports/Makefile \
|
|
${WRKSRC}/interface/Makefile \
|
|
${WRKSRC}/kernel/Makefile \
|
|
${WRKSRC}/kernel/Makefile.L3 \
|
|
${WRKSRC}/lapack/laswp/Makefile \
|
|
${WRKSRC}/lapack-netlib/SRC/Makefile \
|
|
${WRKSRC}/lapack-netlib/SRC/VARIANTS/Makefile \
|
|
${WRKSRC}/lapack-netlib/TESTING/MATGEN/Makefile \
|
|
${WRKSRC}/lapack-netlib/lapacke/src/Makefile \
|
|
${WRKSRC}/lapack-netlib/lapacke/utils/Makefile \
|
|
${WRKSRC}/reference/Makefile
|
|
${REINPLACE_CMD} -e "s+(ARCH)+(ARCH_)+" \
|
|
-e 's+%%LOCALBASE%%+${LOCALBASE}+' \
|
|
-e 's+%%FIND%%+${FIND}+' \
|
|
-e 's+%%XARGS%%+${XARGS}+' \
|
|
-e 's+%%REINPLACE_CMD%%+${REINPLACE_CMD}+' \
|
|
-e 's+%%_GCC_BUILD_DEPENDS%%+${_GCC_BUILD_DEPENDS}+' \
|
|
-e 's+$$(CROSS_SUFFIX)+${LOCALBASE}/bin/+' \
|
|
${WRKSRC}/Makefile.system
|
|
.if ${PORT_OPTIONS:MOPENMP}
|
|
${REINPLACE_CMD} -e "s+OPENBLAS_NUM_THREADS+OMP_NUM_THREADS+g" \
|
|
${WRKSRC}/test/Makefile \
|
|
${WRKSRC}/ctest/Makefile
|
|
.endif
|
|
|
|
do-build:
|
|
cd ${WRKSRC} ; ${SETENV} ${BUILDFLAGS} NUM_THREADS=1 USE_THREAD=0 \
|
|
${GMAKE} ${MAKE_ARGS}
|
|
${CP} ${WRKSRC}/libopenblas-${OPENBLAS_SUFX}.a ${WRKDIR}/lib/libopenblas.a
|
|
${CP} ${WRKSRC}/libopenblas-${OPENBLAS_SUFX}.so ${WRKDIR}/lib/libopenblas.so.${OPENBLAS_SVER}
|
|
cd ${WRKSRC} ; ${GMAKE} ${MAKE_ARGS} clean
|
|
cd ${WRKSRC} ; ${SETENV} ${BUILDFLAGS} NUM_THREADS=${MAXTHREADS} \
|
|
USE_THREAD=1 ${GMAKE} ${MAKE_ARGS}
|
|
${CP} ${WRKSRC}/libopenblasp-${OPENBLAS_SUFX}.a ${WRKDIR}/lib/libopenblasp.a
|
|
${CP} ${WRKSRC}/libopenblasp-${OPENBLAS_SUFX}.so ${WRKDIR}/lib/libopenblasp.so.${OPENBLAS_SVER}
|
|
.if !${PORT_OPTIONS:MDEBUG}
|
|
${LOCALBASE}/bin/strip -X ${WRKDIR}/lib/*.so.${OPENBLAS_SVER}
|
|
.endif
|
|
|
|
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
|
|
|
|
benchmark: build
|
|
cd ${WRKSRC} ; ${SETENV} ${BUILDFLAGS} NUM_THREADS=${MAXTHREADS} \
|
|
USE_THREAD=1 ${GMAKE} ${MAKE_ARGS} hpl
|
|
cd ${WRKSRC}/benchmark ; ${SETENV} ${BUILDFLAGS} NUM_THREADS=${MAXTHREADS} \
|
|
USE_THREAD=1 ${BENCHMARK_THREADS_FLAG} ${GMAKE} ${MAKE_ARGS}
|
|
|
|
do-install:
|
|
cd ${WRKDIR}/lib ; \
|
|
${INSTALL_DATA} ${OPENBLAS_LIBS:S|$|.a|} ${OPENBLAS_LIBS:S|$|.so.${OPENBLAS_SVER}|} \
|
|
${PREFIX}/lib/
|
|
cd ${PREFIX}/lib ; \
|
|
for i in ${OPENBLAS_LIBS:S|$|.so|}; do \
|
|
${LN} -sf $$i.${OPENBLAS_SVER} $$i ; \
|
|
done
|
|
|
|
.include <bsd.port.mk>
|