remove duplicate code in handling of FFTW cdft libs