diff --git a/CMakeLists.txt b/CMakeLists.txt index 575df907e..dcafb1fd2 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -34,12 +34,17 @@ ecbuild_declare_project() ############################################################################### # system checks needed for eccodes_config.h and some options like MEMFS +check_type_size( int ECCODES_SIZEOF_INT ) +check_type_size( long ECCODES_SIZEOF_LONG ) +check_type_size( size_t ECCODES_SIZEOF_SIZE_T ) + check_include_files( assert.h ECCODES_HAVE_ASSERT_H ) check_include_files( string.h ECCODES_HAVE_STRING_H ) check_include_files( sys/types.h ECCODES_HAVE_SYS_TYPES_H ) check_include_files( sys/stat.h ECCODES_HAVE_SYS_STAT_H ) check_include_files( fcntl.h ECCODES_HAVE_FCNTL_H ) check_include_files( unistd.h ECCODES_HAVE_UNISTD_H ) + check_symbol_exists( fseeko "stdio.h" ECCODES_HAVE_FSEEKO ) check_symbol_exists( posix_memalign "stdlib.h" ECCODES_HAVE_POSIX_MEMALIGN ) check_symbol_exists( fmemopen "stdio.h" ECCODES_HAVE_FMEMOPEN ) diff --git a/fortran/CMakeLists.txt b/fortran/CMakeLists.txt index ff5822aad..119f09c2c 100644 --- a/fortran/CMakeLists.txt +++ b/fortran/CMakeLists.txt @@ -13,7 +13,7 @@ if( HAVE_FORTRAN ) COMMAND grib_types > grib_kinds.h DEPENDS grib_types ) - if( ${EC_SIZEOF_INT} EQUAL ${EC_SIZEOF_LONG} ) + if( ${ECCODES_SIZEOF_INT} EQUAL ${ECCODES_SIZEOF_LONG} ) set( _long_int_interface grib_f90_int.f90 ) set( _long_int_interface_ec eccodes_f90_int.f90 ) else() @@ -21,7 +21,7 @@ if( HAVE_FORTRAN ) set( _long_int_interface_ec eccodes_f90_long_int.f90 ) endif() - if( ${EC_SIZEOF_INT} EQUAL ${EC_SIZEOF_SIZE_T} ) + if( ${ECCODES_SIZEOF_INT} EQUAL ${ECCODES_SIZEOF_SIZE_T} ) set( _sizet_int_interface grib_f90_int_size_t.f90 ) set( _sizet_int_interface_ec eccodes_f90_int_size_t.f90 ) else()