1
0
mirror of https://git.FreeBSD.org/ports.git synced 2024-11-23 00:43:28 +00:00
freebsd-ports/math/sfft/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

126 lines
3.3 KiB
Makefile

# Created by: bf@FreeBSD.org
# $FreeBSD$
PORTNAME= sfft
PORTVERSION= 0.1.0
PORTREVISION= 1
CATEGORIES= math
MASTER_SITES= http://spiral.net/software/sfft/ LOCAL/bf
DISTFILES= ${DISTNAME}${EXTRACT_SUFX}
EXTRACT_ONLY= ${DISTNAME}${EXTRACT_SUFX}
MAINTAINER= bf@FreeBSD.org
COMMENT= Optimized Sparse Fast Fourier Transform
LICENSE= GPLv2
LIB_DEPENDS= libfftw3.so:${PORTSDIR}/math/fftw3
USE_GCC= yes
USE_LDCONFIG= yes
USE_ZIP= yes
OPTIONS_DEFINE= OPTIMIZED_CFLAGS PROFILE
OPTIONS_DEFAULT= OPTIMIZED_CFLAGS
BUILD_WRKSRC= ${WRKSRC}/src
INSTALL_WRKSRC= ${BUILD_WRKSRC}
CFLAGS+= -fopenmp -msse2 -Iflopcount -I${LOCALBASE}/include
LDFLAGS+= -L${LOCALBASE}/lib
HEADERS= sfft.h
HDIR= include/sfft
MAKE_ENV= LDADD="-lfftw3 ${LIBM}" LIB=sfft SHLIB_MAJOR="${SHLIB_MAJOR}" \
SRCCONF=/dev/null SRCS="${SRCS}"
PLIST_DIRS= ${HDIR}
PLIST_FILES= ${HEADERS:S|^|${HDIR}/|} lib/libsfft.a lib/libsfft.so \
lib/libsfft.so.${SHLIB_MAJOR}
SHLIB_MAJOR= 1
SRCS= common.cc computefourier-1.0-2.0.cc \
computefourier-3.0.cc fftw.cc filters.cc parameters.cc \
sfft.cc simulation.cc timer.cc utils.cc
NO_STAGE= yes
.include <bsd.port.options.mk>
.if !${ARCH:Mamd64} && !${MACHINE_CPU:Msse2}
IGNORE= this port requires SSE2, and benefits from SSE3 -- set CPUTYPE\
appropriately
.endif
LIBM= -lm
.if ${OSVERSION} < 1000034
LIB_DEPENDS+= libmissing.so:${PORTSDIR}/math/libmissing
LIBM+= -lmissing
.endif
.if ${PORT_OPTIONS:MDOCS} || make(makesum)
DISTFILES+= sfft-doc.pdf
PORTDOCS= sfft-doc.pdf
.endif
.if ${PORT_OPTIONS:MOPTIMIZED_CFLAGS}
CFLAGS+= -O3 -ffast-math
.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/libsfft_p.a
.else
MAKE_ENV+= NO_PROFILE=yes
.endif
post-extract:
@${CP} /usr/include/complex.h ${BUILD_WRKSRC}/sfftcomplex.h
@${PRINTF} "LIBDIR=\t${PREFIX}/lib\n.include <bsd.lib.mk>\n" > \
${BUILD_WRKSRC}/Makefile
post-patch:
@${REINPLACE_CMD} -e 's/string\.h/cstring/' \
${WRKSRC}/src/utils.cc
.if ${OSVERSION} < 1000034
@${REINPLACE_CMD} -e '\|<complex.h>|{x; \
s|^.*$$|#include "missing_complex.h"|; H; x;}' \
${WRKSRC}/src/fft.h
.endif
@${REINPLACE_CMD} -E -e '/<complex\.h>/ \
{s/<complex\.h>/ "sfftcomplex.h"/; x ; \
s|^.*$$|#endif|; G; x; \
s|^.*$$|extern "C" {|; G; x; \
s|^.*$$|#ifdef __cplusplus|; G; x; \
s|^.*$$|#ifdef __cplusplus|; H; \
s|^.*$$|}|; H; \
s|^.*$$|#endif|; H; x;}' \
${WRKSRC}/src/computefourier-1.0-2.0.h \
${WRKSRC}/src/computefourier-3.0.h \
${WRKSRC}/src/fft.h
CORELIMIT?= /usr/bin/limits -Sc 0
check regression-test test: build
@cd ${BUILD_WRKSRC}; \
${CXX} ${CXXFLAGS} -o sfft-verification verification.cc \
${LDFLAGS} libsfft.a -lfftw3 ${LIBM} ; \
for _v in 1 2 3 ; do \
for _k in 5 10 50; do \
echo "Checking sfft version $${_v} with $${_k} frequency components:"; \
${CORELIMIT} ./sfft-verification -k $${_k} -r 3 -v $${_v} || ${TRUE} ; \
done ; done
post-install:
@${MKDIR} ${PREFIX}/${HDIR}
@cd ${BUILD_WRKSRC}; ${INSTALL_DATA} ${HEADERS} ${PREFIX}/${HDIR}
.if ${PORT_OPTIONS:MDOCS}
@${MKDIR} ${DOCSDIR}
@${INSTALL_DATA} ${_DISTDIR}/${PORTDOCS} ${DOCSDIR}
.endif
.include <bsd.port.mk>