1
0
mirror of https://git.FreeBSD.org/ports.git synced 2024-12-25 04:43:33 +00:00
freebsd-ports/math/lapacke/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

161 lines
4.4 KiB
Makefile

# Created by: Eijiro Shibusawa <ej-sib@ice.uec.ac.jp>
# $FreeBSD$
PORTNAME= lapacke
PORTVERSION= 3.4.0
PORTREVISION= 1
CATEGORIES= math
MASTER_SITES= NL
MASTER_SITE_SUBDIR= lapack
DISTNAME= lapack-${PORTVERSION}
DISTFILES= ${DISTNAME}.tgz lapacke.tgz
DIST_SUBDIR= lapack
MAINTAINER= phd_kimberlite@yahoo.co.jp
COMMENT= Standard C language APIs for LAPACK
LICENSE= BSD
LICENSE_FILE= ${WRKSRC}/LICENSE
USE_LDCONFIG= yes
USE_FORTRAN= yes
OPTIONS_DEFINE= PROFILE XLAPACKE
PROFILE_DESC= Build a profiling library
XLAPACKE_DESC= Install interfaces to XLAPACK
NO_STAGE= yes
.include <bsd.port.pre.mk>
LAPACKE_SVERSION= 1
LAPACKE_LIBNAME= lapacke
LAPACKE_LIBNAME_TMG= lapacke_tmg
MAKE_ENV+= "SHLIB_MAJOR=${LAPACKE_SVERSION}" \
"LAPACKE_LIBNAME=${LAPACKE_LIBNAME}" \
"LAPACKE_LIBNAME_TMG=${LAPACKE_LIBNAME_TMG}"
.if ${PORT_OPTIONS:MXLAPACKE}
XLAPACKE_LIBNAME= xlapacke
MAKE_ENV+= "XLAPACKE_LIBNAME=${XLAPACKE_LIBNAME}"
.endif
WRKSRC= ${WRKDIR}/${DISTNAME}/${PORTNAME}
WRKSRC_LEGACY = ${WRKDIR}/lapacke
.if exists(${LOCALBASE}/lib/libgoto2p.so)
WITH_BLAS?= gotoblas
.elif exists(${LOCALBASE}/lib/libatlas.so)
WITH_BLAS?= atlas
.else
WITH_BLAS?= reference
.endif
.if ${WITH_BLAS} == "reference"
LIB_DEPENDS+= blas.2:${PORTSDIR}/math/blas \
lapack.4:${PORTSDIR}/math/lapack
BLAS= -lblas
LAPACK= -llapack
.elif ${WITH_BLAS} == "gotoblas"
CFLAGS+= ${PTHREAD_CFLAGS}
LDFLAGS+= ${PTHREAD_LIBS}
LIB_DEPENDS+= goto2p.1:${PORTSDIR}/math/gotoblas
BLAS= -lgoto2p
LAPACK= -lgoto2p
.elif ${WITH_BLAS} == "atlas"
CFLAGS+= ${PTHREAD_CFLAGS}
LDFLAGS+= ${PTHREAD_LIBS}
LIB_DEPENDS+= atlas.2:${PORTSDIR}/math/atlas
BLAS= -lptf77blas
LAPACK= -lalapack -lptcblas
.endif
.if ${PORT_OPTIONS:MXLAPACKE}
LIB_DEPENDS+= xlapack.4:${PORTSDIR}/math/xlapack
.endif
LDFLAGS+= -L${LOCALBASE}/lib
.if ${PORT_OPTIONS:MDOCS}
PORTDOCS= README
.endif
PLIST_FILES= include/lapacke.h \
include/lapacke_utils.h \
lib/lib${LAPACKE_LIBNAME}.a \
lib/lib${LAPACKE_LIBNAME_TMG}.a \
lib/lib${LAPACKE_LIBNAME}.so \
lib/lib${LAPACKE_LIBNAME_TMG}.so \
lib/lib${LAPACKE_LIBNAME}.so.${LAPACKE_SVERSION} \
lib/lib${LAPACKE_LIBNAME_TMG}.so.${LAPACKE_SVERSION}
.if ${PORT_OPTIONS:MXLAPACKE}
PLIST_FILES+= lib/lib${XLAPACKE_LIBNAME}.a \
lib/lib${XLAPACKE_LIBNAME}.so \
lib/lib${XLAPACKE_LIBNAME}.so.${LAPACKE_SVERSION}
.endif
.if ${PORT_OPTIONS:MPROFILE}
.if defined(NOPROFILE) || defined(NO_PROFILE) || defined(WITHOUT_PROFILE)
IGNORE = you have defined WITH_PROFILE, but have also defined\
WITHOUT_PROFILE, NOPROFILE, or NO_PROFILE
.elif !exists(/usr/lib/libc_p.a)
IGNORE = you have chosen WITH_PROFILE, but have not installed the\
base system profiling libraries
.endif
PLIST_FILES+= lib/lib${LAPACKE_LIBNAME}_p.a \
lib/lib${LAPACKE_LIBNAME_TMG}_p.a
.if ${PORT_OPTIONS:MXLAPACKE}
PLIST_FILES+= lib/lib${XLAPACKE_LIBNAME}_p.a
.endif
.else
MAKE_ENV+= NO_PROFILE=
.endif
post-extract:
@${CP} -r ${WRKSRC_LEGACY}/testing ${WRKSRC}/.
post-patch:
@${FIND} ${WRKSRC} -name "Makefile*" -type f |\
${XARGS} ${REINPLACE_CMD} -e 's;$$(ARCH);$$(ARCH_);g'
@${REINPLACE_CMD} -e 's;%%CC%%;${CC};g' \
-e 's;%%CFLAGS%%;${CFLAGS};g' \
-e 's;%%LDFLAGS%%;${LDFLAGS};g' \
-e 's;%%AR%%;${AR};g' \
-e 's;%%RANLIB%%;${RANLIB};g' \
-e 's;%%BLAS%%;${BLAS};g' \
-e 's;%%LAPACK%%;${LAPACK};g' \
-e 's;%%LAPACKE_LIBNAME%%;${LAPACKE_LIBNAME};g' \
${WRKSRC}/make.inc
@${MV} ${WRKSRC}/Makefile ${WRKSRC}/Makefile.dist
@${CP} ${FILESDIR}/Makefile ${WRKSRC}/Makefile
@${MKDIR} ${WRKSRC}/lib
@${CP} ${FILESDIR}/Makefile.lib ${WRKSRC}/lib/Makefile
@${MKDIR} ${WRKSRC}/libtmg
@${CP} ${FILESDIR}/Makefile.libtmg ${WRKSRC}/libtmg/Makefile
@${REINPLACE_CMD} -e 's;%%XLAPACKE%%;;g' \
-e 's;%%__XLAPACKE%%;\#;g' \
${WRKSRC}/lib/Makefile
.if ${PORT_OPTIONS:MXLAPACKE}
@${MKDIR} ${WRKSRC}/libx
@${CP} ${FILESDIR}/Makefile.lib ${WRKSRC}/libx/Makefile
@${REINPLACE_CMD} -e 's;%%__XLAPACKE%%;;g' \
${WRKSRC}/Makefile
@${REINPLACE_CMD} -e 's;LAPACKE_LIBNAME;XLAPACKE_LIBNAME;g' \
-e 's;%%XLAPACKE%%;\#;g' \
-e 's;%%__XLAPACKE%%;;g' \
${WRKSRC}/libx/Makefile
.endif
post-install:
.if ${PORT_OPTIONS:MDOCS}
@${MKDIR} ${DOCSDIR}
@(cd ${WRKSRC}/ && ${INSTALL_DATA} ${PORTDOCS} ${DOCSDIR})
.endif
check regression-test test: build
@${CP} ${WRKSRC}/lib/lib${LAPACKE_LIBNAME}.a ${WRKSRC}/.
@${ECHO_CMD} "Testing static lapacke library"
@(cd ${WRKSRC}/testing; ${SETENV} ${MAKE_ENV} \
${MAKE} ${MAKE_FLAGS} ${MAKEFILE} ${_MAKE_JOBS} ${MAKE_ARGS})
@${CAT} ${WRKSRC}/testing/interface/*.out
.include <bsd.port.post.mk>