Ofxfft basic setup on osx?


#1

Hello, I tried adding the ofxFft addon to my addons folder and to my project by dragging the addon folder in to the project’s addons-folder, when I compile I get these errors:

Undefined symbols for architecture i386:
“_fftwf_destroy_plan”, referenced from:
ofxFftw::~ofxFftw() in ofxFftw.o
“_fftwf_cleanup”, referenced from:
ofxFftw::~ofxFftw() in ofxFftw.o
“_fftwf_execute”, referenced from:
ofxFftw::executeFft() in ofxFftw.o
ofxFftw::executeIfft() in ofxFftw.o
“_fftwf_malloc”, referenced from:
ofxFftw::setup(int, fftWindowType) in ofxFftw.o
“_fftwf_free”, referenced from:
ofxFftw::~ofxFftw() in ofxFftw.o
“_fftwf_plan_r2r_1d”, referenced from:
ofxFftw::setup(int, fftWindowType) in ofxFftw.o
ld: symbol(s) not found for architecture i386
clang: error: linker command failed with exit code 1 (use -v to see invocation)

I’m on OSX 10.8.2


#2

Same - It’s throwing these. Should one change the target? Seems like an osx version thing?


#3

ofxFft has library dependencies which are not being found by the compiler. if you just drag the src directory into xcode, you won’t include the libraries. you have to make sure the paths for those libraries are in the search paths of your project. the instructions are on the ofxFft github.

do the included examples work for you?


#4

I checked and double checked the build path - I made this from project generator and it already added them.
[here’s a screen shot of them][1]

Here’s my error:
Undefined symbols for architecture i386:
“_fftwf_destroy_plan”, referenced from:
ofxFftw::~ofxFftw() in ofxFftw.o
“_fftwf_plan_r2r_1d”, referenced from:
ofxFftw::setup(int, fftWindowType) in ofxFftw.o
“_fftwf_cleanup”, referenced from:
ofxFftw::~ofxFftw() in ofxFftw.o
“_fftwf_malloc”, referenced from:
ofxFftw::setup(int, fftWindowType) in ofxFftw.o
“_fftwf_free”, referenced from:
ofxFftw::~ofxFftw() in ofxFftw.o
“_fftwf_execute”, referenced from:
ofxFftw::executeFft() in ofxFftw.o
ofxFftw::executeIfft() in ofxFftw.o
ld: symbol(s) not found for architecture i386
clang: error: linker command failed with exit code 1 (use -v to see invocation)

Any clues? I could really use this functionality - I’m digging around for alternative implementations and I think I found one from Zach but should that fail maybe I’ll just try and do it myself from the original code?
[1]: http://www.phoenixperry.com/junk/buildPath.png


#5

I pulled the newest OF build off github and this problem vanished. Now I have a new one…

/Users/phoenix/Documents/openFrameworks/addons/ofxFft/src/ofxEasyFft.cpp:45:32: Unknown type name ‘ofAudioEventArgs’

That’s weird…


#6

Commented out the overloaded function it was fighting and now the same error again :frowning: GRRRRR. Shakes fists at sky.


#7

Ok for anyone else needing to use fft with a mic and also having hilarious architecture problems, I suggest not using this addon. There’s something off way deep down in one of the xcode settings somewhere is my guess. I A/Bed them as closely as I could between the target settings of my project and the settings in the addon. This architecture bug seems to pop up frequently. I can report that the build configurations were a match in both my targets. I had all of the libs correctly added and I rechecked their file paths on my drive.

Simpler solution? Audio input FFT example
It will work in less than 2 minutes and you can forgo all this insanity. I think possibly this is what’s in the addon anyway.


#8

you can also get an fft using the ofxAudioUnitFftNode class in ofxAudioUnit.


#9

@phoenixperry you’ve got the build paths right, but the missing piece is the actual fftw library. The ofxFft readme has a link to a pre-compiled zip of them, which looks like it replaces the libs/fftw/lib folder in the addon.

You’ll need to add the lib (the fftw3f.a) to your project afterwards, either by just dragging it in to the sidebar, or doing a right click + add files to project…


#10

Thanks! I just gave up and used ofxMaxim


#11

I was running into the same issues @phoenixperry was. I downloaded the precompiled libs (as mentioned int the readme) and tried adding them to the xcode project (both in the header compile paths and directly by adding the fftw3f.a file to the project), it didn’t work for me. It would be helpful to have a little more detail on how that should be added to the project, I’d like to compare the KISS and FFTW performance.

I was however able to get the example basic project working by going into the testApp.h and changing the FFTW implementation to the basic KISS implementation:

//fft = ofxFft::create(bufferSize, OF_FFT_WINDOW_HAMMING, OF_FFT_FFTW);
fft = ofxFft::create(bufferSize, OF_FFT_WINDOW_HAMMING, OF_FFT_BASIC); 

I also had to remove the #define ALLOW_FFTW so that the library wouldn’t try to compile in the FFTW.
I assume that would work for the Easy example as well, but I haven’t tried it yet.

Adding in case someone else runs into a similar situation, seems like a solid library.


#12

I know this is an old thread.

@nfrank are you saying you were able to use ofxAudioUnits for all other parts but for the FFT you used ofxFft?
I’m trying the ofxAudioUnitFftNode and it works ok. But I’m more familiar with ofxFft and thought maybe I can handle the FFT analysis outside of ofxAudioUnit.
I just am not sure how to pass the audiounit signal / buffer to ofxFft?

thx for any advice.