Git Product home page Git Product logo

fftw's People

Contributors

adamnemecek avatar ajsyp avatar amilajack avatar derekdreery avatar hombit avatar lingman avatar mergecat[bot] avatar termoshtt avatar thezalli avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

fftw's Issues

fftw-src doesn't compile

Probably the problem is with fs_extra 1.2:

error[E0063]: missing field `content_only` in initializer of `fs_extra::dir::CopyOptions`
  --> fftw-src/build.rs:52:10
   |
52 |         &fs_extra::dir::CopyOptions {
   |          ^^^^^^^^^^^^^^^^^^^^^^^^^^ missing `content_only`

error: aborting due to previous error

For more information about this error, try `rustc --explain E0063`.
error: could not compile `fftw-src`.

Support system mkl

Please, can you add support of system mkl in the same way it made for FFTW? Probably it is already supported by intel-mkl-src 0.5.0

helpers for half-complex

Would you accept a PR for helpers to handle half-complex arrays. I'm thinking for half-complex arrays x, y,

  • x * y
  • mod(x) or abs(x)
  • arg(x) (or phase(x) if preferred)

the signature could be e.g.

/// contents of y are replaced with the result
fn half_complex_mult<X>(x: &[X], y: &mut [X]) 
where X: f32 or f64 // (either define a trait or 2 functions)
{
    assert_eq!(x.len(), y.len());
    let n = x.len();

    y[0] = y[0] * x[0];
    for i in 1..=(n - 1) / 2 {
        let xre = x[i];
        let yre = y[i];
        let xim = x[n - i];
        let yim = y[n - i];
        y[i] = xre * yre - xim * yim;
        y[n - i] = xre * yim + xre * yim;
    }
    if n % 2 == 0 {
        let n2 = n / 2;
        y[n2] = y[n2] * x[n2];
    }
}

Compiling on macOS fails

Hello!

I just tried to compile my project which depends on fftw-src, unfortunately my Mac won't compile and I can't figure out why.

RUST_BACKTRACE=full cargo build
   Compiling rawpointer v0.1.0
   Compiling rustc-serialize v0.3.24
   Compiling ansi_term v0.11.0
   Compiling itertools v0.7.11
   Compiling num-complex v0.2.3
   Compiling coreaudio-sys v0.2.3
   Compiling fftw-src v0.3.0
   Compiling matrixmultiply v0.1.15
   Compiling ndarray v0.12.1
   Compiling coreaudio-rs v0.9.1
   Compiling cpal v0.10.0
error: failed to run custom build command for `fftw-src v0.3.0`

Caused by:
  process didn't exit successfully: `/Users/max/Development/MyProjecttest/target/debug/build/fftw-src-7becbacca0ec1524/build-script-build` (exit code: 101)
--- stdout
Running: "./configure" "--with-pic" "--enable-static" "--prefix=/Users/max/Development/MyProjecttest/target/debug/build/fftw-src-e2f282ac7efc1251/out" "--enable-single"
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for a thread-safe mkdir -p... ./install-sh -c -d
checking for gawk... no
checking for mawk... no
checking for nawk... no
checking for awk... awk
checking whether make sets $(MAKE)... yes
checking whether make supports nested variables... yes
checking whether to enable maintainer-specific portions of Makefiles... no
checking build system type... x86_64-apple-darwin19.0.0
checking host system type... x86_64-apple-darwin19.0.0
checking for gcc... gcc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables...
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking for gcc option to accept ISO C89... none needed
checking whether gcc understands -c and -o together... yes
checking for style of include used by make... GNU
checking dependency style of gcc... gcc3
checking for C compiler vendor... clang
checking for gcc option to accept ISO C99... none needed
checking for gcc option to accept ISO Standard C... (cached) none needed
checking whether ln -s works... yes
checking whether make sets $(MAKE)... (cached) yes
checking how to print strings... printf
checking for a sed that does not truncate output... /usr/bin/sed
checking for grep that handles long lines and -e... /usr/bin/grep
checking for egrep... /usr/bin/grep -E
checking for fgrep... /usr/bin/grep -F
checking for ld used by gcc... /Library/Developer/CommandLineTools/usr/bin/ld
checking if the linker (/Library/Developer/CommandLineTools/usr/bin/ld) is GNU ld... no
checking for BSD- or MS-compatible name lister (nm)... /usr/bin/nm -B
checking the name lister (/usr/bin/nm -B) interface... BSD nm
checking the maximum length of command line arguments... 196608
checking how to convert x86_64-apple-darwin19.0.0 file names to x86_64-apple-darwin19.0.0 format... func_convert_file_noop
checking how to convert x86_64-apple-darwin19.0.0 file names to toolchain format... func_convert_file_noop
checking for /Library/Developer/CommandLineTools/usr/bin/ld option to reload object files... -r
checking for objdump... objdump
checking how to recognize dependent libraries... pass_all
checking for dlltool... dlltool
checking how to associate runtime and link libraries... printf %s\n
checking for ar... ar
checking for archiver @FILE support... no
checking for strip... strip
checking for ranlib... ranlib
checking command to parse /usr/bin/nm -B output from gcc object... ok
checking for sysroot... no
checking for a working dd... /bin/dd
checking how to truncate binary pipes... /bin/dd bs=4096 count=1
checking for mt... no
checking if : is a manifest tool... no
checking for dsymutil... dsymutil
checking for nmedit... nmedit
checking for lipo... lipo
checking for otool... otool
checking for otool64... no
checking for -single_module linker flag... yes
checking for -exported_symbols_list linker flag... yes
checking for -force_load linker flag... yes
checking how to run the C preprocessor... gcc -E
checking for ANSI C header files... yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking for dlfcn.h... yes
checking for objdir... .libs
checking if gcc supports -fno-rtti -fno-exceptions... yes
checking for gcc option to produce PIC... -fno-common -DPIC
checking if gcc PIC flag -fno-common -DPIC works... yes
checking if gcc static flag -static works... no
checking if gcc supports -c -o file.o... yes
checking if gcc supports -c -o file.o... (cached) yes
checking whether the gcc linker (/Library/Developer/CommandLineTools/usr/bin/ld) supports shared libraries... yes
checking dynamic linker characteristics... darwin19.0.0 dyld
checking how to hardcode library paths into programs... immediate
checking whether stripping libraries is possible... yes
checking if libtool supports shared libraries... yes
checking whether to build shared libraries... no
checking whether to build static libraries... yes
checking for ocamlbuild... no
checking whether C compiler accepts -mtune=native... yes
checking whether C compiler accepts -fstrict-aliasing... yes
checking whether C compiler accepts -ffast-math... yes
checking whether C compiler accepts -O3 -fomit-frame-pointer -mtune=native -fstrict-aliasing -ffast-math... yes
checking for ANSI C header files... (cached) yes
checking libintl.h usability... no
checking libintl.h presence... no
checking for libintl.h... no
checking malloc.h usability... no
checking malloc.h presence... no
checking for malloc.h... no
checking stddef.h usability... yes
checking stddef.h presence... yes
checking for stddef.h... yes
checking for stdlib.h... (cached) yes
checking for string.h... (cached) yes
checking for strings.h... (cached) yes
checking sys/time.h usability... yes
checking sys/time.h presence... yes
checking for sys/time.h... yes
checking for unistd.h... (cached) yes
checking limits.h usability... yes
checking limits.h presence... yes
checking for limits.h... yes
checking c_asm.h usability... no
checking c_asm.h presence... no
checking for c_asm.h... no
checking intrinsics.h usability... no
checking intrinsics.h presence... no
checking for intrinsics.h... no
checking for stdint.h... (cached) yes
checking mach/mach_time.h usability... yes
checking mach/mach_time.h presence... yes
checking for mach/mach_time.h... yes
checking sys/sysctl.h usability... yes
checking sys/sysctl.h presence... yes
checking for sys/sysctl.h... yes
checking altivec.h usability... no
checking altivec.h presence... no
checking for altivec.h... no
checking for an ANSI C-conforming const... yes
checking for inline... inline
checking for size_t... yes
checking whether time.h and sys/time.h may both be included... yes
checking for long double... yes
checking for hrtime_t... no
checking size of int... 4
checking size of unsigned int... 4
checking size of long... 8
checking size of unsigned long... 8
checking size of long long... 8
checking size of unsigned long long... 8
checking size of size_t... 8
checking size of ptrdiff_t... 8
checking for uintptr_t... yes
checking size of float... 4
checking size of double... 8
checking size of fftw_r2r_kind... 4
checking for working alloca.h... yes
checking for alloca... yes
checking for working strtod... yes
checking for vprintf... yes
checking for _doprnt... no
checking for sin in -lm... yes
checking for BSDgettimeofday... no
checking for gettimeofday... yes
checking for gethrtime... no
checking for read_real_time... no
checking for time_base_to_time... no
checking for drand48... yes
checking for sqrt... yes
checking for memset... yes
checking for posix_memalign... yes
checking for memalign... no
checking for _mm_malloc... no
checking for _mm_free... no
checking for clock_gettime... yes
checking for mach_absolute_time... yes
checking for sysctl... yes
checking for abort... yes
checking for sinl... yes
checking for cosl... yes
checking for snprintf... yes
checking whether sinl is declared... yes
checking whether cosl is declared... yes
checking whether sinq is declared... no
checking whether cosq is declared... no
checking whether memalign is declared... no
checking whether drand48 is declared... yes
checking whether srand48 is declared... yes
checking whether posix_memalign is declared... yes
checking for _rtc intrinsic... no
checking for isnan... yes
checking whether C compiler accepts -mpreferred-stack-boundary=4... no
checking for g77... no
checking for xlf... no
checking for f77... no
checking for frt... no
checking for pgf77... no
checking for cf77... no
checking for fort77... no
checking for fl32... no
checking for af77... no
checking for xlf90... no
checking for f90... no
checking for pgf90... no
checking for pghpf... no
checking for epcf90... no
checking for gfortran... gfortran
checking whether we are using the GNU Fortran 77 compiler... yes
checking whether gfortran accepts -g... yes
checking if libtool supports shared libraries... yes
checking whether to build shared libraries... no
checking whether to build static libraries... yes
checking for gfortran option to produce PIC... -fno-common
checking if gfortran PIC flag -fno-common works... yes
checking if gfortran static flag -static works... no
checking if gfortran supports -c -o file.o... yes
checking if gfortran supports -c -o file.o... (cached) yes
checking whether the gfortran linker (/Library/Developer/CommandLineTools/usr/bin/ld) supports shared libraries... yes
checking dynamic linker characteristics... darwin19.0.0 dyld
checking how to hardcode library paths into programs... immediate
checking how to get verbose linking output from gfortran... -v
checking for Fortran 77 libraries of gfortran...  -L/usr/local/Cellar/gcc/9.2.0_2/lib/gcc/9/gcc/x86_64-apple-darwin19/9.2.0 -L/usr/local/Cellar/gcc/9.2.0_2/lib/gcc/9/gcc/x86_64-apple-darwin19/9.2.0/../../.. -lgfortran -lquadmath -lm
checking for dummy main to link with Fortran 77 libraries... none
checking for Fortran 77 name-mangling scheme... lower case, underscore, no extra underscore
checking whether a cycle counter is available... yes
checking that generated files are newer than configure... done
configure: creating ./config.status
config.status: creating Makefile
config.status: creating support/Makefile
config.status: creating genfft/Makefile
config.status: creating kernel/Makefile
config.status: creating simd-support/Makefile
config.status: creating dft/Makefile
config.status: creating dft/scalar/Makefile
config.status: creating dft/scalar/codelets/Makefile
config.status: creating dft/simd/Makefile
config.status: creating dft/simd/common/Makefile
config.status: creating dft/simd/sse2/Makefile
config.status: creating dft/simd/avx/Makefile
config.status: creating dft/simd/avx-128-fma/Makefile
config.status: creating dft/simd/avx2/Makefile
config.status: creating dft/simd/avx2-128/Makefile
config.status: creating dft/simd/avx512/Makefile
config.status: creating dft/simd/kcvi/Makefile
config.status: creating dft/simd/altivec/Makefile
config.status: creating dft/simd/vsx/Makefile
config.status: creating dft/simd/neon/Makefile
config.status: creating dft/simd/generic-simd128/Makefile
config.status: creating dft/simd/generic-simd256/Makefile
config.status: creating rdft/Makefile
config.status: creating rdft/scalar/Makefile
config.status: creating rdft/scalar/r2cf/Makefile
config.status: creating rdft/scalar/r2cb/Makefile
config.status: creating rdft/scalar/r2r/Makefile
config.status: creating rdft/simd/Makefile
config.status: creating rdft/simd/common/Makefile
config.status: creating rdft/simd/sse2/Makefile
config.status: creating rdft/simd/avx/Makefile
config.status: creating rdft/simd/avx-128-fma/Makefile
config.status: creating rdft/simd/avx2/Makefile
config.status: creating rdft/simd/avx2-128/Makefile
config.status: creating rdft/simd/avx512/Makefile
config.status: creating rdft/simd/kcvi/Makefile
config.status: creating rdft/simd/altivec/Makefile
config.status: creating rdft/simd/vsx/Makefile
config.status: creating rdft/simd/neon/Makefile
config.status: creating rdft/simd/generic-simd128/Makefile
config.status: creating rdft/simd/generic-simd256/Makefile
config.status: creating reodft/Makefile
config.status: creating threads/Makefile
config.status: creating api/Makefile
config.status: creating mpi/Makefile
config.status: creating libbench2/Makefile
config.status: creating tests/Makefile
config.status: creating doc/Makefile
config.status: creating doc/FAQ/Makefile
config.status: creating tools/Makefile
config.status: creating tools/fftw_wisdom.1
config.status: creating tools/fftw-wisdom-to-conf
config.status: creating m4/Makefile
config.status: creating fftw.pc
config.status: creating config.h
config.status: config.h is unchanged
config.status: executing depfiles commands
config.status: executing libtool commands

--- stderr
thread 'main' panicked at 'failed to execute `"./configure" "--with-pic" "--enable-static" "--prefix=/Users/max/Development/MyProjecttest/target/debug/build/fftw-src-e2f282ac7efc1251/out" "--enable-single"`: No such file or directory (os error 2)', /Users/max/.cargo/registry/src/github.com-1ecc6299db9ec823/fftw-src-0.3.0/build.rs:128:13
stack backtrace:
   0:        0x1040025c5 - backtrace::backtrace::libunwind::trace::h5374dc6304209fb0
                               at /Users/runner/.cargo/registry/src/github.com-1ecc6299db9ec823/backtrace-0.3.37/src/backtrace/libunwind.rs:88
   1:        0x1040025c5 - backtrace::backtrace::trace_unsynchronized::hc6c40d142cd2a86c
                               at /Users/runner/.cargo/registry/src/github.com-1ecc6299db9ec823/backtrace-0.3.37/src/backtrace/mod.rs:66
   2:        0x1040025c5 - std::sys_common::backtrace::_print_fmt::h070478e0aa6dc01e
                               at src/libstd/sys_common/backtrace.rs:76
   3:        0x1040025c5 - <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt::h66f38d4abb2e41c1
                               at src/libstd/sys_common/backtrace.rs:60
   4:        0x104022c70 - core::fmt::write::h4f487e714088986d
                               at src/libcore/fmt/mod.rs:1030
   5:        0x103ffd71b - std::io::Write::write_fmt::h7bd7b6fe8b47c5fb
                               at src/libstd/io/mod.rs:1412
   6:        0x10400445a - std::sys_common::backtrace::_print::hcf7e952e5633d242
                               at src/libstd/sys_common/backtrace.rs:64
   7:        0x10400445a - std::sys_common::backtrace::print::hbc3f189fef9884dc
                               at src/libstd/sys_common/backtrace.rs:49
   8:        0x10400445a - std::panicking::default_hook::{{closure}}::heee79636c241547c
                               at src/libstd/panicking.rs:196
   9:        0x104004165 - std::panicking::default_hook::hfcbd07059d15441e
                               at src/libstd/panicking.rs:210
  10:        0x104004b27 - std::panicking::rust_panic_with_hook::h0c4b67125f55410a
                               at src/libstd/panicking.rs:473
  11:        0x10400469d - std::panicking::continue_panic_fmt::h0e74ab2b215a1401
                               at src/libstd/panicking.rs:380
  12:        0x10402ef8e - std::thread::local::fast::Key<T>::try_initialize::hcdc98eb893033f5a
  13:        0x10377566f - build_script_build::run::h3084bae935ca40b9
                               at /Users/max/.cargo/registry/src/github.com-1ecc6299db9ec823/fftw-src-0.3.0/build.rs:128
  14:        0x1037750e2 - build_script_build::build_fftw::hbd8211b50647c590
                               at /Users/max/.cargo/registry/src/github.com-1ecc6299db9ec823/fftw-src-0.3.0/build.rs:107
  15:        0x103774bf5 - build_script_build::download_archive_unix::h856e9ae03b1ec14a
                               at /Users/max/.cargo/registry/src/github.com-1ecc6299db9ec823/fftw-src-0.3.0/build.rs:101
  16:        0x103775a72 - build_script_build::main::h04b4af8bbc90ff90
                               at /Users/max/.cargo/registry/src/github.com-1ecc6299db9ec823/fftw-src-0.3.0/build.rs:141
  17:        0x10377af62 - std::rt::lang_start::{{closure}}::haf9045e08fd844ed
                               at /rustc/4560ea788cb760f0a34127156c78e2552949f734/src/libstd/rt.rs:64
  18:        0x104004578 - std::rt::lang_start_internal::{{closure}}::h63f39619c053dac6
                               at src/libstd/rt.rs:49
  19:        0x104004578 - std::panicking::try::do_call::ha1a4587e2a4eb439
                               at src/libstd/panicking.rs:292
  20:        0x10400be4f - __rust_maybe_catch_panic
                               at src/libpanic_unwind/lib.rs:80
  21:        0x104004f8e - std::panicking::try::h840ae8cb372083d2
                               at src/libstd/panicking.rs:271
  22:        0x104004f8e - std::panic::catch_unwind::hae56a990bf6a45eb
                               at src/libstd/panic.rs:394
  23:        0x104004f8e - std::rt::lang_start_internal::hcf96e32a124891dc
                               at src/libstd/rt.rs:48
  24:        0x10377af42 - std::rt::lang_start::h1520e100a35f328d
                               at /rustc/4560ea788cb760f0a34127156c78e2552949f734/src/libstd/rt.rs:64
  25:        0x103775e12 - build_script_build::main::h04b4af8bbc90ff90

I tried the ./configure ... command in a separate shell and it works just fine (exit code is 0).

System Stats are:

neofetch --off
[email protected]
-----------------------------------
OS: macOS 10.15.1 19B2106 x86_64
Host: MacBookPro16,1
Kernel: 19.0.0
Uptime: 1 hour, 5 mins
Packages: 40 (brew)
Shell: zsh 5.7.1
Resolution: 1920x1080
DE: Aqua
WM: Quartz Compositor
WM Theme: Blue (Dark)
Terminal: iTerm2
Terminal Font: HackNerdFontComplete-Regular 13
CPU: Intel i9-9980HK (16) @ 2.40GHz
GPU: Intel UHD Graphics 630, AMD Radeon Pro 5500M
Memory: 7464MiB / 16384MiB

Rust Version:

rustc 1.39.0 (4560ea788 2019-11-04)
rustup check
stable-x86_64-apple-darwin - Up to date : 1.39.0 (4560ea788 2019-11-04)

Any help is greatly appreciated :)

Support for Windows builds with GNU ABI

This library is currently not compatible with toolchains like stable-x86_64-pc-windows-gnu. I wasn't able to modify the build script to support building with MSYS/MinGW, but it could be possible to offer pre-built binaries for these platforms.

Static linking on Windows

I never noticed this since I always use Linux myself, but while the Linux and macOS versions statically link to the built version of fftw by default, the Windows version always dynamically links to a downloaded binary. This makes distributing binaries built against this crate a lot more difficult on Windows. Is there an easy way to get it to statically link instead?

Buffer: in-place transformation

Plan-based implementation in FFTW is unconformable with the borrow checker in Rust since fftw_execute(plan) modify in/out arrays.
The transformation in FFTW has two types: in-place and out-place. Current implementation using Pair corresponding to out-place conversion.
I will implement in-place by Buffer struct.

Typing mismatch in mod.rs and timeval.rs for macOS 2.2.0 installation

I'm working with the Pulse Audio binding to do a simple FFT visualizer. I'm getting the following traceback when trying to compile basic usage of the standard mainloop and context and stream stuff:

   Compiling libpulse-binding v2.2.0
error[E0308]: mismatched types
  --> /Users/noahbkim/.cargo/registry/src/github.com-1ecc6299db9ec823/libpulse-binding-2.2.0/src/time/mod.rs:55:35
   |
55 |         Timeval::new(secs as i64, usecs as i64)
   |                                   ^^^^^^^^^^^^ expected i32, found i64

error[E0308]: mismatched types
  --> /Users/noahbkim/.cargo/registry/src/github.com-1ecc6299db9ec823/libpulse-binding-2.2.0/src/time/mod.rs:74:42
   |
74 |         Timeval::new(t.as_secs() as i64, (t.subsec_nanos() / NANOS_PER_MILLI) as i64)
   |                                          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected i32, found i64

error[E0308]: mismatched types
   --> /Users/noahbkim/.cargo/registry/src/github.com-1ecc6299db9ec823/libpulse-binding-2.2.0/src/time/timeval.rs:100:41
    |
100 |             true => { self.0.tv_usec |= PA_TIMEVAL_RTCLOCK; },
    |                                         ^^^^^^^^^^^^^^^^^^ expected i32, found i64

error[E0277]: no implementation for `i32 |= i64`
   --> /Users/noahbkim/.cargo/registry/src/github.com-1ecc6299db9ec823/libpulse-binding-2.2.0/src/time/timeval.rs:100:38
    |
100 |             true => { self.0.tv_usec |= PA_TIMEVAL_RTCLOCK; },
    |                                      ^^ no implementation for `i32 |= i64`
    |
    = help: the trait `std::ops::BitOrAssign<i64>` is not implemented for `i32`

