sdsc / p3dfft

P3DFFT stands for Parallel Three-Dimensional Fast Fourier Transforms. It is a library for large-scale computer simulations on parallel platforms. It implements 3D FFT and related algorithms such as Chebyshev transform (an important class of algorithm for simulations in a wide range of fields). P3DFFT uses 2D, or pencil, decomposition. For more information:
http://www.p3dfft.net
Other
54 stars 16 forks source link

Build/install on Ubuntu 20.04 #17

Open paugier opened 2 years ago

paugier commented 2 years ago

I try to build p3dfft on Ubuntu 20.04.

On Debian based systems, the fftw libs are in /usr/lib/x86_64-linux-gnu so it does not to just use --with-fftw=/usr.

I copied the headers and the libraries in a special directory to please p3dfft:

mkdir -p $HOME/opt/fftw/include/
mkdir -p $HOME/opt/fftw/lib/
cp /usr/include/fftw* $HOME/opt/fftw/include
cp /usr/lib/x86_64-linux-gnu/libfftw3* $HOME/opt/fftw/lib

Then, this configure command seems to work fine:

./configure --prefix=$HOME --enable-fftw --enable-openmpi --enable-gnu --with-fftw=$HOME/opt/fftw  CC=mpicc CCLD=mpif90

However, the make command fails:

$ make                                                                                                                    
 cd . && automake-1.13 --gnu --ignore-deps
/bin/bash: line 4: automake-1.13: command not found
make: *** [Makefile:341: Makefile.in] Error 1

So I tried to run:

libtoolize
aclocal -I . && autoheader && autoconf && automake --add-missing -c

Finally, make starts to compile something but finally, I get

/usr/bin/ld: /home/pierre/opt/fftw/lib/libfftw3.a(mapflags.o): undefined reference to symbol 'log@@GLIBC_2.29'
/usr/bin/ld: /lib/x86_64-linux-gnu/libm.so.6: error adding symbols: DSO missing from command line

From this point, I don't know what to do... Help would be greatly appreciated to compile p3dfft on Ubuntu 20.04.

bkmgit commented 2 years ago

Have you tried building FFTW yourself?

bkmgit commented 2 years ago

The following worked for me:

 ./configure --enable-gnu --enable-fftw --enable-openmpi --with-fftw=$HOME/fftw-3.3.10-install FC=mpif90 CC=mpicc LDFLAGS=-L/lib/x86_64-linux-gnu LIBS=-lm --prefix=$HOME/p3dfft-install
bkmgit commented 2 years ago

This is using commit https://github.com/sdsc/p3dfft/commit/b9d9528bf72eb84cdb0544f1a74e1769ae2efa0b - head of the repository at present.

bkmgit commented 2 years ago

Building FFTW

wget http://fftw.org/fftw-3.3.10.tar.gz
tar -xf fftw-3.3.10.tar.gz 
cd fftw-3.3.10/
./configure --prefix=$HOME/fftw-3.3.10-install
make -j2
make install
 ./configure --prefix=$HOME/fftw-3.3.10-install --enable-shared
make -j2
make install
cd ..
paugier commented 2 years ago

Thanks @bkmgit. It works for me with your configure command (even without building fftw).

It would be nice to have the install procedure for Ubuntu/Debian systems written somewhere.

I don't know if we could be possible to install without libtool, autoconf, automake ?

bkmgit commented 2 years ago

@paugier Great. For many projects, configure script is part of releases, but not part of the Git sources, though possibly the configure script and dependencies used to generate it could be updated to resolve https://github.com/sdsc/p3dfft/issues/13

bkmgit commented 2 years ago

One can update the documentation at: