Trouble linking to fftw3

option, parallelism,...

Moderators: fgoudreault, mcote

Forum rules
Please have a look at ~abinit/doc/config/build-config.ac in the source package for detailed and up-to-date information about the configuration of Abinit 8 builds.
For a video explanation on how to build Abinit 7.x for Linux, please go to: http://www.youtube.com/watch?v=DppLQ-KQA68.
IMPORTANT: when an answer solves your problem, please check the little green V-like button on its upper-right corner to accept it.
Locked
esr3d
Posts: 16
Joined: Sun Jul 27, 2014 12:38 am

Trouble linking to fftw3

Post by esr3d » Fri Nov 14, 2014 11:38 pm

Hi,

I am trying to install Abinit-7.8.2 on my MacBook Pro, running snow leopard (10.6.8), Intel core i7 processor. I'm using the gcc48 set of compilers, which I installed from macports. I am using the following config file:

Code: Select all

prefix="/usr/local"
with_trio_flavor="netcdf+etsf_io"
with_netcdf_incs="-I/opt/local/include"
with_netcdf_libs="-L/opt/local/lib -lnetcdf -lnetcdff"
with_etsf_io_incs="-I/opt/local/include/gcc"
with_etsf_io_libs="-L/opt/local/lib -letsf_io_low_level -letsf_io_utils -letsf_io"
with_fft_flavor="fftw3"
with_fft_incs="-I/usr/local/include"
with_fft_libs="-L/usr/local/lib -lfftw3f -lfftw3"
with_linalg_flavor="atlas"
with_linalg_libs="-L/opt/local/lib -llapack -lf77blas -lcblas -latlas"
with_libxc_incs="-I/opt/etsf/include"
with_libxc_libs="-L/opt/etsf/lib -lxc -lxcf90"
with_wannier90_bins="/opt/local/bin"
with_wannier90_incs="-I/opt/local/bin"
with_wannier90_libs="-L/opt/local/lib -lwannier"
with_dft_flavor="libxc+wannier90"
enable_64bit_flags="yes"
enable_shared
enable_optim="safe"
CC=/opt/local/bin/gcc-mp-4.8
CPP=/opt/local/bin/cpp-mp-4.8
FC=/opt/local/bin/gfortran-mp-4.8
FCCPP=/opt/local/bin/cpp-mp-4.8


Everything is fine during the configure step, but I receive the following error during make (I have attached the full make output in make.log):

Code: Select all

Undefined symbols for architecture x86_64:
  "__gfortran_backtrace", referenced from:
      ___m_errors_MOD_show_backtrace in lib16_hideleave.a(m_errors.o)
      ___m_errors_MOD_msg_hndl in lib16_hideleave.a(m_errors.o)
  "_dfftw_cleanup_", referenced from:
      ___m_fftw3_MOD_fftw3_cleanup in lib52_fft_mpi_noabirule.a(m_fftw3.o)
  "_dfftw_destroy_plan_", referenced from:
      ___m_fftw3_MOD_fftw3_applypot_many in lib52_fft_mpi_noabirule.a(m_fftw3.o)
      ___m_fftw3_MOD_fftw3_mpiforw_manywf in lib52_fft_mpi_noabirule.a(m_fftw3.o)
      ___m_fftw3_MOD_fftw3_mpiback_manywf in lib52_fft_mpi_noabirule.a(m_fftw3.o)
      ___m_fftw3_MOD_fftw3_accrho in lib52_fft_mpi_noabirule.a(m_fftw3.o)
      ___m_fftw3_MOD_fftw3_applypot in lib52_fft_mpi_noabirule.a(m_fftw3.o)
      ___m_fftw3_MOD_fftw3_mpiforw in lib52_fft_mpi_noabirule.a(m_fftw3.o)
      ___m_fftw3_MOD_fftw3_mpiback in lib52_fft_mpi_noabirule.a(m_fftw3.o)
      ...
  "_dfftw_execute_dft_", referenced from:
      ___m_fftw3_MOD_fftw3_applypot_many in lib52_fft_mpi_noabirule.a(m_fftw3.o)
      ___m_fftw3_MOD_fftw3_mpiforw_manywf in lib52_fft_mpi_noabirule.a(m_fftw3.o)
      ___m_fftw3_MOD_fftw3_mpiback_manywf in lib52_fft_mpi_noabirule.a(m_fftw3.o)
      ___m_fftw3_MOD_fftw3_accrho in lib52_fft_mpi_noabirule.a(m_fftw3.o)
      ___m_fftw3_MOD_fftw3_applypot in lib52_fft_mpi_noabirule.a(m_fftw3.o)
      ___m_fftw3_MOD_fftw3_mpiforw in lib52_fft_mpi_noabirule.a(m_fftw3.o)
      ___m_fftw3_MOD_fftw3_mpiback in lib52_fft_mpi_noabirule.a(m_fftw3.o)

 "_dfftw_execute_dft_c2r_", referenced from:
      ___m_fftw3_MOD_fftw3_c2r_op in lib52_fft_mpi_noabirule.a(m_fftw3.o)
  "_dfftw_execute_dft_r2c_", referenced from:
      ___m_fftw3_MOD_fftw3_r2c_op in lib52_fft_mpi_noabirule.a(m_fftw3.o)
  "_dfftw_plan_many_dft_", referenced from:
      ___m_fftw3_MOD_zplan_many_dft in lib52_fft_mpi_noabirule.a(m_fftw3.o)
      ___m_fftw3_MOD_dplan_many_dft_1d in lib52_fft_mpi_noabirule.a(m_fftw3.o)
      ___m_fftw3_MOD_dplan_many_dft_2d.constprop.2 in lib52_fft_mpi_noabirule.a(m_fftw3.o)
  "_dfftw_plan_many_dft_c2r_", referenced from:
      ___m_fftw3_MOD_dplan_many_dft_c2r.constprop.1 in lib52_fft_mpi_noabirule.a(m_fftw3.o)
  "_dfftw_plan_many_dft_r2c_", referenced from:
      ___m_fftw3_MOD_dplan_many_dft_r2c.constprop.0 in lib52_fft_mpi_noabirule.a(m_fftw3.o)
