Page 1 of 1

Compilation error with gcc 7.1

Posted: Fri Jun 02, 2017 3:47 pm
by iMichka
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

Re: Compilation error with gcc 7.1

Posted: Fri Jul 21, 2017 5:45 pm
by pouillon
In progress. You can follow the MR from the Abinit Gitlab: https://gitlab.abinit.org/trunk/abinit/ ... quests/174

Re: Compilation error with gcc 7.1

Posted: Tue Aug 01, 2017 11:42 am
by iMichka
Thanks for having a look at this. The provided link does not work though.

Re: Compilation error with gcc 7.1  [SOLVED]

Posted: Tue Aug 08, 2017 3:26 pm
by admin
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

Re: Compilation error with gcc 7.1

Posted: Tue Aug 08, 2017 10:19 pm
by iMichka
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:)