Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GFortran 10+ Errors #4

Open
HaoZeke opened this issue Sep 2, 2021 · 0 comments
Open

GFortran 10+ Errors #4

HaoZeke opened this issue Sep 2, 2021 · 0 comments

Comments

@HaoZeke
Copy link
Contributor

HaoZeke commented Sep 2, 2021

For Gnu Fortran compilers from version 10 onwards, argument mismatches are treated as errors by default.

This means that if :

gfortran --version | head -n 1 | awk -F ' ' '{print $NF}'
# 10.3.0
# 11.1.0

returns a version greater than 10; you will be greeted with:

m_thermal_scf.f90:346:26:

  329 |       call par_bcast_double(xmunew, 1, 0)
      |                            2
......
  346 |     call par_bcast_double(xnmues, (lx+1)*(nphx+1), 0)
      |                          1
Error: Rank mismatch between actual argument at (1) and actual argument at (2) (scalar and rank-2)
m_thermal_scf.f90:347:26:

  329 |       call par_bcast_double(xmunew, 1, 0)
      |                            2
......
  347 |     call par_bcast_double(rhoval, 251*(nphx+1), 0)
      |                          1
Error: Rank mismatch between actual argument at (1) and actual argument at (2) (scalar and rank-2)
make[1]: *** [Makefile:457: POT/m_thermal_scf.o] Error 1
make[1]: Leaving directory '$HOME/Git/Github/Fortran/feff10/src'
make: *** [Makefile:171: all] Error 2

An easy workaround is simply:

87c87
> FLAGS = -ffree-line-length-none -mcmodel=medium -march=native -O2 -fallow-argument-mismatch
---
< FLAGS = -ffree-line-length-none -mcmodel=medium -march=native -O2

Basically -fallow-argument-mismatch needs to be added to the Compiler.mk.

This is a workaround and not a fix.

The fix is to follow the error and ensure the right arguments are passed throughout. Will open a PR soon.

@HaoZeke HaoZeke changed the title GCC GFortran 10 + GCC GFortran 10+ Errors Sep 2, 2021
@HaoZeke HaoZeke changed the title GCC GFortran 10+ Errors GFortran 10+ Errors Sep 2, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant