Open p-awasthi opened 1 month ago
Hi, You want to make sure you link with both -lfftw and -lfftwf Hope this helps.
Dmitry
From: awasthi_pratyush @.> Sent: Monday, July 8, 2024 2:23 AM To: sdsc/p3dfft @.> Cc: Subscribed @.***> Subject: [sdsc/p3dfft] error while installing p3dfft library (Issue #21)
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
— Reply to this email directly, view it on GitHubhttps://github.com/sdsc/p3dfft/issues/21, or unsubscribehttps://github.com/notifications/unsubscribe-auth/ACXPORTBTNPGHPQO2O672LTZLJLAVAVCNFSM6AAAAABKQNQRB2VHI2DSMVQWIX3LMV43ASLTON2WKOZSGM4TKMJRGM4TMNA. You are receiving this because you are subscribed to this thread.Message ID: @.***>
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?
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_LIBRARYPATH _export LD_LIBRARY_PATH=/usr/local/FFTW/lib:$LD_LIBRARYPATH
Is there an issue with _DEF_FFTFLAGS which I have defined as 123?
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 functionp3dfft::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 functionp3dfft::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 functionp3dfft::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 functionp3dfft::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 tofftwf_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