ECC-1508: Set C++ standard to 11 and re-enable test

This commit is contained in:
Shahram Najm 2023-01-30 10:56:03 +00:00
commit a555f554fd
18 changed files with 30 additions and 20 deletions

1
.github/.cmake-options vendored Normal file
View File

@ -0,0 +1 @@
-DENABLE_EXTRA_TESTS=1

View File

@ -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

View File

@ -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:

View File

View File

View File

@ -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

View File

@ -1,5 +1,5 @@
Action Class Hierarchy
|action
|-action_class_alias
|-action_class_assert

View File

View File

@ -1,5 +1,5 @@
Iterator Class Hierarchy
|-grib_iterator_class_gen
|---grib_iterator_class_gaussian_reduced
|---grib_iterator_class_lambert_azimuthal_equal_area

View File

@ -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

View File

@ -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`

View File

@ -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 <string.h> 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

View File

@ -33,7 +33,7 @@ list(APPEND test_c_bins
grib_set_force
grib_ecc-386
grib_ecc-1467
# grib_ecc-1431
grib_ecc-1431
bufr_ecc-517
bufr_ecc-1288
bufr_get_element
@ -273,9 +273,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)

View File

@ -9,7 +9,7 @@
*/
/*
* C Implementation: big2gribex
* Implementation: big2gribex
*
* Description:
*

View File

@ -9,7 +9,7 @@
*/
/*
* C Implementation: gts_dump
* Implementation: gts_dump
*
*
*/

View File

@ -9,7 +9,7 @@
*/
/*
* C Implementation: grib_dump
* Implementation: grib_dump
*
* Author: Enrico Fucile
*

View File

@ -9,7 +9,7 @@
*/
/*
* C Implementation: grib_ls
* Implementation: grib_ls
*
* Author: Enrico Fucile <enrico.fucile@ecmwf.int>
*