Skip to content
Open
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 0 additions & 4 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -19,14 +19,10 @@ list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake")
option(ENABLE_DOCS "Enable generation of doxygen-based documentation." OFF)
option(USE_NETCDF "Use NetCDF" off)
option(USE_REGEX "Use Regex?" on)
option(USE_TIGGE "Use tigge?" on)
option(USE_MYSQL "Use MySQL?" off)
option(USE_IPOLATES "Use Ipolates" off)
option(USE_UDF "Use UDF?" off)
option(USE_OPENMP "Use OpenMP?" off)
option(USE_PROJ4 "Use Proj4?" off)
option(USE_WMO_VALIDATION "Use WMO Validation?" off)
option(DISABLE_TIMEZONE "Disable posix Timezone?" off)
option(DISABLE_ALARM "Disable Alarm?" off)
set(USE_NAMES "NCEP")
option(USE_G2CLIB_HIGH "Use g2c high-level decoder (-g2clib 2)?" off)
Expand Down
3 changes: 0 additions & 3 deletions docs/user_guide.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,13 +48,10 @@ Additional CMake build options can be used to configure the build by setting the
| FTP_TEST_FILES | Fetch and test with files on FTP site. | OFF |
| FTP_LARGE_TEST_FILES | Fetch and test with very large files on FTP site. | OFF |
| FTP_EXTRA_TEST_FILES | Test with more large files fetched via FTP. | OFF |
| USE_TIGGE | Enable use of TIGGE gribtables | ON |
| USE_UDF | Enable User-Defined functions | OFF |
| USE_WMO_VALIDATION | Use WMO Validation Tables (unofficial templates) | OFF |
| DISABLE_ALARM | Disable alarm for non-compatible systems | OFF |
| DISABLE_STAT | Disable POSIX feature | OFF |
| BUILD_EXTRA | Build user-contributed code. This code is no longer supported - use at your own risk. | OFF |
| USE_MYSQL | Use with BUILD_EXTRA = ON to enable user-contributed MySQL options. It is user's responsibility to ensure MySQL is available. | OFF |

## Documentation for Previous Versions of wgrib2

Expand Down
23 changes: 23 additions & 0 deletions extra/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,29 @@ include_directories(../wgrib2/)
add_library(wgrib2_extra OBJECT ${src})
target_compile_definitions(wgrib2_extra PUBLIC ${definitions_list})

# Optional MySQL support: detect and define USE_MYSQL if available
# This is intentionally NOT REQUIRED; build proceeds without MySQL.
find_package(MySQL QUIET)

if (MYSQL_FOUND)
message(STATUS "MySQL found: enabling USE_MYSQL for wgrib2_extra")
target_compile_definitions(wgrib2_extra PUBLIC USE_MYSQL)

if (DEFINED MYSQL_INCLUDE_DIRS)
target_include_directories(wgrib2_extra PUBLIC ${MYSQL_INCLUDE_DIRS})
elseif(DEFINED MYSQL_INCLUDE_DIR)
target_include_directories(wgrib2_extra PUBLIC ${MYSQL_INCLUDE_DIR})
endif()

if (DEFINED MYSQL_LIBRARIES)
target_link_libraries(wgrib2_extra PUBLIC ${MYSQL_LIBRARIES})
elseif(DEFINED MYSQL_LIBRARY)
target_link_libraries(wgrib2_extra PUBLIC ${MYSQL_LIBRARY})
endif()
else()
message(STATUS "MySQL not found: building wgrib2_extra without MySQL support")
endif()

