discuss-gnuradio
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Discuss-gnuradio] FFTW3 runtime error


From: Marcus Müller
Subject: Re: [Discuss-gnuradio] FFTW3 runtime error
Date: Tue, 04 Mar 2014 10:59:44 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.2.0

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hi Activecat,

your sourcecode should be fine - what you see is an error that tells
you that at runtime, a symbol could not be found. This means that the
fftw library has not been linked against.
On 2014-02-26 there was a thread on discuss-gnuradio with the subject
"Link FFTW3 in OOT module" featuring Sabathy Mischa and me, could you
please look into the mailing list archive; the solution to your
problem should be there :)

Happy hacking,
Marcus

On 04.03.2014 07:27, Activecat wrote:
> The implementation header file is as below:
> 
> 
> #ifndef INCLUDED_ACTIVECAT_FFT1_IMPL_H #define
> INCLUDED_ACTIVECAT_FFT1_IMPL_H
> 
> #include <activecat/fft1.h> #include <fftw3.h>
> 
> namespace gr { namespace activecat {
> 
> class fft1_impl : public fft1 { private: int d_N; int d_direction; 
> int d_shift;
> 
> fftw_complex *d_input; fftw_plan     d_plan;
> 
> public: fft1_impl(int fft_size, int direction, bool fft_shift); 
> ~fft1_impl();
> 
> int work( int noutput_items, gr_vector_const_void_star
> &input_items, gr_vector_void_star &output_items); };
> 
> } // namespace activecat } // namespace gr
> 
> #endif /* INCLUDED_ACTIVECAT_FFT1_IMPL_H */
> 
> 
> 
> On Tue, Mar 4, 2014 at 1:55 PM, Activecat <address@hidden>
> wrote:
> 
>> Dear Sir,
>> 
>> I am trying to build a custom block with FFT capability. I use
>> FFTW3, the FFT stuff runs well as a standalone program before 
>> integrating into gnuradio.
>> 
>> Then I integrate the FFT function into the block, it compiles
>> without any error. But when I run the flow graph in GRC, it
>> produces following error message.
>> 
>> Generating: "/home/sgku/gnuradio/flow_graphs/top_block.py" 
>> Executing: "/home/sgku/gnuradio/flow_graphs/top_block.py" 
>> Traceback (most recent call last): File
>> "/home/sgku/gnuradio/flow_graphs/top_block.py", line 18, in 
>> <module> import activecat File 
>> "/usr/local/lib/python2.7/dist-packages/activecat/__init__.py",
>> line 45, in <module> from activecat_swig import * File 
>> "/usr/local/lib/python2.7/dist-packages/activecat/activecat_swig.py",
>> line 26, in <module> _activecat_swig = swig_import_helper() File 
>> "/usr/local/lib/python2.7/dist-packages/activecat/activecat_swig.py",
>> line 22, in swig_import_helper _mod =
>> imp.load_module('_activecat_swig', fp, pathname, description) 
>> ImportError: /usr/local/lib/libgnuradio-activecat.so: undefined 
>> symbol: fftw_plan_dft_1d
>>>>> Done
>> 
>> 
>> Below is the implmentation source file:
>> 
>> 
>> namespace gr { namespace activecat {
>> 
>> fft1::sptr fft1::make(int fft_size, int direction, bool
>> fft_shift) { return gnuradio::get_initial_sptr (new
>> fft1_impl(fft_size, direction, fft_shift)); }
>> 
>> // constructor fft1_impl::fft1_impl(int fft_size, int direction,
>> bool fft_shift) : gr::sync_block("fft1", gr::io_signature::make(
>> 1, 1, sizeof(gr_complex)), gr::io_signature::make( 1, 1, 
>> sizeof(gr_complex))), d_N(fft_size), d_direction(direction), 
>> d_shift(fft_shift) { d_input = (fftw_complex*) fftw_malloc( 
>> sizeof(fftw_complex) * d_N ); d_plan  = fftw_plan_dft_1d( d_N,
>> d_input, d_input, FFTW_BACKWARD, FFTW_ESTIMATE );  // later
>> change FFTW_BACKWARD to d_direction
>> 
>> set_output_multiple( d_N ); set_min_noutput_items( d_N ); }
>> 
>> // destructor fft1_impl::~fft1_impl() { }
>> 
>> int fft1_impl::work( int noutput_items, gr_vector_const_void_star
>> &input_items, gr_vector_void_star &output_items) { const
>> gr_complex  *in  =  (const gr_complex *) input_items[0]; 
>> gr_complex        *out =  (gr_complex *) output_items[0];
>> 
>> for (int i=0; i < noutput_items; i++) { d_input[i][0] =
>> in[i].real(); d_input[i][1] = in[i].imag(); }
>> 
>> fftw_execute( d_plan );
>> 
>> for (int i=0; i < noutput_items; i++) { out[i].real(
>> d_input[i][0] ); out[i].imag( d_input[i][1] ); }
>> 
>> 
>> return noutput_items; } } /* namespace activecat */ } /*
>> namespace gr */
>> 
>> 
>> 
>> Question: How to solve this error ?
>> 
>> Regards, Activecat address@hidden
>> 
> 
> 
> 
> _______________________________________________ Discuss-gnuradio
> mailing list address@hidden 
> https://lists.gnu.org/mailman/listinfo/discuss-gnuradio
> 
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1
Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/

iQEcBAEBAgAGBQJTFaQQAAoJEBQ6EdjyzlHtjCcH/1cqqf9PSSAc5FmNIH45I6Uy
0A7/Rhqb5nwjBjVlRe0UXrVk7EAAK/PwDQgliMw8oZ+5KuqhqVfFtx3Vch9Rs75a
Hmprl8fEDanKyfVa0cKyhmJCyuRFE29R8XxdAt07HalJqh1clhXOo6vkoZTQeDmh
gm2NOflIdEtWk2kggo92Ii23El8xbQeWhaM1/OXTyqOR7d+V6U4aF6BwirJ4oPos
uOXfKxteqjetMhIm50FClQyKpS/gRLIvhhVz3P2Yc2tJM8GlLvH0gP+5M1MeKh5j
yJTbYzbHByFsAIT39zyFDrmz5FU1+pbwSKe0dLM1/HrclZHSkiW2dWREx7UYEHg=
=clWo
-----END PGP SIGNATURE-----



reply via email to

[Prev in Thread] Current Thread [Next in Thread]