flexible-atomic-code / fac

FAC - Flexible Atomic Code by Ming Feng Gu
GNU General Public License v3.0
69 stars 56 forks source link

Compilation fails with gfortran/gcc 10.2 #474

Open josefongit opened 3 years ago

josefongit commented 3 years ago

Hi,

compilation aborts with a number of coding error messages. I use gfortran/gcc 10.2 on a Mac (non-Apple versions). The trouble starts in a Coulomb routine:

coulcc.f:241:10:

241 | F = CF1R(X,ETA,ZLL,ACC8,SF ,RK, ETANE0,LIMIT,ERR,NFP, | 1 Error: Type mismatch in argument 'x' at (1); passed COMPLEX(8) to REAL(8)

I can fix the bunch of errors in coulcc.f by hand, but then compilation next stops in the file tn.f

tn.f:303:57:

303 | * NLINCG,UPD1,YKSK,GSK,YRSR,LRESET,SFUN,.FALSE.,IPIVOT, | 1 Error: Rank mismatch in argument 'ipivot' at (1) (rank-1 and scalar) tn.f:415:57:

415 | * NLINCG,UPD1,YKSK,GSK,YRSR,LRESET,SFUN,.FALSE.,IPIVOT, | 1 Error: Rank mismatch in argument 'ipivot' at (1) (rank-1 and scalar)

I ran FAC in the past and compilation wasn't a problem. Could it be a stricter interpretation of language with newer compilers? If this is true, such errors are bound to appear more frequently. The flag -fallow-argument-mismatch did not make it work either.

Thanks a lot, Josef

mauriceleutenegger commented 3 years ago

I believe that the flag -fallow-argument-mismatch is the correct one to use.

I was able to compile FAC using macports openmpi gcc version 10 compilers, and I did indeed need to use this flag. The configure option that enables adding fortran compiler flags for MPI compilers is --with-mpifflag.

For compiling with ordinary macports gfortran 10, I tried to set the FFLAGS environment variable, but it is not used in the Makefiles generated by configure. I think there is a bug in configure that is preventing FFLAGS from being correctly passed through.

Since I was able to get the MPI compiler to work (and also gcc9 gfortran for non-parallel work), I gave up on trying to fix the problem.

dbishel commented 1 year ago

I obtain the same error in coulcc.f as josefongit. I am running gfortran 12.1.0 on a Mac with OS Ventura 13.2. Configuring with the -fallow-arguent-mismatch exits successfully, but make fails.

Configure command:

./configure FCFLAGS="-fallow-argument-mismatch" FFLAGS="-fallow-argument-mismatch"

Error during make:

Error: Type mismatch in argument ‘x’ at (1); passed COMPLEX(8) to REAL(8) coulcc.f:237:10:

237 | F = CF1R(X,ETA,ZLL,ACC8,SF ,RK, ETANE0,LIMIT,ERR,NFP, | 1

dbishel commented 1 year ago

Compiling issues occurred with release 1.1.4. After reading #604, I downloaded a .zip of the repository and was able to successfully compile that. A note could be included in the installation guide that recommends using the current repository and not the most recent release.