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

Type mismatch with gcc10 #15

Open
ufdup89 opened this issue Jul 22, 2021 · 3 comments
Open

Type mismatch with gcc10 #15

ufdup89 opened this issue Jul 22, 2021 · 3 comments

Comments

@ufdup89
Copy link

ufdup89 commented Jul 22, 2021

I have tried to compile the 2.7.9 release using gcc10 and got a few errors related to type mismatch. The errors look like the following one and are mostly related to MPI calls:

call mpi_alltoallv (buf1,SndCnts, SndStrt, mpi_byte, buf2,RcvCnts,RcvStrt,mpi_byte,mpi_comm_row,ierr)
|                           1
Error: Type mismatch between actual argument at (1) and actual argument at (2) (COMPLEX(8)/REAL(8)).

Some googling indicates that this is due to a feature introduced in gcc10, which made it more strict regarding type compatibility (some other softwares experienced the same some time ago, see e.g. this link. I found two solutions. The quick and dirty way is to simply add the compilation flag -fallow-argument-mismatch, which will turn the error messages into warnings. The second, among other minor fixes, involves replacing include 'mpif.h' in module.f90 by use mpi.

Is there still interest in maintaining this version of p3dfft? If yes, I would be glad to discuss the problem and ways of fixing it.

@dmitrypek
Copy link
Contributor

Thanks. This is now fixed. If there are other issues let us know. The intention is to continue supporting the package as long as possible.

@ufdup89
Copy link
Author

ufdup89 commented Nov 28, 2021

I have now looked at the most recent commit and it still won't compile on gcc10. It complains at

ftran.F90:526:33:

  526 |          call init_f_r2c(XgYZ,nx,buf2,nxhp,nx,jisize*kjsize)
      |                                 1
......
  810 |     call init_f_r2c (rXgYZ, nx, cXgYZ, nxhp, nx, jisize*kjsize)
      |                                2
Error: Type mismatch between actual argument at (1) and actual argument at (2) (COMPLEX(8)/REAL(8)).

For a successful build, I had to copy the routine init_f_r2c from fft_init.F90 into ftran.F90. I think that otherwise the compiler can't check that the types are correct (sorry for not mentioning that in my previous post). Compilation of driver_sine_many.F90 also fails, but we can look into that afterwards (it's also related to type mismatch).

In any case, the code compiles with -fallow-argument-mismatch as mentioned before.

@dmitrypek
Copy link
Contributor

Thanks for your report. It looks like using -fallow-argument-mismatch flag helps to compile the code. I will think about what else we can do, but as a minimum we can use this flag.

@dmitrypek dmitrypek reopened this Dec 10, 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

2 participants