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

error while installing p3dfft library #21

Open
p-awasthi opened this issue Jul 8, 2024 · 3 comments
Open

error while installing p3dfft library #21

p-awasthi opened this issue Jul 8, 2024 · 3 comments

Comments

@p-awasthi
Copy link

I am having issues while installing p3dfft++ library. I have fftw (mpi enabled) library installed at location /usr/local/FFTW. I am trying to install p3dfft++ library after downloading the source file from official git hub page. When I install using the following command (./configure --prefix=/usr/local/p3dfft --enable-gnu --enable-fftw --with-fftw=/usr/local/FFTW FC=mpif90 CC=mpicc CXX=mpicxx), I am getting the following error after executing make file.

(Rank mismatch between actual argument at (1) and actual argument at (2) (scalar and rank-1)
make[3]: *** [Makefile:460: test1D_cos.o] Error 1
make[3]: Leaving directory '/home/pratyush/Downloads/p3dfft.3-v.3.1.2/sample/FORTRAN'
make[2]: *** [Makefile:315: all-recursive] Error 1
make[2]: Leaving directory '/home/pratyush/Downloads/p3dfft.3-v.3.1.2/sample'
make[1]: *** [Makefile:412: all-recursive] Error 1
make[1]: Leaving directory '/home/pratyush/Downloads/p3dfft.3-v.3.1.2'
make: *** [Makefile:331: all] Error 2)

After exploring on internet, I found that adding FCFLAG suppresses the error to warning. Now executing the command (./configure --prefix=/usr/local/p3dfft --enable-gnu --enable-fftw --with-fftw=/usr/local/FFTW FC=mpif90 CC=mpicc CXX=mpicxx FCFLAGS="-fallow-argument-mismatch"). This installs the library in the system. But when I run the sample files as provided I got a DEF_FFT_FLAGS error to which I defined DEF_FFT_FLAGS as 123. Now when I am executing the sample file provided I am getting the following error.

(/usr/bin/ld: /usr/local/p3dfft/lib/libp3dfft.3.a(init.o): in function p3dfft::exec_r2r_complex_s(long, float*, float*)': init.C:(.text+0x22): undefined reference to fftwf_execute_r2r'

/usr/bin/ld: /usr/local/p3dfft/lib/libp3dfft.3.a(init.o): in function p3dfft::plan_dct1_s(int, int const*, int, float*, int const*, int, int, float*, int const*, int, int, unsigned int)': init.C:(.text+0xe8): undefined reference to fftwf_plan_many_r2r'
/usr/bin/ld: /usr/local/p3dfft/lib/libp3dfft.3.a(init.o): in function p3dfft::plan_dst1_s(int, int const*, int, float*, int const*, int, int, float*, int const*, int, int, unsigned int)': init.C:(.text+0x158): undefined reference to fftwf_plan_many_r2r'
/usr/bin/ld: /usr/local/p3dfft/lib/libp3dfft.3.a(init.o): in function p3dfft::plan_dct1_complex_s(int, int const*, int, float*, int const*, int, int, float*, int const*, int, int, unsigned int)': init.C:(.text+0x1d1): undefined reference to fftwf_plan_many_r2r'
/usr/bin/ld: /usr/local/p3dfft/lib/libp3dfft.3.a(init.o): in function p3dfft::plan_dst1_complex_s(int, int const*, int, float*, int const*, int, int, float*, int const*, int, int, unsigned int)': init.C:(.text+0x251): undefined reference to fftwf_plan_many_r2r'
/usr/bin/ld: /usr/local/p3dfft/lib/libp3dfft.3.a(init.o): in function p3dfft::plan_dct2_s(int, int const*, int, float*, int const*, int, int, float*, int const*, int, int, unsigned int)': init.C:(.text+0x2c8): undefined reference to fftwf_plan_many_r2r'
/usr/bin/ld: /usr/local/p3dfft/lib/libp3dfft.3.a(init.o):init.C:(.text+0x338): more undefined references to fftwf_plan_many_r2r' follow /usr/bin/ld: /usr/local/p3dfft/lib/libp3dfft.3.a(init.o): in function p3dfft::setup()':
init.C:(.text+0x27b0): undefined reference to `fftwf_execute_r2r')

I have also tried installing the previous version but errors remain the same.
Any help is appreciated.
Thanks and regards

@dmitrypek
Copy link
Contributor

dmitrypek commented Jul 8, 2024 via email

@p-awasthi
Copy link
Author

Hey @dmitrypek
mpicxx -o check check.cpp -I/usr/local/FFTW/include -L/usr/local/FFTW/lib -lfftw3 -I/usr/local/p3dfft/include -L/usr/local/p3dfft/lib -lp3dfft -lm
This is how i am running my code file named check. FFTW and p3dfft is the folder in root where FFTW and P3dfft++ is installed. Isn't linking lfftw3 link fftw in float as well as double precision?

@p-awasthi
Copy link
Author

p-awasthi commented Jul 12, 2024

Hey @dmitrypek
mpicxx -o check check.cpp -I/usr/local/FFTW/include -L/usr/local/FFTW/lib -lfftw3 -lfftw3f -I/usr/local/p3dfft/include -L/usr/local/p3dfft/lib -lp3dfft.3 -lm
Linking the -lfftw3f explicitly did not resolve the issue. I get the same error.
I also tried exporting the FFTW path to $LD_LIBRARY_PATH using
export LD_LIBRARY_PATH=/usr/local/FFTW/include:$LD_LIBRARY_PATH
export LD_LIBRARY_PATH=/usr/local/FFTW/lib:$LD_LIBRARY_PATH

Is there an issue with DEF_FFT_FLAGS which I have defined as 123?

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