Skip to content

Commit

Permalink
Update compilation of eccodes.
Browse files Browse the repository at this point in the history
  • Loading branch information
lars2015 committed Feb 20, 2025
1 parent 7ea0e2b commit d8f1391
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 6 deletions.
2 changes: 1 addition & 1 deletion libs/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -267,7 +267,7 @@ if [ $ifBuildAll = true ] || [ $ifBuildEcCodes = true ] ; then
printf "starting to compile ecCodes...\n"
strTarget=$strFileEcCodes
cp $strTarget.tar.gz $strBuildDir/src && cd $strBuildDir/src && tar xvf $strTarget.tar.gz
cd $strBuildDir/src && cmake -DCMAKE_INSTALL_PREFIX=$strBuildDir/src -DBUILD_SHARED_LIBS=BOTH -DENABLE_AEC=OFF -DENABLE_JPEG=OFF -DENABLE_FORTRAN=OFF $strTarget && make -j $numProcs && ctest -j $numProcs && make install \
cd $strBuildDir/src && cmake -DCMAKE_INSTALL_PREFIX=$strBuildDir/src -DBUILD_SHARED_LIBS=BOTH -DENABLE_AEC=OFF -DENABLE_JPEG=OFF -DENABLE_FORTRAN=OFF -DENABLE_NETCDF=OFF $strTarget && make -j $numProcs && ctest -j $numProcs && make install \
&& cp -a include/* $strBuildDir/include/ \
&& cp -a lib/libeccodes* $strBuildDir/lib/ \
|| exit
Expand Down
3 changes: 3 additions & 0 deletions src/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -235,6 +235,9 @@ endif

ifeq ($(ECCODES),1)
LDFLAGS += -leccodes
ifeq ($(STATIC),1)
LDFLAGS += -lstdc++ -lm
endif
CFLAGS += -DECCODES
endif

Expand Down
11 changes: 6 additions & 5 deletions src/mptrac.h
Original file line number Diff line number Diff line change
Expand Up @@ -1010,12 +1010,13 @@
ERRMSG("%s", nc_strerror(nc_result)); \
}

#define ECC(cmd) { \
int ecc_result=(cmd); \
if(ecc_result!=0) \
ERRMSG("ECCODES error"); \
#define ECC(cmd) { \
int ecc_result=(cmd); \
if(ecc_result!=0) \
ERRMSG("ECCODES error: %s", codes_get_error_message(ecc_result)); \
}
#define ECC_READ_2D(variable,target,scaling_factor,found_flag){\

#define ECC_READ_2D(variable,target,scaling_factor,found_flag){ \
if( strcmp(short_name,variable)==0){\
for (int ix = 0; ix < met->nx; ix++) {\
for (int iy = 0; iy < met->ny; iy++) {\
Expand Down

0 comments on commit d8f1391

Please sign in to comment.