freebsd-ports/math/gotoblas/Makefile
Gerald Pfeifer 3be3e90f93 Update to libmpc version 1.0.1 which brings the following fixes:
- 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)
2013-10-26 00:52:33 +00:00

153 lines
4.3 KiB
Makefile

# Created by: Sato Hiroki <hrs@FreeBSD.org>
# $FreeBSD$
PORTNAME= gotoblas
PORTVERSION= 2.${GOTOBLAS2VER}.${LAPACKVER}
PORTREVISION= 1
CATEGORIES= math
MASTER_SITES= ${MASTER_SITE_LOCAL:S|%SUBDIR%|maho/gotoblas|} \
NL:lapack,lapack_tmg
MASTER_SITE_SUBDIR= lapack/:lapack lapack/timing/:lapack_tmg
DISTFILES= GotoBLAS2-${GOTOBLAS2VER}_bsd.tar.gz \
lapack-${LAPACKVER}.tgz:lapack \
large.tgz:lapack_tmg timing.tgz:lapack_tmg
EXTRACT_ONLY= ${GOTOBLAS2_SRCFILE}
MAINTAINER= maho@FreeBSD.org
COMMENT= A fast implementation of Basic Linear Algebra Subprograms
LICENSE= BSD
LICENSE_FILE= ${WRKSRC}/00License.txt
DIST_SUBDIR= gotoblas
GOTOBLAS2VER= 1.13
GOTOBLAS2_SRCFILE= GotoBLAS2-${GOTOBLAS2VER}_bsd.tar.gz
LAPACKVER= 3.4.0
LAPACK_SRCFILE= lapack-${LAPACKVER}.tgz
LARGE_FILE= large.tgz
TIMING_FILE= timing.tgz
USE_GMAKE= yes
USE_LDCONFIG= yes
WRKSRC= ${WRKDIR}/GotoBLAS2
USES= gmake perl5
USE_PERL5= build
USE_FORTRAN= yes
GOTOLIBS= libgoto2 libgoto2p
GOTOFILES= ${GOTOLIBS:S|$|.so|} ${GOTOLIBS:S|$|.so.1|} ${GOTOLIBS:S|$|.a|}
PLIST_FILES= ${GOTOFILES:S|^|lib/|}
SUB_FILES= pkg-message
SUB_LIST= MAXTHREADS=${MAXTHREADS}
.if defined(PACKAGE_BUILDING)
OPTIONS_DEFAULT_i386= DYNAMIC_ARCH
OPTIONS_DEFAULT_amd64= DYNAMIC_ARCH
.endif
OPTIONS_DEFINE_i386= DYNAMIC_ARCH
OPTIONS_DEFINE_amd64= DYNAMIC_ARCH
OPTIONS_DEFINE= INTERFACE64 OPENMP
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
# QUAD_PRECISION "Support IEEE quad precision (experimental)" off
NO_STAGE= yes
.include <bsd.port.pre.mk>
MAXTHREADS?= 8
.if ${ARCH:M*64} == ""
GOTOFLAGS+= BINARY32=1
.else
GOTOFLAGS+= BINARY64=1
.endif
.if ${PORT_OPTIONS:MDYNAMIC_ARCH}
GOTOFLAGS+= DYNAMIC_ARCH=1
.endif
.if ${PORT_OPTIONS:MINTERFACE64}
GOTOFLAGS+= INTERFACE64=1
.endif
.if ${PORT_OPTIONS:MOPENMP}
GOTOFLAGS+= USE_OPENMP=1
.endif
.if ${PORT_OPTIONS:MQUAD_PRECISION}
BROKEN = WITH_QUAD_PRECISION is broken; please disable this option
GOTOFLAGS+= QUAD_PRECISION=1
.endif
post-extract:
${FIND} ${WRKSRC} -type f -name '.*' -delete
cd ${DISTDIR}/${DIST_SUBDIR} ; \
${CP} ${LAPACK_SRCFILE} ${LARGE_FILE} ${TIMING_FILE} ${WRKSRC}
${MKDIR} ${WRKDIR}/lib
post-patch:
${REINPLACE_CMD} -e "s+%%FC%%+${FC}+" -e "s+%%CC%%+${CC}+" \
${WRKSRC}/Makefile.rule
${REINPLACE_CMD} -e "s+%%LAPACKVER%%+${LAPACKVER}+g" \
${WRKSRC}/Makefile
${REINPLACE_CMD} -e "s+%%LAPACKVER%%+${LAPACKVER}+g" \
${WRKSRC}/exports/gensymbol
${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}/reference/Makefile
${REINPLACE_CMD} -e "s+(ARCH)+(ARCH_)+" \
-e 's+%%_GCC_RUNTIME%%+${_GCC_RUNTIME}+' \
-e 's+$$(CROSS_SUFFIX)+${LOCALBASE}/bin/+' \
${WRKSRC}/Makefile.system
.if ${PORT_OPTIONS:MOPENMP}
${REINPLACE_CMD} -e "s+GOTO_NUM_THREADS+OMP_NUM_THREADS+g" \
${WRKSRC}/test/Makefile \
${WRKSRC}/ctest/Makefile
.endif
do-build:
cd ${WRKSRC} ; ${SETENV} ${GOTOFLAGS} NUM_THREADS=1 USE_THREAD=0 \
${GMAKE} ${MAKE_ARGS}
${CP} ${WRKSRC}/libgoto2.a ${WRKDIR}/lib/libgoto2.a
${CP} ${WRKSRC}/libgoto2.so ${WRKDIR}/lib/libgoto2.so.1
cd ${WRKSRC} ; ${GMAKE} ${MAKE_ARGS} clean
cd ${WRKSRC} ; ${SETENV} ${GOTOFLAGS} NUM_THREADS=${MAXTHREADS} \
USE_THREAD=1 ${GMAKE} ${MAKE_ARGS}
${CP} ${WRKSRC}/libgoto2.a ${WRKDIR}/lib/libgoto2p.a
${CP} ${WRKSRC}/libgoto2.so ${WRKDIR}/lib/libgoto2p.so.1
.if ! ${PORT_OPTIONS:MDEBUG}
${LOCALBASE}/bin/strip -X ${WRKDIR}/lib/*.so.1
.endif
BENCHMARK_MAXTHREADS?= ${MAXTHREADS}
.if ${PORT_OPTIONS:MOPENMP}
BENCHMARK_THREADS_FLAG = OMP_NUM_THREADS=${BENCHMARK_MAXTHREADS}
.else
BENCHMARK_THREADS_FLAG = GOTO_NUM_THREADS=${BENCHMARK_MAXTHREADS}
.endif
benchmark: build
cd ${WRKSRC} ; ${SETENV} ${GOTOFLAGS} NUM_THREADS=${MAXTHREADS} \
USE_THREAD=1 ${GMAKE} ${MAKE_ARGS} hpl
cd ${WRKSRC}/benchmark ; ${SETENV} ${GOTOFLAGS} NUM_THREADS=${MAXTHREADS} \
USE_THREAD=1 ${BENCHMARK_THREADS_FLAG} ${GMAKE} ${MAKE_ARGS}
do-install:
cd ${WRKDIR}/lib ; \
${INSTALL_DATA} ${GOTOLIBS:S|$|.a|} ${GOTOLIBS:S|$|.so.1|} \
${PREFIX}/lib/
cd ${PREFIX}/lib ; \
for i in ${GOTOLIBS:S|$|.so|}; do \
${LN} -sf $$i.1 $$i ; \
done
.include <bsd.port.post.mk>