Skip to content

NetCDF 4.10.1 does not build with MPICH #3414

Description

@eschnett

I am building NetCDF 4.10.1 against MPICH for aarch64-linux-gnu. This fails because configure thinks that MPI_Comm_f2c is not available (although it is), and aarch64 is a 64-bit system.

The build error comes from

./libdispatch/dparallel.c:460:        #error "MPI_Comm_f2c unavailable on a 64-bit system: cannot safely convert Fortran comm handle"

I assume that the configure mis-detection is caused by the cmake lines

  CHECK_SYMBOL_EXISTS(MPI_Comm_f2c "mpi.h" HAVE_MPI_COMM_F2C)
  CHECK_SYMBOL_EXISTS(MPI_Info_f2c "mpi.h" HAVE_MPI_INFO_F2C)

which expect that there is a symbol MPI_Comm_f2c. MPICH provides no such symbol, it provides a macro instead.

This configure setting

CONFIGURE_OPTIONS="$CONFIGURE_OPTIONS ac_cv_func_MPI_Comm_f2c=yes ac_cv_func_MPI_Info_f2c=yes"

avoids the problem.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions