Skip to content

Incorrect "has_fortran" and "has-c++4" reporting #2274

@gsjaardema

Description

@gsjaardema

If I run nc-config --all, I get the following (editted) output:

s1041980:build()> ../bin/nc-config --all

This netCDF 4.8.2-development has been built with the following features:

  --cc            -> /opt/local/bin/gcc
  --cflags        -> -I/Users/gdsjaar/src/seacas/include
  --libs          -> -L/Users/gdsjaar/src/seacas/lib -lnetcdf
  --static        -> -lhdf5_hl-shared -lhdf5-shared -lm -lz -lzstd -lbz2 -lsz -lcurl -lxml2

  --has-c++       -> no
  --cxx           ->

  --has-c++4      -> yes
  --cxx4          -> clang++
  --cxx4flags     -> -I/usr/local/Cellar/netcdf/4.8.1_2/include
  --cxx4libs      -> -L/usr/local/Cellar/netcdf/4.8.1_2/lib -lnetcdf-cxx4 -lnetcdf

  --has-fortran   -> yes
  --fc            -> /usr/local/bin/gfortran
  --fflags        -> -I/usr/local/Cellar/netcdf/4.8.1_2/include -I/usr/local/Cellar/netcdf/4.8.1_2/include
  --flibs         -> -L/usr/local/Cellar/netcdf/4.8.1_2/lib -lnetcdff -lnetcdf
  --has-f90       -> TRUE
  --has-f03       -> yes

Note that this indicates that has-fortran is true, but points to a fortran netcdff that is in a different location than my local install. If I look at how nc-config is determining this, it simply searches to see if there is a nf-config in my path somewhere.

I don't think that this is correct behavior since the versions of the libraries don't match and the -flibs setting would result in the application linking with a different libnetcdf (C API) then the local one that this nc-config is giving details for.

Maybe the correct behavior is to search for a nf-config that is in the same path as the nc-config? I'm not sure of the correct behavior, but this output was confusing to me since I intentionally disable fortran when I am building netcdf-c.

The C++ / C++4 reporting is also confusing since they are also picking up a ncxx-config and ncxx4-config anywhere in the path and the resulting library they find may be different versions than what I am building locally.

Metadata

Metadata

Assignees

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