Hello Fellow Matlab/OS X Users,
I was wondering if you can help me out once again. I got here a c-file (st.c, a Stockwell time-frequency analysis for MEG-Data) for Matlab which I should compile for my system (OS X Lion, Xcode 4.1.1). It includes
#include <fftw3.h>
So I downloaded the newest Version from http://www.fftw.org/ and compiled it. So far so good. But if I try to compile the c file
mex -st.c
I get the following error:
-> gcc-4.2 -O -Wl,-twolevel_namespace -undefined error -arch x86_64 -Wl,-syslibroot,/Developer/SDKs/MacOSX10.6.sdk -mmacosx-version-min=10.5 -bundle -Wl,-exported_symbols_list,/Applications/MATLAB_R2011a.app/extern/lib/maci64/mexFunction.map -o "st.mexmaci64" st.o -L/Applications/MATLAB_R2011a.app/bin/maci64 -lmx -lmex -lmat -lstdc++
Undefined symbols for architecture x86_64:
"_fftw_destroy_plan", referenced from:
_ist in st.o
_st in st.o
"_fftw_free", referenced from:
_ist in st.o
_st in st.o
"_fftw_malloc", referenced from:
_ist in st.o
_st in st.o
"_fftw_import_wisdom_from_file", referenced from:
_ist in st.o
_st in st.o
"_fftw_plan_dft_1d", referenced from:
_ist in st.o
_st in st.o
"_fftw_export_wisdom_to_file", referenced from:
_ist in st.o
_st in st.o
"_fftw_execute", referenced from:
_ist in st.o
_st in st.o
"_mexFunction", referenced from:
-exported_symbol[s_list] command line option
ld: symbol(s) not found for architecture x86_64
collect2: ld returned 1 exit status
mex: link of ' "st.mexmaci64"' failed.
(I should say that compiling the c-file from the Matlab example (yprime.c) works without any problem.) By googling I couldnt find to much, but there was someone suggesting the following:
MATLAB needs to link 64-bit (x86_64). You'll need to find a working 64-bit gfortran compiler whose libraries are 64-bit and ABI-compatible with Apple's gcc.
Here http://r.research.att.com/tools/ I found GNU Fortran 4.2.4 for Mac OS X 10.7. But this didnt change anything, the error remains the same.
I guess the architecture is compiled in the wrong way, but I have no idea how to change that for Matlab/Xcode. If this is the case, could someone pls tell me how to do it ?
Thanks for your Help