Skip to content

Compilation fails with MPI options on: cc: error: unknown argument: '-fallow-argument-mismatch' #662

Description

@yurivict

In src/CMakeLists.txt you set the fortran-specific options generally but cc doesn't understand them:

        if (WANNIER90_MPIH AND CMAKE_Fortran_COMPILER_ID STREQUAL "GNU")
                target_compile_options(Wannier90_lib PRIVATE -fallow-argument-mismatch)
                target_compile_options(Wannier90_exe PRIVATE -fallow-argument-mismatch)
        endif ()

Fortran errors follow:

/usr/ports/science/wannier90/work/wannier90-4.0.1/src/comms.F90:1376:22:

 1376 |     call mpi_scatterv(rootglobalarray, counts, displs, MPI_DOUBLE_COMPLEX, array, localcount, &
      |                      1
......
 1468 |     call mpi_scatterv(rootglobalarray, counts, displs, MPI_INTEGER, array, localcount, &
      |                      2
Warning: Type mismatch between actual argument at (1) and actual argument at (2) (COMPLEX(8)/INTEGER(4)).
/usr/ports/science/wannier90/work/wannier90-4.0.1/src/comms.F90:1376:75:

 1376 |     call mpi_scatterv(rootglobalarray, counts, displs, MPI_DOUBLE_COMPLEX, array, localcount, &
      |                                                                           1
......
 1468 |     call mpi_scatterv(rootglobalarray, counts, displs, MPI_INTEGER, array, localcount, &
      |                                                                    2       
Warning: Type mismatch between actual argument at (1) and actual argument at (2) (COMPLEX(8)/INTEGER(4)).

This means that these options are set for the C code and not for the Fortran code.

clang-21
FreeBSD 15.1

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions