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

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

Open
learning-chip opened this issue Sep 29, 2022 · 1 comment
Open

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

learning-chip opened this issue Sep 29, 2022 · 1 comment

Comments

@learning-chip
Copy link

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:

SpLLT/CMakeLists.txt

Lines 86 to 92 in 08a181d

set(CMAKE_Fortran_FLAGS_ALL ${CMAKE_Fortran_FLAGS})
set(CMAKE_C_FLAGS_ALL ${CMAKE_C_FLAGS})
set(CMAKE_Fortran_FLAGS_DEBUG "${CMAKE_Fortran_FLAGS_DEBUG} -fcheck=all -Wall")
set(CMAKE_Fortran_FLAGS_RELWITHDEBINFO "${CMAKE_Fortran_FLAGS_RELWITHDEBINFO} -fcheck=all -Wall")
# CACHE STRING "Flags used by the compiler during release builds with debug info." FORCE)
set(CMAKE_Fortran_FLAGS_RELEASE "${CMAKE_Fortran_FLAGS_RELEASE} -mtune=native")
# CACHE STRING "Flags used by the compiler during release builds." FORCE)

Reference: scipy/scipy#11611

@learning-chip
Copy link
Author

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

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