1
0
mirror of https://git.FreeBSD.org/ports.git synced 2024-12-03 01:23:49 +00:00
freebsd-ports/math/trlan/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

110 lines
3.0 KiB
Makefile

# Created by: b.f. <bf@FreeBSD.org>
# $FreeBSD$
PORTNAME= trlan
PORTVERSION= 201009
PORTREVISION= 1
CATEGORIES= math
MASTER_SITES= https://codeforge.lbl.gov/frs/download.php/210/:1 \
http://crd.lbl.gov/~kewu/ps/:2 \
LOCAL/bf:1,2
DISTFILES= ${DISTNAME}${EXTRACT_SUFX}:1 trlan-ug.pdf:2
EXTRACT_ONLY= ${DISTNAME}${EXTRACT_SUFX}
MAINTAINER= bf@FreeBSD.org
COMMENT= Thick-restart Lanczos method for eigenproblems
USE_FORTRAN= yes
USE_LDCONFIG= yes
ALL_TARGET= lib
PLIST_FILES= lib/libtrlan.a lib/libtrlan.so lib/libtrlan.so.1
NO_STAGE= yes
.include <bsd.port.pre.mk>
.ifndef(NOPORTDOCS)
PORTDOCS= trlan-ug.pdf
.endif
.ifndef(NOPORTEXAMPLES)
PORTEXAMPLES= Makefile README dense.f90 simple.f90 simple77.f simplec.c
.endif
.if ${ARCH} == sparc64
PICFLAG= -fPIC
.else
PICFLAG= -fpic
.endif
post-patch:
@${REINPLACE_CMD} -E \
-e '/^(FC|FFLAGS)=/s/^/#/' \
-e '/^F90=/s/=.*/=${FC}/' \
${WRKSRC}/Make.inc
@${REINPLACE_CMD} -E \
-e '/^(CC|CFLAGS|LDFLAGS|TRLAN)=/s/^/#/' \
${WRKSRC}/examples/SUN/Makefile
@${REINPLACE_CMD} \
-e 's|ar -cru|${AR} -cru|' \
${WRKSRC}/SRC/Makefile
do-build:
@${ECHO_CMD} "Building static archive ..."
@cd ${WRKSRC}; ${SETENV} ${MAKE_ENV} ${MAKE} ${_MAKE_JOBS} ${MAKE_ARGS} \
${ALL_TARGET}
@${STRIP_CMD} -x -o ${WRKDIR}/libtrlan.a ${WRKSRC}/libtrlan.a
@cd ${WRKSRC}; ${SETENV} ${MAKE_ENV} ${MAKE} ${_MAKE_JOBS} ${MAKE_ARGS} \
clean
@${ECHO_CMD} "Building shared library ..."
@cd ${WRKSRC}; ${SETENV} ${MAKE_ENV} ${MAKE} ${_MAKE_JOBS} ${MAKE_ARGS} \
${ALL_TARGET} FFLAGS="${PICFLAG} ${FFLAGS}"
@${FC} ${FFLAGS} ${LDFLAGS} -shared -Wl,-x -Wl,-soname,libtrlan.so.1 \
-o ${WRKDIR}/libtrlan.so.1 -Wl,--whole-archive \
${WRKSRC}/libtrlan.a -Wl,--no-whole-archive -Wl,--as-needed
do-install:
@${INSTALL_DATA} ${WRKDIR}/libtrlan.* ${PREFIX}/lib
@${LN} -sf libtrlan.so.1 ${PREFIX}/lib/libtrlan.so
.ifndef(NOPORTDOCS)
@${MKDIR} ${DOCSDIR}
@${INSTALL_DATA} ${DISTDIR}/${PORTDOCS} ${DOCSDIR}
.endif
.ifndef(NOPORTEXAMPLES)
@${MKDIR} ${EXAMPLESDIR}
@cd ${WRKSRC}/examples/SUN && ${INSTALL_DATA} ${PORTEXAMPLES} \
${EXAMPLESDIR}
.endif
.if defined(MAINTAINER_MODE)
BUILD_DEPENDS += ${LOCALBASE}/lib/libblas.so.2:${PORTSDIR}/math/blas \
${LOCALBASE}/lib/liblapack.so.4:${PORTSDIR}/math/lapack
BLAS?= -L${LOCALBASE}/lib -lblas
LAPACK?= -L${LOCALBASE}/lib -llapack
check regression-test test: test-static test-shared
test-static: build
@${ECHO_CMD} "Checking static archive ..."
@cd ${WRKSRC}/examples/SUN; ${SETENV} ${MAKE_ENV} ${MAKE} ${_MAKE_JOBS} \
${MAKE_ARGS} clean simple simple77 simplec \
LDFLAGS="${LDFLAGS} ${LAPACK} ${BLAS}" \
TRLAN="${WRKDIR}/libtrlan.a" ; \
./simple ; ./simple77 ; ./simplec
test-shared: build
@${ECHO_CMD} "Checking shared library ..."
@cd ${WRKSRC}/examples/SUN; ${SETENV} ${MAKE_ENV} ${MAKE} ${_MAKE_JOBS} \
${MAKE_ARGS} clean simple simple77 simplec \
FFLAGS="${PICFLAG} ${FFLAGS}" \
LDFLAGS="${LDFLAGS} ${LAPACK} ${BLAS}" \
TRLAN="-L${WRKDIR} -ltrlan" ; \
./simple ; ./simple77 ; ./simplec
.endif
.include <bsd.port.post.mk>