I'm trying to recompile a program that uses fftw3 (version 3.2.2) and already runs on a 32-bit linux machine. It compiles correctly on a 64-bit machine - and I linked to the 64-bit fftw library - but the program segfaults when trying to fftw_malloc
. Below is the code used:
//the variables on the right side are already initialized to nonzero values
int olsLen = blockLen + tempLen - 1;
int num_chans = 23;
fftw_complex *gabor_filter, *block_signal, *ols_out;
gabor_filter = (fftw_complex *) fftw_malloc( olsLen
* num_chans
* sizeof(fftw_complex));
block_signal = (fftw_complex *) fftw_malloc( olsLen
* num_chans
* sizeof(fftw_complex));
ols_out = (fftw_complex *) fftw_malloc( olsLen
* num_chans
* sizeof(fftw_complex));
It seems like the problem should be obvious to find, but I'm too daft to see my error at the moment. Any ideas?
EDIT: It segfaults on the first fftw_malloc. In this case, it's gabor_filter, but if I reorder the variables, the program will segfault on the first fftw_malloc.