ld: symbol(s) not found for architecture x86_64
collect2: error: ld returned 1 exit status
make[3]: *** [abinit] Error 1
make[2]: *** [all-recursive] Error 1
make[1]: *** [all-recursive] Error 1
make: *** [all] Error 2



libfftw.a, libfftw.la, libfftw3.3.dylib, libfftw3.a, libfftw3.dylib, libfftw3.la, libfftw3f.3.dylib, libfftw3f.a, libfftw3f.dylib, libfftw3f.la, librfftw.a, and librfftw.la are all located in the /usr/local/lib directory (as I specified in the config file), so I'm not sure what's causing the linking error.

Any thoughts or suggestions would be greatly appreciated. For reference, I have also included the config.log.

Thanks!
Ellen
Attachments
config.log
(150.59 KiB) Downloaded 415 times
make.log
(513.99 KiB) Downloaded 414 times

User avatar
jbeuken
Posts: 365
Joined: Tue Aug 18, 2009 9:24 pm
Contact:

Re: Trouble linking to fftw3

Post by jbeuken » Sat Nov 15, 2014 9:28 pm

Hi,

In our testfarm, I am using the following config file for the bot under Mac OS 10.8 :

Code: Select all

enable_mpi="yes"
enable_mpi_io="yes"
with_mpi_prefix="/opt/local"
with_trio_flavor="netcdf+etsf_io"
with_etsf_io_incs="-I/opt/local/include/gcc"
with_netcdf_incs="-I/opt/local/include"
with_netcdf_libs="-L/opt/local/lib -lnetcdf -lnetcdff"
with_fft_flavor="fftw3"
with_fft_libs="-L/opt/local/lib -lfftw3 -lfftw3f"
with_linalg_flavor="atlas+scalapack"
with_linalg_incs="-I/opt/local/include"
with_linalg_libs="-L/opt/local/lib -lscalapack -llapack -lf77blas -lcblas -latlas"
with_dft_flavor="libxc+wannier90"
with_libxc_incs="-I/opt/local/include"
with_libxc_libs="-L/opt/local/lib -lxc"
enable_clib="yes"


and , this is the list of all ports used :

Code: Select all

  gcc48 @4.8.2_0 (active)
  libgcc @4.8.2_0 (active)
 
  fftw-3 @3.3.4_0+gfortran (active)
  fftw-3-single @3.3.4_0+gfortran (active)

  etsf_io @1.0.4_0+gcc48 (active)
  netcdf-fortran @4.2_12+gcc48 (active)

  atlas @3.10.1_5+gcc48 (active)
  scalapack @2.0.2_0+gcc48+mpich (active)

  mpich-default @3.1_0+gcc48
  mpich-default @3.1_1+gcc48 (active)
  mpich-gcc48 @3.1_1+fortran (active)
 
  libxc @2.0.3_0+gcc48 (active)
  wannier90 @1.2_0+gcc47 (active)


jmb
------
Jean-Michel Beuken
Computer Scientist

User avatar
torrent
Posts: 127
Joined: Fri Aug 14, 2009 7:40 pm

Re: Trouble linking to fftw3

Post by torrent » Mon Nov 17, 2014 1:55 pm

Hi,

If you just want to use ABINIT (without looking at the src) you can install abinit-7.8.2 directly as a macport package...

sudo port install abinit
Marc Torrent
CEA - Bruyères-le-Chatel
France

esr3d
Posts: 16
Joined: Sun Jul 27, 2014 12:38 am

Re: Trouble linking to fftw3

Post by esr3d » Tue Nov 18, 2014 9:44 pm

Thank you for your replies.

Torrent- I have tried installing it as a Macports package using that command, and it installs properly as long as I don't try and link with fftw3. However, if I try to install it with macports using 'sudo port install abinit +fftw3' then I receive the same error that I get when I compile from source.

Jbeuken, I have tried using the config file you provided, but my MPI support is not working. I will get my MPI support running and then see if installing with that config file works.

Thanks again!

User avatar
torrent
Posts: 127
Joined: Fri Aug 14, 2009 7:40 pm

Re: Trouble linking to fftw3

Post by torrent » Wed Nov 19, 2014 10:11 am

Are you sure you have installed both fftw-3 and fftw-3-single ports in their last version (important) ?

What is the result of:
nm /opt/local/lib/libfftw3f.a | grep dfftw_cleanup
and
nm /opt/local/lib/libfftw3.a | grep dfftw_cleanup
?

Your error message indicates that the double precision fftw3 API is missing.

If you're not using plane-wave parallelism (and only k, spin, band) fftw-3 does not provide any acceleration; internal Abinit FFTs are efficient (and you can use FFT parallelism with them). On a laptop, abinit can be used without fftw-3...
Marc Torrent
CEA - Bruyères-le-Chatel
France

esr3d
Posts: 16
Joined: Sun Jul 27, 2014 12:38 am

Re: Trouble linking to fftw3

Post by esr3d » Mon Nov 24, 2014 11:22 pm

Hi,

I have the most recent versions of fftw-3 and fftw-3-single (versions 3.3.4_1) that port offers.

The result of nm /opt/local/lib/libfftw3f.a | grep dfftw_cleanup is

Code: Select all

warning: nm: no name list
warning: nm: no name list
warning: nm: no name list
warning: nm: no name list
warning: nm: no name list


Similarly, the result of nm /opt/local/lib/libfftw3.a | grep dfftw_cleanup is

Code: Select all

warning: nm: no name list
warning: nm: no name list
warning: nm: no name list
warning: nm: no name list
warning: nm: no name list
warning: nm: no name list
warning: nm: no name list
warning: nm: no name list


I am not too familiar with the 'nm' command. Do these results confirm that the double precision fftw3 API is missing?

I am using a laptop, and can get the Abinit port installed without fftw-3. I didn't realize the internal Abinit fft's are efficient enough for use on a laptop, thanks! However, I'm planning on using Wannier90 and I was under the impression that Wannier90 functions better with fftw3. Do you know if this is correct?

Also, when I run the first part of the Wannier90 tutorial (provided by Abinit, http://www.abinit.org/documentation/hel ... ier90.html), the job is interrupted by a segfault and I'm unsure if that could be a result of running it without fftw3 or without the parallel version of Abinit. I've attached the log file.

Thanks for your help!

~Ellen
Attachments
log1.log
(56.28 KiB) Downloaded 418 times

User avatar
torrent
Posts: 127
Joined: Fri Aug 14, 2009 7:40 pm

Re: Trouble linking to fftw3

Post by torrent » Tue Nov 25, 2014 10:52 am

Hi,

Yes, apparently the double precision fftw3 is missing; strange...
I'm running Mavericks or Yosemite and it's OK for me.
Perhaps it's due to the snow leopard install.

I don't know if wannier 90 is more efficient with fftw-3... but it's not connected to Abinit's port.
This is managed by wannier90 port, ie the FFT selection for wannier90 has to be given at the level of the wannier90 compilation.

I'm not really familiar with the wannier90 code sections in Abinit.
But it's seems that you found some kind of bug, apparently connected to a non-initalized size of array (see "size=18446744072846893056" in your log file). Try to post a msg in the "link to other codes" section of the forum... wainting for another developer answer...
Marc Torrent
CEA - Bruyères-le-Chatel
France

esr3d
Posts: 16
Joined: Sun Jul 27, 2014 12:38 am

Re: Trouble linking to fftw3

Post by esr3d » Tue Dec 02, 2014 4:11 am

Thanks for your input! I've submitted a post to the 'link to other codes' section and I will look into whether or not I selected fftw-3 during compilation of wannier90 (although I don't believe I did).

User avatar
pouillon
Posts: 651
Joined: Wed Aug 19, 2009 10:08 am
Location: Spain
Contact:

Re: Trouble linking to fftw3

Post by pouillon » Thu Dec 04, 2014 2:38 pm

FYI: Wannier90 does not depend on FFTW.
Yann Pouillon
Simune Atomistics
Donostia-San Sebastián, Spain

Locked