Compiling Abinit 6.2.2 with FFTW3 support on Ubuntu Lucid

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
prk17
Posts: 2
Joined: Mon Aug 09, 2010 8:01 pm

Compiling Abinit 6.2.2 with FFTW3 support on Ubuntu Lucid

Post by prk17 » Mon Aug 09, 2010 8:21 pm

Dear Abinit Forums,

Great program, I'm able to throw all the configuration switches I want except for FFT. I understand external FFT is in development, but I just wanted to make sure I wasn't doing anything wrong.

On a clean Ubuntu installation, I throw the following command to install FFTW3 headers and libraries to places findable by compilers, also installing gfortran, since no Fortran compiler is provided by default.

Code: Select all

sudo apt-get install fftw3-dev gfortran


I configure by simply throwing

Code: Select all

./configure --enable-fft


Relevant lines from config.log are:

Code: Select all

configure:38751: checking whether to use optimized FFT libraries
configure:38753: result: yes
configure:38977: checking for the requested FFT support
configure:38979: result: fftw3
configure:39481: checking for dfftw_execute in -lfftw3
configure:39499: gfortran -o conftest  -g -ffree-line-length-none        conftest.F90 -lfftw3    >&5
configure:39506: $? = 0
configure:39527: result: yes
configure:39697: checking for dfftw_init_threads in -lfftw3_threads
configure:39715: gfortran -o conftest  -g -ffree-line-length-none        conftest.F90 -lfftw3_threads  -lfftw3   >&5
configure:39722: $? = 0
configure:39743: result: yes
configure:40519: checking for the actual FFT support
configure:40521: result: fftw3-threads

Configure finishes successfully.

All of the make process goes smoothly, until I reach 98_main:

Code: Select all

