NLAFET / SpLLT

Sparse Cholesky solver implemented with a runtime system
BSD 3-Clause "New" or "Revised" License
6 stars 1 forks source link

Add -fallow-argument-mismatch for gfortran 10+ #4

Open learning-chip opened 1 year ago

learning-chip commented 1 year ago

gfortran 10 and newer leads to this compile error:

/opt/SpLLT/src/spllt_kernels_mod.F90:1505:61:

 1505 |                -one, csrc(bcptr), n1, rsrc(brptr), n1, zero, buffer, col_list_sz)
      |                                                             1
......
 2206 |                   buffer(1+col_list_sz*ndiag), col_list_sz)
      |                  2
Error: Rank mismatch between actual argument at (1) and actual argument at (2) (scalar and rank-1)
make[3]: *** [src/CMakeFiles/spllt.dir/build.make:166: src/CMakeFiles/spllt.dir/spllt_kernels_mod.F90.o] Error 1
make[2]: *** [CMakeFiles/Makefile2:210: src/CMakeFiles/spllt.dir/all] Error 2
make[1]: *** [CMakeFiles/Makefile2:217: src/CMakeFiles/spllt.dir/rule] Error 2
make: *** [Makefile:176: spllt] Error 2

Can be fixed by adding -fallow-argument-mismatch to CMAKE_Fortran_FLAGS:

https://github.com/NLAFET/SpLLT/blob/08a181d9088daf4bf9b72856e705e0b0263bfe3b/CMakeLists.txt#L86-L92

Reference: https://github.com/scipy/scipy/issues/11611

learning-chip commented 1 year ago

Simply passing -DCMAKE_Fortran_FLAGS="-fallow-argument-mismatch" to cmake solves the problem