Giter Club home page Giter Club logo

numo-fftw's Introduction

Numo::FFTW

FFTW3 interface for Ruby/Numo::NArray. Under development.

GitHub site | RubyGems

FFTW

  • FFTW is a C subroutine library for computing the discrete Fourier transform (DFT) in one or more dimensions, of arbitrary input size, and of both real and complex data.
  • FFTW site

Installation

$ gem install numo-fftw

numo-fftw's People

Contributors

icm7216 avatar masa16 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

Forkers

icm7216

numo-fftw's Issues

Error when requiring

When I try to use this library and in a pry console write:

require 'numo/fftw'

I get the following error

LoadError: dlopen(/Users/toni/.rvm/gems/ruby-2.5.1@way/gems/numo-fftw-0.1.1/lib/numo/fftw.bundle, 9): Symbol not found: _na_data_type
  Referenced from: /Users/toni/.rvm/gems/ruby-2.5.1@way/gems/numo-fftw-0.1.1/lib/numo/fftw.bundle
  Expected in: flat namespace
 in /Users/toni/.rvm/gems/ruby-2.5.1@way/gems/numo-fftw-0.1.1/lib/numo/fftw.bundle - /Users/toni/.rvm/gems/ruby-2.5.1@way/gems/numo-fftw-0.1.1/lib/numo/fftw.bundle
from /Users/toni/.rvm/rubies/ruby-2.5.1/lib/ruby/2.5.0/rubygems/core_ext/kernel_require.rb:59:in `require'

Fails to compile on Apple silicon

Maybe I'm doing something wrong, I'm happy to try some debugging steps.

I have fftw3 installed via brew install fftw. The directory /opt/homebrew/lib contains:

libfftw3.3.dylib@
libfftw3.a@
libfftw3.dylib@
libfftw3_mpi.3.dylib@
libfftw3_mpi.a@
libfftw3_mpi.dylib@
libfftw3_omp.3.dylib@
libfftw3_omp.a@
libfftw3_omp.dylib@
libfftw3_threads.3.dylib@
libfftw3_threads.a@
libfftw3_threads.dylib@
libfftw3f.3.dylib@
libfftw3f.a@
libfftw3f.dylib@
libfftw3f_mpi.3.dylib@
libfftw3f_mpi.a@
libfftw3f_mpi.dylib@
libfftw3f_omp.3.dylib@
libfftw3f_omp.a@
libfftw3f_omp.dylib@
libfftw3f_threads.3.dylib@
libfftw3f_threads.a@
libfftw3f_threads.dylib@
libfftw3l.3.dylib@
libfftw3l.a@
libfftw3l.dylib@
libfftw3l_mpi.3.dylib@
libfftw3l_mpi.a@
libfftw3l_mpi.dylib@
libfftw3l_omp.3.dylib@
libfftw3l_omp.a@
libfftw3l_omp.dylib@
libfftw3l_threads.3.dylib@
libfftw3l_threads.a@
libfftw3l_threads.dylib@

Unfortunately, gem install numo-fftw fails with the following error:

checking for fftw3.h... yes
checking for -lfftw3... no
*** extconf.rb failed ***
Could not create Makefile due to some reason, probably lack of necessary
libraries and/or headers.  Check the mkmf.log file for more details.  You may
need configuration options.

Full logs here:
mkmf.log
gem_make.out

I also tried manually symlinking fftw3* to libfftw3*, but that didn't seem to help. What's odd is that the mkmf.log reports /opt/homebrew/lib as being on DYLD_LIBRARY_PATH.

Happy to help with debugging, or even submitting a fix once we figure out what's wrong!

Install error on windows rubyinstaller2

$ pacman -Ss mingw-w64-x86_64-fftw
mingw64/mingw-w64-x86_64-fftw 3.3.7-1 [installed]

in windows cmd:

c:\Dominic\programming\ruby\try_numo>gem install numo-fftw
Temporarily enhancing PATH for MSYS/MINGW...
Building native extensions. This could take a while...
ERROR: Error installing numo-fftw:
ERROR: Failed to build gem native extension.

current directory: c:/Dominic/rubies/Ruby25-x64/lib/ruby/gems/2.5.0/gems/numo-fftw-0.1.1/ext/numo/fftw

c:/Dominic/rubies/Ruby25-x64/bin/ruby.exe -r ./siteconf20180417-19488-1ipt2ra.rb extconf.rb
checking for numo/narray.h... yes
checking for fftw3.h... yes
checking for -lfftw3... yes
creating Makefile

current directory: c:/Dominic/rubies/Ruby25-x64/lib/ruby/gems/2.5.0/gems/numo-fftw-0.1.1/ext/numo/fftw
make "DESTDIR=" clean

current directory: c:/Dominic/rubies/Ruby25-x64/lib/ruby/gems/2.5.0/gems/numo-fftw-0.1.1/ext/numo/fftw
make "DESTDIR="
generating fftw-x64-mingw32.def
erb -T- fftw.erb.c > fftw.c
compiling fftw.c
linking shared-object numo/fftw.so
fftw.o:fftw.c:(.text+0x9d): undefined reference to nary_check_contiguous' fftw.o:fftw.c:(.text+0x12a): undefined reference to nary_s_new_like'
fftw.o:fftw.c:(.text+0x136): undefined reference to nary_get_pointer_for_read' fftw.o:fftw.c:(.text+0x141): undefined reference to nary_get_pointer_for_write'
fftw.o:fftw.c:(.text+0x1d8): undefined reference to nary_get_pointer_for_read_write' fftw.o:fftw.c:(.text+0x1f1): undefined reference to nary_dup'
fftw.o:fftw.c:(.text+0x37f): undefined reference to na_ndloop3' fftw.o:fftw.c:(.text+0x4dc): undefined reference to na_ndloop3'
fftw.o:fftw.c:(.text+0x623): undefined reference to na_ndloop3' fftw.o:fftw.c:(.rdata$.refptr.nary_eDimensionError[.refptr.nary_eDimensionError]+0x0): undefined reference to nary_eDimensionError'
fftw.o:fftw.c:(.rdata$.refptr.na_data_type[.refptr.na_data_type]+0x0): undefined reference to na_data_type' fftw.o:fftw.c:(.rdata$.refptr.numo_cDComplex[.refptr.numo_cDComplex]+0x0): undefined reference to numo_cDComplex'
collect2.exe: error: ld returned 1 exit status
make: *** [Makefile:259: fftw.so] Error 1

make failed, exit code 2

Gem files will remain installed in c:/Dominic/rubies/Ruby25-x64/lib/ruby/gems/2.5.0/gems/numo-fftw-0.1.1 for inspection.
Results logged to c:/Dominic/rubies/Ruby25-x64/lib/ruby/gems/2.5.0/extensions/x64-mingw32/2.5.0/numo-fftw-0.1.1/gem_make.out

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.