Making all in 98_main
make[3]: Entering directory `/home/kumar/Downloads/abinit-6.2.2/src/98_main'
gfortran -ffree-form -J/home/kumar/Downloads/abinit-6.2.2/src/mods -O3 -fschedule-insns2 -march=nocona -mmmx -msse -msse2 -msse3 -mfpmath=sse -g -ffree-line-length-none   -g -ffree-line-length-none    -o abinit abinit-abinit.o  ../../src/95_drive/lib95_drive.a ../../src/93_rdm/lib93_rdm.a ../../src/79_seqpar_mpi/lib79_seqpar_mpi.a ../../src/77_ddb/lib77_ddb.a ../../src/77_suscep/lib77_suscep.a ../../src/72_response/lib72_response.a ../../src/72_geomoptim/lib72_geomoptim.a ../../src/69_bse/lib69_bse.a ../../src/68_gw/lib68_gw.a ../../src/68_dmft/lib68_dmft.a ../../src/68_recursion/lib68_recursion.a ../../src/68_rsprc/lib68_rsprc.a ../../src/67_common/lib67_common.a ../../src/66_paw/lib66_paw.a ../../src/66_wfs/lib66_wfs.a ../../src/65_psp/lib65_psp.a ../../src/65_nonlocal/lib65_nonlocal.a ../../src/64_atompaw/lib64_atompaw.a ../../src/62_occeig/lib62_occeig.a ../../src/62_iowfdenpot/lib62_iowfdenpot.a ../../src/62_wvl_wfs/lib62_wvl_wfs.a ../../src/62_poisson/lib62_poisson.a ../../src/62_cg_noabirule/lib62_cg_noabirule.a ../../src/61_ionetcdf/lib61_ionetcdf.a ../../src/59_io_mpi/lib59_io_mpi.a ../../src/57_iovars/lib57_iovars.a ../../src/56_recipspace/lib56_recipspace.a ../../src/56_xc/lib56_xc.a ../../src/53_abiutil/lib53_abiutil.a ../../src/53_spacepar/lib53_spacepar.a ../../src/53_ffts/lib53_ffts.a ../../src/52_fft_mpi_noabirule/lib52_fft_mpi_noabirule.a ../../src/51_manage_mpi/lib51_manage_mpi.a  ../../src/49_gw_toolbox_oop/lib49_gw_toolbox_oop.a ../../src/47_xml/lib47_xml.a ../../src/45_psp_parser/lib45_psp_parser.a ../../src/43_ptgroups/lib43_ptgroups.a ../../src/42_nlstrain/lib42_nlstrain.a ../../src/42_geometry/lib42_geometry.a ../../src/42_parser/lib42_parser.a  ../../src/32_util/lib32_util.a ../../src/28_numeric_noabirule/lib28_numeric_noabirule.a ../../src/27_toolbox_oop/lib27_toolbox_oop.a ../../src/18_timing/lib18_timing.a ../../src/16_hideleave/lib16_hideleave.a ../../src/14_hidewrite/lib14_hidewrite.a  ../../src/12_hide_mpi/lib12_hide_mpi.a ../../src/10_defs/lib10_defs.a  ../../src/01_qespresso_ext/lib01_qespresso_ext.a ../../src/01_interfaces_ext/lib01_interfaces_ext.a    -L/home/kumar/Downloads/abinit-6.2.2/plugins/libxc -lxc  -L/home/kumar/Downloads/abinit-6.2.2/plugins/etsf_io -letsf_io_low_level -letsf_io_utils -letsf_io -L/home/kumar/Downloads/abinit-6.2.2/plugins/netcdf -lnetcdf -L/home/kumar/Downloads/abinit-6.2.2/prereqs/linalg -llapack -lblas -L/usr/lib/gcc/x86_64-linux-gnu/4.4.3 -L/usr/lib/gcc/x86_64-linux-gnu/4.4.3/../../../../lib -L/lib/../lib -L/usr/lib/../lib -L/usr/lib/gcc/x86_64-linux-gnu/4.4.3/../../.. -L/usr/lib/x86_64-linux-gnu -lgfortranbegin -lgfortran -lm
../../src/52_fft_mpi_noabirule/lib52_fft_mpi_noabirule.a(m_fftw3.o): In function `insert_plan':
/home/kumar/Downloads/abinit-6.2.2/src/52_fft_mpi_noabirule/m_fftw3.F90:1173: undefined reference to `dfftw_destroy_plan_'
../../src/52_fft_mpi_noabirule/lib52_fft_mpi_noabirule.a(m_fftw3.o): In function `destroy_plans':
/home/kumar/Downloads/abinit-6.2.2/src/52_fft_mpi_noabirule/m_fftw3.F90:1233: undefined reference to `dfftw_destroy_plan_'
../../src/52_fft_mpi_noabirule/lib52_fft_mpi_noabirule.a(m_fftw3.o): In function `__m_fftw3_MOD_fftw3_set_nthreads':
/home/kumar/Downloads/abinit-6.2.2/src/52_fft_mpi_noabirule/m_fftw3.F90:1398: undefined reference to `dfftw_plan_with_nthreads_'
/home/kumar/Downloads/abinit-6.2.2/src/52_fft_mpi_noabirule/m_fftw3.F90:1376: undefined reference to `dfftw_init_threads_'
../../src/52_fft_mpi_noabirule/lib52_fft_mpi_noabirule.a(m_fftw3.o): In function `__m_fftw3_MOD_dplan_many_dft':
/home/kumar/Downloads/abinit-6.2.2/src/52_fft_mpi_noabirule/m_fftw3.F90:2014: undefined reference to `dfftw_plan_many_dft_'
../../src/52_fft_mpi_noabirule/lib52_fft_mpi_noabirule.a(m_fftw3.o): In function `__m_fftw3_MOD_fftw3_fftpad':
/home/kumar/Downloads/abinit-6.2.2/src/52_fft_mpi_noabirule/m_fftw3.F90:1680: undefined reference to `dfftw_execute_dft_'
/home/kumar/Downloads/abinit-6.2.2/src/52_fft_mpi_noabirule/m_fftw3.F90:1696: undefined reference to `dfftw_execute_dft_'
/home/kumar/Downloads/abinit-6.2.2/src/52_fft_mpi_noabirule/m_fftw3.F90:1624: undefined reference to `dfftw_execute_dft_'
/home/kumar/Downloads/abinit-6.2.2/src/52_fft_mpi_noabirule/m_fftw3.F90:1639: undefined reference to `dfftw_execute_dft_'
/home/kumar/Downloads/abinit-6.2.2/src/52_fft_mpi_noabirule/m_fftw3.F90:1634: undefined reference to `dfftw_execute_dft_'
../../src/52_fft_mpi_noabirule/lib52_fft_mpi_noabirule.a(m_fftw3.o):/home/kumar/Downloads/abinit-6.2.2/src/52_fft_mpi_noabirule/m_fftw3.F90:1686: more undefined references to `dfftw_execute_dft_' follow
../../src/52_fft_mpi_noabirule/lib52_fft_mpi_noabirule.a(m_fftw3.o): In function `__m_fftw3_MOD_fftw3_fftpad':
/home/kumar/Downloads/abinit-6.2.2/src/52_fft_mpi_noabirule/m_fftw3.F90:1658: undefined reference to `dfftw_destroy_plan_'
/home/kumar/Downloads/abinit-6.2.2/src/52_fft_mpi_noabirule/m_fftw3.F90:1592: undefined reference to `dfftw_destroy_plan_'
/home/kumar/Downloads/abinit-6.2.2/src/52_fft_mpi_noabirule/m_fftw3.F90:1660: undefined reference to `dfftw_destroy_plan_'
/home/kumar/Downloads/abinit-6.2.2/src/52_fft_mpi_noabirule/m_fftw3.F90:1659: undefined reference to `dfftw_destroy_plan_'
/home/kumar/Downloads/abinit-6.2.2/src/52_fft_mpi_noabirule/m_fftw3.F90:1594: undefined reference to `dfftw_destroy_plan_'
../../src/52_fft_mpi_noabirule/lib52_fft_mpi_noabirule.a(m_fftw3.o):/home/kumar/Downloads/abinit-6.2.2/src/52_fft_mpi_noabirule/m_fftw3.F90:1593: more undefined references to `dfftw_destroy_plan_' follow
../../src/52_fft_mpi_noabirule/lib52_fft_mpi_noabirule.a(m_fftw3.o): In function `__m_fftw3_MOD_zplan_many_dft':
/home/kumar/Downloads/abinit-6.2.2/src/52_fft_mpi_noabirule/m_fftw3.F90:2074: undefined reference to `dfftw_plan_many_dft_'
../../src/52_fft_mpi_noabirule/lib52_fft_mpi_noabirule.a(m_fftw3.o): In function `fftw3_fftpad_cplx':
/home/kumar/Downloads/abinit-6.2.2/src/52_fft_mpi_noabirule/m_fftw3.F90:1927: undefined reference to `dfftw_execute_dft_'
/home/kumar/Downloads/abinit-6.2.2/src/52_fft_mpi_noabirule/m_fftw3.F90:1943: undefined reference to `dfftw_execute_dft_'
/home/kumar/Downloads/abinit-6.2.2/src/52_fft_mpi_noabirule/m_fftw3.F90:1871: undefined reference to `dfftw_execute_dft_'
/home/kumar/Downloads/abinit-6.2.2/src/52_fft_mpi_noabirule/m_fftw3.F90:1886: undefined reference to `dfftw_execute_dft_'
/home/kumar/Downloads/abinit-6.2.2/src/52_fft_mpi_noabirule/m_fftw3.F90:1881: undefined reference to `dfftw_execute_dft_'
../../src/52_fft_mpi_noabirule/lib52_fft_mpi_noabirule.a(m_fftw3.o):/home/kumar/Downloads/abinit-6.2.2/src/52_fft_mpi_noabirule/m_fftw3.F90:1933: more undefined references to `dfftw_execute_dft_' follow
../../src/52_fft_mpi_noabirule/lib52_fft_mpi_noabirule.a(m_fftw3.o): In function `fftw3_fftpad_cplx':
/home/kumar/Downloads/abinit-6.2.2/src/52_fft_mpi_noabirule/m_fftw3.F90:1905: undefined reference to `dfftw_destroy_plan_'
/home/kumar/Downloads/abinit-6.2.2/src/52_fft_mpi_noabirule/m_fftw3.F90:1839: undefined reference to `dfftw_destroy_plan_'
/home/kumar/Downloads/abinit-6.2.2/src/52_fft_mpi_noabirule/m_fftw3.F90:1907: undefined reference to `dfftw_destroy_plan_'
/home/kumar/Downloads/abinit-6.2.2/src/52_fft_mpi_noabirule/m_fftw3.F90:1906: undefined reference to `dfftw_destroy_plan_'
/home/kumar/Downloads/abinit-6.2.2/src/52_fft_mpi_noabirule/m_fftw3.F90:1841: undefined reference to `dfftw_destroy_plan_'
../../src/52_fft_mpi_noabirule/lib52_fft_mpi_noabirule.a(m_fftw3.o):/home/kumar/Downloads/abinit-6.2.2/src/52_fft_mpi_noabirule/m_fftw3.F90:1840: more undefined references to `dfftw_destroy_plan_' follow
../../src/52_fft_mpi_noabirule/lib52_fft_mpi_noabirule.a(m_fftw3.o): In function `__m_fftw3_MOD_dplan_many_dft_r2c':
/home/kumar/Downloads/abinit-6.2.2/src/52_fft_mpi_noabirule/m_fftw3.F90:2115: undefined reference to `dfftw_plan_many_dft_r2c_'
../../src/52_fft_mpi_noabirule/lib52_fft_mpi_noabirule.a(m_fftw3.o): In function `__m_fftw3_MOD_dplan_many_dft_c2r':
/home/kumar/Downloads/abinit-6.2.2/src/52_fft_mpi_noabirule/m_fftw3.F90:2173: undefined reference to `dfftw_plan_many_dft_c2r_'
../../src/52_fft_mpi_noabirule/lib52_fft_mpi_noabirule.a(m_fftw3.o): In function `fftw3_c2c_ip':
/home/kumar/Downloads/abinit-6.2.2/src/52_fft_mpi_noabirule/m_fftw3.F90:252: undefined reference to `dfftw_execute_dft_'
../../src/52_fft_mpi_noabirule/lib52_fft_mpi_noabirule.a(m_fftw3.o): In function `insert_plan':
/home/kumar/Downloads/abinit-6.2.2/src/52_fft_mpi_noabirule/m_fftw3.F90:1173: undefined reference to `dfftw_destroy_plan_'
../../src/52_fft_mpi_noabirule/lib52_fft_mpi_noabirule.a(m_fftw3.o): In function `fftw3_c2c_op':
/home/kumar/Downloads/abinit-6.2.2/src/52_fft_mpi_noabirule/m_fftw3.F90:352: undefined reference to `dfftw_execute_dft_'
../../src/52_fft_mpi_noabirule/lib52_fft_mpi_noabirule.a(m_fftw3.o): In function `insert_plan':
/home/kumar/Downloads/abinit-6.2.2/src/52_fft_mpi_noabirule/m_fftw3.F90:1173: undefined reference to `dfftw_destroy_plan_'
../../src/52_fft_mpi_noabirule/lib52_fft_mpi_noabirule.a(m_fftw3.o): In function `fftw3_many_dft_op':
/home/kumar/Downloads/abinit-6.2.2/src/52_fft_mpi_noabirule/m_fftw3.F90:807: undefined reference to `dfftw_execute_dft_'
../../src/52_fft_mpi_noabirule/lib52_fft_mpi_noabirule.a(m_fftw3.o): In function `insert_plan':
/home/kumar/Downloads/abinit-6.2.2/src/52_fft_mpi_noabirule/m_fftw3.F90:1173: undefined reference to `dfftw_destroy_plan_'
../../src/52_fft_mpi_noabirule/lib52_fft_mpi_noabirule.a(m_fftw3.o): In function `fftw3_many_dft_ip':
/home/kumar/Downloads/abinit-6.2.2/src/52_fft_mpi_noabirule/m_fftw3.F90:911: undefined reference to `dfftw_execute_dft_'
../../src/52_fft_mpi_noabirule/lib52_fft_mpi_noabirule.a(m_fftw3.o): In function `insert_plan':
/home/kumar/Downloads/abinit-6.2.2/src/52_fft_mpi_noabirule/m_fftw3.F90:1173: undefined reference to `dfftw_destroy_plan_'
../../src/52_fft_mpi_noabirule/lib52_fft_mpi_noabirule.a(m_fftw3.o): In function `fftw3_r2c_op':
/home/kumar/Downloads/abinit-6.2.2/src/52_fft_mpi_noabirule/m_fftw3.F90:454: undefined reference to `dfftw_plan_dft_r2c_3d_'
../../src/52_fft_mpi_noabirule/lib52_fft_mpi_noabirule.a(m_fftw3.o): In function `insert_plan':
/home/kumar/Downloads/abinit-6.2.2/src/52_fft_mpi_noabirule/m_fftw3.F90:1173: undefined reference to `dfftw_destroy_plan_'
../../src/52_fft_mpi_noabirule/lib52_fft_mpi_noabirule.a(m_fftw3.o): In function `fftw3_r2c_op':
/home/kumar/Downloads/abinit-6.2.2/src/52_fft_mpi_noabirule/m_fftw3.F90:478: undefined reference to `dfftw_execute_dft_r2c_'
../../src/52_fft_mpi_noabirule/lib52_fft_mpi_noabirule.a(m_fftw3.o): In function `destroy_plans':
/home/kumar/Downloads/abinit-6.2.2/src/52_fft_mpi_noabirule/m_fftw3.F90:1233: undefined reference to `dfftw_destroy_plan_'
/home/kumar/Downloads/abinit-6.2.2/src/52_fft_mpi_noabirule/m_fftw3.F90:1233: undefined reference to `dfftw_destroy_plan_'
/home/kumar/Downloads/abinit-6.2.2/src/52_fft_mpi_noabirule/m_fftw3.F90:1233: undefined reference to `dfftw_destroy_plan_'
/home/kumar/Downloads/abinit-6.2.2/src/52_fft_mpi_noabirule/m_fftw3.F90:1233: undefined reference to `dfftw_destroy_plan_'
/home/kumar/Downloads/abinit-6.2.2/src/52_fft_mpi_noabirule/m_fftw3.F90:1233: undefined reference to `dfftw_destroy_plan_'
../../src/52_fft_mpi_noabirule/lib52_fft_mpi_noabirule.a(m_fftw3.o):/home/kumar/Downloads/abinit-6.2.2/src/52_fft_mpi_noabirule/m_fftw3.F90:1233: more undefined references to `dfftw_destroy_plan_' follow
../../src/52_fft_mpi_noabirule/lib52_fft_mpi_noabirule.a(m_fftw3.o): In function `fftw3_c2r_op':
/home/kumar/Downloads/abinit-6.2.2/src/52_fft_mpi_noabirule/m_fftw3.F90:686: undefined reference to `dfftw_plan_dft_c2r_3d_'
/home/kumar/Downloads/abinit-6.2.2/src/52_fft_mpi_noabirule/m_fftw3.F90:706: undefined reference to `dfftw_execute_dft_c2r_'
../../src/52_fft_mpi_noabirule/lib52_fft_mpi_noabirule.a(m_fftw3.o): In function `destroy_plans':
/home/kumar/Downloads/abinit-6.2.2/src/52_fft_mpi_noabirule/m_fftw3.F90:1233: undefined reference to `dfftw_destroy_plan_'
../../src/52_fft_mpi_noabirule/lib52_fft_mpi_noabirule.a(m_fftw3.o): In function `insert_plan':
/home/kumar/Downloads/abinit-6.2.2/src/52_fft_mpi_noabirule/m_fftw3.F90:1173: undefined reference to `dfftw_destroy_plan_'
../../src/52_fft_mpi_noabirule/lib52_fft_mpi_noabirule.a(m_fftw3.o): In function `destroy_plans':
/home/kumar/Downloads/abinit-6.2.2/src/52_fft_mpi_noabirule/m_fftw3.F90:1233: undefined reference to `dfftw_destroy_plan_'
../../src/52_fft_mpi_noabirule/lib52_fft_mpi_noabirule.a(m_fftw3.o): In function `fftw3_cleanup':
/home/kumar/Downloads/abinit-6.2.2/src/52_fft_mpi_noabirule/m_fftw3.F90:1309: undefined reference to `dfftw_cleanup_threads_'
collect2: ld returned 1 exit status
make[3]: *** [abinit] Error 1
make[3]: Leaving directory `/home/kumar/Downloads/abinit-6.2.2/src/98_main'
make[2]: *** [all-recursive] Error 1
make[2]: Leaving directory `/home/kumar/Downloads/abinit-6.2.2/src'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/home/kumar/Downloads/abinit-6.2.2'
make: *** [all] Error 2


Which is weird, because while configure shows FFTW3 is properly installed, it doesn't seem like any external fft library is linked to in the end.
Any illumination on this is greatly appreciated!

prk17
Posts: 2
Joined: Mon Aug 09, 2010 8:01 pm

Re: Compiling Abinit 6.2.2 with FFTW3 support on Ubuntu Luci

Post by prk17 » Mon Aug 09, 2010 8:29 pm

I just got a small breakthrough,

For the abinit, cut3d, and fftprof executables, the following flags never get passed

Code: Select all

-lfftw3_threads -lfftw3


I manually copied the failed make commands, adding those libraries to the list, and manually executing the command for those 3 executables, and the whole project properly compiles.

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

Re: Compiling Abinit 6.2.2 with FFTW3 support on Ubuntu Luci

Post by pouillon » Fri Sep 03, 2010 6:03 pm

There was a typo in the support for FFT libraries. This will be fixed in the upcoming 6.2.3.

Thank you for reporting.
Yann Pouillon
Simune Atomistics
Donostia-San Sebastián, Spain

Locked