Skip to content

Commit

Permalink
Merge branch 'check-pnetcdf-exists' into hotfix-v8.2.1 (PR #1203)
Browse files Browse the repository at this point in the history
This merge improves the detection of the locations of the netCDF and pNetCDF
libraries.

Prior to this merge, the top-level Makefile contained logic to check for the
existence of directories $(NETCDF)/lib and $(NETCDF)/lib64, and similarly for
$(PNETCDF)/lib and $(PNETCDF)/lib64. This logic didn't actually include checks
on the presence of libraries within those directories.

Since the presence of a lib64/ directory was checked after the check for a lib/
directory, if, say, the netCDF library were installed in lib/ and not in lib64/,
the result of the Makefile logic would be an incorrect netCDF path of
$(NETCDF)/lib64 if a lib64/ directory was also present.

With this merge, the Makefile logic checks for the existence of libnetcdf.* or
libpnetcdf.* files within the lib/ and lib64/ directories before selecting a
directory for the path to netCDF or PnetCDF.

* check-pnetcdf-exists:
  Check for the libnetcdf library existence similar to pnetcdf
  Check for libpnetcdf library existence rather than just directory
  • Loading branch information
mgduda committed Jul 19, 2024
2 parents 01faa8e + fe46d4f commit c314013
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -737,10 +737,10 @@ else # Not using PIO, using SMIOL
endif

ifneq "$(NETCDF)" ""
ifneq ($(wildcard $(NETCDF)/lib), )
ifneq ($(wildcard $(NETCDF)/lib/libnetcdf.*), )
NETCDFLIBLOC = lib
endif
ifneq ($(wildcard $(NETCDF)/lib64), )
ifneq ($(wildcard $(NETCDF)/lib64/libnetcdf.*), )
NETCDFLIBLOC = lib64
endif
CPPINCLUDES += -I$(NETCDF)/include
Expand All @@ -761,10 +761,10 @@ endif


ifneq "$(PNETCDF)" ""
ifneq ($(wildcard $(PNETCDF)/lib), )
ifneq ($(wildcard $(PNETCDF)/lib/libpnetcdf.*), )
PNETCDFLIBLOC = lib
endif
ifneq ($(wildcard $(PNETCDF)/lib64), )
ifneq ($(wildcard $(PNETCDF)/lib64/libpnetcdf.*), )
PNETCDFLIBLOC = lib64
endif
CPPINCLUDES += -I$(PNETCDF)/include
Expand Down

0 comments on commit c314013

Please sign in to comment.