From 1e99dbd71ad0297818ab76ead2d3ee332e96f165 Mon Sep 17 00:00:00 2001 From: Shahram Najm Date: Sun, 29 Jan 2023 14:17:12 +0000 Subject: [PATCH 1/8] ECC-1508: Update hierarchy docs --- src/accessor_class_hierarchy.txt | 8 +++++++- src/action_class_hierarchy.txt | 2 +- src/iterator_class_hierarchy.txt | 2 +- src/make_accessor_class_hierarchy_dirs.sh | 4 ++-- 4 files changed, 11 insertions(+), 5 deletions(-) diff --git a/src/accessor_class_hierarchy.txt b/src/accessor_class_hierarchy.txt index 180f6edbf..2fdf983e3 100644 --- a/src/accessor_class_hierarchy.txt +++ b/src/accessor_class_hierarchy.txt @@ -1,6 +1,7 @@ Accessor Class Hierarchy. Generated by src/make_accessor_class_hierarchy_dirs.sh + |-grib_accessor_class_forward |-grib_accessor_class_gen |---grib_accessor_class_abstract_long_vector |-----grib_accessor_class_g1step_range @@ -17,11 +18,11 @@ Generated by src/make_accessor_class_hierarchy_dirs.sh |-----grib_accessor_class_mars_param |-----grib_accessor_class_mars_step |-----grib_accessor_class_sprintf + |-----grib_accessor_class_trim |---grib_accessor_class_assert |---grib_accessor_class_bits |---grib_accessor_class_blob |---grib_accessor_class_box - |---grib_accessor_class_bufr_data |---grib_accessor_class_bufr_data_array |---grib_accessor_class_bufr_data_element |---grib_accessor_class_bufr_elements_table @@ -40,6 +41,7 @@ Generated by src/make_accessor_class_hierarchy_dirs.sh |-------grib_accessor_class_padtoeven |-------grib_accessor_class_padtomultiple |-------grib_accessor_class_section_padding + |---grib_accessor_class_change_alternative_row_scanning |---grib_accessor_class_change_scanning_direction |---grib_accessor_class_codetable_title |---grib_accessor_class_codetable_units @@ -61,6 +63,7 @@ Generated by src/make_accessor_class_hierarchy_dirs.sh |-------grib_accessor_class_statistics |-------grib_accessor_class_statistics_spectral |-------grib_accessor_class_vector + |-----grib_accessor_class_closest_date |-----grib_accessor_class_divdouble |-----grib_accessor_class_from_scale_factor_scaled_value |-----grib_accessor_class_g1area @@ -170,10 +173,12 @@ Generated by src/make_accessor_class_hierarchy_dirs.sh |---grib_accessor_class_number_of_values_data_raw_packing |---grib_accessor_class_pack_bufr_values |---grib_accessor_class_position + |---grib_accessor_class_proj_string |---grib_accessor_class_raw |---grib_accessor_class_section |---grib_accessor_class_section_pointer |---grib_accessor_class_smart_table_column + |---grib_accessor_class_step_human_readable |---grib_accessor_class_to_double |-----grib_accessor_class_sexagesimal2decimal |---grib_accessor_class_to_integer @@ -193,6 +198,7 @@ Generated by src/make_accessor_class_hierarchy_dirs.sh |-----grib_accessor_class_data_g22order_packing |-----grib_accessor_class_data_png_packing |-----grib_accessor_class_data_raw_packing + |-----grib_accessor_class_data_run_length_packing |-----grib_accessor_class_data_simple_packing |-------grib_accessor_class_data_complex_packing |---------grib_accessor_class_data_g1complex_packing diff --git a/src/action_class_hierarchy.txt b/src/action_class_hierarchy.txt index 132ec468d..6c311c70c 100644 --- a/src/action_class_hierarchy.txt +++ b/src/action_class_hierarchy.txt @@ -1,5 +1,5 @@ - Action Class Hierarchy + |action |-action_class_alias |-action_class_assert diff --git a/src/iterator_class_hierarchy.txt b/src/iterator_class_hierarchy.txt index 730373f0d..e692fa5c7 100644 --- a/src/iterator_class_hierarchy.txt +++ b/src/iterator_class_hierarchy.txt @@ -1,5 +1,5 @@ - Iterator Class Hierarchy + |-grib_iterator_class_gen |---grib_iterator_class_gaussian_reduced |---grib_iterator_class_lambert_azimuthal_equal_area diff --git a/src/make_accessor_class_hierarchy_dirs.sh b/src/make_accessor_class_hierarchy_dirs.sh index d5152266b..880f5ea2f 100755 --- a/src/make_accessor_class_hierarchy_dirs.sh +++ b/src/make_accessor_class_hierarchy_dirs.sh @@ -10,8 +10,8 @@ ROOT=$TMPDIR/ecCodes_Accessor_Class_Hierarchy rm -fr $ROOT; mkdir $ROOT # Assume we're in the src directory -for f in grib_accessor_class_*.c; do - fbase=`echo $f | sed -e 's/\.c$//'` +for f in grib_accessor_class_*.cpp; do + fbase=`echo $f | sed -e 's/\.cpp$//'` super=`grep 'SUPER *= *' $f | awk '{print $3}'` if [ "$super" != "" ] ; then super_path=`find $ROOT -type d -name $super` From fe05e2e347d824bcefd3a3279adffea3b9d062db Mon Sep 17 00:00:00 2001 From: Shahram Najm Date: Sun, 29 Jan 2023 14:21:58 +0000 Subject: [PATCH 2/8] ECC-1508: Update docs --- tools/big2gribex.cpp | 2 +- tools/gts_dump.cpp | 2 +- tools/metar_dump.cpp | 2 +- tools/metar_ls.cpp | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/tools/big2gribex.cpp b/tools/big2gribex.cpp index 059ad6988..a36b01126 100644 --- a/tools/big2gribex.cpp +++ b/tools/big2gribex.cpp @@ -9,7 +9,7 @@ */ /* - * C Implementation: big2gribex + * Implementation: big2gribex * * Description: * diff --git a/tools/gts_dump.cpp b/tools/gts_dump.cpp index b33831ef0..0f297393b 100644 --- a/tools/gts_dump.cpp +++ b/tools/gts_dump.cpp @@ -9,7 +9,7 @@ */ /* - * C Implementation: gts_dump + * Implementation: gts_dump * * */ diff --git a/tools/metar_dump.cpp b/tools/metar_dump.cpp index 080ec8ea3..4e0e2b8d4 100644 --- a/tools/metar_dump.cpp +++ b/tools/metar_dump.cpp @@ -9,7 +9,7 @@ */ /* - * C Implementation: grib_dump + * Implementation: grib_dump * * Author: Enrico Fucile * diff --git a/tools/metar_ls.cpp b/tools/metar_ls.cpp index ebb160c80..794438715 100644 --- a/tools/metar_ls.cpp +++ b/tools/metar_ls.cpp @@ -9,7 +9,7 @@ */ /* - * C Implementation: grib_ls + * Implementation: grib_ls * * Author: Enrico Fucile * From 2cf3dfc5608fbc43194f6959b8b6cf91bc5d50f5 Mon Sep 17 00:00:00 2001 From: Shahram Najm Date: Sun, 29 Jan 2023 14:24:19 +0000 Subject: [PATCH 3/8] ECC-1508: Update docs --- INSTALL | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/INSTALL b/INSTALL index e74cf260d..802e3cc22 100644 --- a/INSTALL +++ b/INSTALL @@ -45,8 +45,8 @@ You can also pass options to the cmake command above. Some typical examples are: -DENABLE_ECCODES_THREADS=ON Enable POSIX threads -DENABLE_JPG=ON Enable JPEG encoding/decoding (for GRIB packing) -DCMAKE_Fortran_COMPILER=pgf90 Set Fortran compiler to Portland Group F90 compiler - -DCMAKE_C_FLAGS="-O2 -Wall" Prepend the specified flags at the front - of the compilation command for C source files + -DCMAKE_CXX_FLAGS="-O2 -Wall" Prepend the specified flags at the front + of the compilation command for C++ source files By default the ctest step above does NOT require any data to be downloaded and only runs basic sanity tests. However if you wish to exercise more of the functionality of ecCodes, you are advised to configure the build with: From be8803d913b4c0d7616e9a7a91413e24cb964f09 Mon Sep 17 00:00:00 2001 From: Shahram Najm Date: Sun, 29 Jan 2023 18:10:47 +0000 Subject: [PATCH 4/8] Remove deprecated files --- definitions/dummy.am | 0 experimental/templates/dummy.am | 0 python/dummy.am | 0 src/dummy.am | 0 4 files changed, 0 insertions(+), 0 deletions(-) delete mode 100644 definitions/dummy.am delete mode 100644 experimental/templates/dummy.am delete mode 100644 python/dummy.am delete mode 100644 src/dummy.am diff --git a/definitions/dummy.am b/definitions/dummy.am deleted file mode 100644 index e69de29bb..000000000 diff --git a/experimental/templates/dummy.am b/experimental/templates/dummy.am deleted file mode 100644 index e69de29bb..000000000 diff --git a/python/dummy.am b/python/dummy.am deleted file mode 100644 index e69de29bb..000000000 diff --git a/src/dummy.am b/src/dummy.am deleted file mode 100644 index e69de29bb..000000000 From 9277d89d98803c301950a39b7320a254b78cbdbc Mon Sep 17 00:00:00 2001 From: Shahram Najm Date: Sun, 29 Jan 2023 18:52:34 +0000 Subject: [PATCH 5/8] GitHub actions: pass ecCodes-specific cmake options --- .github/.cmake-options | 1 + 1 file changed, 1 insertion(+) create mode 100644 .github/.cmake-options diff --git a/.github/.cmake-options b/.github/.cmake-options new file mode 100644 index 000000000..213b78382 --- /dev/null +++ b/.github/.cmake-options @@ -0,0 +1 @@ +-DENABLE_EXTRA_TESTS=1 From 46ff2952d5b6e8cf68e0fb2548698f86d50a661f Mon Sep 17 00:00:00 2001 From: Shahram Najm Date: Sun, 29 Jan 2023 22:29:03 +0000 Subject: [PATCH 6/8] ECC-1508: Helper scripts --- src/make_hash_keys.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/make_hash_keys.sh b/src/make_hash_keys.sh index 83efd6d9f..99a9ab9f7 100755 --- a/src/make_hash_keys.sh +++ b/src/make_hash_keys.sh @@ -8,7 +8,7 @@ echo "List all keys..." cd ../src -# Editing keys grib_hash_keys.c +# Editing keys grib_hash_keys.cpp # -l Compare key lengths before trying a string comparison # -C Make the contents of generated lookup tables constant, i.e., readonly # -I Include the necessary system include file at the beginning of the code @@ -18,8 +18,8 @@ cd ../src # -N Specify name of generated lookup function gperf -l -C -I -t -G -H hash_keys -N grib_keys_hash_get -m 3 ../tests/keys |\ - sed -e '/^#line /d' > grib_hash_keys.c + sed -e '/^#line /d' > grib_hash_keys.cpp -cat grib_itrie_keys.c >> grib_hash_keys.c +cat grib_itrie_keys.cpp >> grib_hash_keys.cpp echo ALL DONE From 973c82c8be38e28f62a84369049177fec6370574 Mon Sep 17 00:00:00 2001 From: Shahram Najm Date: Sun, 29 Jan 2023 22:32:25 +0000 Subject: [PATCH 7/8] ECC-1508: Helper scripts --- src/make_accessor_class_hash.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/make_accessor_class_hash.sh b/src/make_accessor_class_hash.sh index 6e8236c9e..ee98cbc0c 100755 --- a/src/make_accessor_class_hash.sh +++ b/src/make_accessor_class_hash.sh @@ -12,11 +12,11 @@ EOF cat grib_accessor_factory_hash_list | sed 's/\/\*/#/g' >> accessor_class_list.gperf -# editing grib_accessor_classes_hash.c +# editing grib_accessor_classes_hash.cpp gperf --version echo gperf -C -W classes -t -G -H grib_accessor_classes_get_id -N grib_accessor_classes_hash -m 1 -j 1 accessor_class_list.gperf |\ - sed s/__inline//g | sed s/inline//g > grib_accessor_classes_hash.c + sed s/__inline//g | sed s/inline//g > grib_accessor_classes_hash.cpp From 17ca872f69dc1f70b4eb912ba9a17ac0315e7fe5 Mon Sep 17 00:00:00 2001 From: Shahram Najm Date: Mon, 30 Jan 2023 10:53:14 +0000 Subject: [PATCH 8/8] ECC-1508: Set C++ standard to 11 and re-enable test --- CMakeLists.txt | 3 +++ tests/CMakeLists.txt | 8 ++++---- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 42ae03468..96fde7dc8 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -22,6 +22,9 @@ find_package( ecbuild 3.7 REQUIRED HINTS ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CUR # Initialise project project( eccodes VERSION 2.30.0 LANGUAGES CXX ) +set(CMAKE_CXX_STANDARD 11) +set(CMAKE_CXX_STANDARD_REQUIRED ON) + ############################################################################### # system checks needed for eccodes_config.h and some options like MEMFS diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index e62e2ee1b..11ad25254 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -32,7 +32,7 @@ list(APPEND test_c_bins grib_optimize_scaling_sh grib_set_force grib_ecc-386 - # grib_ecc-1431 + grib_ecc-1431 bufr_ecc-517 bufr_ecc-1288 bufr_get_element @@ -271,9 +271,9 @@ if( HAVE_BUILD_TOOLS ) codes_split_file grib_mars_keys) - #if( HAVE_AEC AND ENABLE_EXTRA_TESTS ) - # list(APPEND tests_extra grib_ecc-1431) - #endif() + if( HAVE_AEC AND ENABLE_EXTRA_TESTS ) + list(APPEND tests_extra grib_ecc-1431) + endif() if( HAVE_FORTRAN AND ENABLE_EXTRA_TESTS ) list(APPEND tests_extra bufr_dump_encode_fortran) list(APPEND tests_extra bufr_dump_decode_fortran)