I have a Fortran code which has been made to work on CPUs, but I need to accelerate it using GPUs and I chose to do that with OpenACC.
This code uses FFTW libraries when compiled with gfortran. However, as you may know, these libraries cannot be used with nvfortran. So, I have to go with cufft libraries.
Therefore, I used this conversion giude. The problem is, fftw allows users to build a Fortran module with iso\_c\_binding including the file fftw.f, while cufft does not have this kind of feature and you need to include the cufft.h header.

When compiling with nvfortran (I use -cpp, -Mfree, -lcufft and -l cufftw flags, checked the include and lib directories given to -I and -L flags) I get many errors:

1. The paths in all the #include inside the cufft.h file are wrong and I had to change them manually
2. All the comments ("//") in the header files are seen as errors (had to remove them manually)
3. “Label field of continuation line is not blank” errors everywhere in header files, starting from line 2 (in lines 1 I solved that giving 7 spaces - but didn’t I use -Mfree for that?)

Please help me, I don’t think that the right way to do so is to change files manually…

Thanks in advance for helping