Skip to content

Commit

Permalink
check if USENETCDFPAR is empty first (#1743)
Browse files Browse the repository at this point in the history
Env variable USENETCDFPAR may not be set when running make.

TYPE: bug fix

KEYWORDS: USENETCDFPAR

SOURCE: Wei-keng Liao

DESCRIPTION OF CHANGES:
When env USENETCDFPAR is not set, running make spews the following error message.
```
/bin/sh: line 0: [: -eq: unary operator expected
```
Solution: Check if USENETCDFPAR  is set first, and then its value if set.

LIST OF MODIFIED FILES: 
M    Makefile

TESTS CONDUCTED:  
1. It removes the error message
2. The Jenkins tests are passing.

RELEASE NOTE: Fixed an error in Makefile to check if USENETCDFPAR is set first.
  • Loading branch information
wkliao authored Dec 8, 2023
1 parent 4c1b732 commit 414c1bf
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -1069,7 +1069,7 @@ fseek_test :

# rule used by configure to test if this will compile with netcdf4
nc4_test:
if [ $(USENETCDFPAR) -eq 0 ] ; then \
if [ -z "$(USENETCDFPAR)" ] || [ $(USENETCDFPAR) -eq 0 ] ; then \
( cd tools ; /bin/rm -f nc4_test.{exe,nc,o} ; $(SCC) -o nc4_test.exe nc4_test.c -I$(NETCDF)/include -L$(NETCDF)/lib -lnetcdf $(NETCDF4_DEP_LIB) ; cd .. ) ; \
else \
( cd tools ; /bin/rm -f nc4_test.{exe,nc,o} ; $(DM_CC) -o nc4_test.exe nc4_test.c -I$(NETCDF)/include -L$(NETCDF)/lib -lnetcdf $(NETCDF4_DEP_LIB) ; cd .. ) ; \
Expand Down

0 comments on commit 414c1bf

Please sign in to comment.