if (BUILD_LIB)
set_property(TARGET wgrib2_extra PROPERTY POSITION_INDEPENDENT_CODE ON)
endif()
Expand Down
6 changes: 3 additions & 3 deletions spack/package.py
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ def url_for_version(self, version):
description="Add commands for user-defined functions and shell commands",
)
variant("regex", default=True, description="Use regular expression library (POSIX-2)")
variant("tigge", default=True, description="Ability for TIGGE-like variable names")
variant("tigge", default=True, description="Ability for TIGGE-like variable names",when="@:3.8")
variant(
"proj4",
default=False,
Expand Down Expand Up @@ -177,7 +177,7 @@ def url_for_version(self, version):
when="@3.7:",
)
variant(
"disable_timezone", default=False, description="Some machines do not support timezones"
"disable_timezone", default=False, description="Some machines do not support timezones", when="@:3.8"
)
variant(
"disable_alarm",
Expand All @@ -197,7 +197,7 @@ def url_for_version(self, version):
when="@:3.7"
)
variant("openmp", default=True, description="OpenMP parallelization")
variant("wmo_validation", default=False, description="WMO validation")
variant("wmo_validation", default=False, description="WMO validation", when="@:3.1")
# variant("shared", default=False, description="Enable shared library", when="+lib")
variant("disable_stat", default=False, description="Disable POSIX feature", when="@:3.1")
variant("openjpeg", default=False, description="Enable OpenJPEG", when="@:3.7")
Expand Down
13 changes: 0 additions & 13 deletions wgrib2/Config.c
Original file line number Diff line number Diff line change
Expand Up @@ -75,13 +75,6 @@ int f_config(ARG0) {
strcat(inv_out, "AEC is installed\n" );
#endif

#ifdef USE_MYSQL
strcat(inv_out, "mysql package is installed\n");
#else
strcat(inv_out, "mysql package is not installed\n");
#endif


#ifdef USE_REGEX
strcat(inv_out, "regex package is installed\n");
#else
Expand All @@ -93,12 +86,6 @@ int f_config(ARG0) {
strcat(inv_out, "flush_mode determined by stat()\n");
#endif

#ifdef USE_TIGGE
strcat(inv_out, "tigge package is installed\n");
#else
strcat(inv_out, "tigge package is not installed\n");
#endif

#ifdef USE_IPOLATES
inv_out += strlen(inv_out);
sprintf(inv_out, "IPOLATES NCEPLIBS-ip\n");
Expand Down
8 changes: 0 additions & 8 deletions wgrib2/Tigge.c
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,6 @@
#include "wgrib2.h"
#include "fnlist.h"

#ifdef USE_TIGGE

/** Use TIGGE flag. */
int tigge;

Expand All @@ -34,10 +32,4 @@ int f_tigge(ARG0) {
if (mode == -1) tigge = 1;
return 0;
}
#else
int f_tigge(ARG0) {
if (mode == -1) {fprintf(stderr,"tigge is not installed\n"); return 1;}
return 0;
}
#endif

6 changes: 0 additions & 6 deletions wgrib2/cname.c
Original file line number Diff line number Diff line change
Expand Up @@ -32,12 +32,10 @@ extern struct gribtable_s *user_gribtable;

static struct gribtable_s *search_gribtable(struct gribtable_s *gribtable, unsigned char **sec);

#ifdef USE_TIGGE
/** Flag to use TIGGE */
extern int tigge;
/** TIGGE Grib Table */
extern struct gribtable_s tigge_gribtable[];
#endif

/** Indicates the GRIB table name to use */
extern int names;
Expand Down Expand Up @@ -78,14 +76,10 @@ int getName_all(unsigned char **sec, int mode, char *inv_out, char *name, char *
if (p == NULL && names == ECMWF) p = search_gribtable(ECMWF_gribtable, sec);
if (p == NULL && names == DWD1) p = search_gribtable(DWD1_gribtable, sec);
if (p == NULL && names == NCEP) {
#ifdef USE_TIGGE
if (tigge && p == NULL) p = search_gribtable(tigge_gribtable, sec); /* tigge is default table */
#endif
if (p == NULL) p = search_gribtable(NCEP_gribtable, sec);
#ifdef USE_TIGGE
/* if undefined and a tigge file */
if (p == NULL && !tigge && (code_table_1_3(sec) == 4 || code_table_1_3(sec) == 5)) p = search_gribtable(tigge_gribtable, sec);
#endif
}

/* check local tables */
Expand Down
4 changes: 0 additions & 4 deletions wgrib2/config.h.in
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,10 @@

#cmakedefine USE_NETCDF
#cmakedefine USE_REGEX
#cmakedefine USE_TIGGE
#cmakedefine USE_MYSQL
#cmakedefine USE_IPOLATES
#cmakedefine USE_UDF
#cmakedefine USE_OPENMP
#cmakedefine USE_PROJ4
#cmakedefine USE_WMO_VALIDATION
#cmakedefine DISABLE_TIMEZONE
#cmakedefine DISABLE_ALARM
#cmakedefine USE_NAMES @USE_NAMES@
#cmakedefine USE_G2CLIB_HIGH
Expand Down
3 changes: 0 additions & 3 deletions wgrib2/gribtab.c
Original file line number Diff line number Diff line change
Expand Up @@ -95,13 +95,10 @@ struct gribtable_s local_gribtable[] = {
{ -1, -1, -1, -1, -1, -1, -1, -1, NULL, NULL, NULL }
};

#ifdef USE_TIGGE

/** Struct for TIGGE GRIB table. */
struct gribtable_s tigge_gribtable[] = {
#include "gribtables/tigge/tigge_gribtable.dat"
/* END MARKER */
{ -1, -1, -1, -1, -1, -1, -1, -1, NULL, NULL, NULL }
};

#endif
4 changes: 0 additions & 4 deletions wgrib2/init.c
Original file line number Diff line number Diff line change
Expand Up @@ -151,9 +151,7 @@ extern char **WxKeys; /**< NDFD weather information keys. */
extern const char *text_format; /**< Pointer to text format. */
extern int text_column; /**< Number of columns in text output. */

#ifdef USE_TIGGE
extern int tigge; /**< Use TIGGE flag. */
#endif
extern int names; /**< Name convention to use. */

// extern long int pos_input; /* seq read of grib */
Expand Down Expand Up @@ -272,9 +270,7 @@ void init_globals(void) {
text_format = "%g"; /* File.c */
text_column = 1;

#ifdef USE_TIGGE
tigge = 0; /* Tigge.c */
#endif

names = USE_NAMES;

Expand Down
4 changes: 0 additions & 4 deletions wgrib2/wgrib2_meta.h.in
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,10 @@

#cmakedefine USE_NETCDF
#cmakedefine USE_REGEX
#cmakedefine USE_TIGGE
#cmakedefine USE_MYSQL
#cmakedefine USE_IPOLATES
#cmakedefine USE_UDF
#cmakedefine USE_OPENMP
#cmakedefine USE_PROJ4
#cmakedefine USE_WMO_VALIDATION
#cmakedefine DISABLE_TIMEZONE
#cmakedefine DISABLE_ALARM
#cmakedefine USE_NAMES NCEP
#cmakedefine USE_G2CLIB_HIGH
Expand Down
Loading