Closed DJDavies2 closed 1 year ago
I don't have permission to create a branch, but looking at FindNetCDF.cmake there is this:
find_path(NetCDF_${_comp}_INCLUDE_DIR
NAMES ${NetCDF_${_comp}_INCLUDE_NAME}
DOC "netcdf ${_comp} include directory"
HINTS ${_search_hints_${_comp}} ${_search_hints}
PATH_SUFFIXES include ../../include
)
mark_as_advanced(NetCDF_${_comp}_INCLUDE_DIR)
## Find libraries for each component
string( TOUPPER "${_comp}" _COMP )
find_library(NetCDF_${_comp}_LIBRARY
NAMES ${NetCDF_${_comp}_LIBRARY_NAME}
DOC "netcdf ${_comp} library"
HINTS ${_search_hints} <-------- is this correct?
PATH_SUFFIXES lib ../../lib
)
From the code it looks like one should be able to pass component specific paths to ecbuild via -DNetCDF_<component>_ROOT
and friends. However it doesn't find the library, perhaps because the component specific paths are not searched for the library? If I update the above to this:
find_path(NetCDF_${_comp}_INCLUDE_DIR
NAMES ${NetCDF_${_comp}_INCLUDE_NAME}
DOC "netcdf ${_comp} include directory"
HINTS ${_search_hints_${_comp}} ${_search_hints}
PATH_SUFFIXES include ../../include
)
mark_as_advanced(NetCDF_${_comp}_INCLUDE_DIR)
## Find libraries for each component
string( TOUPPER "${_comp}" _COMP )
find_library(NetCDF_${_comp}_LIBRARY
NAMES ${NetCDF_${_comp}_LIBRARY_NAME}
DOC "netcdf ${_comp} library"
HINTS ${_search_hints_${_comp}} ${_search_hints}
PATH_SUFFIXES lib ../../lib
)
then passing -DNetCDF_<component>_ROOT
in addition to -DNETCDF_PATH
does in fact work.
Sorry, I don't know how to get the code snippets to appear asis.
Thanks for this issue report. We will fix it as soon as possible.
Sorry, I don't know how to get the code snippets to appear asis.
To get code snippets you have to use "single ticks". See https://docs.github.com/en/get-started/writing-on-github/working-with-advanced-formatting/creating-and-highlighting-code-blocks. I have edited your comments/description to add the ticks.
Thanks for this issue report. We will fix it as soon as possible.
Sorry, I don't know how to get the code snippets to appear asis.
To get code snippets you have to use "single ticks". See https://docs.github.com/en/get-started/writing-on-github/working-with-advanced-formatting/creating-and-highlighting-code-blocks. I have edited your comments/description to add the ticks.
Thanks.
This was fixed with PR #47
I have NetCDF C, Fortran and C++ components installed in different locations. Trying to link a package to multiple components (e.g. C and C++) results in this:
and invoking ecbuild with
-DNETCDF_PATH=...
and putting the /bin directories of the different NetCDF install dirs in$PATH
for the *-config scripts.