Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FFTW3 file referenced in a FFTW2 compilation #109

Open
robmost opened this issue May 19, 2022 · 5 comments
Open

FFTW3 file referenced in a FFTW2 compilation #109

robmost opened this issue May 19, 2022 · 5 comments

Comments

@robmost
Copy link

robmost commented May 19, 2022

Hi,

I want to compile genetIC with FFTW2 support. Following the documentation, I commented the FFTW3 flags and instead turned on the FFTW2 ones:

FFTW    = -DFFTW_TYPE_PREFIX=1
FFTWLIB = -ldfftw -ldrfftw

but at compilation time I get

In file included from src/ic.hpp:16:0,
                 from src/main.cpp:9:
src/tools/numerics/fourier.hpp:6:10: fatal error: fftw3.h: No such file or directory
 #include <fftw3.h>
          ^~~~~~~~~
compilation terminated.
make: *** [src/main.o] Error 1

It seems that fourier.hpp, which is included in main.cpp through ic.hpp, calls fftw3.h even with the FFTW2 flags on. Is there something else I am not configuring properly?

@apontzen
Copy link
Member

Oh dear! It's a long time since this has been tested. Is there a particular reason you want to do this?

@robmost
Copy link
Author

robmost commented May 19, 2022

The GADGET3 version I'm using only supports FFTW2 and I wanted to keep everything in my pipeline within the same environment. It's not a big deal, I can change to FFTW3 when generating the ICs, I was just wondering if it was an issue on my end.

@apontzen
Copy link
Member

Not likely to be a problem on your end. The code isn’t regularly tested against FFTW2 so probably at some point an error has slipped in where it still tries to include FFTW3 headers. You could try editing out those FFTW3 headers manually to see whether it fixes it. We can add FFTW2 to the CI matrix if this is important, it’s just an oversight that I think we had all forgotten about it…

@robmost
Copy link
Author

robmost commented May 19, 2022

We can add FFTW2 to the CI matrix if this is important, it’s just an oversight that I think we had all forgotten about it…

No worries!
I tried the straightforward solution and added a conditional compilation flag in fourier.hpp:

#ifdef FFTW3
#include <fftw3.h>
#endif

but it wasn't as easy as that 😄

For the time being, I can stick to FTTW3 and focus on other issues. If it's OK with you, maybe we keep this issue open so the rest of the users are aware of it?

@apontzen
Copy link
Member

Looking at this, I think it's been too long since we used FFTW2 and it would be significant work to reintroduce and test it. Thanks for spotting it, though, I'll update the documentation to remove any reference to being able to work with FFTW2.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants