Compilation error with gcc 7.1  [SOLVED]

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
iMichka
Posts: 3
Joined: Fri Jun 02, 2017 3:41 pm

Compilation error with gcc 7.1

Post by iMichka » Fri Jun 02, 2017 3:47 pm

Hi

I am one of the homebrew-science maintainers. We updated to the latest gcc version an are getting this error, while building abinit:

m_vcoul.F90:352:24:
call random_seed(put=seed)
1
Error: Size of 'put' argument of 'random_seed' intrinsic at (1) too small (12/33)
make[3]: *** [m_vcoul.o] Error 1
make[3]: *** Waiting for unfinished jobs....
make[2]: *** [all-recursive] Error 1
make[1]: *** [all-recursive] Error 1
make: *** [all] Error 2


I think the seed size for the put argument needs to be dynamically calculated first.
Could you please have a look? A patch would be greatly appreciated.

For ref.: https://github.com/Homebrew/homebrew-science/pull/5682

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

Re: Compilation error with gcc 7.1

Post by pouillon » Fri Jul 21, 2017 5:45 pm

In progress. You can follow the MR from the Abinit Gitlab: https://gitlab.abinit.org/trunk/abinit/ ... quests/174
Yann Pouillon
Simune Atomistics
Donostia-San Sebastián, Spain

iMichka
Posts: 3
Joined: Fri Jun 02, 2017 3:41 pm

Re: Compilation error with gcc 7.1

Post by iMichka » Tue Aug 01, 2017 11:42 am

Thanks for having a look at this. The provided link does not work though.

User avatar
admin
Site Admin
Posts: 33
Joined: Thu Sep 17, 2009 9:49 am

Re: Compilation error with gcc 7.1  [SOLVED]

Post by admin » Tue Aug 08, 2017 3:26 pm

Hi,

sorry for the link : access restricted

but, you can use this workaround :

Code: Select all

diff --git a/src/67_common/m_vcoul.F90 b/src/67_common/m_vcoul.F90
index 4648b80..2ddc638 100644
--- a/src/67_common/m_vcoul.F90
+++ b/src/67_common/m_vcoul.F90
@@ -223,7 +223,7 @@ subroutine vcoul_init(Vcp,Gsph,Cryst,Qmesh,Kmesh,rcut,icutcoul,vcutgeo,ecut,ng,n
  integer :: i1,i2,i3,ig,imc
  integer :: ii,iqlwl,iq_bz,iq_ibz,npar,npt
  integer :: opt_cylinder,opt_surface,test,rank,nprocs
- integer :: seed(12)=0
+ integer :: seed(42)=0
  real(dp),parameter :: tolq0=1.d-3
  real(dp) :: b1b1,b2b2,b3b3,b1b2,b2b3,b3b1
  real(dp) :: bz_geometry_factor,bz_plane,check,dx,integ,q0_vol,q0_volsph
@@ -345,7 +345,7 @@ subroutine vcoul_init(Vcp,Gsph,Cryst,Qmesh,Kmesh,rcut,icutcoul,vcutgeo,ecut,ng,n
    ABI_MALLOC(qran,(3,nmc_max))
 
    if(seed(1)==0) then
-     do i1=1,12
+     do i1=1,42
        seed(i1) = NINT(SQRT(DBLE(i1)*103731))
      end do
    end if

iMichka
Posts: 3
Joined: Fri Jun 02, 2017 3:41 pm

Re: Compilation error with gcc 7.1

Post by iMichka » Tue Aug 08, 2017 10:19 pm

I did that, but I used 33 (based on the error message), and it worked (at least it compiles). So we have a workaround for the moment:)

Locked