[MacPorts] #59799: netcdf-fortran: won't build if mpi doesn't match

MacPorts noreply at macports.org
Tue Dec 3 05:41:13 UTC 2019

#59799: netcdf-fortran: won't build if mpi doesn't match
 Reporter:  dstrubbe  |      Owner:  tenomoto
     Type:  defect    |     Status:  assigned
 Priority:  Normal    |  Milestone:
Component:  ports     |    Version:
 Keywords:  haspatch  |       Port:  netcdf-fortran
 The port failed to upgrade, because I had netcdf installed with +mpich,
 but netcdf-fortran was just +gcc7. Apparently we now need to enforce
 compatibility of these variants. I am not sure if this might cause some
 other problem, so I figured I would file a ticket rather than just commit.

 We should enable parallel tests when using MPI, which needed a bit of
 patching to get to work.

 diff --git a/science/netcdf-fortran/Portfile b/science/netcdf-
 index 5fb29b8f2df..00be09c6cd7 100644
 --- a/science/netcdf-fortran/Portfile
 +++ b/science/netcdf-fortran/Portfile
 @@ -11,6 +11,14 @@ PortGroup                   github 1.0
  # hdf5+cxx (w/o a fortran variant) and netcdf-fortran.
  #mpi.enforce_variant         hdf5

 +# check to avoid the configure error:
 +#        The NetCDF C library is built with parallel I/O feature enabled,
 +#        the Fortran compiler '/opt/local/bin/gfortran-mp-7' supplied in
 this configure command
 +#        does not support MPI-IO. Please use one that does. If parallel
 +#        feature is not desired, please use a NetCDF C library with
 +#        I/O feature disabled. Abort.
 +mpi.enforce_variant         netcdf
  github.setup                Unidata netcdf-fortran 4.5.2 v
  revision                    0
  maintainers                 {takeshi @tenomoto} openmaintainer
 @@ -66,3 +74,12 @@ if {[variant_isset g95]} {

  test.run                    yes
  test.target                 check
 +if {[mpi_variant_isset]} {
 +    configure.args-append      --enable-parallel-tests
 +    pre-test {
 +        foreach script {nf_test4/run_f77_par_test.sh
 nf_test4/run_f77_par_test_03.sh nf03_test4/run_f90_par_test.sh
 examples/F90/run_f90_par_examples.sh} {
 +            reinplace -W ${worksrcpath}
 "s|mpiexec|${prefix}/bin/${mpi.exec}|" ${script}
 +        }
 +    }

Ticket URL: <https://trac.macports.org/ticket/59799>
MacPorts <https://www.macports.org/>
Ports system for macOS

More information about the macports-tickets mailing list