math/pffft: New port: Pretty Fast FFT (PFFFT) library

This commit is contained in:
Yuri Victorovich 2022-01-30 09:41:29 -08:00
parent e1f8368d8c
commit 0bc200372f
7 changed files with 121 additions and 0 deletions

View File

@ -762,6 +762,7 @@
SUBDIR += permlib
SUBDIR += petanque
SUBDIR += petiga
SUBDIR += pffft
SUBDIR += php74-bcmath
SUBDIR += php74-gmp
SUBDIR += php80-bcmath

25
math/pffft/Makefile Normal file
View File

@ -0,0 +1,25 @@
PORTNAME= pffft
PORTVERSION= g20210806
CATEGORIES= math
MAINTAINER= yuri@FreeBSD.org
COMMENT= Pretty Fast FFT (PFFFT) library
LICENSE= BSD3CLAUSE
LICENSE_FILE= ${WRKSRC}/LICENSE.txt
USES= cmake
USE_LDCONFIG= yes
USE_GITHUB= yes
GH_ACCOUNT= marton78
GH_TAGNAME= 9603871
CMAKE_ON= BUILD_SHARED_LIBS INSTALL_PFDSP INSTALL_PFFASTCONV
post-install: # move headers into a dedicated directory
cd ${STAGEDIR}${PREFIX} && \
${MKDIR} include/${PORTNAME} && \
${MV} include/*.h include/*.hpp include/${PORTNAME}
.include <bsd.port.mk>

3
math/pffft/distinfo Normal file
View File

@ -0,0 +1,3 @@
TIMESTAMP = 1643563740
SHA256 (marton78-pffft-g20210806-9603871_GH0.tar.gz) = 474d929600969d2a55e0f599459e4c2a5e004f059ad2a5a001dd481285257e14
SIZE (marton78-pffft-g20210806-9603871_GH0.tar.gz) = 143602

View File

@ -0,0 +1,57 @@
--- CMakeLists.txt.orig 2021-08-06 18:28:48 UTC
+++ CMakeLists.txt
@@ -144,7 +144,7 @@ endif()
######################################################
-add_library(PFFFT STATIC ${FLOAT_SOURCES} ${DOUBLE_SOURCES} pffft_common.c pffft_priv_impl.h pffft.hpp )
+add_library(PFFFT ${FLOAT_SOURCES} ${DOUBLE_SOURCES} pffft_common.c pffft_priv_impl.h pffft.hpp )
set_target_properties(PFFFT PROPERTIES OUTPUT_NAME "pffft")
target_compile_definitions(PFFFT PRIVATE _USE_MATH_DEFINES)
if (USE_SCALAR_VECT)
@@ -193,7 +193,7 @@ endif()
if (USE_TYPE_FLOAT)
- add_library(PFDSP STATIC pf_mixer.cpp pf_mixer.h pf_carrier.cpp pf_carrier.h pf_cic.cpp pf_cic.h fmv.h )
+ add_library(PFDSP pf_mixer.cpp pf_mixer.h pf_carrier.cpp pf_carrier.h pf_cic.cpp pf_cic.h fmv.h )
set_target_properties(PFDSP PROPERTIES OUTPUT_NAME "pfdsp")
target_compile_definitions(PFDSP PRIVATE _USE_MATH_DEFINES)
if (USE_DEBUG_ASAN)
@@ -218,7 +218,7 @@ endif()
if (USE_FFTPACK)
# float / single precision
- add_library(FFTPACK_FLOAT STATIC fftpack.c fftpack.h)
+ add_library(FFTPACK_FLOAT fftpack.c fftpack.h)
target_compile_definitions(FFTPACK_FLOAT PRIVATE _USE_MATH_DEFINES)
target_compile_options(FFTPACK_FLOAT PRIVATE $<$<C_COMPILER_ID:GNU>:-Wall -Wextra -pedantic>)
target_link_libraries( FFTPACK_FLOAT ${MATHLIB} )
@@ -227,7 +227,7 @@ if (USE_FFTPACK)
)
# double precision
- add_library(FFTPACK_DOUBLE STATIC fftpack.c fftpack.h)
+ add_library(FFTPACK_DOUBLE fftpack.c fftpack.h)
target_compile_definitions(FFTPACK_DOUBLE PRIVATE _USE_MATH_DEFINES)
target_compile_definitions(FFTPACK_DOUBLE PUBLIC FFTPACK_DOUBLE_PRECISION)
target_compile_options(FFTPACK_DOUBLE PRIVATE $<$<C_COMPILER_ID:GNU>:-Wall -Wextra -pedantic>)
@@ -251,7 +251,7 @@ endif()
if (USE_TYPE_FLOAT)
# only 'float' supported in PFFASTCONV
- add_library(PFFASTCONV STATIC pffastconv.c pffastconv.h pffft.h )
+ add_library(PFFASTCONV pffastconv.c pffastconv.h pffft.h )
set_target_properties(PFFASTCONV PROPERTIES OUTPUT_NAME "pffastconv")
target_compile_definitions(PFFASTCONV PRIVATE _USE_MATH_DEFINES)
if (USE_DEBUG_ASAN)
@@ -447,7 +447,9 @@ endif()
######################################################
+if (FREEBSD_BUILD_EXAMPLES)
add_subdirectory(examples)
+endif()
######################################################

View File

@ -0,0 +1,11 @@
--- pffft_double.c.orig 2022-01-30 17:29:25 UTC
+++ pffft_double.c
@@ -75,6 +75,8 @@
# include <malloc.h>
#elif defined(__MINGW32__) || defined(__MINGW64__)
# include <malloc.h>
+#elif defined(__FreeBSD__)
+# include <stdlib.h>
#else
# include <alloca.h>
#endif

14
math/pffft/pkg-descr Normal file
View File

@ -0,0 +1,14 @@
PFFFT does 1D Fast Fourier Transforms, of single precision real and
complex vectors. It tries do it fast, it tries to be correct, and it
tries to be small. Computations do take advantage of SSE1 instructions
on x86 cpus, Altivec on powerpc cpus, and NEON on ARM cpus.
PFFFT is a fork of Julien Pommier's library on bitbucket with some
changes and additions.
PFFASTCONV does fast convolution (FIR filtering), of single precision
real vectors, utilizing the PFFFT library.
PFDSP contains a few other signal processing functions.
WWW: https://github.com/marton78/pffft

10
math/pffft/pkg-plist Normal file
View File

@ -0,0 +1,10 @@
include/pffft/pf_carrier.h
include/pffft/pf_cic.h
include/pffft/pf_mixer.h
include/pffft/pffastconv.h
include/pffft/pffft.h
include/pffft/pffft.hpp
include/pffft/pffft_double.h
lib/libpfdsp.so
lib/libpffastconv.so
lib/libpffft.so