Como você não especifica sua versão do Ubuntu, eu testei o método abaixo em duas versões suportadas do LTS - Ubuntu 16.04 LTS (Xenial Xerus) e Ubuntu 18.04 LTS (Bionic Beaver).
Instale os pacotes de desenvolvedor relacionados ao FFTW e as dependências de compilação. Não se esqueça de ativar os repositórios de código-fonte em Software & Atualizações ( software-properties-gtk
) antes de prosseguir.
Então corra:
sudo apt-get install -y libfftw3-dev libfftw3-mpi-dev libopenmpi-dev gfortran
sudo apt-get build-dep -y libfftw3-dev libfftw3-mpi-dev
Faça o download e extraia o pacote P3DFFT:
cd ~/Downloads
wget https://github.com/sdsc/p3dfft/archive/v2.7.6.tar.gz
tar -xf v2.7.6.tar.gz
cd p3dfft-2.7.6/
Como era já escrito por @steeldriver :
The first thing to note is that the argument to
--with-fftw
must be the top level path to the FFTW3 header files and libraries. So for example if the headers are in/usr/include
and the libraries are under/usr/lib
(the default, when packagelibfftw3-dev
is installed from the Ubuntu repository), the value should be given as--with-fftw=/usr
The additional issue in this case is that the provided configure script appears to be hard-wired to look in only the
lib
andlib64
subdirectories:3315 if test -e $withfftw/lib/libfftw3.a ; then 3316 FFTW_INC="-I$withfftw/include" 3317 3318 FFTW_LIB="$withfftw/lib/libfftw3.a" 3319 3320 elif test -e $withfftw/lib64/libfftw3.a ; then 3321 FFTW_INC="-I$withfftw/include" 3322 3323 FFTW_LIB="$withfftw/lib64/libfftw3.a" 3324 3325 else 3326 as_fn_error $? "libfftw3.a was not found in given location!" "$LINENO" 5 3327 fi
The use of a
lib64
subdirectory is an old convention that pre-dates Debian's Multiarch framework - the modern location for 64-bit libraries would belib/x86_64-linux-gnu
Então você precisa corrigir o script configure . Você pode fazer isso com os comandos abaixo:
sed -i 's/\$withfftw\/include/\/usr\/include/g' configure
sed -i 's/\$withfftw\/lib64\//\$withfftw\//g' configure
sed -i 's/\$withfftw\/lib\//\$withfftw\//g' configure
Em seguida, execute o novo script configure com as opções corretas:
./configure --enable-fftw --with-fftw=/usr/lib/x86_64-linux-gnu
Em seguida, execute a compilação e a instalação:
make
sudo make install