Closed BenjaminTJohnson closed 5 months ago
@WardF @edhartnett tagging Ward / Ed for visibility. Thanks --
I don' t think this is a great idea.
Instead, take a look at spack, which is perfect for this sort of thing. I would suggest that netcdf-fortran does not need to know about the install details of netcdf-c, and vice-versa, because that clutters up the cmake files, and spack already knows this out of the box.
For example, you can say:
spack install netcdf-fortran
and it will install HDF5, zlib, netcdf-c, etc., and then netcdf-fortran. It's very clever and you can control all the options from the command line to get exactly what you need. See https://spack.io/
Spack is being used at a lot of HPC centers now to manage the build of complex scientific software...
Yeah, personally I use spack/spack-stack
on all of the HPC environments I'm involved with. I was hoping to avoid a multi-step process, but you're probably right in that it will be easier for me to support / debug if they're using spack
.
Thanks for the advice.
Background: linux environment (no existing netcdf/hdf libraries) CMake v3.23 latest releases of netcdf-c and netcdf-fortran.
In a CMake project (CRTM) that requires netCDF-Fortran, I'm attempting to give users the option to download and compile netcdf-fortran, all during the
cmake
configuration step.In short (pseudo code):
I am able to successfully fetch, download, and cmake
netcdf-c
, and similarly fornetcdf-fortran
, but the latter fails during its cmake step with the error message:So
netcdf-fortran
is not able to "see" thatnetcdf-c
has been installed.Is there an example of code where this is successfully accomplished that I can look at?
or, alternatively, is there a different method for accomplishing this. I'm completely open to any methods that can be run during the CRTM's cmake step.
I've attached my
CMakeLists.txt
file, in case you want to have a look. CMakeLists.txt