I'm working on the current version of macOS with a vanilla installation of Rust. Let me know if you need any other information.

thread 'main' panicked at 'Failed to check md5 sum

I'm new to Rust , so please over look my ignorance of some its functions. I have iMac osx 10.13.6
My issue is the following:error:
failed to run custom build command for fftw-src v0.2.2 (file:///Users/jim/Downloads/rust-fftw3-master-2/fftw-src)
process didn't exit successfully: /Users/jim/Downloads/rust-fftw3-master-2/target/debug/build/fftw-src-a110d0ce96cf96b8/build-script-build (exit code: 101)
--- stderr
thread 'main' panicked at 'Failed to check md5 sum: Os { code: 2, kind: NotFound, message: "No such file or directory" }', libcore/result.rs:945:5

Any help will be greatly appreciated.

ocipkg-based intel-mkl-src does not work on Windows

intel-mkl-src 0.8.0 (upgraded at #121) switched download source from AWS S3 to GitHub Container registry using ocipkg. It only works with static library to avoid runtime search path issue.

However, it causes runtime error:

  process didn't exit successfully: `D:\a\fftw\fftw\target\debug\deps\c2c-8b0385d3c022d1c2.exe` (exit code: 0xc0000135, STATUS_DLL_NOT_FOUND)

https://github.com/rust-math/fftw/actions/runs/4837801529/jobs/8621864073

This does not occur if we use NuGet to download MKL from NuGet registry, and add its path to runtime search path.

Some attempt has been done in #122, but not resolved.

Maybe related to #118

cargo test --doc cannot find DLL on Windows

https://github.com/rust-math/fftw/runs/1044484751

running 3 tests
test src\array.rs - array::alignment_of (line 109) ... FAILED
test src\lib.rs -  (line 10) ... FAILED
test src\lib.rs -  (line 29) ... FAILED

failures:

---- src\array.rs - array::alignment_of (line 109) stdout ----
Test executable failed (exit code -1073741515).

---- src\lib.rs -  (line 10) stdout ----
Test executable failed (exit code -1073741515).

---- src\lib.rs -  (line 29) stdout ----
Test executable failed (exit code -1073741515).

Test Coverage

Add codecov to CI to manage line coverage of tests

Document need for wget

Otherwise, calling cargo build will fail with an error that took me a few minutes to chase down:

error: failed to run custom build command for `fftw-src v0.2.1`
process didn't exit successfully: `/Users/duane/Projects/audio/spectrogram/target/debug/build/fftw-src-1e03addce5c52064/build-script-build` (exit code: 101)
--- stdout
Running: "wget" "http://www.fftw.org/fftw-3.3.6-pl1.tar.gz"

--- stderr
thread 'main' panicked at 'failed to execute `"wget" "http://www.fftw.org/fftw-3.3.6-pl1.tar.gz"`: No such file or directory (os error 2)', /Users/duane/.cargo/registry/src/github.com-1ecc6299db9ec823/fftw-src-0.2.1/build.rs:61
note: Run with `RUST_BACKTRACE=1` for a backtrace.

Note at first I thought the target file was missing, not wget.

Alternatively, you could just use curl on darwin.

Drop reqwest dependency

From #83

  • For Linux and macOS, #88 make possible to drop download phase
  • For Windows, however, downloading is still needed to get compiled binary. We have some choice:
    • Also compile with GNU toolchain, and drop msvc support
    • Use reqwest or more light downloader, e.g. curl crate which is used in intel-mkl-src if download feature is enabled, only for Windows
    • or combine them (build for gnu, and download for msvc)

Can plan executions take &self instead of &mut self?

I am asking this, because I am having a hard time trying to check whether this is possible or not. According to this documentation, execution of plans should take a const pointer to the plan (which AFAIK is nearly meaningless in the C world, because you are totally safe (ahem) to change nested values...).

Maybe it could be possible, but I am completely unable to hack through the code of FFTW3 to find the answer by myself. I could not find a similar question, therefore, even if c2c/r2c/c2r really need to use &mut self, at least there is an issue explicitly discussing this.

num-complex v0.2.0 support seems to be broken

It looks like the fftw-sys dependency is stuck on v0.2.4 which uses num-complex v0.1.43.

Creating a minimal project with the following dependencies

[dependencies]
fftw = "0.5.0"
num-complex = "0.2.0"

causes cargo to pull down both num-complex v0.2.0 and num-complex v0.1.43. Cargo reports that it's using v0.3.0 of fftw-sys, but the actual Cargo.toml in the registry (~/.cargo/registry/src/github.com-1ecc6299db9ec823/fftw-sys-0.3.0) shows version 0.2.4 with the old num-complex dependency.

use num_complex::Complex;
use fftw::array::AlignedVec;

fn main() {
    let v: AlignedVec<Complex<f64>> = AlignedVec::new(1);
}

errors with "the trait fftw::array::AlignedAllocable is not implemented for num_complex::Complex<f64>"

Changing the num-complex dependency version to 0.1.43 allows the above to compile.

The source and intel-mkl feature flags are mutually exclusive

I've noticed that if the source and intel-mkl feature flags are both set, it leads to a build failure:

   Compiling fftw-sys v0.6.0
error[E0259]: the name `ffi` is defined multiple times
 --> /home/bowlofeggs/.cargo/registry/src/github.com-1ecc6299db9ec823/fftw-sys-0.6.0/src/lib.rs:7:1
  |
4 | extern crate fftw_src as ffi;
  | ----------------------------- previous import of the extern crate `ffi` here
...
7 | extern crate intel_mkl_src as ffi;
  | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `ffi` reimported here
  |
  = note: `ffi` must be defined only once in the type namespace of this module
help: you can use `as` to change the binding name of the import
  |
7 | extern crate intel_mkl_src as other_ffi;
  |

error: aborting due to previous error

For more information about this error, try `rustc --explain E0259`.
error: could not compile `fftw-sys`

The Cargo Book suggests avoiding this scenario if possible:

There are rare cases where features may be mutually incompatible with one another. This should be avoided if at all possible, because it requires coordinating all uses of the package in the dependency graph to cooperate to avoid enabling them together.

Since source is the default feature, would it make sense to use intel-mkl if that feature is set, and fall back to source if it is not set?

Context

My particular problem is that my application also has an intel-mkl feature flag. If that flag is set, I have my application configured to set the same flag on fftw. However, if that flag is not set I would like to use the source feature. I am unfamiliar with a way to express that I want the source flag set if my feature is not set, but set if it is. If fftw made these flags additive rather than mutually exclusive, I could simply use the default feature set in fftw (giving me source), and then I can add the intel-mkl flag to fftw if my corresponding feature is enabled without hitting this compilation issue.

Failed to compile on Windows

x fftw-3.3.6-pl1/doc/fftw3.info-2
x fftw-3.3.6-pl1/tools/
x fftw-3.3.6-pl1/tools/Makefile.am
x fftw-3.3.6-pl1/tools/fftw-wisdom-to-conf.1
x fftw-3.3.6-pl1/tools/fftwf-wisdom.1
x fftw-3.3.6-pl1/tools/Makefile.in
x fftw-3.3.6-pl1/tools/fftw-wisdom-to-conf.in
x fftw-3.3.6-pl1/tools/fftw_wisdom.1.in
x fftw-3.3.6-pl1/tools/fftw-wisdom.c
thread 'main' panicked at 'failed to execute `"./configure" "--enable-static" "--with-pic" "--enable-single"`: The system cannot find the file specified. (os error 2)', C:\Users\username\.cargo\registry\src\github.com-1ecc6299db9ec823\fftw-src-0.2.3\build.rs:101:13
note: Run with `RUST_BACKTRACE=1` environment variable to display a backtrace.

System: Windows 10 Pro 17134 x64
Rust Toolchain: nightly-2019-01-26-x86_64-pc-windows-gnu
System Compiler: MSVC 2017

FFTW offically supports Windows. How can I build this crate on windows?

Multi dimension fft

First of all great effort to port a amazing fft library to an amazing programming language. I am relatively new to rust and come from a more c++ heavy background. I am struggling a bit in understanding how to use the multi dimensional fft. I saw that there are some commits related to this feature. When trying to figure out how to actually create the plan for this and pass the data I fail though. Would be amazing if someone could point me into the right direction.
Best wishes,
Malte

License question

Hey there:

We are very interested in using these RUST bindings for FFTW.

We are wondering if we can buy a license for the RUST bindings to be able to try it out in production.

We currently have an FFTW 3.3.x license, but would really like to extend that to RUST. Unfortunately, we can't use GPL :(

Let us know what you think :)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.