Note: This is a public test instance of Red Hat Bugzilla. The data contained within is a snapshot of the live data so any changes you make will not be reflected in the production Bugzilla. Email is disabled so feel free to test any aspect of the site that you want. File any problems you find or give feedback at bugzilla.redhat.com.

Bug 1738541

Summary: nf-config does not report the location of netcdf.mod
Product: [Fedora] Fedora Reporter: Fredrik Jansson <fjansson>
Component: netcdf-fortranAssignee: Orion Poplawski <orion>
Status: CLOSED ERRATA QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 30CC: dakingun, orion
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: netcdf-fortran-4.5.2-3.fc31 netcdf-fortran-4.5.2-3.el8 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2020-03-06 02:22:11 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Fredrik Jansson 2019-08-07 12:14:17 UTC
Description of problem:

The nf-config utility (provided by package netcdf-fortran-devel) is supposed to paths where netcdf.mod is found when specifying the --fflags. 

On Fedora 30, it returns /usr/include, however netcdf.mod is found in a different directory, /usr/lib64/gfortran/modules. Thus when compiling software that queries nf-config to find the module include path, it gets a path that doesn't have netcdf.mod, and compilation fails when it does not find netcdf.mod

This is exactly the same problem as in https://bugzilla.redhat.com/show_bug.cgi?id=1554621 which was closed as EOL for Fedora 26. The problem was also present in Fedora 29. I would have re-opened that bug, but I couldn't.

Version-Release number of selected component (if applicable):
$ rpm -qa | grep netcdf-fortran
netcdf-fortran-devel-4.4.4-12.fc30.x86_64
netcdf-fortran-4.4.4-12.fc30.x86_64

Steps to Reproduce:
1. nf-config --fflags

Actual results:
$ nf-config --fflags
-I/usr/include

Expected results:
$ nf-config --fflags
-I/usr/include -I/usr/lib64/gfortran/modules/

Note that /usr/include contains netcdf.inc which may also be needed for netcdf-using Fortran programs, thus I think /usr/include should be kept in the response.

Additional info:
One workaround, which fixes the problem for me, is to patch /usr/bin/nf-config to return also the module directory:

 includedir=${prefix}/include
+moduledir=/usr/lib64/gfortran/modules/
 
 cc="gcc"
 fc="gfortran"
 cflags=" -I${includedir} " 
-fflags="-I${includedir}"
+fflags="-I${includedir} -I${moduledir}"

Comment 1 Fedora Update System 2020-02-25 16:02:12 UTC
FEDORA-2020-b218fe02ad has been submitted as an update to Fedora 31. https://bodhi.fedoraproject.org/updates/FEDORA-2020-b218fe02ad

Comment 2 Fedora Update System 2020-02-27 18:35:01 UTC
netcdf-fortran-4.5.2-3.fc31 has been pushed to the Fedora 31 testing repository. If problems still persist, please make note of it in this bug report.
See https://fedoraproject.org/wiki/QA:Updates_Testing for
instructions on how to install test updates.
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2020-b218fe02ad

Comment 3 Fedora Update System 2020-02-27 19:26:04 UTC
netcdf-fortran-4.5.2-3.el8 has been pushed to the Fedora EPEL 8 testing repository. If problems still persist, please make note of it in this bug report.
See https://fedoraproject.org/wiki/QA:Updates_Testing for
instructions on how to install test updates.
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-EPEL-2020-ea68ebc8bf

Comment 4 Fedora Update System 2020-03-06 02:22:11 UTC
netcdf-fortran-4.5.2-3.fc31 has been pushed to the Fedora 31 stable repository. If problems still persist, please make note of it in this bug report.

Comment 5 Fedora Update System 2020-03-13 23:21:26 UTC
netcdf-fortran-4.5.2-3.el8 has been pushed to the Fedora EPEL 8 stable repository. If problems still persist, please make note of it in this bug report.