[Linux+gpu] Abinit 8.10.1 Linking fails with error  [SOLVED]

option, parallelism,...

Moderators: jbeuken, Jordan, pouillon

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 builds.
For a video explanation on how to build Abinit 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.

[Linux+gpu] Abinit 8.10.1 Linking fails with error

Postby Lucius » Fri Nov 30, 2018 7:41 am

Hello dear community,
I am trying to compile GPU version of abinit-8.10.1 with this configuration:

CC=mpicc CXX=mpicxx FC=mpif90 ./configure --enable-gpu --enable-mpi --with-mpi-incs=-I/usr/include/ --with-gpu-libs="-L/opt/cuda/lib64 -lcublas -lcufft -lcudart" --with-gpu-incs="-I/opt/cuda/include" --with-linalg-flavor="magma+custom" --with-linalg-incs="-I/usr/include -I/home/lucius/local/share/magma/include" --with-linalg-libs="-L/usr/lib64 -lblas -llapack -L/home/lucius/local/share/magma/lib -lmagma"

After successful compilation of source files, linking fails with error:

mpif90 -ffree-form -J/home/lucius/local/share/abinit-8.10.1/src/mods -O2 -mtune=native -march=native -g -ffree-line-length-none -g -ffree-line-length-none -o abinit abinit-abinit.o ../../src/95_drive/lib95_drive.a ../../src/94_scfcv/lib94_scfcv.a ../../src/79_seqpar_mpi/lib79_seqpar_mpi.a ../../src/78_effpot/lib78_effpot.a ../../src/78_eph/lib78_eph.a ../../src/77_ddb/lib77_ddb.a ../../src/77_suscep/lib77_suscep.a ../../src/72_response/lib72_response.a ../../src/71_bse/lib71_bse.a ../../src/71_wannier/lib71_wannier.a ../../src/70_gw/lib70_gw.a ../../src/69_wfdesc/lib69_wfdesc.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_vdwxc/lib66_vdwxc.a ../../src/66_wfs/lib66_wfs.a ../../src/66_nonlocal/lib66_nonlocal.a ../../src/65_paw/lib65_paw.a ../../src/64_psp/lib64_psp.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/62_ctqmc/lib62_ctqmc.a ../../src/61_occeig/lib61_occeig.a ../../src/59_ionetcdf/lib59_ionetcdf.a ../../src/57_iovars/lib57_iovars.a ../../src/57_iopsp_parser/lib57_iopsp_parser.a ../../src/56_recipspace/lib56_recipspace.a ../../src/56_xc/lib56_xc.a ../../src/56_mixing/lib56_mixing.a ../../src/56_io_mpi/lib56_io_mpi.a ../../src/55_abiutil/lib55_abiutil.a ../../src/54_spacepar/lib54_spacepar.a ../../src/53_ffts/lib53_ffts.a ../../src/52_manage_cuda/lib52_manage_cuda.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/46_diago/lib46_diago.a ../../src/45_xgTools/lib45_xgTools.a ../../src/45_geomoptim/lib45_geomoptim.a ../../src/44_abitypes_defs/lib44_abitypes_defs.a ../../src/44_abitools/lib44_abitools.a ../../src/43_wvl_wrappers/lib43_wvl_wrappers.a ../../src/43_ptgroups/lib43_ptgroups.a ../../src/42_parser/lib42_parser.a ../../src/42_nlstrain/lib42_nlstrain.a ../../src/42_libpaw/lib42_libpaw.a ../../src/41_xc_lowlevel/lib41_xc_lowlevel.a ../../src/41_geometry/lib41_geometry.a ../../src/32_util/lib32_util.a ../../src/29_kpoints/lib29_kpoints.a ../../src/28_numeric_noabirule/lib28_numeric_noabirule.a ../../src/27_toolbox_oop/lib27_toolbox_oop.a ../../src/21_hashfuncs/lib21_hashfuncs.a ../../src/18_timing/lib18_timing.a ../../src/17_libtetra_ext/lib17_libtetra_ext.a ../../src/16_hideleave/lib16_hideleave.a ../../src/15_gpu_toolbox/lib15_gpu_toolbox.a ../../src/14_hidewrite/lib14_hidewrite.a ../../src/12_hide_mpi/lib12_hide_mpi.a ../../src/11_memory_mpi/lib11_memory_mpi.a ../../src/10_dumpinfo/lib10_dumpinfo.a ../../src/10_defs/lib10_defs.a ../../src/02_clib/lib02_clib.a -L/usr/lib64 -lblas -llapack -L/home/lucius/local/share/magma/lib -lmagma -lrt -L/opt/cuda/lib64 -lcublas -lcufft -lcudart -L/usr/lib64 -L/usr/lib/gcc/x86_64-pc-linux-gnu/7.3.0 -L/usr/lib/gcc/x86_64-pc-linux-gnu/7.3.0/../../../../lib64 -L/lib/../lib64 -L/usr/lib/../lib64 -L/usr/lib/gcc/x86_64-pc-linux-gnu/7.3.0/../../../../x86_64-pc-linux-gnu/lib -L/usr/lib/gcc/x86_64-pc-linux-gnu/7.3.0/../../.. -lmpi_usempif08 -lmpi_usempi_ignore_tkr -lmpi_mpifh -lmpi -lgfortran -lm -lquadmath -lpthread -L/usr/lib64 -L/usr/lib/gcc/x86_64-pc-linux-gnu/7.3.0 -L/usr/lib/gcc/x86_64-pc-linux-gnu/7.3.0/../../../../lib64 -L/lib/../lib64 -L/usr/lib/../lib64 -L/usr/lib/gcc/x86_64-pc-linux-gnu/7.3.0/../../../../x86_64-pc-linux-gnu/lib -L/usr/lib/gcc/x86_64-pc-linux-gnu/7.3.0/../../.. -lmpi_usempif08 -lmpi_usempi_ignore_tkr -lmpi_mpifh -lmpi -lgfortran -lm -lquadmath -lpthread
/usr/lib/gcc/x86_64-pc-linux-gnu/7.3.0/../../../../x86_64-pc-linux-gnu/bin/ld: ../../src/52_manage_cuda/lib52_manage_cuda.a(density.o): undefined reference to symbol '__gxx_personality_v0@@CXXABI_1.3'
/usr/lib/gcc/x86_64-pc-linux-gnu/7.3.0/libstdc++.so.6: error adding symbols: DSO missing from command line
collect2: error: ld returned 1 exit status
make[3]: *** [Makefile:3850: abinit] Error 1
make[3]: Leaving directory '/home/lucius/local/share/abinit-8.10.1/src/98_main'
make[2]: *** [Makefile:924: all-recursive] Error 1
make[2]: Leaving directory '/home/lucius/local/share/abinit-8.10.1/src'
make[1]: *** [Makefile:2316: all-recursive] Error 1
make[1]: Leaving directory '/home/lucius/local/share/abinit-8.10.1'
make: *** [Makefile:2244: all] Error 2

please help :cry:

P.S. without --enable-gpu same configuration compiles successfully
Lucius
 
Posts: 2
Joined: Fri Nov 30, 2018 7:34 am

Re: [Linux+gpu] Abinit 8.10.1 Linking fails with error  [SOLVED]

Postby jun1234 » Fri Nov 30, 2018 8:54 pm

I think you should add "-lstdc++" to --with-gpu-libs, because cuda runtime libraries need libstdc++ but fortran compiler doesn't know how to link it.
(so, your --with-gpu-libs looks like this: --with-gpu-libs="-L/opt/cuda/lib64 -lcublas -lcufft -lcudart -lstdc++")
Best regard, Junho
jun1234
 
Posts: 7
Joined: Wed Aug 22, 2018 4:16 pm

Re: [Linux+gpu] Abinit 8.10.1 Linking fails with error

Postby Lucius » Sat Dec 01, 2018 7:34 am

Dear Junho,
thank you, it worked.
Lucius
 
Posts: 2
Joined: Fri Nov 30, 2018 7:34 am


Return to Configuration

Who is online

Users browsing this forum: No registered users and 1 guest