Merge of release/2.11.0 into develop

This commit is contained in:
Shahram Najm 2019-01-21 15:00:56 +00:00
commit ad9b817d1e
5 changed files with 129 additions and 43 deletions

94
.appveyor.yml Normal file
View File

@ -0,0 +1,94 @@
#---------------------------------#
# general configuration #
#---------------------------------#
version: 2.11.0-{build}-{branch}
branches:
only:
- develop
- master
image: Visual Studio 2015
environment:
CONDA: c:\Miniconda37-x64
ECMWF: c:\ecmwf
GIT_CLONE_DIR: $(ECMWF)\git
INSTALL_DIR: $(ECMWF)\install
ECCODES_SRC: $(GIT_CLONE_DIR)\eccodes
ECBUILD_SRC: $(GIT_CLONE_DIR)\ecbuild
# scripts that are called at very beginning, before repo cloning
init:
# make sure git clones symlinks as symlinks
- cmd: git config --global core.symlinks true
# activate conda environment so the tests can find linux utils
- cmd: call %CONDA%\Scripts\activate.bat
# add eccodes\build\bin to path so tests can find eccodes.dll
- cmd: set PATH=%PATH%;%ECCODES_SRC%\build\bin
# auto-yes for conda
- cmd: conda config --set always_yes yes
clone_folder: $(ECCODES_SRC)
clone_depth: 1
# scripts that run after cloning repository
install:
# install ecbuild
- cmd: git clone --depth 1 https://github.com/ecmwf/ecbuild.git %ECBUILD_SRC%
# install linux utils
- cmd: conda install -c msys2 m2-bash ^
m2-findutils ^
m2-coreutils ^
m2-grep ^
m2-sed ^
m2-gawk ^
m2-diffutils ^
m2-perl
# get the latest version of cmake
- cmd: conda install -c conda-forge cmake
# other deps
- cmd: conda install netcdf4
#---------------------------------#
# build configuration #
#---------------------------------#
platform:
- x64
before_build:
- cmd: call "C:\Program Files\Microsoft SDKs\Windows\v7.1\Bin\SetEnv.cmd" /x64
- cmd: call "C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\vcvarsall.bat" x86_amd64
build_script:
- cmd: cd %ECCODES_SRC%
- cmd: mkdir build && cd build
- cmd: cmake -G "NMake Makefiles" ^
-D CMAKE_INSTALL_PREFIX=%INSTALL_DIR% ^
-D CMAKE_BUILD_TYPE=Release ^
-D ENABLE_FORTRAN=0 ^
-D ENABLE_PYTHON=0 ^
-D ENABLE_NETCDF=1 ^
-D ENABLE_JPG=1 ^
-D IEEE_LE=1 ^
-D ENABLE_MEMFS=0 ^
-D ENABLE_EXTRA_TESTS=OFF ^
..
- cmd: nmake
- cmd: ctest
- cmd: nmake install
#---------------------------------#
# tests configuration #
#---------------------------------#
test_script:
- cmd: codes_info
- cmd: for /F "tokens=* USEBACKQ" %%F IN (`codes_info -s`) DO (ls %%F)
- cmd: for /F "tokens=* USEBACKQ" %%F IN (`codes_info -d`) DO (ls %%F)

View File

@ -58,6 +58,9 @@ check_c_source_compiles(
" ECCODES_HAVE_C_INLINE )
include(eccodes_test_endiness)
if( EC_OS_NAME MATCHES "windows" )
include(eccodes_find_linux_utils)
endif()
ecbuild_debug("ECCODES_BIG_ENDIAN=${ECCODES_BIG_ENDIAN}")
ecbuild_debug("ECCODES_LITTLE_ENDIAN=${ECCODES_LITTLE_ENDIAN}")

View File

@ -1,3 +1,9 @@
ecCodes
=======
[![Windows: master](https://img.shields.io/appveyor/ci/ecmwf/eccodes/master.svg?label=windows-master)](https://ci.appveyor.com/project/ecmwf/eccodes/branch/master)
[![Windows: develop](https://img.shields.io/appveyor/ci/ecmwf/eccodes/develop.svg?label=windows-dev)](https://ci.appveyor.com/project/ecmwf/eccodes/branch/develop)
ecCodes is a package developed by ECMWF which provides an application programming interface
and a set of tools for decoding and encoding messages in the following formats:

View File

@ -0,0 +1,26 @@
# (C) Copyright 2011- ECMWF.
#
# This software is licensed under the terms of the Apache Licence Version 2.0
# which can be obtained at http://www.apache.org/licenses/LICENSE-2.0.
# In applying this licence, ECMWF does not waive the privileges and immunities
# granted to it by virtue of its status as an intergovernmental organisation nor
# does it submit to any jurisdiction.
function( eccodes_find_linux_util _p_UTIL )
find_program( FOUND_PROGRAM ${_p_UTIL} )
if( NOT FOUND_PROGRAM )
ecbuild_critical( "Failed to find linux util: ${_p_UTIL}" )
endif()
endfunction( eccodes_find_linux_util )
if( ENABLE_TESTS )
# These utils are required for the tests to run.
# To install them on Windows, install the appropriate m2-* conda package.
# e.g. for bash: `conda install -msys2 m2-bash`
# Make sure to activate the conda environment so the utils are in the system path.
set( REQUIRED_UTILS bash find grep sed gawk diff )
foreach( UTIL ${REQUIRED_UTILS} )
eccodes_find_linux_util( ${UTIL} )
endforeach()
endif()

View File

@ -34,7 +34,6 @@
#include <io.h>
#endif
/* #define CHECK(a) check(#a,a) */
#define NUMBER(a) (sizeof(a)/sizeof(a[0]))
int error = 0;
@ -44,48 +43,6 @@ const char* param = "unknown";
int list_mode = 0;
int compare_mode = 0;
#if 0
static void check(const char* name,int a)
{
if(!a) {
printf("%s, field %d [%s]: %s failed\n",file,field,param,name);
error++;
}
}
static double dget(grib_handle *h,const char* what)
{
int e; double val;
if((e = grib_get_double(h,what,&val)) != GRIB_SUCCESS)
{
printf("%s, field %d [%s]: cannot get %s: %s\n",file,field,param,what,grib_get_error_message(e));
error++;
val = -1;
}
return val;
}
static int missing(grib_handle *h,const char* what)
{
int err=0;
return grib_is_missing(h,what,&err);
}
static int eq(grib_handle *h,const char* what,long value)
{
return get(h,what) == value;
}
static int ne(grib_handle *h,const char* what,long value)
{
return get(h,what) != value;
}
static int ge(grib_handle *h,const char* what,long value)
{
return get(h,what) >= value;
}
#endif
static long get(grib_handle *h,const char* what)
{
int e; long val;