Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Investigate using nc-config / nf-config to discover NetCDF libraries #36

Open
letmaik opened this issue Jul 15, 2019 · 4 comments
Open
Labels
enhancement New feature or request

Comments

@letmaik
Copy link

letmaik commented Jul 15, 2019

#24 (comment)

In some situations, typically HPC environments, this would avoid having to set -DNETCDF_DIR=.. / -DNETCDF_FORTRAN_DIR=...

Note that if netcdf-fortran is built with CMake, then nf-config --prefix just prints "not supported in CMake builds" or something similar.

@zbeekman
Copy link

Note that if netcdf-fortran is built with CMake, then nf-config --prefix just prints "not supported in CMake builds" or something similar.

oh. sigh.

It's relatively easy to get CMake to generate pkg-config files. I wish NetCDF would install good/thorough CMake package config files and generate pkg-config files, then just abandon auto-tools. It would save everyone the hassle of having to write yet another FindNetCDF.cmake module. I've seen at least 4 popular versions floating around, each with its strengths and deficiencies. If NetCDF always used CMake, installed decent CMake pacakge config files and pkg-config files, and was smart enough to set nf-config --prefix in CMake based builds, then the world would be a beautiful place.

(i.e., you could adjust CMAKE_PREFIX_PATH if needed and find_package(NetCDF) would just work without having to roll your own find module.)

@letmaik letmaik added the enhancement New feature or request label Sep 4, 2019
@dmey
Copy link

dmey commented Nov 14, 2019

Could we not simply rely on nc-config instead of nf-config and use it to infer the path to netcdf with the --fflags and --flibs? But then again I think this would end up not being configured if users build NetCDF Fortran with CMake... . The question is whether all this is actually worth doing all this...

If not I would probably just the hints to something like:

PATH_SUFFIXES ["x86_64-linux-gnu", ""]

and then the user can simply pass NETCDF_DIR and NETCDF_FORTRAN_DIR at configure time...

@letmaik
Copy link
Author

letmaik commented Nov 14, 2019

@dmey Do you have a concrete situation where you're unable to use NETCDF_DIR/NETCDF_FORTRAN_DIR on some system? Not sure why you mention x86_64-linux-gnu.

@dmey
Copy link

dmey commented Nov 14, 2019

Well this is why I suggested adding to PATH_SUFFIXES ["x86_64-linux-gnu", ""]-- at the moment it would only work with "x86_64-linux-gnu", I think -- I am pretty sure I had this issue some time ago...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Development

No branches or pull requests

3 participants