Question

I'm using fftw on a Mac using Xcode 4.4. In my project, I added the whole fftw source code into the project and tried to compile it.

It cannot compile successfully, because in the simd-altivec.h, it gives errors like these:


ALTIVEC only works in single precision

compiling simd-altivec.h requires -maltivec or equivalent

unknown type vector

unknown type V


My questions are:

What is a better way to add a third party library into my project? Directly adding all the source file into my project seems awkward to me...

Second, how should I deal with the errors in simd-altivec.h? what does simd-altivec.h do?

Was it helpful?

Solution

You should just build FFTW the normal way and then add the compiled library (e.g. libfftw3.a) and header (fftw3.h) to your Xcode project.

E.g. to build and install FFTW from the command line for single precision (float) (libfftw3f.a):

$ ./configure --enable-float --enable-sse
$ make
$ sudo make install

For double precision (libfftw3.a):

$ ./configure --enable-sse2
$ make
$ sudo make install

Alternatively you can just use the excellent homebrew package manager which takes care of everything for you:

$ sudo brew install fftw

Note: simd-altivec.h is for PowerPC builds with AltiVec SIMD.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top