[metview] 03/20: upstream release 4.6.6
Alastair McKinstry
mckinstry at moszumanska.debian.org
Sat Oct 29 13:50:47 UTC 2016
This is an automated email from the git hooks/post-receive script.
mckinstry pushed a commit to tag debian/4.7.2-1
in repository metview.
commit d57de33fda58cb908afce030e31d20cc9464ed39
Author: Alastair McKinstry <mckinstry at debian.org>
Date: Thu Jul 7 20:59:09 2016 +0100
upstream release 4.6.6
---
CMakeLists.txt | 167 +++++++--------
VERSION.cmake | 2 +-
VERSION.cmake.orig | 9 -
bin/CMakeLists.txt | 4 +-
cmake/CheckFortranSourceCompiles.cmake | 8 +-
cmake/FindADSM.cmake | 2 +-
cmake/FindAEC.cmake | 2 +-
cmake/FindAIO.cmake | 2 +-
cmake/FindArmadillo.cmake | 7 +-
cmake/FindCMath.cmake | 15 +-
cmake/FindCairo.cmake | 5 +-
cmake/FindDl.cmake | 7 +-
cmake/FindEMOS.cmake | 2 +-
cmake/FindFDB.cmake | 2 +-
cmake/FindGeoTIFF.cmake | 5 +-
cmake/FindHPSS.cmake | 2 +-
cmake/FindLEX.cmake | 2 +-
cmake/FindLegacyFDB.cmake | 35 ---
cmake/FindLibGFortran.cmake | 9 +-
cmake/FindLibIFort.cmake | 7 +-
cmake/FindMKL.cmake | 2 +-
cmake/FindNDBM.cmake | 2 +-
cmake/FindNetCDF.cmake | 2 +-
cmake/FindNetCDF3.cmake | 7 +-
cmake/FindODB.cmake | 2 +-
cmake/FindOpenCL.cmake | 7 +-
cmake/FindOpenJPEG.cmake | 2 +-
cmake/FindPGIFortran.cmake | 11 +-
cmake/FindPango.cmake | 8 +-
cmake/FindPangoCairo.cmake | 20 +-
cmake/FindProj4.cmake | 2 +-
cmake/FindREADLINE.cmake | 2 +-
cmake/FindRPCGEN.cmake | 2 +-
cmake/FindRealtime.cmake | 8 +-
cmake/FindSZip.cmake | 2 +-
cmake/FindTrilinos.cmake | 2 +-
cmake/FindViennaCL.cmake | 7 +-
cmake/FindXLFortranLibs.cmake | 8 +-
cmake/FindYACC.cmake | 2 +-
cmake/Findgrib_api.cmake | 2 +-
cmake/Findodb_api.cmake | 2 +-
cmake/Findspot.cmake | 2 +-
cmake/VERSION.cmake | 4 +-
cmake/compiler_flags/PGI_C.cmake | 2 +-
cmake/compiler_flags/PGI_CXX.cmake | 2 +-
cmake/compiler_flags/PGI_Fortran.cmake | 2 +-
cmake/contrib/FindFFTW.cmake | 193 +++++++++++------
cmake/contrib/FindNetCDF4.cmake | 29 ++-
cmake/ecbuild_add_c_flags.cmake | 4 +-
cmake/ecbuild_add_cxx11_flags.cmake | 2 +-
cmake/ecbuild_add_cxx_flags.cmake | 4 +-
cmake/ecbuild_add_executable.cmake | 8 +-
cmake/ecbuild_add_extra_search_paths.cmake | 2 +-
cmake/ecbuild_add_fortran_flags.cmake | 4 +-
cmake/ecbuild_add_library.cmake | 12 +-
cmake/ecbuild_add_option.cmake | 38 ++--
cmake/ecbuild_add_persistent.cmake | 8 +-
cmake/ecbuild_add_resources.cmake | 6 +-
cmake/ecbuild_add_test.cmake | 52 +++--
cmake/ecbuild_append_to_rpath.cmake | 4 +-
cmake/ecbuild_bundle.cmake | 8 +-
cmake/ecbuild_cache.cmake | 2 +-
cmake/ecbuild_check_c_source_return.cmake | 12 +-
cmake/ecbuild_check_compiler.cmake | 2 +-
cmake/ecbuild_check_cxx11.cmake | 17 +-
cmake/ecbuild_check_cxx_source_return.cmake | 16 +-
cmake/ecbuild_check_fortran_source_return.cmake | 14 +-
cmake/ecbuild_check_functions.cmake | 2 +-
cmake/ecbuild_check_os.cmake | 46 ++--
cmake/ecbuild_config.h.in | 2 +-
cmake/ecbuild_declare_project.cmake | 12 +-
cmake/ecbuild_define_build_types.cmake | 4 +-
cmake/ecbuild_define_libs_and_execs_target.cmake | 2 +-
cmake/ecbuild_define_links_target.cmake | 2 +-
cmake/ecbuild_define_options.cmake | 2 +-
cmake/ecbuild_define_paths.cmake | 2 +-
cmake/ecbuild_dont_pack.cmake | 6 +-
cmake/ecbuild_download_resource.cmake | 6 +-
cmake/ecbuild_echo_targets.cmake | 18 +-
cmake/ecbuild_enable_fortran.cmake | 6 +-
cmake/ecbuild_features.cmake | 4 +-
cmake/ecbuild_find_fortranlibs.cmake | 14 +-
cmake/ecbuild_find_lexyacc.cmake | 2 +-
cmake/ecbuild_find_mpi.cmake | 14 +-
cmake/ecbuild_find_omp.cmake | 4 +-
cmake/ecbuild_find_package.cmake | 30 +--
cmake/ecbuild_find_perl.cmake | 6 +-
cmake/ecbuild_find_python.cmake | 8 +-
cmake/ecbuild_generate_config_headers.cmake | 4 +-
cmake/ecbuild_generate_fortran_interfaces.cmake | 54 +++--
cmake/ecbuild_generate_rpc.cmake | 10 +-
cmake/ecbuild_generate_yy.cmake | 12 +-
cmake/ecbuild_get_cxx11_flags.cmake | 4 +-
cmake/ecbuild_get_date.cmake | 6 +-
cmake/ecbuild_get_resources.cmake | 6 +-
cmake/ecbuild_get_test_data.cmake | 20 +-
cmake/ecbuild_git.cmake | 51 ++---
cmake/ecbuild_install_project.cmake | 8 +-
cmake/ecbuild_list_add_pattern.cmake | 2 +-
cmake/ecbuild_list_exclude_pattern.cmake | 8 +-
cmake/ecbuild_list_extra_search_paths.cmake | 2 +-
cmake/ecbuild_list_macros.cmake | 2 +-
cmake/ecbuild_log.cmake | 131 ++++++++----
cmake/ecbuild_pkgconfig.cmake | 6 +-
cmake/ecbuild_policies.cmake | 2 +-
cmake/ecbuild_print_summary.cmake | 60 +++---
cmake/ecbuild_project_files.cmake | 4 +-
cmake/ecbuild_requires_macro_version.cmake | 4 +-
cmake/ecbuild_separate_sources.cmake | 8 +-
cmake/ecbuild_setup_test_framework.cmake | 6 +-
cmake/ecbuild_source_flags.cmake | 2 +-
cmake/ecbuild_system.cmake | 22 +-
cmake/ecbuild_use_package.cmake | 16 +-
cmake/ecbuild_version.h.in | 2 +-
cmake/ecbuild_warn_unused_files.cmake | 28 +--
cmake/fcm-make-interfaces.cfg | 31 +++
cmake/gen_source_flags.py | 2 +-
cmake/include/ecbuild/boost_test_framework.h | 2 +-
cmake/sg.pl | 2 +-
project_summary.cmake | 46 ++--
scripts/CMakeLists.txt | 20 +-
scripts/CMakeLists.txt.orig | 260 -----------------------
scripts/metview_base.in | 11 +
scripts/mv_flextra_prep | 2 +-
share/ecbuild/toolchains/ecmwf-XC30-Cray.cmake | 11 +
share/ecbuild/toolchains/ecmwf-XC30-GNU.cmake | 11 +
share/ecbuild/toolchains/ecmwf-XC30-Intel.cmake | 25 ++-
share/metview/app-defaults/CMakeLists.txt | 2 +-
share/metview/etc/CMakeLists.txt | 10 +-
share/metview/etc/ObjectList | 2 +-
share/metview/etc/ecmwf.def | 17 +-
share/metview/etc/tigge.def | 6 +
src/Desktop/Parameter.cc | 13 ++
src/Macro/misc.cc | 11 +
src/OdbExaminer/OdbExaminer.cc | 9 +-
src/libMars/CMakeLists.txt | 2 +-
src/libMarsClient/CMakeLists.txt | 8 +-
src/libMarsClient/environ.c | 2 +-
src/libMarsClient/request.c | 4 +-
src/libMarsClient/tools.c | 12 +-
src/libMetview/MvObsSet.cc | 134 ++++++------
src/libMetview/MvScanFileType.cc | 21 +-
src/libMvQtGui/MvQAbout.cc | 8 +
src/libMvQtGui/MvQAbout.h | 3 +-
src/libUtil/CMakeLists.txt.orig | 73 -------
src/uPlot/CMakeLists.txt | 2 +-
src/uPlot/MagicsTranslator.cc | 6 +
src/uPlot/uPlotBase.cc | 13 +-
test/data/odb_test_set.odb | Bin 0 -> 13297 bytes
test/macros/CMakeLists.txt | 5 +
test/macros/odb_read.mv | 53 +++++
test/macros/plot_coast_order.mv | 1 -
152 files changed, 1218 insertions(+), 1139 deletions(-)
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 4fb076f..8b8ab53 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -20,7 +20,7 @@
# -DLOG_DIR=/path/to/dir/for/module/log/files
# -DODB1_USE_SCRIPT_PATH=/path/to/odb1/use/script
-cmake_minimum_required( VERSION 2.8.4 FATAL_ERROR )
+cmake_minimum_required( VERSION 2.8.11 FATAL_ERROR )
project( metview C CXX Fortran)
@@ -82,18 +82,18 @@ if(NOT METVIEW_SITE STREQUAL ecmwf)
set( SITE_WMO_CODE "255") # DO WE NEED AN OPTION TO ALLOW INSTALLERS TO SPECIFY THIS?
set( MV_ENVIRON "common")
set( AT_ECMWF "FALSE" )
- message("Building outside ECMWF")
+ ecbuild_info("Building outside ECMWF")
else()
set( SITE_WMO_CODE "098")
set( MV_ENVIRON "ecm_lnx64")
set( AT_ECMWF "TRUE" )
add_definitions( -DECMWF )
- message("Building inside ECMWF")
+ ecbuild_info("Building inside ECMWF")
endif()
if(DEFINED EXTRA_CONFIG_PATH)
- message(STATUS "Will search ${EXTRA_CONFIG_PATH} for additional config files")
+ ecbuild_info("Will search ${EXTRA_CONFIG_PATH} for additional config files")
endif()
@@ -116,7 +116,7 @@ if(ENABLE_WEATHER_ROOM)
find_package( Boost 1.49.0 ) # Weather Room export needs Boost
set(MV_WEATHER_ROOM_BUILT true)
else()
- message(WARNING "ENABLE_WEATHER_ROOM only available when building at ECMWF")
+ ecbuild_error("ENABLE_WEATHER_ROOM only available when building at ECMWF")
endif()
else()
set(MV_WEATHER_ROOM_BUILT false)
@@ -154,9 +154,9 @@ find_path( MARS_SOURCE request.c
NO_DEFAULT_PATH )
if (MARS_SOURCE)
- message(STATUS "Found MARS source at ${MARS_SOURCE}")
+ ecbuild_info("Found MARS source at ${MARS_SOURCE}")
else()
- message(FATAL_ERROR "MARS source is required, but was not found in " ${MARS_SOURCE_PATHS})
+ ecbuild_critical("MARS source is required, but was not found in ${MARS_SOURCE_PATHS}")
endif()
@@ -176,23 +176,37 @@ if(ENABLE_MARS)
set( MARS_ACCESS MARS_local )
set( METVIEW_MARS 1 )
if(DEFINED MARS_LOCAL_HOME)
- message(STATUS "MARS_LOCAL_HOME=${MARS_LOCAL_HOME}")
+ ecbuild_info("MARS_LOCAL_HOME=${MARS_LOCAL_HOME}")
if(NOT EXISTS ${MARS_LOCAL_HOME})
- message(FATAL_ERROR "MARS_LOCAL_HOME (${MARS_LOCAL_HOME}) does not exist")
+ ecbuild_critical("MARS_LOCAL_HOME (${MARS_LOCAL_HOME}) does not exist")
else()
set(MARS_HOME ${MARS_LOCAL_HOME})
endif()
else()
- message(FATAL_ERROR "If setting local MARS access, -DMARS_LOCAL_HOME=/path/to/mars/home must be provided.")
+ ecbuild_critical("If setting local MARS access, -DMARS_LOCAL_HOME=/path/to/mars/home must be provided.")
endif()
+ # FDB
+ if(AT_ECMWF)
+ ecbuild_use_package( PROJECT FDB REQUIRED )
+ else()
+ ecbuild_use_package( PROJECT FDB )
+ endif()
+
+ ecbuild_debug("FDB: ${FDB_LIBRARIES}")
+
+ if( NOT FDB_FOUND )
+ ecbuild_info("NO FDB")
+ endif()
+
+
if(ENABLE_MARS_ODB)
set(ENABLE_ODB 1)
set(METVIEW_MARS_ODB 1)
endif()
#find_library( FDB REQUIRED )
- #message(STATUS "FDB: ${FDB_LIBRARIES}" )
+ #ecbuild_debug("FDB: ${FDB_LIBRARIES}" )
else()
if(${CURL_FOUND})
@@ -200,23 +214,11 @@ else()
else()
set( MARS_ACCESS MARS_none )
add_definitions(-DNOCURL)
- message(STATUS "Could not find the Curl library - disabling Web API Mars")
+ ecbuild_warn("Could not find the Curl library - disabling Web API Mars")
endif()
endif()
-if(AT_ECMWF)
- ecbuild_use_package( PROJECT FDB REQUIRED )
-else()
- ecbuild_use_package( PROJECT FDB )
-endif()
-
-message(STATUS "FDB: ${FDB_LIBRARIES}" )
-
-if( NOT FDB_FOUND )
- message(STATUS "NO FDB" )
-endif()
-
###############################################################################
@@ -259,8 +261,7 @@ if(ENABLE_ODB)
${ECKIT_INCLUDE_DIRS})
else()
if(ENABLE_MARS_ODB)
- message(FATAL_ERROR "ENABLE_ODB was set, but ODB not found")
-# message(FATAL_ERROR "ENABLE_MARS_ODB was set, but ODB not found")
+ ecbuild_critical("ENABLE_ODB was set, but ODB not found")
set(ENABLE_MARS_ODB 0)
set(METVIEW_MARS_ODB 0)
endif()
@@ -293,13 +294,13 @@ if(ENABLE_ODB)
endif()
else()
- message(WARNING "ODB-1 support is DISABLED - No odbsql script found in ${ODB_PATH}/bin")
+ ecbuild_warn("ODB-1 support is DISABLED - No odbsql script found in ${ODB_PATH}/bin")
endif()
else()
- message(WARNING "ODB-1 found, but no bin directory in ${ODB_PATH}")
+ ecbuild_warn("ODB-1 found, but no bin directory in ${ODB_PATH}")
endif()
else()
- message(WARNING "ODB-1 not found!")
+ ecbuild_warn("ODB-1 not found!")
endif()
endif()
@@ -313,41 +314,41 @@ if(ENABLE_PLOTTING)
set(MAGICS_LIB_DIR "${magics_BASE_DIR}/lib")
if(ENABLE_UI AND (NOT MAGICS_HAVE_METVIEW))
- message(FATAL_ERROR "Magics must be built with Metview and Qt support!")
+ ecbuild_critical("Magics must be built with Metview and Qt support!")
endif()
if((NOT ENABLE_UI) AND (NOT MAGICS_HAVE_METVIEW_NO_QT))
- message(FATAL_ERROR "No UI: Magics must be built with Metview but no Qt support!")
+ ecbuild_critical("No UI: Magics must be built with Metview but no Qt support!")
endif()
if(NOT MAGICS_HAVE_NETCDF)
- message(FATAL_ERROR "Magics must be built with netCDF support!")
+ ecbuild_critical("Magics must be built with netCDF support!")
endif()
if(MAGICS_HAVE_ODB)
add_definitions(-DMETVIEW_ODB_PLOT)
else()
if(ENABLE_ODB)
- message(STATUS "ODB plotting is disabled, because Magics was built without ODB support! Please, rebuild Magics with ODB support to enable ODB plotting!") #xxx should be at end
+ ecbuild_warn("ODB plotting is disabled, because Magics was built without ODB support! Please, rebuild Magics with ODB support to enable ODB plotting!") #xxx should be at end
endif()
endif()
if(NOT MAGICS_HAVE_CAIRO)
- message(STATUS "NO PNG and PDF plotting support (disabled in Magics)") #xxx should be at end
+ ecbuild_warn("NO PNG and PDF plotting support (disabled in Magics)") #xxx should be at end
endif()
if(NOT MAGICS_HAVE_BUFR)
- message(STATUS "NO BUFR plotting support (disabled in Magics)") #xxx should be at end
+ ecbuild_warn("NO BUFR plotting support (disabled in Magics)") #xxx should be at end
endif()
else()
- message(FATAL_ERROR "Magics was not found, and it is required if ENABLE_PLOTTING=ON. Please supply MAGICS_PATH if necessary.")
+ ecbuild_critical("Magics was not found, and it is required if ENABLE_PLOTTING=ON. Please supply MAGICS_PATH if necessary.")
endif()
endif()
ecbuild_declare_project()
-message(STATUS "VERSION: ${METVIEW_VERSION_STR}")
+ecbuild_debug("VERSION: ${METVIEW_VERSION_STR}")
###############################################################################
# Find external dependencies
@@ -366,7 +367,7 @@ message(STATUS "VERSION: ${METVIEW_VERSION_STR}")
if(CMAKE_Fortran_COMPILER_ID STREQUAL "GNU")
find_library(QUADMATH_LIB quadmath)
if(QUADMATH_LIB)
- message(STATUS "quadmath found: ${QUADMATH_LIB}")
+ ecbuild_debug("quadmath found: ${QUADMATH_LIB}")
list( APPEND METVIEW_EXTRA_LIBRARIES ${QUADMATH_LIB} )
else()
# sometimes CMake does not properly detect libquadmath
@@ -380,9 +381,9 @@ endif()
find_library(PTHREAD_LIB pthread)
if(PTHREAD_LIB)
- message(STATUS "pthread found: ${PTHREAD_LIB}")
+ ecbuild_debug("pthread found: ${PTHREAD_LIB}")
else()
- message(FATAL_ERROR "library pthread not found")
+ ecbuild_critical("library pthread not found")
endif()
@@ -393,14 +394,14 @@ if(NOT (ENABLE_OPERA_RADAR STREQUAL "OFF"))
if(NOT DEFINED PROJ4_FOUND)
if(ENABLE_OPERA_RADAR STREQUAL "ON") # user wanted library, but it could not be found
- message(FATAL_ERROR "proj4 library not found - it is required for OPERA radar support (or set ENABLE_OPERA_RADAR=OFF)")
+ ecbuild_critical("proj4 library not found - it is required for OPERA radar support (or set ENABLE_OPERA_RADAR=OFF)")
else()
set(ENABLE_OPERA_RADAR "OFF") # not found, but setting=AUTO so just set it to OFF
endif()
else()
set(ENABLE_OPERA_RADAR "ON")
- message(STATUS "OPERA Radar enabled - proj 4 include: ${PROJ4_INCLUDE_DIRS}")
- message(STATUS "OPERA Radar enabled - proj 4 lib: ${PROJ4_LIBRARIES}")
+ ecbuild_debug("OPERA Radar enabled - proj 4 include: ${PROJ4_INCLUDE_DIRS}")
+ ecbuild_debug("OPERA Radar enabled - proj 4 lib: ${PROJ4_LIBRARIES}")
endif()
endif()
@@ -412,7 +413,7 @@ if(DEFINED FLEXTRA_PATH)
if(EXISTS ${FLEXTRA_PATH})
set(MV_FLEXTRA_PATH_SET "MV_FLEXTRA_EXE=${FLEXTRA_PATH}")
else()
- message(FATAL_ERROR "FLEXTRA_PATH: (${FLEXTRA_PATH}) does not exist")
+ ecbuild_critical("FLEXTRA_PATH: (${FLEXTRA_PATH}) does not exist")
endif()
endif()
@@ -422,15 +423,15 @@ endif()
if(ENABLE_NETWORK_PROXY)
if(NOT DEFINED PROXY_URL)
- message(FATAL_ERROR "ENABLE_NETWORK_PROXY is ON but PROXY_URL is not defined")
+ ecbuild_critical("ENABLE_NETWORK_PROXY is ON but PROXY_URL is not defined")
endif()
if(NOT DEFINED PROXY_PORT)
- message(FATAL_ERROR "ENABLE_NETWORK_PROXY is ON but PROXY_PORT is not defined")
+ ecbuild_critical("ENABLE_NETWORK_PROXY is ON but PROXY_PORT is not defined")
endif()
if(NOT DEFINED NO_PROXY_FOR)
- message(FATAL_ERROR "ENABLE_NETWORK_PROXY is ON but NO_PROXY_FOR is not defined")
+ ecbuild_critical("ENABLE_NETWORK_PROXY is ON but NO_PROXY_FOR is not defined")
endif()
set(USE_NETWORK_PROXY YES)
@@ -456,18 +457,18 @@ find_package( NetCDF 4 COMPONENTS CXX)
if( NETCDF_FOUND )
list( APPEND METVIEW_TPLS NetCDF )
else()
- message(FATAL_ERROR "NetCDF was not found")
+ ecbuild_critical("NetCDF was not found")
endif()
find_library(GDBM_LIB gdbm )
find_path( GDBM_INCLUDE gdbm.h )
if(GDBM_LIB AND GDBM_INCLUDE)
- message(STATUS "gdbm found")
- message(STATUS " library: ${GDBM_LIB}")
- message(STATUS " include: ${GDBM_INCLUDE}")
+ ecbuild_debug("gdbm found")
+ ecbuild_debug(" library: ${GDBM_LIB}")
+ ecbuild_debug(" include: ${GDBM_INCLUDE}")
else()
- message(FATAL_ERROR "library gdbm not found")
+ ecbuild_critical("library gdbm not found")
endif()
@@ -476,7 +477,7 @@ if( ENABLE_UI )
if( ENABLE_QT5 )
if( ENABLE_MOTIF )
- message(FATAL_ERROR "Metview does not support the Motif user interface with Qt5. Please set ENABLE_MOTIF=OFF in the CMake arguments")
+ ecbuild_critical("Metview does not support the Motif user interface with Qt5. Please set ENABLE_MOTIF=OFF in the CMake arguments")
endif()
find_package(Qt5Widgets REQUIRED)
@@ -494,13 +495,13 @@ if( ENABLE_UI )
#endif()
if( Qt5Widgets_FOUND )
- message(STATUS "Qt5 version ${Qt5Widgets_VERSION_STRING} was found")
+ ecbuild_debug("Qt5 version ${Qt5Widgets_VERSION_STRING} was found")
include_directories(${Qt5Widgets_INCLUDE_DIRS} ${Qt5Gui_INCLUDE_DIRS} ${Qt5Xml_INCLUDE_DIRS} ${Qt5XmlPatterns_INCLUDE_DIRS} ${Qt5Network_INCLUDE_DIRS} ${Qt5PrintSupport_INCLUDE_DIRS})
set( METVIEW_QT 1)
set( METVIEW_QT5 true)
add_definitions( -DMETVIEW_QT5 )
else()
- message(FATAL_ERROR "Qt5 was NOT found ...")
+ ecbuild_critical("Qt5 was NOT found ...")
endif()
else( ENABLE_QT5 )
find_package(Qt4 4.6.2 REQUIRED QtCore QtNetwork QtGui QtXml QtXmlPatterns) # QtWebKit QtHelp
@@ -508,7 +509,7 @@ if( ENABLE_UI )
include( ${QT_USE_FILE} )
set( METVIEW_QT 1)
else()
- message(FATAL_ERROR "Qt not found - this is required for the user interface")
+ ecbuild_critical("Qt not found - this is required for the user interface")
endif()
endif( ENABLE_QT5 )
@@ -516,8 +517,8 @@ if( ENABLE_UI )
if( ENABLE_MOTIF )
find_package(Motif REQUIRED)
if(MOTIF_FOUND)
- message(STATUS "MOTIF_INCLUDE_DIR: " ${MOTIF_INCLUDE_DIR})
- message(STATUS "MOTIF_LIBRARIES: " ${MOTIF_LIBRARIES})
+ ecbuild_debug("MOTIF_INCLUDE_DIR: ${MOTIF_INCLUDE_DIR}")
+ ecbuild_debug("MOTIF_LIBRARIES: ${MOTIF_LIBRARIES}")
endif()
add_definitions( -DMETVIEW_MOTIF )
endif()
@@ -525,39 +526,39 @@ if( ENABLE_UI )
find_package(X11 REQUIRED)
if(X11_FOUND)
# hack? we want to use the R6 version if available
- message(STATUS "X11_INCLUDE_DIR: " ${X11_INCLUDE_DIR})
+ ecbuild_debug("X11_INCLUDE_DIR: ${X11_INCLUDE_DIR}")
set(X11_INCLUDE_DIR "/usr/X11R6/include;\;${X11_INCLUDE_DIR}")
- message(STATUS "X11_INCLUDE_DIR: " ${X11_INCLUDE_DIR})
- message(STATUS "X11_LIBRARIES: " ${X11_LIBRARIES})
+ ecbuild_debug("X11_INCLUDE_DIR: ${X11_INCLUDE_DIR}")
+ ecbuild_debug("X11_LIBRARIES: ${X11_LIBRARIES}")
if(X11_Xpm_FOUND)
- message(STATUS " X11_Xpm_INCLUDE_PATH: " ${X11_Xpm_INCLUDE_PATH})
- message(STATUS " X11_Xpm_LIB: " ${X11_Xpm_LIB} " (adding to X11_LIBRARIES)")
+ ecbuild_debug(" X11_Xpm_INCLUDE_PATH: ${X11_Xpm_INCLUDE_PATH}")
+ ecbuild_debug(" X11_Xpm_LIB: ${X11_Xpm_LIB} (adding to X11_LIBRARIES)")
list(APPEND X11_INCLUDE_DIR ${X11_Xpm_INCLUDE_PATH})
list(APPEND X11_LIBRARIES ${X11_Xpm_LIB})
endif()
# some platforms (e.g. openSUSE 13.1) also require libXt in the link command
if(X11_Xt_FOUND)
- message(STATUS " X11_Xt_INCLUDE_PATH: " ${X11_Xt_INCLUDE_PATH})
- message(STATUS " X11_Xt_LIB: " ${X11_Xt_LIB} " (adding to X11_LIBRARIES)")
+ ecbuild_debug(" X11_Xt_INCLUDE_PATH: ${X11_Xt_INCLUDE_PATH}")
+ ecbuild_debug(" X11_Xt_LIB: ${X11_Xt_LIB} (adding to X11_LIBRARIES)")
list(APPEND X11_INCLUDE_DIR ${X11_Xt_INCLUDE_PATH})
list(APPEND X11_LIBRARIES ${X11_Xt_LIB})
else()
- message(STATUS "NO X11 Xt found!!!!!!!")
+ ecbuild_warn("NO X11 Xt found!!!!!!!")
endif()
# some platforms (e.g. openSUSE 13.1) also require libXmu in the link command
if(X11_Xmu_FOUND)
- message(STATUS " X11_Xmu_INCLUDE_PATH: " ${X11_Xmu_INCLUDE_PATH})
- message(STATUS " X11_Xmu_LIB: " ${X11_Xmu_LIB} " (adding to X11_LIBRARIES)")
+ ecbuild_debug(" X11_Xmu_INCLUDE_PATH: ${X11_Xmu_INCLUDE_PATH}")
+ ecbuild_debug(" X11_Xmu_LIB: ${X11_Xmu_LIB} (adding to X11_LIBRARIES)")
list(APPEND X11_INCLUDE_DIR ${X11_Xmu_INCLUDE_PATH})
list(APPEND X11_LIBRARIES ${X11_Xmu_LIB})
else()
- message(STATUS "NO X11 Xmu found!!!!!!!")
+ ecbuild_warn("NO X11 Xmu found!!!!!!!")
endif()
else()
- message(STATUS "X11 NOT FOUND")
+ ecbuild_warn("X11 NOT FOUND")
endif()
set( METVIEW_GUI_BUILT true )
@@ -615,7 +616,7 @@ foreach( _tpl ${METVIEW_TPLS} )
list( APPEND METVIEW_EXTRA_DEFINITIONS ${${TPL}_DEFINITIONS} )
list( APPEND METVIEW_EXTRA_INCLUDE_DIRS ${${TPL}_INCLUDE_DIRS} )
list( APPEND METVIEW_EXTRA_LIBRARIES ${${TPL}_LIBRARIES} )
- message(STATUS "xTPL_LIBRARIES: ${TPL}_LIBRARIES")
+ ecbuild_debug("xTPL_LIBRARIES: ${TPL}_LIBRARIES")
endforeach()
@@ -632,11 +633,11 @@ endif()
endif()
-message(STATUS "METVIEW_EXTRA_DEFINITIONS => ${METVIEW_EXTRA_DEFINITIONS}")
-message(STATUS "METVIEW_EXTRA_INCLUDE_DIRS => ${METVIEW_EXTRA_INCLUDE_DIRS}")
-message(STATUS "METVIEW_EXTRA_LIBRARIES => ${METVIEW_EXTRA_LIBRARIES}")
-message(STATUS "STANDARD_METVIEW_LIBS => ${STANDARD_METVIEW_LIBS}")
-message(STATUS "LIBEMOS_LIBRARIES => ${LIBEMOS_LIBRARIES}")
+ecbuild_info("METVIEW_EXTRA_DEFINITIONS => ${METVIEW_EXTRA_DEFINITIONS}")
+ecbuild_info("METVIEW_EXTRA_INCLUDE_DIRS => ${METVIEW_EXTRA_INCLUDE_DIRS}")
+ecbuild_info("METVIEW_EXTRA_LIBRARIES => ${METVIEW_EXTRA_LIBRARIES}")
+ecbuild_info("STANDARD_METVIEW_LIBS => ${STANDARD_METVIEW_LIBS}")
+ecbuild_info("LIBEMOS_LIBRARIES => ${LIBEMOS_LIBRARIES}")
###get_directory_property( MAGICS_DEFINITIONS COMPILE_DEFINITIONS )
@@ -647,7 +648,7 @@ message(STATUS "LIBEMOS_LIBRARIES => ${LIBEMOS_LIBRARIES}")
###include_directories( ${METVIEW_INCLUDE_DIRS} ${METVIEW_EXTRA_INCLUDE_DIRS} )
set(METVIEW_STANDARD_INCLUDES ${METVIEW_STANDARD_INCLUDE_DIRS} ${METVIEW_EXTRA_INCLUDE_DIRS} )
link_directories( ${CMAKE_CURRENT_SOURCE_DIR}/lib )
-message(STATUS "METVIEW_STANDARD_INCLUDE_DIRS => ${METVIEW_STANDARD_INCLUDES}")
+ecbuild_info("METVIEW_STANDARD_INCLUDE_DIRS => ${METVIEW_STANDARD_INCLUDES}")
set( __metview_inc_tmp ${METVIEW_EXTRA_INCLUDE_DIRS} )
@@ -725,9 +726,7 @@ macro(metview_module_files)
set(multi_value_args ETC_FILES XPM_FILES SVG_FILES)
cmake_parse_arguments( PAR "${options}" "${single_value_args}" "${multi_value_args}" ${_FIRST_ARG} ${ARGN} )
- #message(STATUS "bbb ${PAR_ETC_FILES} ccc")
foreach( etc ${PAR_ETC_FILES} )
- #message(STATUS "a ${etc}")
# copy to the build 'etc' directory
configure_file(${etc} ${CMAKE_BINARY_DIR}/share/metview/etc/ COPYONLY)
@@ -743,18 +742,14 @@ macro(metview_module_files)
if(${etc} MATCHES ObjectSpec*)
set(ModuleObjectSpecFiles ${ModuleObjectSpecFiles} ${CMAKE_BINARY_DIR}/share/metview/etc/${etc})
set(ModuleObjectSpecFiles ${ModuleObjectSpecFiles} PARENT_SCOPE) # make it visible outside
- #message(STATUS "MOSF: ${ModuleObjectSpecFiles} ${etc}")
endif()
endforeach()
- #message(STATUS "eeee ${PAR_XPM_FILES} ffff")
foreach( xpm ${PAR_XPM_FILES} )
- #message(STATUS "g ${xpm}")
# copy to the build 'etc' directory
set(ModuleXpmFiles ${ModuleXpmFiles} ${CMAKE_CURRENT_SOURCE_DIR}/${xpm})
set(ModuleXpmFiles ${ModuleXpmFiles} PARENT_SCOPE)
- #message(STATUS "xpm: ${xpm}")
#configure_file(${xpm} ${CMAKE_BINARY_DIR}/share/metview/icons/ COPYONLY)
@@ -801,7 +796,7 @@ macro(metview_script_files)
${CMAKE_SOURCE_DIR}/../metview-ecmwf-configs )
if( NOT SCRIPT_${script} )
- message( FATAL_ERROR "Could not find script ${script}. Specify the path to the script with -DEXTRA_CONFIG_PATH=..." )
+ ecbuild_critical( "Could not find script ${script}. Specify the path to the script with -DEXTRA_CONFIG_PATH=...")
else()
ecbuild_debug("metview_script_files: found ${script} at ${SCRIPT_${script}}")
endif()
@@ -917,7 +912,7 @@ ecbuild_dont_pack(FILES "share/metview/grib_seed" )
#list( APPEND ECBUILD_DONT_PACK_FILES "${CMAKE_SOURCE_DIR}/src/Traj" )
#list( APPEND ECBUILD_DONT_PACK_FILES "${CMAKE_SOURCE_DIR}/share/metview/grib_seed" )
-#message(STATUS "NOPACK: ${ECBUILD_DONT_PACK_FILES}")
+#ecbuild_debug("NOPACK: ${ECBUILD_DONT_PACK_FILES}")
#CPACK_SOURCE_IGNORE_FILES
@@ -930,7 +925,7 @@ ecbuild_dont_pack(FILES "share/metview/grib_seed" )
# print all variables
#get_cmake_property(_variableNames VARIABLES)
#foreach (_variableName ${_variableNames})
-# message(STATUS "${_variableName}=${${_variableName}}")
+# ecbuild_debug("${_variableName}=${${_variableName}}")
#endforeach()
diff --git a/VERSION.cmake b/VERSION.cmake
index 892031e..0f93ad4 100644
--- a/VERSION.cmake
+++ b/VERSION.cmake
@@ -1,5 +1,5 @@
set(${PROJECT_NAME}_MAJOR_VERSION_STR "4")
set(${PROJECT_NAME}_MINOR_VERSION_STR "6")
-set(${PROJECT_NAME}_REVISION_VERSION_STR "5")
+set(${PROJECT_NAME}_REVISION_VERSION_STR "6")
set(${PROJECT_NAME}_VERSION_STR "${${PROJECT_NAME}_MAJOR_VERSION_STR}.${${PROJECT_NAME}_MINOR_VERSION_STR}.${${PROJECT_NAME}_REVISION_VERSION_STR}")
diff --git a/VERSION.cmake.orig b/VERSION.cmake.orig
deleted file mode 100644
index 26d3b78..0000000
--- a/VERSION.cmake.orig
+++ /dev/null
@@ -1,9 +0,0 @@
-set(${PROJECT_NAME}_MAJOR_VERSION_STR "4")
-set(${PROJECT_NAME}_MINOR_VERSION_STR "6")
-<<<<<<< HEAD
-set(${PROJECT_NAME}_REVISION_VERSION_STR "4")
-=======
-set(${PROJECT_NAME}_REVISION_VERSION_STR "5")
->>>>>>> release/4.6.5
-
-set(${PROJECT_NAME}_VERSION_STR "${${PROJECT_NAME}_MAJOR_VERSION_STR}.${${PROJECT_NAME}_MINOR_VERSION_STR}.${${PROJECT_NAME}_REVISION_VERSION_STR}")
diff --git a/bin/CMakeLists.txt b/bin/CMakeLists.txt
index 24a12cf..93cef4e 100644
--- a/bin/CMakeLists.txt
+++ b/bin/CMakeLists.txt
@@ -1,3 +1 @@
-if( ENABLE_INSTALL )
- install( PROGRAMS ecbuild DESTINATION ${INSTALL_BIN_DIR} )
-endif()
+install( PROGRAMS ecbuild DESTINATION ${INSTALL_BIN_DIR} )
diff --git a/cmake/CheckFortranSourceCompiles.cmake b/cmake/CheckFortranSourceCompiles.cmake
index 4303315..d3dc968 100644
--- a/cmake/CheckFortranSourceCompiles.cmake
+++ b/cmake/CheckFortranSourceCompiles.cmake
@@ -38,7 +38,7 @@ if( ${VAR} MATCHES "^${VAR}$" )
elseif(_key)
list(APPEND _${_key} "${arg}")
else()
- message(FATAL_ERROR "Unknown argument:\n ${arg}\n")
+ ecbuild_critical("Unknown argument:\n ${arg}\n")
endif()
endforeach()
set(MACRO_CHECK_FUNCTION_DEFINITIONS
@@ -58,7 +58,7 @@ if( ${VAR} MATCHES "^${VAR}$" )
file(WRITE "${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/src.f90"
"${SOURCE}\n")
- message(STATUS "Performing Test ${VAR}")
+ ecbuild_debug("Performing Test ${VAR}")
try_compile(${VAR}
${CMAKE_BINARY_DIR}
${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/src.f90
@@ -76,13 +76,13 @@ if( ${VAR} MATCHES "^${VAR}$" )
if(${VAR})
set(${VAR} 1 CACHE INTERNAL "Test ${VAR}")
- message(STATUS "Performing Test ${VAR} - Success")
+ ecbuild_debug("Performing Test ${VAR} - Success")
file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log
"Performing Fortran SOURCE FILE Test ${VAR} succeded with the following output:\n"
"${OUTPUT}\n"
"Source file was:\n${SOURCE}\n")
else()
- message(STATUS "Performing Test ${VAR} - Failed")
+ ecbuild_debug("Performing Test ${VAR} - Failed")
set(${VAR} "" CACHE INTERNAL "Test ${VAR}")
file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log
"Performing Fortran SOURCE FILE Test ${VAR} failed with the following output:\n"
diff --git a/cmake/FindADSM.cmake b/cmake/FindADSM.cmake
index 7af6723..b46e798 100644
--- a/cmake/FindADSM.cmake
+++ b/cmake/FindADSM.cmake
@@ -1,4 +1,4 @@
-# (C) Copyright 1996-2015 ECMWF.
+# (C) Copyright 1996-2016 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.
diff --git a/cmake/FindAEC.cmake b/cmake/FindAEC.cmake
index 8a59037..767544f 100644
--- a/cmake/FindAEC.cmake
+++ b/cmake/FindAEC.cmake
@@ -1,4 +1,4 @@
-# (C) Copyright 1996-2015 ECMWF.
+# (C) Copyright 1996-2016 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.
diff --git a/cmake/FindAIO.cmake b/cmake/FindAIO.cmake
index c27b795..76e357a 100644
--- a/cmake/FindAIO.cmake
+++ b/cmake/FindAIO.cmake
@@ -1,4 +1,4 @@
-# (C) Copyright 1996-2015 ECMWF.
+# (C) Copyright 1996-2016 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.
diff --git a/cmake/FindArmadillo.cmake b/cmake/FindArmadillo.cmake
index a3628a5..4ef1a4a 100644
--- a/cmake/FindArmadillo.cmake
+++ b/cmake/FindArmadillo.cmake
@@ -1,4 +1,4 @@
-# (C) Copyright 1996-2015 ECMWF.
+# (C) Copyright 1996-2016 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.
@@ -34,9 +34,10 @@ set( ARMADILLO_INCLUDE_DIRS ${ARMADILLO_INCLUDE_DIR} )
include(FindPackageHandleStandardArgs)
-# handle the QUIETLY and REQUIRED arguments and set ARMADILLO_FOUND to TRUE
+# handle the QUIET and REQUIRED arguments and set ARMADILLO_FOUND to TRUE
# if all listed variables are TRUE
-find_package_handle_standard_args(ARMADILLO DEFAULT_MSG
+# Note: capitalisation of the package name must be the same as in the file name
+find_package_handle_standard_args(Armadillo DEFAULT_MSG
ARMADILLO_LIBRARY ARMADILLO_INCLUDE_DIR)
mark_as_advanced(ARMADILLO_INCLUDE_DIR ARMADILLO_LIBRARY )
diff --git a/cmake/FindCMath.cmake b/cmake/FindCMath.cmake
index cf80f85..b8a2a0b 100644
--- a/cmake/FindCMath.cmake
+++ b/cmake/FindCMath.cmake
@@ -1,4 +1,4 @@
-# (C) Copyright 1996-2015 ECMWF.
+# (C) Copyright 1996-2016 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.
@@ -10,14 +10,17 @@
# CMATH_LIBRARIES = the library to link against (RT etc)
IF(UNIX)
- if( DEFINED CMATH_PATH )
+ if( DEFINED CMATH_PATH )
find_library(CMATH_LIBRARIES m PATHS ${CMATH_PATH}/lib NO_DEFAULT_PATH )
- endif()
+ endif()
- find_library(CMATH_LIBRARIES m )
+ find_library(CMATH_LIBRARIES m )
- include(FindPackageHandleStandardArgs)
+ include(FindPackageHandleStandardArgs)
- find_package_handle_standard_args(CMATH DEFAULT_MSG CMATH_LIBRARIES )
+ # handle the QUIET and REQUIRED arguments and set CMATH_FOUND to TRUE
+ # if all listed variables are TRUE
+ # Note: capitalisation of the package name must be the same as in the file name
+ find_package_handle_standard_args(CMath DEFAULT_MSG CMATH_LIBRARIES )
ENDIF(UNIX)
diff --git a/cmake/FindCairo.cmake b/cmake/FindCairo.cmake
index 7b3d47e..4298a1d 100644
--- a/cmake/FindCairo.cmake
+++ b/cmake/FindCairo.cmake
@@ -50,9 +50,10 @@ set( CAIRO_INCLUDE_DIRS ${CAIRO_INCLUDE_DIR} )
include(FindPackageHandleStandardArgs)
-# handle the QUIETLY and REQUIRED arguments and set GRIBAPI_FOUND to TRUE
+# handle the QUIET and REQUIRED arguments and set CAIRO_FOUND to TRUE
# if all listed variables are TRUE
-find_package_handle_standard_args(CAIRO DEFAULT_MSG
+# Note: capitalisation of the package name must be the same as in the file name
+find_package_handle_standard_args(Cairo DEFAULT_MSG
CAIRO_LIBRARY CAIRO_INCLUDE_DIR)
mark_as_advanced( CAIRO_INCLUDE_DIR CAIRO_LIBRARY )
diff --git a/cmake/FindDl.cmake b/cmake/FindDl.cmake
index 30db9c6..16463c6 100644
--- a/cmake/FindDl.cmake
+++ b/cmake/FindDl.cmake
@@ -1,4 +1,4 @@
-# © Copyright 1996-2015 ECMWF.
+# © Copyright 1996-2016 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.
@@ -17,4 +17,7 @@ find_library(DL_LIBRARIES dl )
include(FindPackageHandleStandardArgs)
-find_package_handle_standard_args(DL DEFAULT_MSG DL_LIBRARIES )
+# handle the QUIET and REQUIRED arguments and set DL_FOUND to TRUE
+# if all listed variables are TRUE
+# Note: capitalisation of the package name must be the same as in the file name
+find_package_handle_standard_args(Dl DEFAULT_MSG DL_LIBRARIES )
diff --git a/cmake/FindEMOS.cmake b/cmake/FindEMOS.cmake
index 70028ca..c549fc2 100644
--- a/cmake/FindEMOS.cmake
+++ b/cmake/FindEMOS.cmake
@@ -1,4 +1,4 @@
-# (C) Copyright 1996-2015 ECMWF.
+# (C) Copyright 1996-2016 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.
diff --git a/cmake/FindFDB.cmake b/cmake/FindFDB.cmake
index 9608a54..4bcbdf3 100644
--- a/cmake/FindFDB.cmake
+++ b/cmake/FindFDB.cmake
@@ -1,4 +1,4 @@
-# (C) Copyright 1996-2015 ECMWF.
+# (C) Copyright 1996-2016 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.
diff --git a/cmake/FindGeoTIFF.cmake b/cmake/FindGeoTIFF.cmake
index f4f3b53..83c868c 100644
--- a/cmake/FindGeoTIFF.cmake
+++ b/cmake/FindGeoTIFF.cmake
@@ -31,7 +31,8 @@ IF(GEOTIFF_FOUND)
SET(GEOTIFF_LIBRARIES ${GEOTIFF_LIBRARY})
ENDIF()
-# Handle the QUIETLY and REQUIRED arguments and set SPATIALINDEX_FOUND to TRUE
+# Handle the QUIET and REQUIRED arguments and set GEOTIFF_FOUND to TRUE
# if all listed variables are TRUE
+# Note: capitalisation of the package name must be the same as in the file name
INCLUDE(FindPackageHandleStandardArgs)
-FIND_PACKAGE_HANDLE_STANDARD_ARGS(GEOTIFF DEFAULT_MSG GEOTIFF_LIBRARY GEOTIFF_INCLUDE_DIR)
+FIND_PACKAGE_HANDLE_STANDARD_ARGS(GEOTiff DEFAULT_MSG GEOTIFF_LIBRARY GEOTIFF_INCLUDE_DIR)
diff --git a/cmake/FindHPSS.cmake b/cmake/FindHPSS.cmake
index a96b8d4..b2b662b 100644
--- a/cmake/FindHPSS.cmake
+++ b/cmake/FindHPSS.cmake
@@ -1,4 +1,4 @@
-# (C) Copyright 1996-2015 ECMWF.
+# (C) Copyright 1996-2016 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.
diff --git a/cmake/FindLEX.cmake b/cmake/FindLEX.cmake
index 00335c2..221868f 100644
--- a/cmake/FindLEX.cmake
+++ b/cmake/FindLEX.cmake
@@ -44,7 +44,7 @@
# This file is based on the FindFLEX CMake macro, and adapted by ECMWF
#=============================================================================
-# (C) Copyright 1996-2015 ECMWF.
+# (C) Copyright 1996-2016 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.
diff --git a/cmake/FindLegacyFDB.cmake b/cmake/FindLegacyFDB.cmake
deleted file mode 100644
index f461a0e..0000000
--- a/cmake/FindLegacyFDB.cmake
+++ /dev/null
@@ -1,35 +0,0 @@
-# (C) Copyright 1996-2015 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.
-
-# - Try to find FDB
-# Once done this will define
-# LEGACY_FDB_FOUND - System has FDB
-# LEGACY_FDB_INCLUDE_DIRS - The FDB include directories
-# LEGACY_FDB_LIBRARIES - The libraries needed to use FDB
-
-
-if( NOT LEGACY_FDB_FOUND )
-
- if( DEFINED LEGACY_FDB_PATH )
- find_library( LEGACY_FDB_LIBRARY NAMES fdb_legacy PATHS ${LEGACY_FDB_PATH} ${LEGACY_FDB_PATH}/lib NO_DEFAULT_PATH)
- endif()
-
- find_library( LEGACY_FDB_LIBRARY NAMES fdb_legacy )
-
- set( LEGACY_FDB_LIBRARIES ${LEGACY_FDB_LIBRARY} )
-
- include(FindPackageHandleStandardArgs)
-
- # handle the QUIETLY and REQUIRED arguments and set LEGACY_FDB_FOUND to TRUE
- # if all listed variables are TRUE
- find_package_handle_standard_args(LEGACY_FDB DEFAULT_MSG
- LEGACY_FDB_LIBRARY )
-
- mark_as_advanced(LEGACY_FDB_LIBRARY)
-
-endif()
diff --git a/cmake/FindLibGFortran.cmake b/cmake/FindLibGFortran.cmake
index 95b6036..a293ea5 100644
--- a/cmake/FindLibGFortran.cmake
+++ b/cmake/FindLibGFortran.cmake
@@ -1,4 +1,4 @@
-# © Copyright 1996-2015 ECMWF.
+# © Copyright 1996-2016 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.
@@ -47,6 +47,7 @@ endif()
include(FindPackageHandleStandardArgs)
-find_package_handle_standard_args( LIBGFORTRAN DEFAULT_MSG GFORTRAN_LIBRARIES )
-
-
+# Handle the QUIET and REQUIRED arguments and set LIBGFORTRAN_FOUND to TRUE
+# if all listed variables are TRUE
+# Note: capitalisation of the package name must be the same as in the file name
+find_package_handle_standard_args( LibGFortran DEFAULT_MSG GFORTRAN_LIBRARIES )
diff --git a/cmake/FindLibIFort.cmake b/cmake/FindLibIFort.cmake
index e1d82ee..da782a4 100644
--- a/cmake/FindLibIFort.cmake
+++ b/cmake/FindLibIFort.cmake
@@ -1,4 +1,4 @@
-# © Copyright 1996-2015 ECMWF.
+# © Copyright 1996-2016 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.
@@ -44,4 +44,7 @@ endif()
include(FindPackageHandleStandardArgs)
-find_package_handle_standard_args( LIBIFORT DEFAULT_MSG IFORT_LIBRARIES )
+# Handle the QUIET and REQUIRED arguments and set LIBIFORT_FOUND to TRUE
+# if all listed variables are TRUE
+# Note: capitalisation of the package name must be the same as in the file name
+find_package_handle_standard_args( LibIFort DEFAULT_MSG IFORT_LIBRARIES )
diff --git a/cmake/FindMKL.cmake b/cmake/FindMKL.cmake
index fe182a4..1123234 100644
--- a/cmake/FindMKL.cmake
+++ b/cmake/FindMKL.cmake
@@ -1,4 +1,4 @@
-# (C) Copyright 1996-2015 ECMWF.
+# (C) Copyright 1996-2016 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.
diff --git a/cmake/FindNDBM.cmake b/cmake/FindNDBM.cmake
index 5203ee9..869223f 100644
--- a/cmake/FindNDBM.cmake
+++ b/cmake/FindNDBM.cmake
@@ -1,4 +1,4 @@
-# (C) Copyright 1996-2015 ECMWF.
+# (C) Copyright 1996-2016 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.
diff --git a/cmake/FindNetCDF.cmake b/cmake/FindNetCDF.cmake
index 822ecf0..9084549 100644
--- a/cmake/FindNetCDF.cmake
+++ b/cmake/FindNetCDF.cmake
@@ -1,4 +1,4 @@
-# (C) Copyright 1996-2015 ECMWF.
+# (C) Copyright 1996-2016 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.
diff --git a/cmake/FindNetCDF3.cmake b/cmake/FindNetCDF3.cmake
index 40e6bc0..5519fd6 100644
--- a/cmake/FindNetCDF3.cmake
+++ b/cmake/FindNetCDF3.cmake
@@ -1,4 +1,4 @@
-# (C) Copyright 1996-2015 ECMWF.
+# (C) Copyright 1996-2016 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.
@@ -104,7 +104,10 @@ if( NETCDF_FIND_REQUIRED )
set( NETCDF3_FIND_REQUIRED ${NETCDF_FIND_REQUIRED} )
endif()
-find_package_handle_standard_args( NETCDF3 DEFAULT_MSG ${NETCDF_REQUIRED_VARS} )
+# Handle the QUIET and REQUIRED arguments and set NETCDF3_FOUND to TRUE
+# if all listed variables are TRUE
+# Note: capitalisation of the package name must be the same as in the file name
+find_package_handle_standard_args( NetCDF3 DEFAULT_MSG ${NETCDF_REQUIRED_VARS} )
set( NETCDF_FOUND ${NETCDF3_FOUND} )
diff --git a/cmake/FindODB.cmake b/cmake/FindODB.cmake
index 3a1fa12..1beb5c8 100644
--- a/cmake/FindODB.cmake
+++ b/cmake/FindODB.cmake
@@ -1,4 +1,4 @@
-# © Copyright 1996-2015 ECMWF.
+# © Copyright 1996-2016 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.
diff --git a/cmake/FindOpenCL.cmake b/cmake/FindOpenCL.cmake
index e4e9556..9b6e978 100644
--- a/cmake/FindOpenCL.cmake
+++ b/cmake/FindOpenCL.cmake
@@ -1,4 +1,4 @@
-# (C) Copyright 1996-2015 ECMWF.
+# (C) Copyright 1996-2016 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.
@@ -61,7 +61,10 @@ endif()
include(FindPackageHandleStandardArgs)
-find_package_handle_standard_args( OPENCL DEFAULT_MSG
+# Handle the QUIET and REQUIRED arguments and set OPENCL_FOUND to TRUE
+# if all listed variables are TRUE
+# Note: capitalisation of the package name must be the same as in the file name
+find_package_handle_standard_args( OpenCL DEFAULT_MSG
OPENCL_LIBRARIES OPENCL_INCLUDE_DIRS )
mark_as_advanced( OPENCL_INCLUDE_DIRS OPENCL_LIBRARIES )
diff --git a/cmake/FindOpenJPEG.cmake b/cmake/FindOpenJPEG.cmake
index 82d19fb..805f091 100644
--- a/cmake/FindOpenJPEG.cmake
+++ b/cmake/FindOpenJPEG.cmake
@@ -1,4 +1,4 @@
-# (C) Copyright 1996-2015 ECMWF.
+# (C) Copyright 1996-2016 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.
diff --git a/cmake/FindPGIFortran.cmake b/cmake/FindPGIFortran.cmake
index 7308e49..e68bdf6 100644
--- a/cmake/FindPGIFortran.cmake
+++ b/cmake/FindPGIFortran.cmake
@@ -1,4 +1,4 @@
-# (C) Copyright 1996-2015 ECMWF.
+# (C) Copyright 1996-2016 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.
@@ -35,12 +35,15 @@ endforeach()
include(FindPackageHandleStandardArgs)
-find_package_handle_standard_args( LIBPGIFORTRAN DEFAULT_MSG pgi_fortran_all_libs_found PGIFORTRAN_LIBRARIES )
+# Handle the QUIET and REQUIRED arguments and set PGIFORTRAN_FOUND to TRUE
+# if all listed variables are TRUE
+# Note: capitalisation of the package name must be the same as in the file name
+find_package_handle_standard_args( PGIFortran DEFAULT_MSG pgi_fortran_all_libs_found PGIFORTRAN_LIBRARIES )
-if( LIBPGIFORTRAN_FOUND )
+if( PGIFORTRAN_FOUND )
find_package( Realtime )
endif()
if( REALTIME_FOUND )
- set( LIBPGIFORTRAN_LIBRARIES ${PGIFORTRAN_LIBRARIES} ${RT_LIB} )
+ set( PGIFORTRAN_LIBRARIES ${PGIFORTRAN_LIBRARIES} ${RT_LIB} )
endif()
diff --git a/cmake/FindPango.cmake b/cmake/FindPango.cmake
index 9f183b9..76e152a 100644
--- a/cmake/FindPango.cmake
+++ b/cmake/FindPango.cmake
@@ -1,4 +1,4 @@
-# (C) Copyright 1996-2015 ECMWF.
+# (C) Copyright 1996-2016 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.
@@ -23,9 +23,11 @@ ecbuild_debug_var( PC_LIBPANGO_LIBRARIES )
ecbuild_debug_var( PC_LIBPANGO_INCLUDE_DIRS )
include(FindPackageHandleStandardArgs)
-find_package_handle_standard_args( pango DEFAULT_MSG PC_LIBPANGO_LIBRARIES PC_LIBPANGO_INCLUDE_DIRS )
+# Handle the QUIET and REQUIRED arguments and set PANGO_FOUND to TRUE
+# if all listed variables are TRUE
+# Note: capitalisation of the package name must be the same as in the file name
+find_package_handle_standard_args( Pango DEFAULT_MSG PC_LIBPANGO_LIBRARIES PC_LIBPANGO_INCLUDE_DIRS )
set( PANGO_VERSION ${PC_LIBPANGO_VERSION} )
set( PANGO_LIBRARIES ${PC_LIBPANGO_LIBRARIES} )
set( PANGO_INCLUDE_DIRS ${PC_LIBPANGO_INCLUDE_DIRS} )
-
diff --git a/cmake/FindPangoCairo.cmake b/cmake/FindPangoCairo.cmake
index 7d7750e..9979550 100644
--- a/cmake/FindPangoCairo.cmake
+++ b/cmake/FindPangoCairo.cmake
@@ -1,4 +1,4 @@
-# (C) Copyright 1996-2015 ECMWF.
+# (C) Copyright 1996-2016 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.
@@ -28,7 +28,10 @@ pkg_check_modules(PC_LIBPANGOCAIRO QUIET pangocairo)
if(PC_LIBPANGOCAIRO_FOUND)
include(FindPackageHandleStandardArgs)
- find_package_handle_standard_args( pangocairo DEFAULT_MSG PC_LIBPANGOCAIRO_LIBRARIES PC_LIBPANGOCAIRO_INCLUDE_DIRS )
+ # Handle the QUIET and REQUIRED arguments and set PANGOCAIRO_FOUND to TRUE
+ # if all listed variables are TRUE
+ # Note: capitalisation of the package name must be the same as in file name
+ find_package_handle_standard_args( PangoCairo DEFAULT_MSG PC_LIBPANGOCAIRO_LIBRARIES PC_LIBPANGOCAIRO_INCLUDE_DIRS )
set( PANGOCAIRO_VERSION ${PC_LIBPANGOCAIRO_VERSION} )
set( PANGOCAIRO_LIBRARIES "${PC_LIBPANGOCAIRO_LDFLAGS} ${PC_LIBPANGOCAIRO_LDFLAGS_OTHER}" )
set( PANGOCAIRO_INCLUDE_DIRS ${PC_LIBPANGOCAIRO_INCLUDE_DIRS} )
@@ -69,8 +72,6 @@ else()
${X11_INCLUDE_DIR}
)
-#message(WARNING "===> ${PANGOCAIRO_INCLUDE_DIRS}")
-
find_library( _PANGOCAIRO_LIBRARIES NAMES pangocairo pangocairo-${PANGO_VERSION})
find_library( _PANGO_LIBRARIES NAMES pango pango-${PANGO_VERSION})
find_library( _CAIRO_LIBRARIES NAMES cairo)
@@ -84,11 +85,12 @@ else()
${X11_LIBRARIES}
)
-#message(WARNING "===> ${PANGOCAIRO_LIBRARIES}")
-
- find_package_handle_standard_args( pangocairo DEFAULT_MSG
- PANGOCAIRO_LIBRARIES
- PANGOCAIRO_INCLUDE_DIRS )
+ # Handle the QUIET and REQUIRED arguments and set PANGOCAIRO_FOUND to TRUE
+ # if all listed variables are TRUE
+ # Note: capitalisation of the package name must be the same as in file name
+ find_package_handle_standard_args( PangoCairo DEFAULT_MSG
+ PANGOCAIRO_LIBRARIES
+ PANGOCAIRO_INCLUDE_DIRS )
endif()
diff --git a/cmake/FindProj4.cmake b/cmake/FindProj4.cmake
index 64eab79..a3560b2 100644
--- a/cmake/FindProj4.cmake
+++ b/cmake/FindProj4.cmake
@@ -60,7 +60,7 @@ find_library( PROJ4_LIBRARY NAMES proj PATHS PATH_SUFFIXES proj4 )
# handle the QUIETLY and REQUIRED arguments and set GRIBAPI_FOUND
include(FindPackageHandleStandardArgs)
-find_package_handle_standard_args(PROJ4 DEFAULT_MSG
+find_package_handle_standard_args(Proj4 DEFAULT_MSG
PROJ4_LIBRARY PROJ4_INCLUDE_DIR)
set( PROJ4_LIBRARIES ${PROJ4_LIBRARY} )
diff --git a/cmake/FindREADLINE.cmake b/cmake/FindREADLINE.cmake
index c6ae778..2ba08b4 100644
--- a/cmake/FindREADLINE.cmake
+++ b/cmake/FindREADLINE.cmake
@@ -1,4 +1,4 @@
-# (C) Copyright 1996-2015 ECMWF.
+# (C) Copyright 1996-2016 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.
diff --git a/cmake/FindRPCGEN.cmake b/cmake/FindRPCGEN.cmake
index 3e25daf..fd42e9f 100644
--- a/cmake/FindRPCGEN.cmake
+++ b/cmake/FindRPCGEN.cmake
@@ -1,4 +1,4 @@
-# (C) Copyright 1996-2015 ECMWF.
+# (C) Copyright 1996-2016 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.
diff --git a/cmake/FindRealtime.cmake b/cmake/FindRealtime.cmake
index 2c2a7b2..843a54f 100644
--- a/cmake/FindRealtime.cmake
+++ b/cmake/FindRealtime.cmake
@@ -1,4 +1,4 @@
-# (C) Copyright 1996-2015 ECMWF.
+# (C) Copyright 1996-2016 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.
@@ -18,5 +18,7 @@ find_library( RT_LIB rt )
mark_as_advanced( RT_LIB )
include(FindPackageHandleStandardArgs)
-
-find_package_handle_standard_args(REALTIME DEFAULT_MSG RT_LIB )
+# Handle the QUIET and REQUIRED arguments and set REALTIME_FOUND to TRUE
+# if all listed variables are TRUE
+# Note: capitalisation of the package name must be the same as in the file name
+find_package_handle_standard_args(Realtime DEFAULT_MSG RT_LIB )
diff --git a/cmake/FindSZip.cmake b/cmake/FindSZip.cmake
index 6e9b1a2..925348c 100644
--- a/cmake/FindSZip.cmake
+++ b/cmake/FindSZip.cmake
@@ -1,4 +1,4 @@
-# (C) Copyright 1996-2015 ECMWF.
+# (C) Copyright 1996-2016 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.
diff --git a/cmake/FindTrilinos.cmake b/cmake/FindTrilinos.cmake
index a1cabce..0d99b54 100644
--- a/cmake/FindTrilinos.cmake
+++ b/cmake/FindTrilinos.cmake
@@ -1,4 +1,4 @@
-# (C) Copyright 1996-2015 ECMWF.
+# (C) Copyright 1996-2016 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.
diff --git a/cmake/FindViennaCL.cmake b/cmake/FindViennaCL.cmake
index a1b1eb9..aba2980 100644
--- a/cmake/FindViennaCL.cmake
+++ b/cmake/FindViennaCL.cmake
@@ -1,4 +1,4 @@
-# (C) Copyright 1996-2015 ECMWF.
+# (C) Copyright 1996-2016 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.
@@ -30,9 +30,10 @@ set( VIENNACL_INCLUDE_DIRS ${VIENNACL_INCLUDE_DIR} )
include(FindPackageHandleStandardArgs)
-# handle the QUIETLY and REQUIRED arguments and set VIENNACL_FOUND to TRUE
+# handle the QUIET and REQUIRED arguments and set VIENNACL_FOUND to TRUE
# if all listed variables are valid
-find_package_handle_standard_args(VIENNACL DEFAULT_MSG
+# Note: capitalisation of the package name must be the same as in the file name
+find_package_handle_standard_args(ViennaCL DEFAULT_MSG
VIENNACL_INCLUDE_DIR)
mark_as_advanced(VIENNACL_INCLUDE_DIRS)
diff --git a/cmake/FindXLFortranLibs.cmake b/cmake/FindXLFortranLibs.cmake
index 10a68aa..37800c7 100644
--- a/cmake/FindXLFortranLibs.cmake
+++ b/cmake/FindXLFortranLibs.cmake
@@ -1,4 +1,4 @@
-# © Copyright 1996-2015 ECMWF.
+# © Copyright 1996-2016 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.
@@ -27,8 +27,10 @@ foreach( lib ${xl_libs} )
endforeach()
include(FindPackageHandleStandardArgs)
-
-find_package_handle_standard_args( LIBXLFORTRAN DEFAULT_MSG xlf_all_libs_found XLFORTRAN_LIBRARIES )
+# handle the QUIET and REQUIRED arguments and set XLFORTRANLIBS_FOUND to TRUE
+# if all listed variables are valid
+# Note: capitalisation of the package name must be the same as in the file name
+find_package_handle_standard_args( XLFortranLibs DEFAULT_MSG xlf_all_libs_found XLFORTRAN_LIBRARIES )
# HACK for support libraries
diff --git a/cmake/FindYACC.cmake b/cmake/FindYACC.cmake
index a410c6f..7b15bfe 100644
--- a/cmake/FindYACC.cmake
+++ b/cmake/FindYACC.cmake
@@ -41,7 +41,7 @@
# This file is based on the FindFLEX CMake macro, and adapted by ECMWF
#=============================================================================
-# (C) Copyright 1996-2015 ECMWF.
+# (C) Copyright 1996-2016 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.
diff --git a/cmake/Findgrib_api.cmake b/cmake/Findgrib_api.cmake
index 3150039..ab6fc0b 100644
--- a/cmake/Findgrib_api.cmake
+++ b/cmake/Findgrib_api.cmake
@@ -1,4 +1,4 @@
-# (C) Copyright 1996-2015 ECMWF.
+# (C) Copyright 1996-2016 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.
diff --git a/cmake/Findodb_api.cmake b/cmake/Findodb_api.cmake
index 2b8e800..0058fbe 100644
--- a/cmake/Findodb_api.cmake
+++ b/cmake/Findodb_api.cmake
@@ -1,4 +1,4 @@
-# (C) Copyright 1996-2015 ECMWF.
+# (C) Copyright 1996-2016 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.
diff --git a/cmake/Findspot.cmake b/cmake/Findspot.cmake
index cad0e33..52e0fb5 100644
--- a/cmake/Findspot.cmake
+++ b/cmake/Findspot.cmake
@@ -1,4 +1,4 @@
-# (C) Copyright 1996-2015 ECMWF.
+# (C) Copyright 1996-2016 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.
diff --git a/cmake/VERSION.cmake b/cmake/VERSION.cmake
index e7ac9ad..a65cc6d 100644
--- a/cmake/VERSION.cmake
+++ b/cmake/VERSION.cmake
@@ -1,7 +1,7 @@
set( ECBUILD_MAJOR_VERSION "2" )
-set( ECBUILD_MINOR_VERSION "0" )
+set( ECBUILD_MINOR_VERSION "2" )
set( ECBUILD_PATCH_VERSION "0" )
-set( ECBUILD_VERSION_STR "2.0.0" )
+set( ECBUILD_VERSION_STR "2.2.0" )
set( ECBUILD_MACRO_VERSION "${ECBUILD_MAJOR_VERSION}.${ECBUILD_MINOR_VERSION}" )
diff --git a/cmake/compiler_flags/PGI_C.cmake b/cmake/compiler_flags/PGI_C.cmake
index 8cbf6e1..6784a14 100644
--- a/cmake/compiler_flags/PGI_C.cmake
+++ b/cmake/compiler_flags/PGI_C.cmake
@@ -1,4 +1,4 @@
-# (C) Copyright 1996-2015 ECMWF.
+# (C) Copyright 1996-2016 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.
diff --git a/cmake/compiler_flags/PGI_CXX.cmake b/cmake/compiler_flags/PGI_CXX.cmake
index f97098e..877ef3f 100644
--- a/cmake/compiler_flags/PGI_CXX.cmake
+++ b/cmake/compiler_flags/PGI_CXX.cmake
@@ -1,4 +1,4 @@
-# (C) Copyright 1996-2015 ECMWF.
+# (C) Copyright 1996-2016 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.
diff --git a/cmake/compiler_flags/PGI_Fortran.cmake b/cmake/compiler_flags/PGI_Fortran.cmake
index a777947..a268cc9 100644
--- a/cmake/compiler_flags/PGI_Fortran.cmake
+++ b/cmake/compiler_flags/PGI_Fortran.cmake
@@ -1,4 +1,4 @@
-# (C) Copyright 1996-2015 ECMWF.
+# (C) Copyright 1996-2016 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.
diff --git a/cmake/contrib/FindFFTW.cmake b/cmake/contrib/FindFFTW.cmake
index d76767b..5ef46df 100644
--- a/cmake/contrib/FindFFTW.cmake
+++ b/cmake/contrib/FindFFTW.cmake
@@ -1,22 +1,60 @@
-# - Find the FFTW library
-#
-# Usage:
-# find_package(FFTW [REQUIRED] [QUIET] )
-#
-# It sets the following variables:
-# FFTW_FOUND ... true if fftw is found on the system
-# FFTW_LIBRARIES ... full path to fftw library
-# FFTW_INCLUDES ... fftw include directory
-#
-# The following variables will be checked by the function
-# FFTW_USE_STATIC_LIBS ... if true, only static libraries are found
-# FFTW_ROOT ... if set, the libraries are exclusively searched
-# under this path
-# FFTW_DIR ... equivalent to FFTW_ROOT
-# FFTW_PATH ... equivalent to FFTW_ROOT
-# FFTW_LIBRARY ... fftw library to use
-# FFTW_INCLUDE_DIR ... fftw include directory
+# (C) Copyright 1996-2016 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.
+
+##############################################################################
+#.rst:
+#
+# FindFFTW
+# ========
+#
+# Find the FFTW library. ::
+#
+# find_package(FFTW [REQUIRED] [QUIET]
+# [COMPONENTS [single] [double] [long_double] [quad]])
+#
+# By default, search for the double precision library ``fftw3``
+#
+# Components
+# ----------
+#
+# If a different version or multiple versions of the library are required,
+# these need to be specified as ``COMPONENTS``. Note that double must be given
+# explicitly if any ``COMPONENTS`` are specified.
+#
+# The libraries corresponding to each of the ``COMPONENTS`` are:
+#
+# :single: ``fftw3f``
+# :double: ``fftw3``
+# :long_double: ``fftw3l``
+# :quad: ``fftw3q``
+#
+# Output variables
+# ----------------
+#
+# The following CMake variables are set on completion:
+#
+# :FFTW_FOUND: true if FFTW is found on the system
+# :FFTW_LIBRARIES: full paths to requested FFTW libraries
+# :FFTW_INCLUDES: FFTW include directory
+#
+# Input variables
+# ---------------
+#
+# The following CMake variables are checked by the function:
+#
+# :FFTW_USE_STATIC_LIBS: if true, only static libraries are found
+# :FFTW_ROOT: if set, this path is exclusively searched
+# :FFTW_DIR: equivalent to FFTW_ROOT
+# :FFTW_PATH: equivalent to FFTW_ROOT
+# :FFTW_LIBRARY: FFTW library to use
+# :FFTW_INCLUDE_DIR: FFTW include directory
+#
+##############################################################################
#============================================#
# #
@@ -72,76 +110,103 @@ else()
set( CMAKE_FIND_LIBRARY_SUFFIXES ${CMAKE_SHARED_LIBRARY_SUFFIX} )
endif()
+if( FFTW_FIND_COMPONENTS )
+ ecbuild_debug( "FindFFTW: looking for components: ${FFTW_FIND_COMPONENTS}" )
+ foreach( _component ${FFTW_FIND_COMPONENTS} )
+ if( _component MATCHES "single" )
+ ecbuild_debug( "FindFFTW: looking for single precision (fftw3f)" )
+ set( _require_sp TRUE )
+ elseif( _component MATCHES "double" )
+ ecbuild_debug( "FindFFTW: looking for double precision (fftw3)" )
+ set( _require_dp TRUE )
+ elseif( _component MATCHES "long_double" )
+ ecbuild_debug( "FindFFTW: looking for long double precision (fftw3l)" )
+ set( _require_lp TRUE )
+ elseif( _component MATCHES "quad" )
+ ecbuild_debug( "FindFFTW: looking for quad precision (fftw3q)" )
+ set( _require_qp TRUE )
+ else()
+ endif()
+ endforeach()
+else()
+ ecbuild_debug( "FindFFTW: no components specified, looking for double precision (fftw3)" )
+ set( _require_dp TRUE )
+endif()
+
if( FFTW_ROOT )
+ set( _default_paths NO_DEFAULT_PATH )
+ set( _lib_paths ${FFTW_ROOT} )
+ set( _include_paths ${FFTW_ROOT} )
+else()
+ set( _lib_paths ${PKG_FFTW_LIBRARY_DIRS} ${LIB_INSTALL_DIR} )
+ set( _include_paths ${PKG_FFTW_INCLUDE_DIRS} ${INCLUDE_INSTALL_DIR} )
+endif()
+
+#find libs
- #find libs
+if( _require_dp )
find_library(
FFTW_LIB
NAMES "fftw3"
- PATHS ${FFTW_ROOT}
+ PATHS ${_lib_paths}
PATH_SUFFIXES "lib" "lib64"
- NO_DEFAULT_PATH
+ ${_default_paths}
)
+ if( NOT FFTW_LIB )
+ ecbuild_warn("FindFFTW: double precision required, but fftw3 was not found")
+ endif()
+endif()
+if( _require_sp )
find_library(
FFTWF_LIB
NAMES "fftw3f"
- PATHS ${FFTW_ROOT}
+ PATHS ${_lib_paths}
PATH_SUFFIXES "lib" "lib64"
- NO_DEFAULT_PATH
+ ${_default_paths}
)
+ if( NOT FFTWF_LIB )
+ ecbuild_warn("FindFFTW: single precision required, but fftw3f was not found")
+ endif()
+endif()
+if( _require_lp )
find_library(
FFTWL_LIB
NAMES "fftw3l"
- PATHS ${FFTW_ROOT}
+ PATHS ${_lib_paths}
PATH_SUFFIXES "lib" "lib64"
- NO_DEFAULT_PATH
+ ${_default_paths}
)
+ if( NOT FFTWL_LIB )
+ ecbuild_warn("FindFFTW: long double precision required, but fftw3l was not found")
+ endif()
+endif()
- #find includes
- find_path(
- FFTW_INCLUDES
- NAMES "fftw3.h"
- PATHS ${FFTW_ROOT}
- PATH_SUFFIXES "include"
- NO_DEFAULT_PATH
- )
-
-else()
-
- find_library(
- FFTW_LIB
- NAMES "fftw3"
- PATHS ${PKG_FFTW_LIBRARY_DIRS} ${LIB_INSTALL_DIR}
- )
-
- find_library(
- FFTWF_LIB
- NAMES "fftw3f"
- PATHS ${PKG_FFTW_LIBRARY_DIRS} ${LIB_INSTALL_DIR}
- )
-
-
+if( _require_qp )
find_library(
- FFTWL_LIB
- NAMES "fftw3l"
- PATHS ${PKG_FFTW_LIBRARY_DIRS} ${LIB_INSTALL_DIR}
- )
-
- find_path(
- FFTW_INCLUDES
- NAMES "fftw3.h"
- PATHS ${PKG_FFTW_INCLUDE_DIRS} ${INCLUDE_INSTALL_DIR}
+ FFTWQ_LIB
+ NAMES "fftw3q"
+ PATHS ${_lib_paths}
+ PATH_SUFFIXES "lib" "lib64"
+ ${_default_paths}
)
+ if( NOT FFTWQ_LIB )
+ ecbuild_warn("FindFFTW: quad precision required, but fftw3q was not found")
+ endif()
+endif()
-endif( FFTW_ROOT )
+#find includes
-set(FFTW_LIBRARIES ${FFTW_LIB} ${FFTWF_LIB})
+find_path(
+ FFTW_INCLUDES
+ NAMES "fftw3.h"
+ PATHS ${_include_paths}
+ PATH_SUFFIXES "include"
+ ${_default_paths}
+)
-if(FFTWL_LIB)
- set(FFTW_LIBRARIES ${FFTW_LIBRARIES} ${FFTWL_LIB})
-endif()
+set(FFTW_LIBRARIES ${FFTW_LIB} ${FFTWF_LIB} ${FFTWL_LIB} ${FFTWQ_LIB})
set( CMAKE_FIND_LIBRARY_SUFFIXES ${CMAKE_FIND_LIBRARY_SUFFIXES_SAV} )
@@ -149,4 +214,4 @@ include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(FFTW DEFAULT_MSG
FFTW_INCLUDES FFTW_LIBRARIES)
-mark_as_advanced(FFTW_INCLUDES FFTW_LIBRARIES FFTW_LIB FFTWF_LIB FFTWL_LIB)
\ No newline at end of file
+mark_as_advanced(FFTW_INCLUDES FFTW_LIBRARIES FFTW_LIB FFTWF_LIB FFTWL_LIB)
diff --git a/cmake/contrib/FindNetCDF4.cmake b/cmake/contrib/FindNetCDF4.cmake
index 2afff21..6bba4e0 100644
--- a/cmake/contrib/FindNetCDF4.cmake
+++ b/cmake/contrib/FindNetCDF4.cmake
@@ -157,10 +157,13 @@ else()
foreach( LANGUAGE ${NETCDF_LANGUAGE_BINDINGS} )
ecbuild_debug("FindNetCDF4: looking for ${LANGUAGE} language bindings")
+
set( NETCDF_${LANGUAGE}_FOUND 1 ) # disable this in following if necessary
# find the NETCDF includes
foreach( INC ${NETCDF_${LANGUAGE}_INCLUDE_NAMES} )
+ #ecbuild_debug( "FindNetCDF4: looking for include file ${INC}")
+
find_path( NETCDF_${INC}_INCLUDE_DIR ${INC}
HINTS ${NETCDF_${LANGUAGE}_INCLUDE_FLAGS}
${NETCDF_ROOT} ${NETCDF_DIR} ${NETCDF_PATH} ${NETCDF4_DIR}
@@ -169,8 +172,25 @@ else()
include
Include
)
+ if( NOT NETCDF_${INC}_INCLUDE_DIR )
+ #ecbuild_debug( "FindNetCDF4: ${INC} not found" )
+ GET_FILENAME_COMPONENT( _basename ${INC} NAME_WE )
+ GET_FILENAME_COMPONENT( _ext ${INC} EXT )
+ string( TOUPPER ${_basename} _BASENAME )
+ set( INC_MOD "${_BASENAME}${_ext}")
+ #ecbuild_debug( "FindNetCDF4: try ${INC_MOD}" )
+ find_path( NETCDF_${INC}_INCLUDE_DIR ${INC_MOD}
+ HINTS ${NETCDF_${LANGUAGE}_INCLUDE_FLAGS}
+ ${NETCDF_ROOT} ${NETCDF_DIR} ${NETCDF_PATH} ${NETCDF4_DIR}
+ ENV NETCDF_ROOT ENV NETCDF_DIR ENV NETCDF_PATH ENV NETCDF4_DIR
+ PATH_SUFFIXES
+ include
+ Include
+ )
+ endif()
+
mark_as_advanced( NETCDF_${INC}_INCLUDE_DIR )
- # ecbuild_debug_var( NETCDF_${INC}_INCLUDE_DIR)
+ #ecbuild_debug_var( NETCDF_${INC}_INCLUDE_DIR)
if (NETCDF_${INC}_INCLUDE_DIR)
list( APPEND NETCDF_INCLUDE_DIRS ${NETCDF_${INC}_INCLUDE_DIR} )
else()
@@ -178,7 +198,7 @@ else()
if( ${location} EQUAL -1 )
else()
if(NETCDF_FIND_REQUIRED)
- message( SEND_ERROR "\"${INC}\" is not found for NetCDF component ${LANGUAGE}" )
+ ecbuild_error( "\"${INC}\" is not found for NetCDF component ${LANGUAGE}" )
elseif( NOT NETCDF_FIND_QUIETLY )
message( STATUS "\"${INC}\" is not found for NetCDF component ${LANGUAGE}" )
endif()
@@ -294,7 +314,10 @@ endif()
set( NETCDF4_FIND_QUIETLY ${NETCDF_FIND_QUIETLY} )
set( NETCDF4_FIND_REQUIRED ${NETCDF_FIND_REQUIRED} )
-find_package_handle_standard_args( NETCDF4 DEFAULT_MSG
+# handle the QUIET and REQUIRED arguments and set NETCDF4_FOUND to TRUE
+# if all listed variables are valid
+# Note: capitalisation of the package name must be the same as in the file name
+find_package_handle_standard_args( NetCDF4 DEFAULT_MSG
${NETCDF_FOUND_REQUIRED_VARS}
NETCDF_LIBRARIES
NETCDF_INCLUDE_DIRS
diff --git a/cmake/ecbuild_add_c_flags.cmake b/cmake/ecbuild_add_c_flags.cmake
index 132d29c..e6923a9 100644
--- a/cmake/ecbuild_add_c_flags.cmake
+++ b/cmake/ecbuild_add_c_flags.cmake
@@ -1,4 +1,4 @@
-# (C) Copyright 1996-2015 ECMWF.
+# (C) Copyright 1996-2016 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.
@@ -76,7 +76,7 @@ macro( ecbuild_add_c_flags m_c_flags )
ecbuild_debug( "C FLAG [${_flags}] added" )
endif()
else()
- message( WARNING "Unrecognised C flag [${_flags}] -- skipping" )
+ ecbuild_warn( "Unrecognised C flag [${_flags}] -- skipping" )
endif()
endif()
unset( _flags )
diff --git a/cmake/ecbuild_add_cxx11_flags.cmake b/cmake/ecbuild_add_cxx11_flags.cmake
index a4cce91..df8cde5 100644
--- a/cmake/ecbuild_add_cxx11_flags.cmake
+++ b/cmake/ecbuild_add_cxx11_flags.cmake
@@ -1,4 +1,4 @@
-# (C) Copyright 1996-2015 ECMWF.
+# (C) Copyright 1996-2016 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.
diff --git a/cmake/ecbuild_add_cxx_flags.cmake b/cmake/ecbuild_add_cxx_flags.cmake
index c4aef6e..63c442e 100644
--- a/cmake/ecbuild_add_cxx_flags.cmake
+++ b/cmake/ecbuild_add_cxx_flags.cmake
@@ -1,4 +1,4 @@
-# (C) Copyright 1996-2015 ECMWF.
+# (C) Copyright 1996-2016 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.
@@ -76,7 +76,7 @@ macro( ecbuild_add_cxx_flags m_cxx_flags )
ecbuild_debug( "C++ FLAG [${_flags}] added" )
endif()
else()
- message( STATUS "Unrecognised CXX flag [${_flags}] -- skipping" )
+ ecbuild_info( "Unrecognised CXX flag [${_flags}] -- skipping" )
endif()
endif()
unset( _flags )
diff --git a/cmake/ecbuild_add_executable.cmake b/cmake/ecbuild_add_executable.cmake
index 228cf9e..4572832 100644
--- a/cmake/ecbuild_add_executable.cmake
+++ b/cmake/ecbuild_add_executable.cmake
@@ -1,4 +1,4 @@
-# (C) Copyright 1996-2015 ECMWF.
+# (C) Copyright 1996-2016 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.
@@ -115,15 +115,15 @@ macro( ecbuild_add_executable )
cmake_parse_arguments( _PAR "${options}" "${single_value_args}" "${multi_value_args}" ${_FIRST_ARG} ${ARGN} )
if(_PAR_UNPARSED_ARGUMENTS)
- message(FATAL_ERROR "Unknown keywords given to ecbuild_add_executable(): \"${_PAR_UNPARSED_ARGUMENTS}\"")
+ ecbuild_critical("Unknown keywords given to ecbuild_add_executable(): \"${_PAR_UNPARSED_ARGUMENTS}\"")
endif()
if( NOT _PAR_TARGET )
- message(FATAL_ERROR "The call to ecbuild_add_executable() doesn't specify the TARGET.")
+ ecbuild_critical("The call to ecbuild_add_executable() doesn't specify the TARGET.")
endif()
if( NOT _PAR_SOURCES AND NOT _PAR_OBJECTS AND NOT _PAR_SOURCES_GLOB )
- message(FATAL_ERROR "The call to ecbuild_add_executable() specifies neither SOURCES nor OBJECTS nor SOURCES_GLOB.")
+ ecbuild_critical("The call to ecbuild_add_executable() specifies neither SOURCES nor OBJECTS nor SOURCES_GLOB.")
endif()
### conditional build
diff --git a/cmake/ecbuild_add_extra_search_paths.cmake b/cmake/ecbuild_add_extra_search_paths.cmake
index 3cb38d2..94ac85b 100644
--- a/cmake/ecbuild_add_extra_search_paths.cmake
+++ b/cmake/ecbuild_add_extra_search_paths.cmake
@@ -1,4 +1,4 @@
-# (C) Copyright 1996-2015 ECMWF.
+# (C) Copyright 1996-2016 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.
diff --git a/cmake/ecbuild_add_fortran_flags.cmake b/cmake/ecbuild_add_fortran_flags.cmake
index fc1edcc..86cea83 100644
--- a/cmake/ecbuild_add_fortran_flags.cmake
+++ b/cmake/ecbuild_add_fortran_flags.cmake
@@ -1,4 +1,4 @@
-# (C) Copyright 1996-2015 ECMWF.
+# (C) Copyright 1996-2016 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.
@@ -81,7 +81,7 @@ macro( ecbuild_add_fortran_flags m_fortran_flags )
ecbuild_debug( "Fortran FLAG [${_flags}] added" )
endif()
else()
- message( STATUS "Unrecognised Fortran flag [${_flags}] -- skipping" )
+ ecbuild_info( "Unrecognised Fortran flag [${_flags}] -- skipping" )
endif()
endif()
diff --git a/cmake/ecbuild_add_library.cmake b/cmake/ecbuild_add_library.cmake
index 561f274..48602a4 100644
--- a/cmake/ecbuild_add_library.cmake
+++ b/cmake/ecbuild_add_library.cmake
@@ -1,4 +1,4 @@
-# (C) Copyright 1996-2015 ECMWF.
+# (C) Copyright 1996-2016 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.
@@ -154,15 +154,15 @@ function( ecbuild_add_library_impl )
cmake_parse_arguments( _PAR "${options}" "${single_value_args}" "${multi_value_args}" ${_FIRST_ARG} ${ARGN} )
if(_PAR_UNPARSED_ARGUMENTS)
- message(FATAL_ERROR "Unknown keywords given to ecbuild_add_library(): \"${_PAR_UNPARSED_ARGUMENTS}\"")
+ ecbuild_critical("Unknown keywords given to ecbuild_add_library(): \"${_PAR_UNPARSED_ARGUMENTS}\"")
endif()
if( NOT _PAR_TARGET )
- message(FATAL_ERROR "The call to ecbuild_add_library() doesn't specify the TARGET.")
+ ecbuild_critical("The call to ecbuild_add_library() doesn't specify the TARGET.")
endif()
if( NOT _PAR_SOURCES AND NOT _PAR_OBJECTS AND NOT _PAR_SOURCES_GLOB )
- message(FATAL_ERROR "The call to ecbuild_add_library() specifies neither SOURCES nor OBJECTS nor SOURCES_GLOB")
+ ecbuild_critical("The call to ecbuild_add_library() specifies neither SOURCES nor OBJECTS nor SOURCES_GLOB")
endif()
### conditional build
@@ -188,7 +188,7 @@ function( ecbuild_add_library_impl )
NOT _PAR_TYPE MATCHES "SHARED" AND
NOT _PAR_TYPE MATCHES "OBJECT" AND
NOT _PAR_TYPE MATCHES "MODULE" )
- message( FATAL_ERROR "library type must be one of [ STATIC | SHARED | MODULE | OBJECT ]" )
+ ecbuild_critical( "library type must be one of [ STATIC | SHARED | MODULE | OBJECT ]" )
endif()
ecbuild_debug("ecbuild_add_library(${_PAR_TARGET}): library type is ${_PAR_TYPE}")
endif()
@@ -564,7 +564,7 @@ macro( ecbuild_add_library )
else()
if( NOT DEFINED _p_TARGET )
- message(FATAL_ERROR "The call to ecbuild_add_library() doesn't specify the TARGET.")
+ ecbuild_critical("The call to ecbuild_add_library() doesn't specify the TARGET.")
else()
if( BUILD_SHARED_LIBS MATCHES "[Bb][Oo][Tt][Hh]" ) # build both types
diff --git a/cmake/ecbuild_add_option.cmake b/cmake/ecbuild_add_option.cmake
index c7006f2..c270517 100644
--- a/cmake/ecbuild_add_option.cmake
+++ b/cmake/ecbuild_add_option.cmake
@@ -1,4 +1,4 @@
-# (C) Copyright 1996-2015 ECMWF.
+# (C) Copyright 1996-2016 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.
@@ -43,15 +43,21 @@
# REQUIRED_PACKAGES : optional
# list of packages required to be found for this feature to be enabled
#
-# The package specification can be either ::
+# The package specification can have one of two forms. Either ::
#
-# <package> [ <version> ... ]
+# "<package> [ <version> ... ]"
#
-# to search for a given package with option minimum required version or ::
+# to search for a given package using the CMake ``find_package`` mechanism.
+# The entire specification must be enclosed in quotes and is passed on
+# verbatim. Any options of ``find_package`` are supported.
#
-# PROJECT <name> [ VERSION <version> ... ]
+# The other specification must start with ``PROJECT`` like this ::
#
-# to search for an ecBuild project with optional minimum required version.
+# "PROJECT <name> [ VERSION <version> ... ]"
+#
+# and is used to search for an ecBuild project via ``ecbuild_use_package``.
+# The entire specification must be enclosed in quotes and is passed on
+# verbatim. Any options of ``ecbuild_use_package`` are supported.
#
# CONDITION : optional
# conditional expression which must evaluate to true for this option to be
@@ -85,13 +91,13 @@ macro( ecbuild_add_option )
cmake_parse_arguments( _p "${options}" "${single_value_args}" "${multi_value_args}" ${_FIRST_ARG} ${ARGN} )
if( _p_UNPARSED_ARGUMENTS )
- message(FATAL_ERROR "Unknown keywords given to ecbuild_add_option(): \"${_p_UNPARSED_ARGUMENTS}\"")
+ ecbuild_critical("Unknown keywords given to ecbuild_add_option(): \"${_p_UNPARSED_ARGUMENTS}\"")
endif()
# check FEATURE parameter
if( NOT _p_FEATURE )
- message(FATAL_ERROR "The call to ecbuild_add_option() doesn't specify the FEATURE.")
+ ecbuild_critical("The call to ecbuild_add_option() doesn't specify the FEATURE.")
endif()
# check DEFAULT parameter
@@ -100,7 +106,7 @@ macro( ecbuild_add_option )
set( _p_DEFAULT ON )
else()
if( NOT _p_DEFAULT MATCHES "[Oo][Nn]" AND NOT _p_DEFAULT MATCHES "[Oo][Ff][Ff]" )
- message(FATAL_ERROR "In macro ecbuild_add_option(), DEFAULT is either ON or OFF: \"${_p_DEFAULT}\"")
+ ecbuild_critical("In macro ecbuild_add_option(), DEFAULT is either ON or OFF: \"${_p_DEFAULT}\"")
endif()
endif()
ecbuild_debug("ecbuild_add_option(${_p_FEATURE}): defaults to ${_p_DEFAULT}")
@@ -251,9 +257,9 @@ macro( ecbuild_add_option )
# we have feature if all required packages were FOUND
if( ${pkgname}_FOUND OR ${pkgUPPER}_FOUND OR ${pkgLOWER}_FOUND )
- message( STATUS "Found package ${pkgname} required for feature ${_p_FEATURE}" )
+ ecbuild_info( "Found package ${pkgname} required for feature ${_p_FEATURE}" )
else()
- message( STATUS "Could not find package ${pkgname} required for feature ${_p_FEATURE} -- Provide ${pkgname} location with -D${pkgUPPER}_PATH=/..." )
+ ecbuild_info( "Could not find package ${pkgname} required for feature ${_p_FEATURE} -- Provide ${pkgname} location with -D${pkgUPPER}_PATH=/..." )
set( HAVE_${_p_FEATURE} 0 )
list( APPEND _failed_to_find_packages ${pkgname} )
endif()
@@ -268,21 +274,21 @@ macro( ecbuild_add_option )
if( HAVE_${_p_FEATURE} )
- message( STATUS "Feature ${_p_FEATURE} enabled" )
+ ecbuild_info( "Feature ${_p_FEATURE} enabled" )
else() # if user provided input and we cannot satisfy FAIL otherwise WARN
if( ${_p_FEATURE}_user_provided_input )
if( _${_p_FEATURE}_condition )
- message( FATAL_ERROR "Feature ${_p_FEATURE} cannot be enabled -- following required packages weren't found: ${_failed_to_find_packages}" )
+ ecbuild_critical( "Feature ${_p_FEATURE} cannot be enabled -- following required packages weren't found: ${_failed_to_find_packages}" )
else()
- message( FATAL_ERROR "Feature ${_p_FEATURE} cannot be enabled -- following condition was not met: ${_p_CONDITION}" )
+ ecbuild_critical( "Feature ${_p_FEATURE} cannot be enabled -- following condition was not met: ${_p_CONDITION}" )
endif()
else()
if( _${_p_FEATURE}_condition )
- message( STATUS "Feature ${_p_FEATURE} was not enabled (also not requested) -- following condition was not met: ${_p_CONDITION}" )
+ ecbuild_info( "Feature ${_p_FEATURE} was not enabled (also not requested) -- following condition was not met: ${_p_CONDITION}" )
else()
- message( STATUS "Feature ${_p_FEATURE} was not enabled (also not requested) -- following required packages weren't found: ${_failed_to_find_packages}" )
+ ecbuild_info( "Feature ${_p_FEATURE} was not enabled (also not requested) -- following required packages weren't found: ${_failed_to_find_packages}" )
endif()
set( ENABLE_${_p_FEATURE} OFF )
ecbuild_set_feature( ${_p_FEATURE} ENABLED OFF )
diff --git a/cmake/ecbuild_add_persistent.cmake b/cmake/ecbuild_add_persistent.cmake
index 0e1fdbf..42bb44b 100644
--- a/cmake/ecbuild_add_persistent.cmake
+++ b/cmake/ecbuild_add_persistent.cmake
@@ -1,4 +1,4 @@
-# (C) Copyright 1996-2015 ECMWF.
+# (C) Copyright 1996-2016 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.
@@ -49,15 +49,15 @@ macro( ecbuild_add_persistent )
cmake_parse_arguments( _PAR "${options}" "${single_value_args}" "${multi_value_args}" ${_FIRST_ARG} ${ARGN} )
if(_PAR_UNPARSED_ARGUMENTS)
- message(FATAL_ERROR "Unknown keywords given to ecbuild_add_persistent(): \"${_PAR_UNPARSED_ARGUMENTS}\"")
+ ecbuild_critical("Unknown keywords given to ecbuild_add_persistent(): \"${_PAR_UNPARSED_ARGUMENTS}\"")
endif()
if( NOT _PAR_SRC_LIST )
- message(FATAL_ERROR "The call to ecbuild_add_persistent() doesn't specify the SRC_LIST.")
+ ecbuild_critical("The call to ecbuild_add_persistent() doesn't specify the SRC_LIST.")
endif()
if( NOT _PAR_FILES )
- message(FATAL_ERROR "The call to ecbuild_add_persistent() doesn't specify the FILES.")
+ ecbuild_critical("The call to ecbuild_add_persistent() doesn't specify the FILES.")
endif()
foreach( file ${_PAR_FILES} )
diff --git a/cmake/ecbuild_add_resources.cmake b/cmake/ecbuild_add_resources.cmake
index da6e55a..cf0543b 100644
--- a/cmake/ecbuild_add_resources.cmake
+++ b/cmake/ecbuild_add_resources.cmake
@@ -1,4 +1,4 @@
-# (C) Copyright 1996-2015 ECMWF.
+# (C) Copyright 1996-2016 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.
@@ -62,11 +62,11 @@ macro( ecbuild_add_resources )
cmake_parse_arguments( _PAR "${options}" "${single_value_args}" "${multi_value_args}" ${_FIRST_ARG} ${ARGN} )
if(_PAR_UNPARSED_ARGUMENTS)
- message(FATAL_ERROR "Unknown keywords given to ecbuild_add_resources(): \"${_PAR_UNPARSED_ARGUMENTS}\"")
+ ecbuild_critical("Unknown keywords given to ecbuild_add_resources(): \"${_PAR_UNPARSED_ARGUMENTS}\"")
endif()
if( NOT _PAR_TARGET )
- message(FATAL_ERROR "The call to ecbuild_add_resources() doesn't specify the TARGET.")
+ ecbuild_critical("The call to ecbuild_add_resources() doesn't specify the TARGET.")
endif()
set( LOCAL_FILES_NOT_TO_PACK "" )
diff --git a/cmake/ecbuild_add_test.cmake b/cmake/ecbuild_add_test.cmake
index 47baa67..2097683 100644
--- a/cmake/ecbuild_add_test.cmake
+++ b/cmake/ecbuild_add_test.cmake
@@ -1,4 +1,4 @@
-# (C) Copyright 1996-2015 ECMWF.
+# (C) Copyright 1996-2016 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.
@@ -23,7 +23,8 @@
# [ RESOURCES <file1> [<file2> ...] ]
# [ TEST_DATA <file1> [<file2> ...] ]
# [ BOOST ]
-# [ MPI <number-of-ranks> ]
+# [ MPI <number-of-mpi-tasks> ]
+# [ OMP <number-of-threads-per-mpi-task> ]
# [ ENABLED ON|OFF ]
# [ LIBS <library1> [<library2> ...] ]
# [ INCLUDES <path1> [<path2> ...] ]
@@ -79,6 +80,12 @@
#
# If greater than 1, and MPI is not available, the test is disabled.
#
+# OMP : optional
+# number of OpenMP threads per MPI task to use.
+#
+# If set, the environment variable OMP_NUM_THREADS will set.
+# Also, in case of launchers like aprun, the OMP_NUMTHREADS_FLAG will be used.
+#
# ENABLED : optional
# if set to OFF, the test is built but not enabled as a test case
#
@@ -130,7 +137,7 @@
macro( ecbuild_add_test )
set( options BOOST )
- set( single_value_args TARGET ENABLED COMMAND TYPE LINKER_LANGUAGE MPI WORKING_DIRECTORY )
+ set( single_value_args TARGET ENABLED COMMAND TYPE LINKER_LANGUAGE MPI OMP WORKING_DIRECTORY )
set( multi_value_args SOURCES OBJECTS LIBS INCLUDES TEST_DEPENDS DEPENDS ARGS
PERSISTENT DEFINITIONS RESOURCES TEST_DATA CFLAGS
CXXFLAGS FFLAGS GENERATED CONDITION ENVIRONMENT )
@@ -138,7 +145,7 @@ macro( ecbuild_add_test )
cmake_parse_arguments( _PAR "${options}" "${single_value_args}" "${multi_value_args}" ${_FIRST_ARG} ${ARGN} )
if(_PAR_UNPARSED_ARGUMENTS)
- message(FATAL_ERROR "Unknown keywords given to ecbuild_add_test(): \"${_PAR_UNPARSED_ARGUMENTS}\"")
+ ecbuild_critical("Unknown keywords given to ecbuild_add_test(): \"${_PAR_UNPARSED_ARGUMENTS}\"")
endif()
set( _TEST_DIR ${CMAKE_CURRENT_BINARY_DIR} )
@@ -156,6 +163,13 @@ macro( ecbuild_add_test )
endif()
endif()
+ # Check for OMP
+ if( NOT DEFINED _PAR_OMP )
+ set( _PAR_OMP 1 )
+ endif()
+ list( APPEND _PAR_ENVIRONMENT "OMP_NUM_THREADS=${_PAR_OMP}" )
+
+
# default is enabled
if( NOT DEFINED _PAR_ENABLED )
set( _PAR_ENABLED 1 )
@@ -173,7 +187,7 @@ macro( ecbuild_add_test )
if( NOT _PAR_TYPE AND DEFINED _PAR_TARGET )
set( _PAR_TYPE "EXE" )
if( NOT _PAR_SOURCES )
- message(FATAL_ERROR "The call to ecbuild_add_test() defines a TARGET without SOURCES.")
+ ecbuild_critical("The call to ecbuild_add_test() defines a TARGET without SOURCES.")
endif()
endif()
@@ -181,7 +195,7 @@ macro( ecbuild_add_test )
if( PYTHONINTERP_FOUND )
set( _PAR_COMMAND ${PYTHON_EXECUTABLE} )
else()
- message( WARNING "Requested a python test but python interpreter not found - disabling test\nPYTHON_EXECUTABLE: [${PYTHON_EXECUTABLE}]" )
+ ecbuild_warn( "Requested a python test but python interpreter not found - disabling test\nPYTHON_EXECUTABLE: [${PYTHON_EXECUTABLE}]" )
set( _PAR_ENABLED 0 )
endif()
endif()
@@ -189,15 +203,15 @@ macro( ecbuild_add_test )
### further checks
if( _PAR_ENABLED AND NOT _PAR_TARGET AND NOT _PAR_COMMAND )
- message(FATAL_ERROR "The call to ecbuild_add_test() defines neither a TARGET nor a COMMAND.")
+ ecbuild_critical("The call to ecbuild_add_test() defines neither a TARGET nor a COMMAND.")
endif()
if( _PAR_ENABLED AND NOT _PAR_COMMAND AND NOT _PAR_SOURCES )
- message(FATAL_ERROR "The call to ecbuild_add_test() defines neither a COMMAND nor SOURCES, so no test can be defined or built.")
+ ecbuild_critical("The call to ecbuild_add_test() defines neither a COMMAND nor SOURCES, so no test can be defined or built.")
endif()
if( _PAR_TYPE MATCHES "SCRIPT" AND NOT _PAR_COMMAND )
- message(FATAL_ERROR "The call to ecbuild_add_test() defines a 'script' but doesn't specify the COMMAND.")
+ ecbuild_critical("The call to ecbuild_add_test() defines a 'script' but doesn't specify the COMMAND.")
endif()
### conditional build
@@ -391,12 +405,20 @@ macro( ecbuild_add_test )
# Wrap with MPIEXEC
if( _PAR_MPI )
+
+ set( MPIEXEC_TASKS ${MPIEXEC_NUMPROC_FLAG} ${_PAR_MPI} )
+ if( DEFINED MPIEXEC_NUMTHREAD_FLAG )
+ set( MPIEXEC_THREADS ${MPIEXEC_NUMTHREAD_FLAG} ${_PAR_OMP} )
+ endif()
+
+ set( _LAUNCH ${MPIEXEC} ${MPIEXEC_TASKS} ${MPIEXEC_THREADS} )
+
if( DEFINED _PAR_COMMAND )
- ecbuild_debug("ecbuild_add_test(${_PAR_TARGET}): running as ${MPIEXEC} -n ${_PAR_MPI} ${_TEST_DIR}/${_PAR_COMMAND}")
- set( _PAR_COMMAND ${MPIEXEC} -n ${_PAR_MPI} ${_TEST_DIR}/${_PAR_COMMAND} )
+ ecbuild_debug("ecbuild_add_test(${_PAR_TARGET}): running as ${_LAUNCH} ${_PAR_COMMAND}")
+ set( _PAR_COMMAND ${_LAUNCH} ${_PAR_COMMAND} )
else()
- ecbuild_debug("ecbuild_add_test(${_PAR_TARGET}): running as ${MPIEXEC} -n ${_PAR_MPI} ${_TEST_DIR}/${_PAR_TARGET}")
- set( _PAR_COMMAND ${MPIEXEC} -n ${_PAR_MPI} ${_TEST_DIR}/${_PAR_TARGET} )
+ ecbuild_debug("ecbuild_add_test(${_PAR_TARGET}): running as ${_LAUNCH} ${_TEST_DIR}/${_PAR_TARGET}")
+ set( _PAR_COMMAND ${_LAUNCH} ${_TEST_DIR}/${_PAR_TARGET} )
endif()
endif()
@@ -405,9 +427,9 @@ macro( ecbuild_add_test )
if( _PAR_ENABLED ) # we can disable and still build it but not run it with 'make tests'
if( DEFINED _PAR_COMMAND )
- add_test( ${_PAR_TARGET} ${_PAR_COMMAND} ${TEST_ARGS} ${_working_dir} ) # run a command as test
+ add_test( NAME ${_PAR_TARGET} COMMAND ${_PAR_COMMAND} ${TEST_ARGS} ${_working_dir} ) # run a command as test
else()
- add_test( ${_PAR_TARGET} ${_PAR_TARGET} ${TEST_ARGS} ${_working_dir} ) # run the test that was generated
+ add_test( NAME ${_PAR_TARGET} COMMAND ${_PAR_TARGET} ${TEST_ARGS} ${_working_dir} ) # run the test that was generated
endif()
# get test data
diff --git a/cmake/ecbuild_append_to_rpath.cmake b/cmake/ecbuild_append_to_rpath.cmake
index 5a7bd66..9ecde3e 100644
--- a/cmake/ecbuild_append_to_rpath.cmake
+++ b/cmake/ecbuild_append_to_rpath.cmake
@@ -1,4 +1,4 @@
-# (C) Copyright 1996-2015 ECMWF.
+# (C) Copyright 1996-2016 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.
@@ -39,7 +39,7 @@ endfunction()
macro( ecbuild_append_to_rpath RPATH_DIRS )
if( NOT ${ARGC} EQUAL 1 )
- message( SEND_ERROR "ecbuild_append_to_rpath takes 1 argument")
+ ecbuild_error( "ecbuild_append_to_rpath takes 1 argument")
endif()
foreach( RPATH_DIR ${RPATH_DIRS} )
diff --git a/cmake/ecbuild_bundle.cmake b/cmake/ecbuild_bundle.cmake
index bad22d6..83b0bba 100644
--- a/cmake/ecbuild_bundle.cmake
+++ b/cmake/ecbuild_bundle.cmake
@@ -1,4 +1,4 @@
-# (C) Copyright 1996-2015 ECMWF.
+# (C) Copyright 1996-2016 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.
@@ -9,10 +9,6 @@
# Set policies
include( ecbuild_policies NO_POLICY_SCOPE )
-macro( debug_here VAR )
- message( STATUS " >>>>> ${VAR} [${${VAR}}]")
-endmacro()
-
include(CMakeParseArguments)
include(ecbuild_git)
@@ -133,7 +129,7 @@ macro( ecbuild_bundle )
string(TOUPPER "${_PAR_PROJECT}" PNAME)
if( BUNDLE_SKIP_${PNAME} )
- message( STATUS "Skipping bundle project ${PNAME}" )
+ ecbuild_info( "Skipping bundle project ${PNAME}" )
else()
if( _PAR_STASH )
diff --git a/cmake/ecbuild_cache.cmake b/cmake/ecbuild_cache.cmake
index 9663bca..e257b36 100644
--- a/cmake/ecbuild_cache.cmake
+++ b/cmake/ecbuild_cache.cmake
@@ -1,4 +1,4 @@
-# (C) Copyright 1996-2015 ECMWF.
+# (C) Copyright 1996-2016 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.
diff --git a/cmake/ecbuild_check_c_source_return.cmake b/cmake/ecbuild_check_c_source_return.cmake
index 1dadca6..18b6117 100644
--- a/cmake/ecbuild_check_c_source_return.cmake
+++ b/cmake/ecbuild_check_c_source_return.cmake
@@ -1,4 +1,4 @@
-# (C) Copyright 1996-2015 ECMWF.
+# (C) Copyright 1996-2016 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.
@@ -59,11 +59,11 @@ macro( ecbuild_check_c_source_return SOURCE )
cmake_parse_arguments( _PAR "${options}" "${single_value_args}" "${multi_value_args}" ${_FIRST_ARG} ${ARGN} )
if(_PAR_UNPARSED_ARGUMENTS)
- message(FATAL_ERROR "Unknown keywords given to ecbuild_check_c_source_return(): \"${_PAR_UNPARSED_ARGUMENTS}\"")
+ ecbuild_critical("Unknown keywords given to ecbuild_check_c_source_return(): \"${_PAR_UNPARSED_ARGUMENTS}\"")
endif()
if( NOT _PAR_VAR OR NOT _PAR_OUTPUT )
- message(FATAL_ERROR "The call to ecbuild_check_c_source_return() doesn't specify either SOURCE, VAR or OUTPUT")
+ ecbuild_critical("The call to ecbuild_check_c_source_return() doesn't specify either SOURCE, VAR or OUTPUT")
endif()
@@ -97,7 +97,7 @@ macro( ecbuild_check_c_source_return SOURCE )
file( WRITE "${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/test_${_PAR_VAR}.c" "${SOURCE}\n" )
- message( STATUS "Performing Test ${_PAR_VAR}" )
+ ecbuild_debug( "Performing Test ${_PAR_VAR}" )
try_run( ${_PAR_VAR}_EXITCODE ${_PAR_VAR}_COMPILED
${CMAKE_BINARY_DIR}
${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/test_${_PAR_VAR}.c
@@ -117,7 +117,7 @@ macro( ecbuild_check_c_source_return SOURCE )
# if the return value was 0 then it worked
if("${${_PAR_VAR}_EXITCODE}" EQUAL 0)
- message(STATUS "Performing Test ${_PAR_VAR} - Success")
+ ecbuild_debug("Performing Test ${_PAR_VAR} - Success")
file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log
"Performing C SOURCE FILE Test ${_PAR_VAR} succeded with the following compile output:\n"
"${compile_OUTPUT}\n"
@@ -139,7 +139,7 @@ macro( ecbuild_check_c_source_return SOURCE )
set(${_PAR_OUTPUT} "" CACHE INTERNAL "Test ${_PAR_VAR} output")
endif()
- message(STATUS "Performing Test ${_PAR_VAR} - Failed")
+ ecbuild_debug("Performing Test ${_PAR_VAR} - Failed")
file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log
"Performing C SOURCE FILE Test ${_PAR_VAR} failed with the following compile output:\n"
"${compile_OUTPUT}\n"
diff --git a/cmake/ecbuild_check_compiler.cmake b/cmake/ecbuild_check_compiler.cmake
index c0f0f29..437b81e 100644
--- a/cmake/ecbuild_check_compiler.cmake
+++ b/cmake/ecbuild_check_compiler.cmake
@@ -1,4 +1,4 @@
-# (C) Copyright 1996-2015 ECMWF.
+# (C) Copyright 1996-2016 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.
diff --git a/cmake/ecbuild_check_cxx11.cmake b/cmake/ecbuild_check_cxx11.cmake
index 6453786..390462b 100644
--- a/cmake/ecbuild_check_cxx11.cmake
+++ b/cmake/ecbuild_check_cxx11.cmake
@@ -1,4 +1,4 @@
-# (C) Copyright 1996-2015 ECMWF.
+# (C) Copyright 1996-2016 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.
@@ -45,7 +45,7 @@ function( ecbuild_check_cxx11 )
cmake_parse_arguments( _p "${options}" "${single_value_args}" "${multi_value_args}" ${_FIRST_ARG} ${ARGN} )
if(_PAR_UNPARSED_ARGUMENTS)
- message(FATAL_ERROR "Unknown keywords given to ecbuild_check_cxx11(): \"${_PAR_UNPARSED_ARGUMENTS}\"")
+ ecbuild_critical("Unknown keywords given to ecbuild_check_cxx11(): \"${_PAR_UNPARSED_ARGUMENTS}\"")
endif()
include( ${ECBUILD_MACROS_DIR}/contrib/GreatCMakeCookOff/CheckCXX11Features.cmake )
@@ -86,7 +86,6 @@ function( ecbuild_check_cxx11 )
endif()
foreach( f ${CXX11_CHECKED_FEATURES} )
- # message( "HAS_CXX11_${FEAT}" )
string( TOUPPER ${f} FEAT )
if( HAS_CXX11_${FEAT} )
list( APPEND CXX11_SUPPORTED_FEATURES ${f} )
@@ -112,21 +111,21 @@ function( ecbuild_check_cxx11 )
if( _p_PRINT )
if( CXX11_CHECKED_FEATURES )
join( CXX11_CHECKED_FEATURES " " CXX11_CHECKED_FEATURES_STR )
- message( STATUS "Checked C++11 features: ${CXX11_CHECKED_FEATURES_STR}" )
+ ecbuild_info( "Checked C++11 features: ${CXX11_CHECKED_FEATURES_STR}" )
else()
- message( STATUS "Checked no C++11 features" )
+ ecbuild_info( "Checked no C++11 features" )
endif()
if( CXX11_SUPPORTED_FEATURES )
join( CXX11_SUPPORTED_FEATURES " " CXX11_SUPPORTED_FEATURES_STR )
- message( STATUS "Found C++11 features: ${CXX11_SUPPORTED_FEATURES_STR}" )
+ ecbuild_info( "Found C++11 features: ${CXX11_SUPPORTED_FEATURES_STR}" )
else()
- message( STATUS "Found no C++11 features" )
+ ecbuild_info( "Found no C++11 features" )
endif()
if( CXX11_NOT_SUPPORTED_FEATURES )
join( CXX11_NOT_SUPPORTED_FEATURES " " CXX11_NOT_SUPPORTED_FEATURES_STR )
- message( STATUS "Not found C++11 features: ${CXX11_NOT_SUPPORTED_FEATURES_STR}" )
+ ecbuild_info( "Not found C++11 features: ${CXX11_NOT_SUPPORTED_FEATURES_STR}" )
else()
- message( STATUS "Found all checked C++11 features" )
+ ecbuild_info( "Found all checked C++11 features" )
endif()
endif()
diff --git a/cmake/ecbuild_check_cxx_source_return.cmake b/cmake/ecbuild_check_cxx_source_return.cmake
index 8f96f61..0868b22 100644
--- a/cmake/ecbuild_check_cxx_source_return.cmake
+++ b/cmake/ecbuild_check_cxx_source_return.cmake
@@ -1,4 +1,4 @@
-# (C) Copyright 1996-2015 ECMWF.
+# (C) Copyright 1996-2016 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.
@@ -59,11 +59,11 @@ macro( ecbuild_check_cxx_source_return SOURCE )
cmake_parse_arguments( _p "${options}" "${single_value_args}" "${multi_value_args}" ${_FIRST_ARG} ${ARGN} )
if(_p_UNPARSED_ARGUMENTS)
- message(FATAL_ERROR "Unknown keywords given to ecbuild_check_cxx_source_return(): \"${_p_UNPARSED_ARGUMENTS}\"")
+ ecbuild_critical("Unknown keywords given to ecbuild_check_cxx_source_return(): \"${_p_UNPARSED_ARGUMENTS}\"")
endif()
if( NOT _p_VAR OR NOT _p_OUTPUT )
- message(FATAL_ERROR "The call to ecbuild_check_cxx_source_return() doesn't specify either SOURCE, VAR or OUTPUT")
+ ecbuild_critical("The call to ecbuild_check_cxx_source_return() doesn't specify either SOURCE, VAR or OUTPUT")
endif()
set( _msg "Testing ${_p_VAR}:" )
@@ -98,7 +98,7 @@ macro( ecbuild_check_cxx_source_return SOURCE )
file( WRITE "${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/test_${_p_VAR}.cxx" "${SOURCE}\n" )
- message( STATUS "${_msg}" )
+ ecbuild_debug( "${_msg}" )
try_run( ${_p_VAR}_EXITCODE ${_p_VAR}_COMPILED
${CMAKE_BINARY_DIR}
${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/test_${_p_VAR}.cxx
@@ -116,17 +116,17 @@ macro( ecbuild_check_cxx_source_return SOURCE )
# if it did not compile make the return value fail code of 1
if( NOT ${_p_VAR}_COMPILED )
- message( STATUS "${_msg} failed to compile" )
+ ecbuild_debug( "${_msg} failed to compile" )
endif()
if( "${${_p_VAR}_EXITCODE}" MATCHES "FAILED_TO_RUN" )
- message( STATUS "${_msg} failed to run" )
+ ecbuild_debug( "${_msg} failed to run" )
endif()
# if the return value was 0 then it worked
if( ${_p_VAR}_COMPILED AND "${${_p_VAR}_EXITCODE}" EQUAL 0 )
- message(STATUS "${_msg} Success")
+ ecbuild_debug("${_msg} Success")
file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log
"Performing C++ SOURCE FILE Test ${_p_VAR} succeded with the following compile output:\n"
"${compile_OUTPUT}\n"
@@ -148,7 +148,7 @@ macro( ecbuild_check_cxx_source_return SOURCE )
set(${_p_OUTPUT} "" CACHE INTERNAL "Test ${_p_VAR} output")
endif()
- message(STATUS "Test ${_p_VAR} - Failed")
+ ecbuild_debug("Test ${_p_VAR} - Failed")
file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log
"Performing C++ SOURCE FILE Test ${_p_VAR} failed with the following compile output:\n"
"${compile_OUTPUT}\n"
diff --git a/cmake/ecbuild_check_fortran_source_return.cmake b/cmake/ecbuild_check_fortran_source_return.cmake
index 1c50896..6b007df 100644
--- a/cmake/ecbuild_check_fortran_source_return.cmake
+++ b/cmake/ecbuild_check_fortran_source_return.cmake
@@ -1,4 +1,4 @@
-# (C) Copyright 1996-2015 ECMWF.
+# (C) Copyright 1996-2016 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.
@@ -52,7 +52,7 @@
macro( ecbuild_check_fortran_source_return SOURCE )
- message( WARNING "This macro ecbuild_check_fortran_source has never been tested" )
+ ecbuild_warn( "This macro ecbuild_check_fortran_source has never been tested" )
set( options )
set( single_value_args VAR OUTPUT )
set( multi_value_args INCLUDES LIBS DEFINITIONS )
@@ -60,11 +60,11 @@ macro( ecbuild_check_fortran_source_return SOURCE )
cmake_parse_arguments( _PAR "${options}" "${single_value_args}" "${multi_value_args}" ${_FIRST_ARG} ${ARGN} )
if(_PAR_UNPARSED_ARGUMENTS)
- message(FATAL_ERROR "Unknown keywords given to ecbuild_check_fortran_source_return(): \"${_PAR_UNPARSED_ARGUMENTS}\"")
+ ecbuild_critical("Unknown keywords given to ecbuild_check_fortran_source_return(): \"${_PAR_UNPARSED_ARGUMENTS}\"")
endif()
if( NOT _PAR_VAR OR NOT _PAR_OUTPUT )
- message(FATAL_ERROR "The call to ecbuild_check_fortran_source_return() doesn't specify either SOURCE, VAR or OUTPUT")
+ ecbuild_critical("The call to ecbuild_check_fortran_source_return() doesn't specify either SOURCE, VAR or OUTPUT")
endif()
@@ -98,7 +98,7 @@ macro( ecbuild_check_fortran_source_return SOURCE )
file( WRITE "${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/test_${_PAR_VAR}.f" "${SOURCE}\n" )
- message( STATUS "Performing Test ${_PAR_VAR}" )
+ ecbuild_debug( "Performing Test ${_PAR_VAR}" )
try_run( ${_PAR_VAR}_EXITCODE ${_PAR_VAR}_COMPILED
${CMAKE_BINARY_DIR}
${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/test_${_PAR_VAR}.f
@@ -118,7 +118,7 @@ macro( ecbuild_check_fortran_source_return SOURCE )
# if the return value was 0 then it worked
if("${${_PAR_VAR}_EXITCODE}" EQUAL 0)
- message(STATUS "Performing Test ${_PAR_VAR} - Success")
+ ecbuild_debug("Performing Test ${_PAR_VAR} - Success")
file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log
"Performing Fortran SOURCE FILE Test ${_PAR_VAR} succeded with the following compile output:\n"
"${compile_OUTPUT}\n"
@@ -140,7 +140,7 @@ macro( ecbuild_check_fortran_source_return SOURCE )
set(${_PAR_OUTPUT} "" CACHE INTERNAL "Test ${_PAR_VAR} output")
endif()
- message(STATUS "Performing Test ${_PAR_VAR} - Failed")
+ ecbuild_debug("Performing Test ${_PAR_VAR} - Failed")
file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log
"Performing C SOURCE FILE Test ${_PAR_VAR} failed with the following compile output:\n"
"${compile_OUTPUT}\n"
diff --git a/cmake/ecbuild_check_functions.cmake b/cmake/ecbuild_check_functions.cmake
index 25f9d62..7b850e9 100644
--- a/cmake/ecbuild_check_functions.cmake
+++ b/cmake/ecbuild_check_functions.cmake
@@ -1,4 +1,4 @@
-# (C) Copyright 1996-2015 ECMWF.
+# (C) Copyright 1996-2016 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.
diff --git a/cmake/ecbuild_check_os.cmake b/cmake/ecbuild_check_os.cmake
index 06be4c7..7bbb344 100644
--- a/cmake/ecbuild_check_os.cmake
+++ b/cmake/ecbuild_check_os.cmake
@@ -1,4 +1,4 @@
-# (C) Copyright 1996-2015 ECMWF.
+# (C) Copyright 1996-2016 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.
@@ -23,7 +23,7 @@ math( EXPR EC_OS_BITS "${CMAKE_SIZEOF_VOID_P} * 8" )
# we only support 32 and 64 bit operating systems
if( NOT EC_OS_BITS EQUAL "32" AND NOT EC_OS_BITS EQUAL "64" )
- message( FATAL_ERROR "operating system ${CMAKE_SYSTEM} ${EC_OS_BITS} bits -- ecbuild only supports 32 or 64 bit OS's" )
+ ecbuild_critical( "operating system ${CMAKE_SYSTEM} ${EC_OS_BITS} bits -- ecbuild only supports 32 or 64 bit OS's" )
endif()
############################################################################################
@@ -56,21 +56,21 @@ if( ENABLE_OS_TYPES_TEST )
ecbuild_cache_check_type_size( ssize_t EC_SIZEOF_SSIZE_T )
ecbuild_cache_check_type_size( off_t EC_SIZEOF_OFF_T )
-# message( STATUS "sizeof void* [${EC_SIZEOF_PTR}]" )
-# message( STATUS "sizeof off_t [${EC_SIZEOF_OFF_T}]" )
-# message( STATUS "sizeof int [${EC_SIZEOF_INT}]" )
-# message( STATUS "sizeof short [${EC_SIZEOF_SHORT}]" )
-# message( STATUS "sizeof long [${EC_SIZEOF_LONG}]" )
-# message( STATUS "sizeof size_t [${EC_SIZEOF_SIZE_T}]" )
-# message( STATUS "sizeof float [${EC_SIZEOF_FLOAT}]" )
-# message( STATUS "sizeof double [${EC_SIZEOF_DOUBLE}]" )
-# message( STATUS "sizeof long long [${EC_SIZEOF_LONG_LONG}]" )
-# message( STATUS "sizeof long double [${EC_SIZEOF_LONG_DOUBLE}]" )
-
-# message( STATUS "system sizeof :" )
-# message( STATUS " void* [${EC_SIZEOF_PTR}] size_t [${EC_SIZEOF_SIZE_T}] off_t [${EC_SIZEOF_OFF_T}] short [${EC_SIZEOF_SHORT}]" )
-# message( STATUS " int [${EC_SIZEOF_INT}] long [${EC_SIZEOF_LONG}] long long [${EC_SIZEOF_LONG_LONG}]" )
-# message( STATUS " float [${EC_SIZEOF_FLOAT}] double [${EC_SIZEOF_DOUBLE}] long double [${EC_SIZEOF_LONG_DOUBLE}]" )
+# ecbuild_info( "sizeof void* [${EC_SIZEOF_PTR}]" )
+# ecbuild_info( "sizeof off_t [${EC_SIZEOF_OFF_T}]" )
+# ecbuild_info( "sizeof int [${EC_SIZEOF_INT}]" )
+# ecbuild_info( "sizeof short [${EC_SIZEOF_SHORT}]" )
+# ecbuild_info( "sizeof long [${EC_SIZEOF_LONG}]" )
+# ecbuild_info( "sizeof size_t [${EC_SIZEOF_SIZE_T}]" )
+# ecbuild_info( "sizeof float [${EC_SIZEOF_FLOAT}]" )
+# ecbuild_info( "sizeof double [${EC_SIZEOF_DOUBLE}]" )
+# ecbuild_info( "sizeof long long [${EC_SIZEOF_LONG_LONG}]" )
+# ecbuild_info( "sizeof long double [${EC_SIZEOF_LONG_DOUBLE}]" )
+
+# ecbuild_info( "system sizeof :" )
+# ecbuild_info( " void* [${EC_SIZEOF_PTR}] size_t [${EC_SIZEOF_SIZE_T}] off_t [${EC_SIZEOF_OFF_T}] short [${EC_SIZEOF_SHORT}]" )
+# ecbuild_info( " int [${EC_SIZEOF_INT}] long [${EC_SIZEOF_LONG}] long long [${EC_SIZEOF_LONG_LONG}]" )
+# ecbuild_info( " float [${EC_SIZEOF_FLOAT}] double [${EC_SIZEOF_DOUBLE}] long double [${EC_SIZEOF_LONG_DOUBLE}]" )
endif()
@@ -231,7 +231,7 @@ if( ENABLE_PROFILING )
unset( _flags )
else()
- message( WARNING "Profiling enabled but ecbuild doesn't know how to enable for this particular compiler ${CMAKE_C_COMPILER_ID}")
+ ecbuild_warn( "Profiling enabled but ecbuild doesn't know how to enable for this particular compiler ${CMAKE_C_COMPILER_ID}")
endif()
endif()
@@ -377,7 +377,7 @@ endif()
if( ${CMAKE_SYSTEM_NAME} MATCHES "CYGWIN" )
set( EC_OS_NAME "cygwin" )
- message( WARNING "Building on Cygwin should work but is untested" )
+ ecbuild_warn( "Building on Cygwin should work but is untested" )
endif()
@@ -386,11 +386,11 @@ endif()
if( ${EC_OS_NAME} MATCHES "UNKNOWN" )
if( DISABLE_OS_CHECK )
- message( WARNING "ecBuild is untested for this operating system: [${CMAKE_SYSTEM_NAME}]"
- " -- DISABLE_OS_CHECK is ON so proceeding at your own risk ..." )
+ ecbuild_warn( "ecBuild is untested for this operating system: [${CMAKE_SYSTEM_NAME}]"
+ " -- DISABLE_OS_CHECK is ON so proceeding at your own risk ..." )
else()
- message( FATAL_ERROR "ecBuild is untested for this operating system: [${CMAKE_SYSTEM_NAME}]"
- " -- refusing to continue. Disable this check with -DDISABLE_OS_CHECK=ON" )
+ ecbuild_critical( "ecBuild is untested for this operating system: [${CMAKE_SYSTEM_NAME}]"
+ " -- refusing to continue. Disable this check with -DDISABLE_OS_CHECK=ON" )
endif()
endif()
diff --git a/cmake/ecbuild_config.h.in b/cmake/ecbuild_config.h.in
index 2a01618..eef9b85 100644
--- a/cmake/ecbuild_config.h.in
+++ b/cmake/ecbuild_config.h.in
@@ -1,5 +1,5 @@
/*
- * (C) Copyright 1996-2015 ECMWF.
+ * (C) Copyright 1996-2016 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.
diff --git a/cmake/ecbuild_declare_project.cmake b/cmake/ecbuild_declare_project.cmake
index 23e835d..1c2e93b 100644
--- a/cmake/ecbuild_declare_project.cmake
+++ b/cmake/ecbuild_declare_project.cmake
@@ -1,4 +1,4 @@
-# (C) Copyright 1996-2015 ECMWF.
+# (C) Copyright 1996-2016 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.
@@ -72,7 +72,7 @@ macro( ecbuild_declare_project )
# ecbuild_debug_var( ${PNAME}_GIT_SHA1 )
# ecbuild_debug_var( ${PNAME}_GIT_SHA1_SHORT )
else()
- message( STATUS "Could not get git-sha1 for project ${PNAME}")
+ ecbuild_debug( "Could not get git-sha1 for project ${PNAME}")
endif()
endif()
@@ -133,7 +133,7 @@ macro( ecbuild_declare_project )
foreach( p LIB BIN INCLUDE DATA CMAKE )
if( IS_ABSOLUTE ${INSTALL_${p}_DIR} )
- message( WARNING "Defining INSTALL_${p}_DIR as absolute path '${INSTALL_${p}_DIR}' makes this build non-relocatable, possibly breaking the installation of RPMS and DEB packages" )
+ ecbuild_warn( "Defining INSTALL_${p}_DIR as absolute path '${INSTALL_${p}_DIR}' makes this build non-relocatable, possibly breaking the installation of RPMS and DEB packages" )
endif()
endforeach()
@@ -146,7 +146,7 @@ macro( ecbuild_declare_project )
set( ${PNAME}_FULL_INSTALL_${p}_DIR "${CMAKE_INSTALL_PREFIX}/${${var}}"
CACHE INTERNAL "${PNAME} ${p} full install path" )
else()
- message( WARNING "Setting an absolute path for ${VAR} in project ${PNAME}, breakes generation of relocatable binary packages (rpm,deb,...)" )
+ ecbuild_warn( "Setting an absolute path for ${VAR} in project ${PNAME}, breakes generation of relocatable binary packages (rpm,deb,...)" )
set( ${PNAME}_FULL_INSTALL_${p}_DIR "${${var}}"
CACHE INTERNAL "${PNAME} ${p} full install path" )
endif()
@@ -185,9 +185,9 @@ macro( ecbuild_declare_project )
message( STATUS "---------------------------------------------------------" )
if( ${PNAME}_GIT_SHA1_SHORT )
- message( STATUS "[${PROJECT_NAME}] (${${PNAME}_VERSION_STR}) [${${PNAME}_GIT_SHA1_SHORT}]" )
+ ecbuild_info( "[${PROJECT_NAME}] (${${PNAME}_VERSION_STR}) [${${PNAME}_GIT_SHA1_SHORT}]" )
else()
- message( STATUS "[${PROJECT_NAME}] (${${PNAME}_VERSION_STR})" )
+ ecbuild_info( "[${PROJECT_NAME}] (${${PNAME}_VERSION_STR})" )
endif()
endmacro( ecbuild_declare_project )
diff --git a/cmake/ecbuild_define_build_types.cmake b/cmake/ecbuild_define_build_types.cmake
index 69c5d1b..cf92d23 100644
--- a/cmake/ecbuild_define_build_types.cmake
+++ b/cmake/ecbuild_define_build_types.cmake
@@ -1,4 +1,4 @@
-# (C) Copyright 1996-2015 ECMWF.
+# (C) Copyright 1996-2016 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.
@@ -55,5 +55,5 @@ if( NOT CMAKE_BUILD_TYPE MATCHES "None" AND
NOT CMAKE_BUILD_TYPE MATCHES "Production" AND
NOT CMAKE_BUILD_TYPE MATCHES "Release" AND
NOT CMAKE_BUILD_TYPE MATCHES "RelWithDebInfo" )
- message( FATAL_ERROR "CMAKE_BUILD_TYPE is not recognized. ${_BUILD_TYPE_MSG}" )
+ ecbuild_critical( "CMAKE_BUILD_TYPE is not recognized. ${_BUILD_TYPE_MSG}" )
endif()
diff --git a/cmake/ecbuild_define_libs_and_execs_target.cmake b/cmake/ecbuild_define_libs_and_execs_target.cmake
index ff009f4..812f42c 100644
--- a/cmake/ecbuild_define_libs_and_execs_target.cmake
+++ b/cmake/ecbuild_define_libs_and_execs_target.cmake
@@ -1,4 +1,4 @@
-# (C) Copyright 1996-2015 ECMWF.
+# (C) Copyright 1996-2016 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.
diff --git a/cmake/ecbuild_define_links_target.cmake b/cmake/ecbuild_define_links_target.cmake
index bd9fe6c..b5f53fe 100644
--- a/cmake/ecbuild_define_links_target.cmake
+++ b/cmake/ecbuild_define_links_target.cmake
@@ -1,4 +1,4 @@
-# (C) Copyright 1996-2015 ECMWF.
+# (C) Copyright 1996-2016 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.
diff --git a/cmake/ecbuild_define_options.cmake b/cmake/ecbuild_define_options.cmake
index e13bc8d..af40ae1 100644
--- a/cmake/ecbuild_define_options.cmake
+++ b/cmake/ecbuild_define_options.cmake
@@ -1,4 +1,4 @@
-# (C) Copyright 1996-2015 ECMWF.
+# (C) Copyright 1996-2016 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.
diff --git a/cmake/ecbuild_define_paths.cmake b/cmake/ecbuild_define_paths.cmake
index 822bf71..856903d 100644
--- a/cmake/ecbuild_define_paths.cmake
+++ b/cmake/ecbuild_define_paths.cmake
@@ -1,4 +1,4 @@
-# (C) Copyright 1996-2015 ECMWF.
+# (C) Copyright 1996-2016 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.
diff --git a/cmake/ecbuild_dont_pack.cmake b/cmake/ecbuild_dont_pack.cmake
index 099ee1d..bc62182 100644
--- a/cmake/ecbuild_dont_pack.cmake
+++ b/cmake/ecbuild_dont_pack.cmake
@@ -1,4 +1,4 @@
-# (C) Copyright 1996-2015 ECMWF.
+# (C) Copyright 1996-2016 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.
@@ -41,11 +41,11 @@ macro( ecbuild_dont_pack )
cmake_parse_arguments( _PAR "${options}" "${single_value_args}" "${multi_value_args}" ${_FIRST_ARG} ${ARGN} )
if(_PAR_UNPARSED_ARGUMENTS)
- message(FATAL_ERROR "Unknown keywords given to ecbuild_dont_pack(): \"${_PAR_UNPARSED_ARGUMENTS}\"")
+ ecbuild_critical("Unknown keywords given to ecbuild_dont_pack(): \"${_PAR_UNPARSED_ARGUMENTS}\"")
endif()
if( NOT DEFINED _PAR_REGEX AND NOT DEFINED _PAR_FILES AND NOT DEFINED _PAR_DIRS )
- message(FATAL_ERROR "Call to ecbuild_dont_pack does not speficify any list to avoid packing.")
+ ecbuild_critical("Call to ecbuild_dont_pack does not speficify any list to avoid packing.")
endif()
set( LOCAL_FILES_NOT_TO_PACK "" )
diff --git a/cmake/ecbuild_download_resource.cmake b/cmake/ecbuild_download_resource.cmake
index d313704..3b2f90e 100644
--- a/cmake/ecbuild_download_resource.cmake
+++ b/cmake/ecbuild_download_resource.cmake
@@ -1,4 +1,4 @@
-# (C) Copyright 1996-2015 ECMWF.
+# (C) Copyright 1996-2016 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.
@@ -34,12 +34,12 @@ function( ecbuild_download_resource _p_OUT _p_URL )
execute_process( COMMAND ${WGET_PROGRAM} -nv -O ${_p_OUT} ${_p_URL}
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} RESULT_VARIABLE CMD_RESULT )
else()
- message(FATAL_ERROR "Could not find curl or wget. Error downloading ${_p_URL}")
+ ecbuild_critical("Could not find curl or wget. Error downloading ${_p_URL}")
endif()
endif()
if(CMD_RESULT)
- message(FATAL_ERROR "Error downloading ${_p_URL}")
+ ecbuild_critical("Error downloading ${_p_URL}")
endif()
endif()
diff --git a/cmake/ecbuild_echo_targets.cmake b/cmake/ecbuild_echo_targets.cmake
index 217a196..1406a1f 100644
--- a/cmake/ecbuild_echo_targets.cmake
+++ b/cmake/ecbuild_echo_targets.cmake
@@ -1,4 +1,4 @@
-# (C) Copyright 1996-2015 ECMWF.
+# (C) Copyright 1996-2016 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.
@@ -33,11 +33,11 @@ function(ecbuild_echo_target_property tgt prop)
# only produce output for values that are set
if(s)
- message("tgt='${tgt}' prop='${prop}'")
- message(" value='${v}'")
- message(" defined='${d}'")
- message(" set='${s}'")
- message("")
+ ecbuild_debug("tgt='${tgt}' prop='${prop}'")
+ ecbuild_debug(" value='${v}'")
+ ecbuild_debug(" defined='${d}'")
+ ecbuild_debug(" set='${s}'")
+ ecbuild_debug("")
endif()
cmake_policy(POP)
@@ -58,7 +58,7 @@ endfunction()
function(ecbuild_echo_target tgt)
if(NOT TARGET ${tgt})
- message("There is no target named '${tgt}'")
+ ecbuild_debug("There is no target named '${tgt}'")
return()
endif()
@@ -205,11 +205,11 @@ WIN32_EXECUTABLE
XCODE_ATTRIBUTE_WHATEVER
)
- message("======================== ${tgt} ========================")
+ ecbuild_debug("======================== ${tgt} ========================")
foreach(p ${props})
ecbuild_echo_target_property("${tgt}" "${p}")
endforeach()
- message("")
+ ecbuild_debug("")
endfunction()
##############################################################################
diff --git a/cmake/ecbuild_enable_fortran.cmake b/cmake/ecbuild_enable_fortran.cmake
index 434d5ee..c1c5503 100644
--- a/cmake/ecbuild_enable_fortran.cmake
+++ b/cmake/ecbuild_enable_fortran.cmake
@@ -1,4 +1,4 @@
-# (C) Copyright 1996-2015 ECMWF.
+# (C) Copyright 1996-2016 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.
@@ -36,7 +36,7 @@ macro( ecbuild_enable_fortran )
cmake_parse_arguments( _PAR "${options}" "${single_value_args}" "${multi_value_args}" ${_FIRST_ARG} ${ARGN} )
if(_PAR_UNPARSED_ARGUMENTS)
- message(FATAL_ERROR "Unknown keywords given to ecbuild_enable_fortran(): \"${_PAR_UNPARSED_ARGUMENTS}\"")
+ ecbuild_critical("Unknown keywords given to ecbuild_enable_fortran(): \"${_PAR_UNPARSED_ARGUMENTS}\"")
endif()
if( NOT CMAKE_Fortran_COMPILER_LOADED )
@@ -53,7 +53,7 @@ macro( ecbuild_enable_fortran )
set( CMAKE_Fortran_COMPILER_WORKS 1 )
endif()
if( NOT CMAKE_Fortran_COMPILER OR NOT CMAKE_Fortran_COMPILER_WORKS )
- message( FATAL_ERROR "Fortran compiler required by project ${PROJECT_NAME} but does not seem to work" )
+ ecbuild_critical( "Fortran compiler required by project ${PROJECT_NAME} but does not seem to work" )
endif()
endif()
diff --git a/cmake/ecbuild_features.cmake b/cmake/ecbuild_features.cmake
index aebd874..6d20038 100644
--- a/cmake/ecbuild_features.cmake
+++ b/cmake/ecbuild_features.cmake
@@ -1,4 +1,4 @@
-# (C) Copyright 1996-2015 ECMWF.
+# (C) Copyright 1996-2016 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.
@@ -92,7 +92,7 @@ function( ecbuild_set_feature _name )
endif()
if( NOT _feature_found )
- message( WARNING "Feature ${_name} has not yet been enabled or disabled" )
+ ecbuild_warn( "Feature ${_name} has not yet been enabled or disabled" )
endif()
endfunction()
diff --git a/cmake/ecbuild_find_fortranlibs.cmake b/cmake/ecbuild_find_fortranlibs.cmake
index 850c4a3..279833f 100644
--- a/cmake/ecbuild_find_fortranlibs.cmake
+++ b/cmake/ecbuild_find_fortranlibs.cmake
@@ -1,4 +1,4 @@
-# (C) Copyright 1996-2015 ECMWF.
+# (C) Copyright 1996-2016 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.
@@ -39,7 +39,7 @@ macro( ecbuild_find_fortranlibs )
cmake_parse_arguments( _PAR "${options}" "${single_value_args}" "${multi_value_args}" ${_FIRST_ARG} ${ARGN} )
if(_PAR_UNPARSED_ARGUMENTS)
- message(FATAL_ERROR "Unknown keywords given to ecbuild_find_python(): \"${_PAR_UNPARSED_ARGUMENTS}\"")
+ ecbuild_critical("Unknown keywords given to ecbuild_find_python(): \"${_PAR_UNPARSED_ARGUMENTS}\"")
endif()
if( NOT FORTRANLIBS_FOUND ) # don't repeat search
@@ -69,7 +69,7 @@ macro( ecbuild_find_fortranlibs )
endif()
if( _PAR_COMPILER AND NOT __known_fcomp )
- message( FATAL_ERROR "unknown fortran compiler ${_PAR_COMPILER}" )
+ ecbuild_critical( "unknown fortran compiler ${_PAR_COMPILER}" )
endif()
### set path from environment variables
@@ -88,7 +88,7 @@ macro( ecbuild_find_fortranlibs )
WITH_XL_FORTRAN OR WITH_INTEL_FORTRAN)
AND NOT (DEFINED PGI_PATH OR DEFINED LIBGFORTRAN_PATH OR
DEFINED XLF_PATH OR DEFINED INTEL_PATH) )
- message( WARNING "Finding fortran libs for unspecified Fortran compiler: default search [ gfortran ]" )
+ ecbuild_warn( "Finding fortran libs for unspecified Fortran compiler: default search [ gfortran ]" )
set( WITH_LIBGFORTRAN 1 )
endif()
@@ -148,13 +148,13 @@ macro( ecbuild_find_fortranlibs )
set( FORTRANLIBS_FOUND 1 CACHE INTERNAL "Fortran libraries found" )
set( FORTRANLIBS_NAME ${_flibs_txt} CACHE INTERNAL "Fortran library name" )
set( FORTRAN_LIBRARIES ${FORTRAN_LIBRARIES} CACHE INTERNAL "Fortran libraries" )
- message( STATUS "Found Fortran libraries: ${_flibs_txt}" )
+ ecbuild_info( "Found Fortran libraries: ${_flibs_txt}" )
else()
set( FORTRANLIBS_FOUND 0 )
if( _PAR_REQUIRED )
- message( FATAL_ERROR "Failed to find Fortran libraries" )
+ ecbuild_critical( "Failed to find Fortran libraries" )
else()
- message( STATUS "Failed to find Fortran libraries" )
+ ecbuild_warn( "Failed to find Fortran libraries" )
endif()
endif()
diff --git a/cmake/ecbuild_find_lexyacc.cmake b/cmake/ecbuild_find_lexyacc.cmake
index 4853851..628488f 100644
--- a/cmake/ecbuild_find_lexyacc.cmake
+++ b/cmake/ecbuild_find_lexyacc.cmake
@@ -1,4 +1,4 @@
-# (C) Copyright 1996-2015 ECMWF.
+# (C) Copyright 1996-2016 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.
diff --git a/cmake/ecbuild_find_mpi.cmake b/cmake/ecbuild_find_mpi.cmake
index 82fc4b5..a0c6cfa 100644
--- a/cmake/ecbuild_find_mpi.cmake
+++ b/cmake/ecbuild_find_mpi.cmake
@@ -1,4 +1,4 @@
-# (C) Copyright 1996-2015 ECMWF.
+# (C) Copyright 1996-2016 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.
@@ -81,7 +81,7 @@ macro( ecbuild_find_mpi )
cmake_parse_arguments( _PAR "${options}" "${single_value_args}" "${multi_value_args}" ${_FIRST_ARG} ${ARGN} )
if(_PAR_UNPARSED_ARGUMENTS)
- message(FATAL_ERROR "Unknown keywords given to ecbuild_find_mpi(): \"${_PAR_UNPARSED_ARGUMENTS}\"")
+ ecbuild_critical("Unknown keywords given to ecbuild_find_mpi(): \"${_PAR_UNPARSED_ARGUMENTS}\"")
endif()
# if user defined compilers are MPI compliant, then we use them ...
@@ -110,7 +110,7 @@ macro( ecbuild_find_mpi )
C_COMPILER_SUPPORTS_MPI )
if( C_COMPILER_SUPPORTS_MPI )
- message( STATUS "C compiler supports MPI -- ${CMAKE_C_COMPILER}" )
+ ecbuild_info( "C compiler supports MPI -- ${CMAKE_C_COMPILER}" )
set( MPI_C_COMPILER ${CMAKE_C_COMPILER} )
endif()
@@ -134,7 +134,7 @@ macro( ecbuild_find_mpi )
CXX_COMPILER_SUPPORTS_MPI )
if( CXX_COMPILER_SUPPORTS_MPI )
- message( STATUS "C++ compiler supports MPI -- ${CMAKE_CXX_COMPILER}" )
+ ecbuild_info( "C++ compiler supports MPI -- ${CMAKE_CXX_COMPILER}" )
set( MPI_CXX_COMPILER ${CMAKE_CXX_COMPILER} )
endif()
@@ -157,7 +157,7 @@ macro( ecbuild_find_mpi )
Fortran_COMPILER_SUPPORTS_MPI )
if( Fortran_COMPILER_SUPPORTS_MPI )
- message( STATUS "Fortran compiler supports MPI (F90) -- ${CMAKE_Fortran_COMPILER}" )
+ ecbuild_info( "Fortran compiler supports MPI (F90) -- ${CMAKE_Fortran_COMPILER}" )
set( MPI_Fortran_COMPILER ${CMAKE_Fortran_COMPILER} )
set( MPI_Fortran_FOUND TRUE )
endif()
@@ -251,7 +251,7 @@ macro( ecbuild_enable_mpi )
cmake_parse_arguments( _PAR "${options}" "${single_value_args}" "${multi_value_args}" ${_FIRST_ARG} ${ARGN} )
if(_PAR_UNPARSED_ARGUMENTS)
- message(FATAL_ERROR "Unknown keywords given to ecbuild_find_mpi(): \"${_PAR_UNPARSED_ARGUMENTS}\"")
+ ecbuild_critical("Unknown keywords given to ecbuild_find_mpi(): \"${_PAR_UNPARSED_ARGUMENTS}\"")
endif()
if( NOT _PAR_COMPONENTS )
@@ -304,7 +304,7 @@ macro( ecbuild_include_mpi )
cmake_parse_arguments( _PAR "${options}" "${single_value_args}" "${multi_value_args}" ${_FIRST_ARG} ${ARGN} )
if(_PAR_UNPARSED_ARGUMENTS)
- message(FATAL_ERROR "Unknown keywords given to ecbuild_find_mpi(): \"${_PAR_UNPARSED_ARGUMENTS}\"")
+ ecbuild_critical("Unknown keywords given to ecbuild_find_mpi(): \"${_PAR_UNPARSED_ARGUMENTS}\"")
endif()
if( MPI_C_FOUND AND NOT C_COMPILER_SUPPORTS_MPI )
diff --git a/cmake/ecbuild_find_omp.cmake b/cmake/ecbuild_find_omp.cmake
index ff38ccf..47c05c2 100644
--- a/cmake/ecbuild_find_omp.cmake
+++ b/cmake/ecbuild_find_omp.cmake
@@ -1,4 +1,4 @@
-# (C) Copyright 1996-2015 ECMWF.
+# (C) Copyright 1996-2016 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.
@@ -123,7 +123,7 @@ macro( ecbuild_find_omp )
cmake_parse_arguments( _PAR "${options}" "${single_value_args}" "${multi_value_args}" ${_FIRST_ARG} ${ARGN} )
if( NOT _PAR_COMPONENTS )
- message( FATAL_ERROR "No COMPONENTS were specified, looking for OMP.\n Please find with COMPONENTS C CXX Fortran " )
+ ecbuild_critical( "No COMPONENTS were specified, looking for OMP.\n Please find with COMPONENTS C CXX Fortran " )
endif()
set( _STUBS "" )
diff --git a/cmake/ecbuild_find_package.cmake b/cmake/ecbuild_find_package.cmake
index 3ec1204..f7f1a9c 100644
--- a/cmake/ecbuild_find_package.cmake
+++ b/cmake/ecbuild_find_package.cmake
@@ -1,4 +1,4 @@
-# (C) Copyright 1996-2015 ECMWF.
+# (C) Copyright 1996-2016 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.
@@ -92,15 +92,15 @@ macro( ecbuild_find_package )
cmake_parse_arguments( _PAR "${options}" "${single_value_args}" "${multi_value_args}" ${_FIRST_ARG} ${ARGN} )
if(_PAR_UNPARSED_ARGUMENTS)
- message(FATAL_ERROR "Unknown keywords given to ecbuild_find_package(): \"${_PAR_UNPARSED_ARGUMENTS}\"")
+ ecbuild_critical("Unknown keywords given to ecbuild_find_package(): \"${_PAR_UNPARSED_ARGUMENTS}\"")
endif()
if( NOT _PAR_NAME )
- message(FATAL_ERROR "The call to ecbuild_find_package() doesn't specify the NAME.")
+ ecbuild_critical("The call to ecbuild_find_package() doesn't specify the NAME.")
endif()
if( _PAR_EXACT AND NOT _PAR_VERSION )
- message(FATAL_ERROR "Call to ecbuild_find_package() requests EXACT but doesn't specify VERSION.")
+ ecbuild_critical("Call to ecbuild_find_package() requests EXACT but doesn't specify VERSION.")
endif()
# ecbuild_debug_var( _PAR_NAME )
@@ -191,10 +191,10 @@ macro( ecbuild_find_package )
if( NOT ${_PAR_NAME}_FOUND )
if( ${_PAR_NAME}_PATH )
- message( FATAL_ERROR "${_PAR_NAME}_PATH was provided by user but package ${_PAR_NAME} wasn't found" )
+ ecbuild_critical( "${_PAR_NAME}_PATH was provided by user but package ${_PAR_NAME} wasn't found" )
endif()
if( ${pkgUPPER}_PATH )
- message( FATAL_ERROR "${pkgUPPER}_PATH was provided by user but package ${_PAR_NAME} wasn't found" )
+ ecbuild_critical( "${pkgUPPER}_PATH was provided by user but package ${_PAR_NAME} wasn't found" )
endif()
endif()
@@ -250,7 +250,7 @@ macro( ecbuild_find_package )
if( ${_PAR_NAME}_VERSION )
if( _PAR_EXACT )
if( NOT ${_PAR_NAME}_VERSION VERSION_EQUAL _PAR_VERSION )
- message( WARNING "${PROJECT_NAME} requires (exactly) ${_PAR_NAME} = ${_PAR_VERSION} -- found ${${_PAR_NAME}_VERSION}" )
+ ecbuild_warn( "${PROJECT_NAME} requires (exactly) ${_PAR_NAME} = ${_PAR_VERSION} -- found ${${_PAR_NAME}_VERSION}" )
set( _version_acceptable 0 )
endif()
else()
@@ -258,14 +258,14 @@ macro( ecbuild_find_package )
set( _version_acceptable 1 )
else()
if( NOT _PAR_QUIET )
- message( WARNING "${PROJECT_NAME} requires ${_PAR_NAME} >= ${_PAR_VERSION} -- found ${${_PAR_NAME}_VERSION}" )
+ ecbuild_warn( "${PROJECT_NAME} requires ${_PAR_NAME} >= ${_PAR_VERSION} -- found ${${_PAR_NAME}_VERSION}" )
endif()
set( _version_acceptable 0 )
endif()
endif()
else()
if( NOT _PAR_QUIET )
- message( WARNING "${PROJECT_NAME} found ${_PAR_NAME} but no version information, so cannot check if satisfies ${_PAR_VERSION}" )
+ ecbuild_warn( "${PROJECT_NAME} found ${_PAR_NAME} but no version information, so cannot check if satisfies ${_PAR_VERSION}" )
endif()
set( _version_acceptable 0 )
endif()
@@ -278,7 +278,7 @@ macro( ecbuild_find_package )
set( ${pkgUPPER}_FOUND ${${_PAR_NAME}_FOUND} )
else()
if( NOT _PAR_QUIET )
- message( WARNING "${PROJECT_NAME} found ${_PAR_NAME} but with unsuitable version" )
+ ecbuild_warn( "${PROJECT_NAME} found ${_PAR_NAME} but with unsuitable version" )
endif()
set( ${pkgUPPER}_FOUND 0 )
set( ${_PAR_NAME}_FOUND 0 )
@@ -303,21 +303,21 @@ macro( ecbuild_find_package )
if( ${_PAR_NAME}_FOUND OR ${pkgUPPER}_FOUND )
if( NOT _PAR_QUIET )
- message( STATUS "[${_PAR_NAME}] (${${_PAR_NAME}_VERSION})" )
+ ecbuild_info( "[${_PAR_NAME}] (${${_PAR_NAME}_VERSION})" )
foreach( var in ITEMS INCLUDE_DIR INCLUDE_DIRS DEFINITIONS LIBRARY LIBRARIES )
if( ${pkgUPPER}_${var} )
- message( STATUS " ${pkgUPPER}_${var} : [${${pkgUPPER}_${var}}]" )
+ ecbuild_info( " ${pkgUPPER}_${var} : [${${pkgUPPER}_${var}}]" )
elseif( ${_PAR_NAME}_${var} )
- message( STATUS " ${_PAR_NAME}_${var} : [${${_PAR_NAME}_${var}}]" )
+ ecbuild_info( " ${_PAR_NAME}_${var} : [${${_PAR_NAME}_${var}}]" )
endif()
endforeach()
endif()
else()
if( _PAR_REQUIRED )
- message( FATAL_ERROR ${_failed_message} " !! ${PROJECT_NAME} requires package ${_PAR_NAME} !!" )
+ ecbuild_critical( ${_failed_message} " !! ${PROJECT_NAME} requires package ${_PAR_NAME} !!" )
else()
if( NOT _PAR_QUIET )
- message( STATUS ${_failed_message} )
+ ecbuild_warn( ${_failed_message} )
endif()
endif()
endif()
diff --git a/cmake/ecbuild_find_perl.cmake b/cmake/ecbuild_find_perl.cmake
index c615203..97b22f8 100644
--- a/cmake/ecbuild_find_perl.cmake
+++ b/cmake/ecbuild_find_perl.cmake
@@ -1,4 +1,4 @@
-# (C) Copyright 1996-2015 ECMWF.
+# (C) Copyright 1996-2016 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.
@@ -45,13 +45,13 @@ macro( ecbuild_find_perl )
cmake_parse_arguments( _p "${options}" "${single_value_args}" "${multi_value_args}" ${_FIRST_ARG} ${ARGN} )
if(_p_UNPARSED_ARGUMENTS)
- message(FATAL_ERROR "Unknown keywords given to ecbuild_find_perl(): \"${_p_UNPARSED_ARGUMENTS}\"")
+ ecbuild_critical("Unknown keywords given to ecbuild_find_perl(): \"${_p_UNPARSED_ARGUMENTS}\"")
endif()
find_package( Perl )
if( NOT PERL_EXECUTABLE AND _p_REQUIRED )
- message( FATAL_ERROR "Failed to find Perl (REQUIRED)" )
+ ecbuild_critical( "Failed to find Perl (REQUIRED)" )
endif()
if( PERL_EXECUTABLE )
diff --git a/cmake/ecbuild_find_python.cmake b/cmake/ecbuild_find_python.cmake
index e06e94f..48ba28f 100644
--- a/cmake/ecbuild_find_python.cmake
+++ b/cmake/ecbuild_find_python.cmake
@@ -1,4 +1,4 @@
-# (C) Copyright 1996-2015 ECMWF.
+# (C) Copyright 1996-2016 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.
@@ -60,7 +60,7 @@ function( ecbuild_find_python )
cmake_parse_arguments( _p "${options}" "${single_value_args}" "${multi_value_args}" ${_FIRST_ARG} ${ARGN} )
if(_p_UNPARSED_ARGUMENTS)
- message(FATAL_ERROR "Unknown keywords given to ecbuild_find_python(): \"${_p_UNPARSED_ARGUMENTS}\"")
+ ecbuild_critical("Unknown keywords given to ecbuild_find_python(): \"${_p_UNPARSED_ARGUMENTS}\"")
endif()
# find python executable
@@ -88,9 +88,9 @@ function( ecbuild_find_python )
set( PYTHONINTERP_FOUND 0 )
set( PYTHON_EXECUTABLE "PYTHON_EXECUTABLE-NOTFOUND" )
if( _p_REQUIRED )
- message( FATAL_ERROR "Required python version at least ${_p_VERSION} but found only ${PYTHON_VERSION_STRING}" )
+ ecbuild_critical( "Required python version at least ${_p_VERSION} but found only ${PYTHON_VERSION_STRING}" )
else()
- message( WARNING "Looking for python version at least ${_p_VERSION} but found only ${PYTHON_VERSION_STRING}\nMarking Python as NOTFOUND" )
+ ecbuild_warn( "Looking for python version at least ${_p_VERSION} but found only ${PYTHON_VERSION_STRING}\nMarking Python as NOTFOUND" )
endif()
endif()
endif()
diff --git a/cmake/ecbuild_generate_config_headers.cmake b/cmake/ecbuild_generate_config_headers.cmake
index 93cbb1f..6bc8301 100644
--- a/cmake/ecbuild_generate_config_headers.cmake
+++ b/cmake/ecbuild_generate_config_headers.cmake
@@ -1,4 +1,4 @@
-# (C) Copyright 1996-2015 ECMWF.
+# (C) Copyright 1996-2016 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.
@@ -36,7 +36,7 @@ function( ecbuild_generate_config_headers )
cmake_parse_arguments( _p "${options}" "${single_value_args}" "${multi_value_args}" ${_FIRST_ARG} ${ARGN} )
if(_PAR_UNPARSED_ARGUMENTS)
- message(FATAL_ERROR "Unknown keywords given to ecbuild_generate_config_headers(): \"${_PAR_UNPARSED_ARGUMENTS}\"")
+ ecbuild_critical("Unknown keywords given to ecbuild_generate_config_headers(): \"${_PAR_UNPARSED_ARGUMENTS}\"")
endif()
# generate list of compiler flags
diff --git a/cmake/ecbuild_generate_fortran_interfaces.cmake b/cmake/ecbuild_generate_fortran_interfaces.cmake
index d57d89a..d586248 100644
--- a/cmake/ecbuild_generate_fortran_interfaces.cmake
+++ b/cmake/ecbuild_generate_fortran_interfaces.cmake
@@ -1,4 +1,4 @@
-# (C) Copyright 1996-2015 ECMWF.
+# (C) Copyright 1996-2016 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.
@@ -29,39 +29,65 @@ function( ecbuild_generate_fortran_interfaces )
find_program( FCM_EXECUTABLE fcm REQUIRED DOC "Fortran interface generator" )
if( NOT FCM_EXECUTABLE )
- message( FATAL_ERROR "ecbuild_generate_fortran_interfaces: fcm executable not found." )
- endif()
-
- set( FCM_CONFIG_FILE "${PROJECT_SOURCE_DIR}/cmake/fcm-make-interfaces.cfg")
-
- if( NOT EXISTS ${FCM_CONFIG_FILE} )
- message( FATAL_ERROR "ecbuild_generate_fortran_interfaces: needs fcm configuration in ${FCM_CONFIG_FILE}" )
+ ecbuild_error( "ecbuild_generate_fortran_interfaces: fcm executable not found." )
endif()
set( options )
- set( single_value_args TARGET DESTINATION PARALLEL INCLUDE_DIRS GENERATED SOURCE_DIR )
+ set( single_value_args TARGET DESTINATION PARALLEL INCLUDE_DIRS GENERATED SOURCE_DIR FCM_CONFIG_FILE )
set( multi_value_args DIRECTORIES )
cmake_parse_arguments( P "${options}" "${single_value_args}" "${multi_value_args}" ${_FIRST_ARG} ${ARGN} )
if( NOT DEFINED P_TARGET )
- message( FATAL_ERROR "ecbuild_generate_fortran_interfaces: TARGET argument missing" )
+ ecbuild_error( "ecbuild_generate_fortran_interfaces: TARGET argument missing" )
endif()
if( NOT DEFINED P_DESTINATION )
- message( FATAL_ERROR "ecbuild_generate_fortran_interfaces: DESTINATION argument missing" )
+ ecbuild_error( "ecbuild_generate_fortran_interfaces: DESTINATION argument missing" )
endif()
if( NOT DEFINED P_DIRECTORIES )
- message( FATAL_ERROR "ecbuild_generate_fortran_interfaces: DIRECTORIES argument missing" )
+ ecbuild_error( "ecbuild_generate_fortran_interfaces: DIRECTORIES argument missing" )
endif()
if( NOT DEFINED P_PARALLEL OR (${CMAKE_SYSTEM_NAME} MATCHES "Darwin") )
set( P_PARALLEL 1 )
endif()
+ ecbuild_debug_var( P_PARALLEL )
+
if( NOT DEFINED P_SOURCE_DIR )
- message( FATAL_ERROR "ecbuild_generate_fortran_interfaces: SOURCE_DIR argument missing")
+ ecbuild_error( "ecbuild_generate_fortran_interfaces: SOURCE_DIR argument missing")
+ endif()
+
+ if( DEFINED P_FCM_CONFIG_FILE )
+ set( FCM_CONFIG_FILE ${P_FCM_CONFIG_FILE} )
+ endif()
+
+ if( NOT FCM_CONFIG_FILE )
+ set( PROJECT_FCM_CONFIG_FILE "${PROJECT_SOURCE_DIR}/cmake/fcm-make-interfaces.cfg" )
+ if( EXISTS ${PROJECT_FCM_CONFIG_FILE} )
+ set( FCM_CONFIG_FILE ${PROJECT_FCM_CONFIG_FILE} )
+ ecbuild_debug( "ecbuild_generate_fortran_interfaces: fcm configuration found in ${PROJECT_FCM_CONFIG_FILE}" )
+ else()
+ ecbuild_debug( "ecbuild_generate_fortran_interfaces: fcm configuration not found in ${PROJECT_FCM_CONFIG_FILE}" )
+ endif()
+ endif()
+
+ if( NOT FCM_CONFIG_FILE )
+ set( DEFAULT_FCM_CONFIG_FILE "${ECBUILD_MACROS_DIR}/fcm-make-interfaces.cfg" )
+ if( EXISTS ${DEFAULT_FCM_CONFIG_FILE} )
+ set( FCM_CONFIG_FILE ${DEFAULT_FCM_CONFIG_FILE} )
+ ecbuild_debug( "ecbuild_generate_fortran_interfaces: fcm configuration found in ${DEFAULT_FCM_CONFIG_FILE}" )
+ else()
+ ecbuild_debug( "ecbuild_generate_fortran_interfaces: fcm configuration not found in ${DEFAULT_FCM_CONFIG_FILE}" )
+ endif()
+ endif()
+
+ ecbuild_debug_var( FCM_CONFIG_FILE )
+
+ if( NOT EXISTS ${FCM_CONFIG_FILE} )
+ ecbuild_error( "ecbuild_generate_fortran_interfaces: needs fcm configuration in ${FCM_CONFIG_FILE}" )
endif()
foreach( _srcdir ${P_DIRECTORIES} )
@@ -91,6 +117,8 @@ function( ecbuild_generate_fortran_interfaces )
ecbuild_info("Target ${P_TARGET} will generate ${_cnt} interface files using FCM")
+
+
if( DEFINED P_GENERATED )
set( ${P_GENERATED} ${interface_files} PARENT_SCOPE )
endif()
diff --git a/cmake/ecbuild_generate_rpc.cmake b/cmake/ecbuild_generate_rpc.cmake
index 45a00ba..f06624f 100644
--- a/cmake/ecbuild_generate_rpc.cmake
+++ b/cmake/ecbuild_generate_rpc.cmake
@@ -1,4 +1,4 @@
-# (C) Copyright 1996-2015 ECMWF.
+# (C) Copyright 1996-2016 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.
@@ -45,20 +45,20 @@ macro( ecbuild_generate_rpc )
cmake_parse_arguments( _PAR "${options}" "${single_value_args}" "${multi_value_args}" ${_FIRST_ARG} ${ARGN} )
if(_PAR_UNPARSED_ARGUMENTS)
- message(FATAL_ERROR "Unknown keywords given to ecbuild_generate_rpc(): \"${_PAR_UNPARSED_ARGUMENTS}\"")
+ ecbuild_critical("Unknown keywords given to ecbuild_generate_rpc(): \"${_PAR_UNPARSED_ARGUMENTS}\"")
endif()
if( NOT _PAR_SOURCE )
- message(FATAL_ERROR "The call to ecbuild_generate_rpc() doesn't specify the SOURCE file.")
+ ecbuild_critical("The call to ecbuild_generate_rpc() doesn't specify the SOURCE file.")
endif()
# optional
# if( NOT _PAR_DEPENDANT )
-# message(FATAL_ERROR "The call to ecbuild_generate_rpc() doesn't specify the DEPENDANT files.")
+# ecbuild_critical("The call to ecbuild_generate_rpc() doesn't specify the DEPENDANT files.")
# endif()
if( NOT DEFINED _PAR_TARGET_H AND NOT DEFINED _PAR_TARGET_C )
- message(FATAL_ERROR "The call to ecbuild_generate_rpc() doesn't specify the _PAR_TARGET_H or _PAR_TARGET_C files.")
+ ecbuild_critical("The call to ecbuild_generate_rpc() doesn't specify the _PAR_TARGET_H or _PAR_TARGET_C files.")
endif()
find_package( RPCGEN REQUIRED )
diff --git a/cmake/ecbuild_generate_yy.cmake b/cmake/ecbuild_generate_yy.cmake
index 85cdd9b..35088fb 100644
--- a/cmake/ecbuild_generate_yy.cmake
+++ b/cmake/ecbuild_generate_yy.cmake
@@ -1,4 +1,4 @@
-# (C) Copyright 1996-2015 ECMWF.
+# (C) Copyright 1996-2016 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.
@@ -82,23 +82,23 @@ macro( ecbuild_generate_yy )
cmake_parse_arguments( _PAR "${options}" "${single_value_args}" "${multi_value_args}" ${_FIRST_ARG} ${ARGN} )
if(_PAR_UNPARSED_ARGUMENTS)
- message(FATAL_ERROR "Unknown keywords given to ecbuild_generate_yy(): \"${_PAR_UNPARSED_ARGUMENTS}\"")
+ ecbuild_critical("Unknown keywords given to ecbuild_generate_yy(): \"${_PAR_UNPARSED_ARGUMENTS}\"")
endif()
if( NOT _PAR_YYPREFIX )
- message(FATAL_ERROR "The call to ecbuild_generate_yy() doesn't specify the YYPREFIX.")
+ ecbuild_critical("The call to ecbuild_generate_yy() doesn't specify the YYPREFIX.")
endif()
if( NOT _PAR_YACC )
- message(FATAL_ERROR "The call to ecbuild_generate_yy() doesn't specify the YACC file.")
+ ecbuild_critical("The call to ecbuild_generate_yy() doesn't specify the YACC file.")
endif()
if( NOT _PAR_LEX )
- message(FATAL_ERROR "The call to ecbuild_generate_yy() doesn't specify the LEX file.")
+ ecbuild_critical("The call to ecbuild_generate_yy() doesn't specify the LEX file.")
endif()
if( NOT _PAR_DEPENDANT )
- message(FATAL_ERROR "The call to ecbuild_generate_yy() doesn't specify the DEPENDANT files.")
+ ecbuild_critical("The call to ecbuild_generate_yy() doesn't specify the DEPENDANT files.")
endif()
set( BASE ${_PAR_YYPREFIX}_${_PAR_YACC} )
diff --git a/cmake/ecbuild_get_cxx11_flags.cmake b/cmake/ecbuild_get_cxx11_flags.cmake
index 5bfed07..47d0e1a 100644
--- a/cmake/ecbuild_get_cxx11_flags.cmake
+++ b/cmake/ecbuild_get_cxx11_flags.cmake
@@ -1,4 +1,4 @@
-# (C) Copyright 1996-2015 ECMWF.
+# (C) Copyright 1996-2016 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.
@@ -65,7 +65,7 @@ function( ecbuild_get_cxx11_flags CXX11_FLAGS )
elseif(has_std_cpp0x)
set(${CXX11_FLAGS} "-std=c++0x" PARENT_SCOPE)
else()
- message(FATAL ERROR "Could not detect C++11 flags")
+ ecbuild_critical("Could not detect C++11 flags")
endif(has_std_gnupp11)
endfunction()
diff --git a/cmake/ecbuild_get_date.cmake b/cmake/ecbuild_get_date.cmake
index ec308a3..730ea54 100644
--- a/cmake/ecbuild_get_date.cmake
+++ b/cmake/ecbuild_get_date.cmake
@@ -1,4 +1,4 @@
-# (C) Copyright 1996-2015 ECMWF.
+# (C) Copyright 1996-2016 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.
@@ -24,7 +24,7 @@ macro(ecbuild_get_date RESULT)
execute_process(COMMAND "date" "+%d/%m/%Y" OUTPUT_VARIABLE ${RESULT})
string(REGEX REPLACE "(..)/(..)/(....).*" "\\3.\\2.\\1" ${RESULT} ${${RESULT}})
else()
- message(SEND_ERROR "date not implemented")
+ ecbuild_error("date not implemented")
endif()
endmacro(ecbuild_get_date)
@@ -46,7 +46,7 @@ macro(ecbuild_get_timestamp RESULT)
execute_process(COMMAND "date" "+%Y/%m/%d/%H/%M/%S" OUTPUT_VARIABLE _timestamp)
string(REGEX REPLACE "(....)/(..)/(..)/(..)/(..)/(..).*" "\\1\\2\\3\\4\\5\\6" ${RESULT} ${_timestamp})
else()
- message(WARNING "This is NOT UNIX - timestamp not implemented")
+ ecbuild_warn("This is NOT UNIX - timestamp not implemented")
endif()
endmacro(ecbuild_get_timestamp)
diff --git a/cmake/ecbuild_get_resources.cmake b/cmake/ecbuild_get_resources.cmake
index d79ee59..f531d82 100644
--- a/cmake/ecbuild_get_resources.cmake
+++ b/cmake/ecbuild_get_resources.cmake
@@ -1,4 +1,4 @@
-# (C) Copyright 1996-2015 ECMWF.
+# (C) Copyright 1996-2016 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.
@@ -19,11 +19,11 @@ macro( ecbuild_get_resources )
cmake_parse_arguments( _PAR "${options}" "${single_value_args}" "${multi_value_args}" ${_FIRST_ARG} ${ARGN} )
if(_PAR_UNPARSED_ARGUMENTS)
- message(FATAL_ERROR "Unknown keywords given to ecbuild_get_resources(): \"${_PAR_UNPARSED_ARGUMENTS}\"")
+ ecbuild_critical("Unknown keywords given to ecbuild_get_resources(): \"${_PAR_UNPARSED_ARGUMENTS}\"")
endif()
if( NOT _PAR_LIST )
- message( FATAL_ERROR "Missing parameter LIST of resources in macro ecbuild_get_resources()" )
+ ecbuild_critical( "Missing parameter LIST of resources in macro ecbuild_get_resources()" )
endif()
if( NOT _PAR_TO_DIR )
diff --git a/cmake/ecbuild_get_test_data.cmake b/cmake/ecbuild_get_test_data.cmake
index 0920133..c19a760 100644
--- a/cmake/ecbuild_get_test_data.cmake
+++ b/cmake/ecbuild_get_test_data.cmake
@@ -1,4 +1,4 @@
-# (C) Copyright 1996-2015 ECMWF.
+# (C) Copyright 1996-2016 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.
@@ -42,7 +42,7 @@ function( _download_test_data _p_NAME _p_DIRNAME )
else()
if( WARNING_CANNOT_DOWNLOAD_TEST_DATA )
- message( WARNING "Couldn't find curl neither wget -- cannot download test data from server.\nPlease obtain the test data by other means and pleace it in the build directory." )
+ ecbuild_warn( "Couldn't find curl neither wget -- cannot download test data from server.\nPlease obtain the test data by other means and pleace it in the build directory." )
set( WARNING_CANNOT_DOWNLOAD_TEST_DATA 1 CACHE INTERNAL "Couldn't find curl neither wget -- cannot download test data from server" )
mark_as_advanced( WARNING_CANNOT_DOWNLOAD_TEST_DATA )
endif()
@@ -130,7 +130,7 @@ function( ecbuild_get_test_data )
cmake_parse_arguments( _p "${options}" "${single_value_args}" "${multi_value_args}" ${_FIRST_ARG} ${ARGN} )
if(_p_UNPARSED_ARGUMENTS)
- message(FATAL_ERROR "Unknown keywords given to ecbuild_get_test_data(): \"${_p_UNPARSED_ARGUMENTS}\"")
+ ecbuild_critical("Unknown keywords given to ecbuild_get_test_data(): \"${_p_UNPARSED_ARGUMENTS}\"")
endif()
file( RELATIVE_PATH currdir ${PROJECT_SOURCE_DIR} ${CMAKE_CURRENT_SOURCE_DIR} )
@@ -138,7 +138,7 @@ function( ecbuild_get_test_data )
### check parameters
if( NOT _p_NAME )
- message(FATAL_ERROR "ecbuild_get_test_data() expects a NAME")
+ ecbuild_critical("ecbuild_get_test_data() expects a NAME")
endif()
if( NOT _p_TARGET )
@@ -168,8 +168,6 @@ function( ecbuild_get_test_data )
if( NOT _p_MD5 AND NOT _p_SHA1) # use remote md5
-# message( STATUS " --- getting MD5 sum " )
-
add_custom_command( OUTPUT ${_p_NAME}.localmd5
COMMAND ${CMAKE_COMMAND} -E md5sum ${_p_NAME} > ${_p_NAME}.localmd5
DEPENDS ${_p_NAME} )
@@ -187,8 +185,6 @@ function( ecbuild_get_test_data )
if( _p_MD5 )
-# message( STATUS " --- computing MD5 sum [${_p_MD5}]" )
-
add_custom_command( OUTPUT ${_p_NAME}.localmd5
COMMAND ${CMAKE_COMMAND} -E md5sum ${_p_NAME} > ${_p_NAME}.localmd5
DEPENDS ${_p_NAME} )
@@ -206,8 +202,6 @@ function( ecbuild_get_test_data )
# if( _p_SHA1 )
-## message( STATUS " --- computing SHA1 sum [${_p_SHA1}]" )
-
# find_program( SHASUM NAMES sha1sum shasum )
# if( SHASUM )
# add_custom_command( OUTPUT ${_p_NAME}.localsha1
@@ -313,17 +307,17 @@ function( ecbuild_get_test_multidata )
cmake_parse_arguments( _p "${options}" "${single_value_args}" "${multi_value_args}" ${_FIRST_ARG} ${ARGN} )
if(_p_UNPARSED_ARGUMENTS)
- message(FATAL_ERROR "Unknown keywords given to ecbuild_get_test_data(): \"${_p_UNPARSED_ARGUMENTS}\"")
+ ecbuild_critical("Unknown keywords given to ecbuild_get_test_data(): \"${_p_UNPARSED_ARGUMENTS}\"")
endif()
### check parameters
if( NOT _p_NAMES )
- message(FATAL_ERROR "ecbuild_get_test_data() expects a NAMES")
+ ecbuild_critical("ecbuild_get_test_data() expects a NAMES")
endif()
if( NOT _p_TARGET )
- message(FATAL_ERROR "ecbuild_get_test_data() expects a TARGET")
+ ecbuild_critical("ecbuild_get_test_data() expects a TARGET")
endif()
# ecbuild_debug_var( _p_TARGET )
diff --git a/cmake/ecbuild_git.cmake b/cmake/ecbuild_git.cmake
index 2ae0513..0a378a6 100644
--- a/cmake/ecbuild_git.cmake
+++ b/cmake/ecbuild_git.cmake
@@ -1,4 +1,4 @@
-# (C) Copyright 1996-2015 ECMWF.
+# (C) Copyright 1996-2016 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.
@@ -80,15 +80,15 @@ macro( ecbuild_git )
cmake_parse_arguments( _PAR "${options}" "${single_value_args}" "${multi_value_args}" ${_FIRST_ARG} ${ARGN} )
if( DEFINED _PAR_BRANCH AND DEFINED _PAR_TAG )
- message( FATAL_ERROR "Cannot defined both BRANCH and TAG in macro ecbuild_git" )
+ ecbuild_critical( "Cannot defined both BRANCH and TAG in macro ecbuild_git" )
endif()
if( _PAR_UPDATE AND _PAR_NOREMOTE )
- message( FATAL_ERROR "Cannot pass both NOREMOTE and UPDATE in macro ecbuild_git" )
+ ecbuild_critical( "Cannot pass both NOREMOTE and UPDATE in macro ecbuild_git" )
endif()
if(_PAR_UNPARSED_ARGUMENTS)
- message(FATAL_ERROR "Unknown keywords given to ecbuild_git(): \"${_PAR_UNPARSED_ARGUMENTS}\"")
+ ecbuild_critical("Unknown keywords given to ecbuild_git(): \"${_PAR_UNPARSED_ARGUMENTS}\"")
endif()
if( ECBUILD_GIT )
@@ -102,15 +102,15 @@ macro( ecbuild_git )
if( NOT EXISTS "${_PAR_DIR}" )
- message( STATUS "Cloning ${_PAR_PROJECT} from ${_PAR_URL} into ${_PAR_DIR}...")
+ ecbuild_info( "Cloning ${_PAR_PROJECT} from ${_PAR_URL} into ${_PAR_DIR}...")
execute_process(
COMMAND ${GIT_EXECUTABLE} "clone" ${_PAR_URL} ${clone_args} ${_PAR_DIR} "-q"
RESULT_VARIABLE nok ERROR_VARIABLE error
WORKING_DIRECTORY "${PARENT_DIR}")
if(nok)
- message(FATAL_ERROR "${_PAR_DIR} git clone failed:\n ${GIT_EXECUTABLE} clone ${_PAR_URL} ${clone_args} ${_PAR_DIR} -q\n ${error}\n")
+ ecbuild_critical("${_PAR_DIR} git clone failed:\n ${GIT_EXECUTABLE} clone ${_PAR_URL} ${clone_args} ${_PAR_DIR} -q\n ${error}\n")
endif()
- message( STATUS "${_PAR_DIR} retrieved.")
+ ecbuild_info( "${_PAR_DIR} retrieved.")
set( _needs_switch 1 )
endif()
@@ -124,7 +124,7 @@ macro( ecbuild_git )
OUTPUT_STRIP_TRAILING_WHITESPACE
WORKING_DIRECTORY "${ABS_PAR_DIR}" )
if(nok)
- message(STATUS "git rev-parse HEAD on ${_PAR_DIR} failed:\n ${error}")
+ ecbuild_info("git rev-parse HEAD on ${_PAR_DIR} failed:\n ${error}")
endif()
execute_process( COMMAND ${GIT_EXECUTABLE} rev-parse --abbrev-ref HEAD
@@ -132,7 +132,7 @@ macro( ecbuild_git )
OUTPUT_STRIP_TRAILING_WHITESPACE
WORKING_DIRECTORY "${ABS_PAR_DIR}" )
if( nok OR _current_branch STREQUAL "" )
- message(STATUS "git rev-parse --abbrev-ref HEAD on ${_PAR_DIR} failed:\n ${error}")
+ ecbuild_info("git rev-parse --abbrev-ref HEAD on ${_PAR_DIR} failed:\n ${error}")
endif()
execute_process( COMMAND ${GIT_EXECUTABLE} describe --exact-match --abbrev=0
@@ -144,7 +144,7 @@ macro( ecbuild_git )
unset( _current_tag )
else()
if( nok )
- message(STATUS "git describe --exact-match --abbrev=0 on ${_PAR_DIR} failed:\n ${error}")
+ ecbuild_info("git describe --exact-match --abbrev=0 on ${_PAR_DIR} failed:\n ${error}")
endif()
endif()
@@ -154,7 +154,7 @@ macro( ecbuild_git )
OUTPUT_STRIP_TRAILING_WHITESPACE
WORKING_DIRECTORY "${ABS_PAR_DIR}" )
if( nok OR _current_tag STREQUAL "" )
- message(STATUS "git name-rev --tags --name-only on ${_PAR_DIR} failed:\n ${error}")
+ ecbuild_info("git name-rev --tags --name-only on ${_PAR_DIR} failed:\n ${error}")
endif()
endif()
@@ -183,20 +183,11 @@ macro( ecbuild_git )
if( _needs_switch AND IS_DIRECTORY "${_PAR_DIR}/.git" )
- # debug_here( ABS_PAR_DIR )
- # debug_here( _sha1 )
- # debug_here( _current_branch )
- # debug_here( _current_tag )
- # debug_here( _PAR_TAG )
- # debug_here( _PAR_BRANCH )
- # debug_here( _needs_switch )
- # debug_here( _PAR_UPDATE )
-
if( DEFINED _PAR_BRANCH )
set ( _gitref ${_PAR_BRANCH} )
- message(STATUS "Updating ${_PAR_PROJECT} to head of BRANCH ${_PAR_BRANCH}...")
+ ecbuild_info("Updating ${_PAR_PROJECT} to head of BRANCH ${_PAR_BRANCH}...")
else()
- message(STATUS "Updating ${_PAR_PROJECT} to TAG ${_PAR_TAG}...")
+ ecbuild_info("Updating ${_PAR_PROJECT} to TAG ${_PAR_TAG}...")
set ( _gitref ${_PAR_TAG} )
endif()
@@ -204,34 +195,34 @@ macro( ecbuild_git )
if( NOT _PAR_NOREMOTE )
- message(STATUS "git fetch --all @ ${ABS_PAR_DIR}")
+ ecbuild_info("git fetch --all @ ${ABS_PAR_DIR}")
execute_process( COMMAND "${GIT_EXECUTABLE}" fetch --all -q
RESULT_VARIABLE nok ERROR_VARIABLE error
WORKING_DIRECTORY "${ABS_PAR_DIR}")
if(nok)
- message(STATUS "git fetch --all in ${_PAR_DIR} failed:\n ${error}")
+ ecbuild_warn("git fetch --all in ${_PAR_DIR} failed:\n ${error}")
endif()
- message(STATUS "git fetch --all --tags @ ${ABS_PAR_DIR}")
+ ecbuild_info("git fetch --all --tags @ ${ABS_PAR_DIR}")
execute_process( COMMAND "${GIT_EXECUTABLE}" fetch --all --tags -q
RESULT_VARIABLE nok ERROR_VARIABLE error
WORKING_DIRECTORY "${ABS_PAR_DIR}")
if(nok)
- message(STATUS "git fetch --all --tags in ${_PAR_DIR} failed:\n ${error}")
+ ecbuild_warn("git fetch --all --tags in ${_PAR_DIR} failed:\n ${error}")
endif()
else()
- message(STATUS "${_PAR_DIR} marked NOREMOTE : Skipping git fetch")
+ ecbuild_info("${_PAR_DIR} marked NOREMOTE : Skipping git fetch")
endif()
# checking out gitref
- message(STATUS "git checkout ${_gitref} @ ${ABS_PAR_DIR}")
+ ecbuild_info("git checkout ${_gitref} @ ${ABS_PAR_DIR}")
execute_process( COMMAND "${GIT_EXECUTABLE}" checkout -q "${_gitref}"
RESULT_VARIABLE nok ERROR_VARIABLE error
WORKING_DIRECTORY "${ABS_PAR_DIR}")
if(nok)
- message(FATAL_ERROR "git checkout ${_gitref} on ${_PAR_DIR} failed:\n ${GIT_EXECUTABLE} checkout -q ${_gitref}\n ${error}")
+ ecbuild_critical("git checkout ${_gitref} on ${_PAR_DIR} failed:\n ${GIT_EXECUTABLE} checkout -q ${_gitref}\n ${error}")
endif()
if( DEFINED _PAR_BRANCH AND _PAR_UPDATE ) #############################################################################
@@ -240,7 +231,7 @@ macro( ecbuild_git )
RESULT_VARIABLE nok ERROR_VARIABLE error
WORKING_DIRECTORY "${ABS_PAR_DIR}")
if(nok)
- message(STATUS "git pull of branch ${_PAR_BRANCH} on ${_PAR_DIR} failed:\n ${error}")
+ ecbuild_warn("git pull of branch ${_PAR_BRANCH} on ${_PAR_DIR} failed:\n ${error}")
endif()
endif() ####################################################################################
diff --git a/cmake/ecbuild_install_project.cmake b/cmake/ecbuild_install_project.cmake
index 960d8d9..2ba472e 100644
--- a/cmake/ecbuild_install_project.cmake
+++ b/cmake/ecbuild_install_project.cmake
@@ -1,4 +1,4 @@
-# (C) Copyright 1996-2015 ECMWF.
+# (C) Copyright 1996-2016 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.
@@ -79,11 +79,11 @@ macro( ecbuild_install_project )
cmake_parse_arguments( _PAR "${options}" "${single_value_args}" "${multi_value_args}" ${_FIRST_ARG} ${ARGN} )
if(_PAR_UNPARSED_ARGUMENTS)
- message(FATAL_ERROR "Unknown keywords given to ecbuild_install_project(): \"${_PAR_UNPARSED_ARGUMENTS}\"")
+ ecbuild_critical("Unknown keywords given to ecbuild_install_project(): \"${_PAR_UNPARSED_ARGUMENTS}\"")
endif()
if( NOT _PAR_NAME )
- message(FATAL_ERROR "The call to ecbuild_install_project() doesn't specify the NAME.")
+ ecbuild_critical("The call to ecbuild_install_project() doesn't specify the NAME.")
endif()
### EXTRA TARGETS #####################################################
@@ -201,7 +201,7 @@ macro( ecbuild_install_project )
set( ${PNAME}_HAVE_${_f} 1 )
endforeach()
- message( STATUS "${PROJECT_NAME_CAPS}_TPLS: ${${PROJECT_NAME_CAPS}_TPLS}" )
+ ecbuild_info( "${PROJECT_NAME_CAPS}_TPLS: ${${PROJECT_NAME_CAPS}_TPLS}" )
foreach( _tpl ${${PNAME}_TPLS} )
string( TOUPPER ${_tpl} _TPL )
diff --git a/cmake/ecbuild_list_add_pattern.cmake b/cmake/ecbuild_list_add_pattern.cmake
index 32cf74a..0f68217 100644
--- a/cmake/ecbuild_list_add_pattern.cmake
+++ b/cmake/ecbuild_list_add_pattern.cmake
@@ -1,4 +1,4 @@
-# (C) Copyright 1996-2015 ECMWF.
+# (C) Copyright 1996-2016 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.
diff --git a/cmake/ecbuild_list_exclude_pattern.cmake b/cmake/ecbuild_list_exclude_pattern.cmake
index 9add278..7e02f47 100644
--- a/cmake/ecbuild_list_exclude_pattern.cmake
+++ b/cmake/ecbuild_list_exclude_pattern.cmake
@@ -1,4 +1,4 @@
-# (C) Copyright 1996-2015 ECMWF.
+# (C) Copyright 1996-2016 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.
@@ -41,15 +41,15 @@ function( ecbuild_list_exclude_pattern )
cmake_parse_arguments( _p "${options}" "${single_value_args}" "${multi_value_args}" ${_FIRST_ARG} ${ARGN} )
if(_p_UNPARSED_ARGUMENTS)
- message(FATAL_ERROR "Unknown keywords given to ecbuild_list_exclude_pattern(): \"${_p_UNPARSED_ARGUMENTS}\"")
+ ecbuild_critical("Unknown keywords given to ecbuild_list_exclude_pattern(): \"${_p_UNPARSED_ARGUMENTS}\"")
endif()
if( NOT _p_LIST )
- message(FATAL_ERROR "The call to ecbuild_list_exclude_pattern() doesn't specify the LIST.")
+ ecbuild_critical("The call to ecbuild_list_exclude_pattern() doesn't specify the LIST.")
endif()
if( NOT _p_REGEX )
- message(FATAL_ERROR "The call to ecbuild_list_exclude_pattern() doesn't specify the REGEX.")
+ ecbuild_critical("The call to ecbuild_list_exclude_pattern() doesn't specify the REGEX.")
endif()
#####
diff --git a/cmake/ecbuild_list_extra_search_paths.cmake b/cmake/ecbuild_list_extra_search_paths.cmake
index c307012..b81f062 100644
--- a/cmake/ecbuild_list_extra_search_paths.cmake
+++ b/cmake/ecbuild_list_extra_search_paths.cmake
@@ -1,4 +1,4 @@
-# (C) Copyright 1996-2015 ECMWF.
+# (C) Copyright 1996-2016 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.
diff --git a/cmake/ecbuild_list_macros.cmake b/cmake/ecbuild_list_macros.cmake
index 95d9512..176a161 100644
--- a/cmake/ecbuild_list_macros.cmake
+++ b/cmake/ecbuild_list_macros.cmake
@@ -1,4 +1,4 @@
-# (C) Copyright 1996-2015 ECMWF.
+# (C) Copyright 1996-2016 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.
diff --git a/cmake/ecbuild_log.cmake b/cmake/ecbuild_log.cmake
index d0acbc6..ec99495 100644
--- a/cmake/ecbuild_log.cmake
+++ b/cmake/ecbuild_log.cmake
@@ -1,4 +1,4 @@
-# (C) Copyright 1996-2015 ECMWF.
+# (C) Copyright 1996-2016 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.
@@ -12,7 +12,7 @@
# Logging
# =======
#
-# ecBuild provides macros for logging based on a log level set by the user,
+# ecBuild provides functions for logging based on a log level set by the user,
# similar to the Python logging module:
#
# :ecbuild_debug: logs a ``STATUS`` message if log level <= ``DEBUG``
@@ -22,13 +22,30 @@
# :ecbuild_critical: logs a ``FATAL_ERROR`` message if log level <= ``CRITICAL``
# :ecbuild_deprecate: logs a ``DEPRECATION`` message
#
+# Furthermore there are auxilliary functions for outputting CMake variables,
+# CMake lists and environment variables if the log level is ``DEBUG``:
+#
+# :ecbuild_debug_var: logs given CMake variables if log level <= ``DEBUG``
+# :ecbuild_debug_list: logs given CMake lists if log level <= ``DEBUG``
+# :ecbuild_debug_env_var: logs given environment variables if log level <= ``DEBUG``
+#
+# To log a message to the ecBuild log file only at a given log level, use ::
+#
+# ecbuild_log( <level> <msg> )
+#
# Input variables
# ---------------
#
# CMake variables controlling logging behaviour:
#
+# ECBUILD_LOG_FILE : path
+# set the log file, defaults to ``${CMAKE_BINARY_DIR}/ecbuild.log``
+#
+# All ecBuild log functions write their messages to this log file with a time
+# stamp. Messages emitted by CMake directly cannot be logged to file.
+#
# ECBUILD_LOG_LEVEL : string, one of DEBUG, INFO, WARN, ERROR, CRITICAL, OFF
-# set the desired log level, OFF to disable logging altogether
+# desired log level, defaults to ``INFO``, ``OFF`` to disable logging
#
# ECBUILD_NO_COLOUR : bool
# if set, does not colour log output (by default log output is coloured)
@@ -40,7 +57,7 @@
# Usage
# -----
#
-# The macros ``ecbuild_debug`` and ``ecbuild_info`` can be used to output
+# The functions ``ecbuild_debug`` and ``ecbuild_info`` can be used to output
# messages which are not printed by default. Many ecBuild macros use this
# facility to log debugging hints. When debugging a CMake run, users can use
# ``-DECBUILD_LOG_LEVEL=DEBUG`` to get detailed diagnostics.
@@ -93,85 +110,120 @@ else()
set(ECBUILD_LOG_LEVEL ${ECBUILD_WARN})
endif()
+if( NOT DEFINED ECBUILD_LOG_FILE )
+ set( ECBUILD_LOG_FILE ${CMAKE_BINARY_DIR}/ecbuild.log )
+endif()
+
+##############################################################################
+
+function( ecbuild_log LEVEL )
+ string( REPLACE ";" " " MSG "${ARGN}" )
+ string( TIMESTAMP _time )
+ file( APPEND ${ECBUILD_LOG_FILE} "${_time} - ${LEVEL} - ${MSG}\n" )
+endfunction( ecbuild_log )
+
##############################################################################
-macro( ecbuild_debug MSG )
+function( ecbuild_debug )
+ string( REPLACE ";" " " MSG "${ARGV}" )
+ ecbuild_log(DEBUG "${MSG}")
if( ECBUILD_LOG_LEVEL LESS 11)
message(STATUS "${Blue}DEBUG - ${MSG}${ColourReset}")
endif()
-endmacro( ecbuild_debug )
+endfunction( ecbuild_debug )
##############################################################################
-macro( ecbuild_info MSG )
+function( ecbuild_info )
+ string( REPLACE ";" " " MSG "${ARGV}" )
+ ecbuild_log(INFO "${MSG}")
if( ECBUILD_LOG_LEVEL LESS 21)
- message(STATUS "${Green}INFO - ${MSG}${ColourReset}")
+ message(STATUS "${MSG}")
endif()
-endmacro( ecbuild_info )
+endfunction( ecbuild_info )
##############################################################################
-macro( ecbuild_warn MSG )
+function( ecbuild_warn )
+ string( REPLACE ";" " " MSG "${ARGV}" )
+ ecbuild_log(WARNING "${MSG}")
if( ECBUILD_LOG_LEVEL LESS 31)
message(WARNING "${Yellow}WARN - ${MSG}${ColourReset}")
endif()
-endmacro( ecbuild_warn )
+endfunction( ecbuild_warn )
##############################################################################
-macro( ecbuild_error MSG )
+function( ecbuild_error )
+ string( REPLACE ";" " " MSG "${ARGV}" )
+ ecbuild_log(ERROR "${MSG}")
if( ECBUILD_LOG_LEVEL LESS 41)
message(SEND_ERROR "${BoldRed}ERROR - ${MSG}${ColourReset}")
endif()
-endmacro( ecbuild_error )
+endfunction( ecbuild_error )
##############################################################################
-macro( ecbuild_deprecate )
+function( ecbuild_deprecate )
+ string(REPLACE ";" " " MSG ${ARGV})
+ ecbuild_log(DEPRECATION "${MSG}")
if( NOT ECBUILD_NO_DEPRECATIONS )
- string(REPLACE ";" "" MSG ${ARGV})
message(DEPRECATION "${BoldRed}${MSG}${ColourReset}")
endif()
-endmacro( ecbuild_deprecate )
+endfunction( ecbuild_deprecate )
##############################################################################
-macro( ecbuild_critical MSG )
+function( ecbuild_critical )
+ string(REPLACE ";" " " MSG ${ARGV})
+ ecbuild_log(FATAL_ERROR "${MSG}")
if( ECBUILD_LOG_LEVEL LESS 51)
message(FATAL_ERROR "${BoldMagenta}CRITICAL - ${MSG}${ColourReset}")
endif()
-endmacro( ecbuild_critical )
+endfunction( ecbuild_critical )
##############################################################################
-# macro for debugging a cmake variable
+# function for debugging CMake variables
-macro( ecbuild_debug_var VAR )
- if( ECBUILD_LOG_LEVEL LESS 11)
- message(STATUS "${Blue}DEBUG - ${VAR} : ${${VAR}}${ColourReset}")
- endif()
-endmacro()
+function( ecbuild_debug_var )
+ foreach( VAR ${ARGV} )
+ ecbuild_log(DEBUG "${VAR} : ${${VAR}}")
+ if( ECBUILD_LOG_LEVEL LESS 11)
+ message(STATUS "${Blue}DEBUG - ${VAR} : ${${VAR}}${ColourReset}")
+ endif()
+ endforeach()
+endfunction()
##############################################################################
-# macro for debugging a cmake variable
+# function for debugging CMake lists
-macro( ecbuild_debug_list VAR )
- if( ECBUILD_LOG_LEVEL LESS 11)
- message( STATUS "${Blue}DEBUG - ${VAR}" )
+function( ecbuild_debug_list )
+ foreach( VAR ${ARGV} )
+ ecbuild_log(DEBUG "${VAR} : ${${VAR}}")
foreach( _elem ${${VAR}} )
- message( STATUS " ${_elem}" )
+ ecbuild_log( DEBUG " ${_elem}" )
endforeach()
- message(STATUS "${ColourReset}")
- endif()
-endmacro()
+ if( ECBUILD_LOG_LEVEL LESS 11)
+ message( STATUS "${Blue}DEBUG - ${VAR}" )
+ foreach( _elem ${${VAR}} )
+ message( STATUS " ${_elem}" )
+ endforeach()
+ message(STATUS "${ColourReset}")
+ endif()
+ endforeach()
+endfunction()
##############################################################################
-# macro for debugging a environment variable within cmake
+# function for debugging environment variables
-macro( ecbuild_debug_env_var VAR )
- if( ECBUILD_LOG_LEVEL LESS 11)
- message(STATUS "${Blue}DEBUG - ENV ${VAR} [$ENV{${VAR}}]${ColourReset}")
- endif()
-endmacro()
+function( ecbuild_debug_env_var )
+ foreach( VAR ${ARGV} )
+ ecbuild_log(DEBUG "ENV ${VAR} : $ENV{${VAR}}")
+ if( ECBUILD_LOG_LEVEL LESS 11)
+ message(STATUS "${Blue}DEBUG - ENV ${VAR} [$ENV{${VAR}}]${ColourReset}")
+ endif()
+ endforeach()
+endfunction()
##############################################################################
# macro for debugging a cmake variable
@@ -202,6 +254,3 @@ macro( debug_env_var VAR )
message( WARNING "DEPRECATED debug_env_var() -- ENV ${VAR} [$ENV{${VAR}}]" )
endmacro()
-
-
-
diff --git a/cmake/ecbuild_pkgconfig.cmake b/cmake/ecbuild_pkgconfig.cmake
index 6db3726..6f62977 100644
--- a/cmake/ecbuild_pkgconfig.cmake
+++ b/cmake/ecbuild_pkgconfig.cmake
@@ -1,4 +1,4 @@
-# (C) Copyright 1996-2015 ECMWF.
+# (C) Copyright 1996-2016 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.
@@ -312,7 +312,7 @@ function( ecbuild_pkgconfig )
string( TOLOWER ${PROJECT_NAME} LNAME )
if(_PAR_UNPARSED_ARGUMENTS)
- message(FATAL_ERROR "Unknown keywords given to ecbuild_add_executable(): \"${_PAR_UNPARSED_ARGUMENTS}\"")
+ ecbuild_critical("Unknown keywords given to ecbuild_add_executable(): \"${_PAR_UNPARSED_ARGUMENTS}\"")
endif()
unset( PKGCONFIG_LANGUAGES )
@@ -412,7 +412,7 @@ function( ecbuild_pkgconfig )
endif()
configure_file( ${_PAR_TEMPLATE} "${CMAKE_BINARY_DIR}/${_PAR_FILENAME}" @ONLY )
- message( STATUS "pkg-config file created: ${_PAR_FILENAME}" )
+ ecbuild_info( "pkg-config file created: ${_PAR_FILENAME}" )
install( FILES ${CMAKE_BINARY_DIR}/${_PAR_FILENAME}
DESTINATION ${CMAKE_INSTALL_PREFIX}/${INSTALL_LIB_DIR}/pkgconfig/
diff --git a/cmake/ecbuild_policies.cmake b/cmake/ecbuild_policies.cmake
index e420e81..36ab7fe 100644
--- a/cmake/ecbuild_policies.cmake
+++ b/cmake/ecbuild_policies.cmake
@@ -1,4 +1,4 @@
-# (C) Copyright 1996-2015 ECMWF.
+# (C) Copyright 1996-2016 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.
diff --git a/cmake/ecbuild_print_summary.cmake b/cmake/ecbuild_print_summary.cmake
index 14ccdd1..4cf05cc 100644
--- a/cmake/ecbuild_print_summary.cmake
+++ b/cmake/ecbuild_print_summary.cmake
@@ -1,4 +1,4 @@
-# (C) Copyright 1996-2015 ECMWF.
+# (C) Copyright 1996-2016 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.
@@ -28,9 +28,9 @@ macro( ecbuild_print_summary )
if( EXISTS ${PROJECT_SOURCE_DIR}/project_summary.cmake )
- message( STATUS "---------------------------------------------------------" )
- message( STATUS "Project ${PROJECT_NAME} summary" )
- message( STATUS "---------------------------------------------------------" )
+ ecbuild_info( "---------------------------------------------------------" )
+ ecbuild_info( "Project ${PROJECT_NAME} summary" )
+ ecbuild_info( "---------------------------------------------------------" )
include( ${PROJECT_SOURCE_DIR}/project_summary.cmake )
@@ -40,50 +40,50 @@ macro( ecbuild_print_summary )
get_property( langs GLOBAL PROPERTY ENABLED_LANGUAGES )
- message( STATUS "---------------------------------------------------------" )
+ ecbuild_info( "---------------------------------------------------------" )
if( NOT ${DEVELOPER_MODE} )
- message( STATUS "Build summary" )
+ ecbuild_info( "Build summary" )
else()
- message( STATUS "Build summary -- ( DEVELOPER_MODE )" )
+ ecbuild_info( "Build summary -- ( DEVELOPER_MODE )" )
endif()
- message( STATUS "---------------------------------------------------------" )
+ ecbuild_info( "---------------------------------------------------------" )
- message( STATUS "system : [${BUILD_SITE}] [${CMAKE_SYSTEM}] [${EC_OS_NAME}.${EC_OS_BITS}]" )
- message( STATUS "processor : [${CMAKE_SYSTEM_PROCESSOR}]" )
+ ecbuild_info( "system : [${BUILD_SITE}] [${CMAKE_SYSTEM}] [${EC_OS_NAME}.${EC_OS_BITS}]" )
+ ecbuild_info( "processor : [${CMAKE_SYSTEM_PROCESSOR}]" )
if( EC_BIG_ENDIAN )
- message( STATUS "endiness : Big Endian -- IEEE [${IEEE_BE}]" )
+ ecbuild_info( "endiness : Big Endian -- IEEE [${IEEE_BE}]" )
endif()
if( EC_LITTLE_ENDIAN )
- message( STATUS "endiness : Little Endian -- IEEE [${IEEE_LE}]" )
+ ecbuild_info( "endiness : Little Endian -- IEEE [${IEEE_LE}]" )
endif()
- message( STATUS "build type : [${CMAKE_BUILD_TYPE}]" )
- message( STATUS "timestamp : [${EC_BUILD_TIMESTAMP}]" )
- message( STATUS "install prefix : [${CMAKE_INSTALL_PREFIX}]" )
+ ecbuild_info( "build type : [${CMAKE_BUILD_TYPE}]" )
+ ecbuild_info( "timestamp : [${EC_BUILD_TIMESTAMP}]" )
+ ecbuild_info( "install prefix : [${CMAKE_INSTALL_PREFIX}]" )
if( EC_LINK_DIR )
- message( STATUS "links prefix : [${EC_LINK_DIR}]" )
+ ecbuild_info( "links prefix : [${EC_LINK_DIR}]" )
endif()
- message( STATUS "---------------------------------------------------------" )
+ ecbuild_info( "---------------------------------------------------------" )
foreach( lang ${langs} )
- message( STATUS "${lang} -- ${CMAKE_${lang}_COMPILER_ID} ${CMAKE_${lang}_COMPILER_VERSION}" )
- message( STATUS " compiler : ${CMAKE_${lang}_COMPILER} ${CMAKE_${lang}_FLAGS} ${CMAKE_${lang}_FLAGS_${CMAKE_BUILD_TYPE_CAPS}}" )
- message( STATUS " link flags : ${CMAKE_${lang}_LINK_FLAGS}" )
+ ecbuild_info( "${lang} -- ${CMAKE_${lang}_COMPILER_ID} ${CMAKE_${lang}_COMPILER_VERSION}" )
+ ecbuild_info( " compiler : ${CMAKE_${lang}_COMPILER} ${CMAKE_${lang}_FLAGS} ${CMAKE_${lang}_FLAGS_${CMAKE_BUILD_TYPE_CAPS}}" )
+ ecbuild_info( " link flags : ${CMAKE_${lang}_LINK_FLAGS}" )
endforeach()
- message( STATUS "linker : ${CMAKE_LINKER}")
- message( STATUS "ar : ${CMAKE_AR}")
- message( STATUS "ranlib : ${CMAKE_RANLIB}")
- message( STATUS "link flags" )
- message( STATUS " executable [${CMAKE_EXE_LINKER_FLAGS} ${CMAKE_EXE_LINKER_FLAGS_${CMAKE_BUILD_TYPE_CAPS}}]" )
- message( STATUS " shared lib [${CMAKE_SHARED_LINKER_FLAGS} ${CMAKE_SHARED_LINKER_FLAGS_${CMAKE_BUILD_TYPE_CAPS}}]" )
- message( STATUS " static lib [${CMAKE_MODULE_LINKER_FLAGS} ${CMAKE_MODULE_LINKER_FLAGS_${CMAKE_BUILD_TYPE_CAPS}}]" )
- message( STATUS "install rpath : ${CMAKE_INSTALL_RPATH}" )
+ ecbuild_info( "linker : ${CMAKE_LINKER}")
+ ecbuild_info( "ar : ${CMAKE_AR}")
+ ecbuild_info( "ranlib : ${CMAKE_RANLIB}")
+ ecbuild_info( "link flags" )
+ ecbuild_info( " executable [${CMAKE_EXE_LINKER_FLAGS} ${CMAKE_EXE_LINKER_FLAGS_${CMAKE_BUILD_TYPE_CAPS}}]" )
+ ecbuild_info( " shared lib [${CMAKE_SHARED_LINKER_FLAGS} ${CMAKE_SHARED_LINKER_FLAGS_${CMAKE_BUILD_TYPE_CAPS}}]" )
+ ecbuild_info( " static lib [${CMAKE_MODULE_LINKER_FLAGS} ${CMAKE_MODULE_LINKER_FLAGS_${CMAKE_BUILD_TYPE_CAPS}}]" )
+ ecbuild_info( "install rpath : ${CMAKE_INSTALL_RPATH}" )
get_directory_property( defs COMPILE_DEFINITIONS )
- message( STATUS "common definitions: ${defs}" )
+ ecbuild_info( "common definitions: ${defs}" )
- message( STATUS "---------------------------------------------------------" )
+ ecbuild_info( "---------------------------------------------------------" )
### FEATURE SUMMARY
diff --git a/cmake/ecbuild_project_files.cmake b/cmake/ecbuild_project_files.cmake
index 537556a..3e4b3d2 100644
--- a/cmake/ecbuild_project_files.cmake
+++ b/cmake/ecbuild_project_files.cmake
@@ -1,4 +1,4 @@
-# (C) Copyright 1996-2015 ECMWF.
+# (C) Copyright 1996-2016 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.
@@ -62,7 +62,7 @@ macro( ecbuild_declare_project_files )
if( EXISTS ${_abspath} )
list( REMOVE_ITEM EC_UNUSED_FILES ${_abspath} )
else()
- message( FATAL_ERROR "In directory ${CMAKE_CURRENT_SOURCE_DIR} file ${_afile} was declared in CMakeLists.txt but not found" )
+ ecbuild_critical( "In directory ${CMAKE_CURRENT_SOURCE_DIR} file ${_afile} was declared in CMakeLists.txt but not found" )
endif()
endif()
diff --git a/cmake/ecbuild_requires_macro_version.cmake b/cmake/ecbuild_requires_macro_version.cmake
index ef13d64..1603446 100644
--- a/cmake/ecbuild_requires_macro_version.cmake
+++ b/cmake/ecbuild_requires_macro_version.cmake
@@ -1,4 +1,4 @@
-# (C) Copyright 1996-2015 ECMWF.
+# (C) Copyright 1996-2016 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.
@@ -21,7 +21,7 @@
macro( ecbuild_requires_macro_version req_vrs )
if( ECBUILD_MACRO_VERSION VERSION_LESS ${req_vrs} )
- message( FATAL_ERROR "${PROJECT_NAME} needs ecbuild macro version >= ${req_vrs}" )
+ ecbuild_critical( "${PROJECT_NAME} needs ecbuild macro version >= ${req_vrs}" )
endif()
endmacro()
diff --git a/cmake/ecbuild_separate_sources.cmake b/cmake/ecbuild_separate_sources.cmake
index 3f930b3..b56db63 100644
--- a/cmake/ecbuild_separate_sources.cmake
+++ b/cmake/ecbuild_separate_sources.cmake
@@ -1,4 +1,4 @@
-# (C) Copyright 1996-2015 ECMWF.
+# (C) Copyright 1996-2016 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.
@@ -48,15 +48,15 @@ macro( ecbuild_separate_sources )
cmake_parse_arguments( _PAR "${options}" "${single_value_args}" "${multi_value_args}" ${_FIRST_ARG} ${ARGN} )
if(_PAR_UNPARSED_ARGUMENTS)
- message(FATAL_ERROR "Unknown keywords given to ecbuild_separate_sources(): \"${_PAR_UNPARSED_ARGUMENTS}\"")
+ ecbuild_critical("Unknown keywords given to ecbuild_separate_sources(): \"${_PAR_UNPARSED_ARGUMENTS}\"")
endif()
if( NOT _PAR_TARGET )
- message(FATAL_ERROR "The call to ecbuild_separate_sources() doesn't specify the TARGET.")
+ ecbuild_critical("The call to ecbuild_separate_sources() doesn't specify the TARGET.")
endif()
if( NOT _PAR_SOURCES )
- message(FATAL_ERROR "The call to ecbuild_separate_sources() doesn't specify the SOURCES.")
+ ecbuild_critical("The call to ecbuild_separate_sources() doesn't specify the SOURCES.")
endif()
foreach( src ${_PAR_SOURCES} )
diff --git a/cmake/ecbuild_setup_test_framework.cmake b/cmake/ecbuild_setup_test_framework.cmake
index f38bafb..c14b2f9 100644
--- a/cmake/ecbuild_setup_test_framework.cmake
+++ b/cmake/ecbuild_setup_test_framework.cmake
@@ -23,11 +23,11 @@ if( ENABLE_TESTS AND CMAKE_CXX_COMPILER_LOADED )
set( HAVE_BOOST_UNIT_TEST 1 )
set( BOOST_UNIT_TEST_FRAMEWORK_LINKED 1 )
- message( STATUS "Using Boost for unit tests:\n INC [${Boost_INCLUDE_DIRS}]\n LIB [${Boost_UNIT_TEST_FRAMEWORK_LIBRARY}]" )
+ ecbuild_info( "Using Boost for unit tests:\n INC [${Boost_INCLUDE_DIRS}]\n LIB [${Boost_UNIT_TEST_FRAMEWORK_LIBRARY}]" )
else()
- message( STATUS "Boost unit test framework -- NOT FOUND" )
+ ecbuild_info( "Boost unit test framework -- NOT FOUND" )
set( HAVE_BOOST_UNIT_TEST 0 )
@@ -42,4 +42,4 @@ endif()
if( NOT ENABLE_TESTS )
ecbuild_info("Tests have been disabled")
-endif()
\ No newline at end of file
+endif()
diff --git a/cmake/ecbuild_source_flags.cmake b/cmake/ecbuild_source_flags.cmake
index 325a941..2414765 100644
--- a/cmake/ecbuild_source_flags.cmake
+++ b/cmake/ecbuild_source_flags.cmake
@@ -1,4 +1,4 @@
-# (C) Copyright 1996-2015 ECMWF.
+# (C) Copyright 1996-2016 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.
diff --git a/cmake/ecbuild_system.cmake b/cmake/ecbuild_system.cmake
index f885fc6..a4361f7 100644
--- a/cmake/ecbuild_system.cmake
+++ b/cmake/ecbuild_system.cmake
@@ -1,4 +1,4 @@
-# (C) Copyright 1996-2015 ECMWF.
+# (C) Copyright 1996-2016 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.
@@ -59,20 +59,23 @@ if( PROJECT_NAME STREQUAL CMAKE_PROJECT_NAME )
set( ECBUILD_PROJECTS "" CACHE INTERNAL "list of ecbuild (sub)projects that use ecbuild" )
- message( STATUS "ecbuild ${ecbuild_VERSION_STR}\t${ECBUILD_MACROS_DIR}" )
- message( STATUS "cmake ${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION}.${CMAKE_PATCH_VERSION}\t${CMAKE_COMMAND}" )
+ # Include log macros since these are used right away
+ include( ecbuild_log )
+
+ ecbuild_info( "ecbuild ${ecbuild_VERSION_STR}\t${ECBUILD_MACROS_DIR}" )
+ ecbuild_info( "cmake ${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION}.${CMAKE_PATCH_VERSION}\t${CMAKE_COMMAND}" )
if( CMAKE_TOOLCHAIN_FILE )
- message( STATUS "toolchain ${CMAKE_TOOLCHAIN_FILE}" )
+ ecbuild_info( "toolchain ${CMAKE_TOOLCHAIN_FILE}" )
endif()
if( ECBUILD_CONFIG )
- message( STATUS "config ${ECBUILD_CONFIG}" )
+ ecbuild_info( "config ${ECBUILD_CONFIG}" )
endif()
if( ECBUILD_CACHE )
- include( ${ECBUILD_CACHE} )
- message( STATUS "cache ${ECBUILD_CACHE}" )
+ include( ${ECBUILD_CACHE} )
+ ecbuild_info( "cache ${ECBUILD_CACHE}" )
endif()
message( STATUS "---------------------------------------------------------" )
@@ -97,7 +100,7 @@ if( PROJECT_NAME STREQUAL CMAKE_PROJECT_NAME )
enable_testing()
# keep this until we modify the meaning to 'check' if installation worked
- add_custom_target( check COMMAND ${CMAKE_CTEST_COMMAND} -V )
+ add_custom_target( check COMMAND ${CMAKE_CTEST_COMMAND} )
############################################################################################
# define valid build types
@@ -156,7 +159,6 @@ if( PROJECT_NAME STREQUAL CMAKE_PROJECT_NAME )
############################################################################################
# add our macros
- include( ecbuild_log )
include( ecbuild_list_macros )
include( ecbuild_list_add_pattern )
include( ecbuild_list_exclude_pattern )
@@ -256,7 +258,7 @@ else()
# set( ECBUILD_CONFIG "<subproject-config>.cmake" )
if( ECBUILD_CONFIG )
message( STATUS "---------------------------------------------------------" )
- message( STATUS "config ${ECBUILD_CONFIG}" )
+ ecbuild_info( "config ${ECBUILD_CONFIG}" )
include( ${ECBUILD_CONFIG} )
endif()
include( ecbuild_compiler_flags )
diff --git a/cmake/ecbuild_use_package.cmake b/cmake/ecbuild_use_package.cmake
index 2c6febb..6bd2bed 100644
--- a/cmake/ecbuild_use_package.cmake
+++ b/cmake/ecbuild_use_package.cmake
@@ -1,4 +1,4 @@
-# (C) Copyright 1996-2015 ECMWF.
+# (C) Copyright 1996-2016 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.
@@ -87,15 +87,15 @@ macro( ecbuild_use_package )
cmake_parse_arguments( _p "${options}" "${single_value_args}" "${multi_value_args}" ${_FIRST_ARG} ${ARGN} )
if(_p_UNPARSED_ARGUMENTS)
- message(FATAL_ERROR "Unknown keywords given to ecbuild_use_package(): \"${_p_UNPARSED_ARGUMENTS}\"")
+ ecbuild_critical("Unknown keywords given to ecbuild_use_package(): \"${_p_UNPARSED_ARGUMENTS}\"")
endif()
if( NOT _p_PROJECT )
- message(FATAL_ERROR "The call to ecbuild_use_package() doesn't specify the PROJECT.")
+ ecbuild_critical("The call to ecbuild_use_package() doesn't specify the PROJECT.")
endif()
if( _p_EXACT AND NOT _p_VERSION )
- message(FATAL_ERROR "Call to ecbuild_use_package() requests EXACT but doesn't specify VERSION.")
+ ecbuild_critical("Call to ecbuild_use_package() requests EXACT but doesn't specify VERSION.")
endif()
# try to find the package as a subproject and build it
@@ -201,7 +201,7 @@ macro( ecbuild_use_package )
ecbuild_debug("ecbuild_use_package(${_p_PROJECT}): 2) project was already added as subproject, check version is acceptable")
if( NOT ${pkgUPPER}_FOUND )
- message( FATAL_ERROR "${_p_PROJECT} was already included as sub-project but ${pkgUPPER}_FOUND isn't set -- this is likely a BUG in ecbuild" )
+ ecbuild_critical( "${_p_PROJECT} was already included as sub-project but ${pkgUPPER}_FOUND isn't set -- this is likely a BUG in ecbuild" )
endif()
# check version is acceptable
@@ -237,13 +237,13 @@ macro( ecbuild_use_package )
if( _p_VERSION AND _do_version_check )
if( _p_EXACT )
if( NOT ${_p_PROJECT}_VERSION VERSION_EQUAL _p_VERSION )
- message( FATAL_ERROR "${PROJECT_NAME} requires (exactly) ${_p_PROJECT} = ${_p_VERSION} -- detected as ${_source_description} ${${_p_PROJECT}_VERSION}" )
+ ecbuild_critical( "${PROJECT_NAME} requires (exactly) ${_p_PROJECT} = ${_p_VERSION} -- detected as ${_source_description} ${${_p_PROJECT}_VERSION}" )
endif()
else()
if( _p_VERSION VERSION_LESS ${_p_PROJECT}_VERSION OR _p_VERSION VERSION_EQUAL ${_p_PROJECT}_VERSION )
- message( STATUS "${PROJECT_NAME} requires ${_p_PROJECT} >= ${_p_VERSION} -- detected as ${_source_description} ${${_p_PROJECT}_VERSION}" )
+ ecbuild_info( "${PROJECT_NAME} requires ${_p_PROJECT} >= ${_p_VERSION} -- detected as ${_source_description} ${${_p_PROJECT}_VERSION}" )
else()
- message( FATAL_ERROR "${PROJECT_NAME} requires ${_p_PROJECT} >= ${_p_VERSION} -- detected only ${_source_description} ${${_p_PROJECT}_VERSION}" )
+ ecbuild_critical( "${PROJECT_NAME} requires ${_p_PROJECT} >= ${_p_VERSION} -- detected only ${_source_description} ${${_p_PROJECT}_VERSION}" )
endif()
endif()
endif()
diff --git a/cmake/ecbuild_version.h.in b/cmake/ecbuild_version.h.in
index 3ed96ce..70c5f0a 100644
--- a/cmake/ecbuild_version.h.in
+++ b/cmake/ecbuild_version.h.in
@@ -1,5 +1,5 @@
/*
- * (C) Copyright 1996-2015 ECMWF.
+ * (C) Copyright 1996-2016 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.
diff --git a/cmake/ecbuild_warn_unused_files.cmake b/cmake/ecbuild_warn_unused_files.cmake
index 084adb3..314a006 100644
--- a/cmake/ecbuild_warn_unused_files.cmake
+++ b/cmake/ecbuild_warn_unused_files.cmake
@@ -1,4 +1,4 @@
-# (C) Copyright 1996-2015 ECMWF.
+# (C) Copyright 1996-2016 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.
@@ -48,24 +48,24 @@ macro( ecbuild_warn_unused_files )
# if unused files where found, put the list on the file
if( EC_UNUSED_FILES )
- message( STATUS "")
- message( STATUS " !!!--- ${UNUSED_FILES_LEVEL} ---!!! ")
- message( STATUS " !!!--- ${UNUSED_FILES_LEVEL} ---!!! ")
- message( STATUS "")
- message( STATUS " Unused source files found:")
+ ecbuild_info("")
+ ecbuild_info(" !!!--- ${UNUSED_FILES_LEVEL} ---!!! ")
+ ecbuild_info(" !!!--- ${UNUSED_FILES_LEVEL} ---!!! ")
+ ecbuild_info("")
+ ecbuild_info(" Unused source files found:")
foreach( AFILE ${EC_UNUSED_FILES} )
- message( STATUS " ${AFILE}")
+ ecbuild_info(" ${AFILE}")
file( APPEND ${UNUSED_FILE} "${AFILE}\n" )
endforeach()
- message( STATUS "")
- message( STATUS " List dumped to ${UNUSED_FILE}")
- message( STATUS "")
- message( STATUS " !!!--- ${UNUSED_FILES_LEVEL} ---!!! ")
- message( STATUS " !!!--- ${UNUSED_FILES_LEVEL} ---!!! ")
- message( STATUS "")
+ ecbuild_info("")
+ ecbuild_info(" List dumped to ${UNUSED_FILE}")
+ ecbuild_info("")
+ ecbuild_info(" !!!--- ${UNUSED_FILES_LEVEL} ---!!! ")
+ ecbuild_info(" !!!--- ${UNUSED_FILES_LEVEL} ---!!! ")
+ ecbuild_info("")
if( UNUSED_FILES_LEVEL STREQUAL "ERROR" )
- message( FATAL_ERROR "\n Aborted build system configuration. \n Add unused files to the build system or remove them." )
+ ecbuild_critical( "\n Aborted build system configuration. \n Add unused files to the build system or remove them." )
endif()
endif()
diff --git a/cmake/fcm-make-interfaces.cfg b/cmake/fcm-make-interfaces.cfg
new file mode 100644
index 0000000..a73363a
--- /dev/null
+++ b/cmake/fcm-make-interfaces.cfg
@@ -0,0 +1,31 @@
+# FCM configuration file used to auto-generate interface files
+# for F77 and F90 files.
+# Interface files will have the extention ".intfb.h"
+# Results will be in a directory "interfaces/include" relative to cwd
+
+# Usage: fcm make --config-file=<path -to-this-file> \
+# interfaces.ns-incl="<space-sep-list-of-dirs>"
+
+$SRC{?} = $HERE
+
+step.class[interfaces] = build
+steps = interfaces
+
+interfaces.target{task} = ext-iface
+interfaces.target{category} = include
+
+interfaces.source = $SRC
+
+# Exclude all
+interfaces.ns-excl = /
+
+# Include some
+# interfaces.ns-incl = <list of dirs passed at command-line>
+
+# Extention of interface files
+interfaces.prop{file-ext.f90-interface} = .intfb.h
+
+# Do not follow includes
+interfaces.prop{no-dep.f.module} = *
+interfaces.prop{no-dep.include} = *
+
diff --git a/cmake/gen_source_flags.py b/cmake/gen_source_flags.py
index 9393c11..b976d31 100644
--- a/cmake/gen_source_flags.py
+++ b/cmake/gen_source_flags.py
@@ -1,4 +1,4 @@
-# (C) Copyright 1996-2015 ECMWF.
+# (C) Copyright 1996-2016 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.
diff --git a/cmake/include/ecbuild/boost_test_framework.h b/cmake/include/ecbuild/boost_test_framework.h
index 8cbd8e9..f593b70 100644
--- a/cmake/include/ecbuild/boost_test_framework.h
+++ b/cmake/include/ecbuild/boost_test_framework.h
@@ -1,5 +1,5 @@
/*
- * (C) Copyright 1996-2015 ECMWF.
+ * (C) Copyright 1996-2016 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.
diff --git a/cmake/sg.pl b/cmake/sg.pl
index 8a64bf4..6bce843 100755
--- a/cmake/sg.pl
+++ b/cmake/sg.pl
@@ -1,7 +1,7 @@
#!/usr/bin/perl
#!/usr/local/share/perl56
-# (C) Copyright 1996-2015 ECMWF.
+# (C) Copyright 1996-2016 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.
diff --git a/project_summary.cmake b/project_summary.cmake
index 95e0483..622a472 100644
--- a/project_summary.cmake
+++ b/project_summary.cmake
@@ -1,40 +1,40 @@
foreach( _tpl ${METVIEW_TPLS} )
string( TOUPPER ${_tpl} TPL )
if( ${TPL}_FOUND )
- message( STATUS " ${_tpl} ${${_tpl}_VERSION}" )
+ ecbuild_info(" ${_tpl} ${${_tpl}_VERSION}" )
if( ${TPL}_INCLUDE_DIRS )
- message( STATUS " includes : [${${TPL}_INCLUDE_DIRS}]" )
+ ecbuild_info(" includes : [${${TPL}_INCLUDE_DIRS}]" )
endif()
if( ${TPL}_LIBRARIES )
- message( STATUS " libs : [${${TPL}_LIBRARIES}]" )
+ ecbuild_info(" libs : [${${TPL}_LIBRARIES}]" )
endif()
if( ${TPL}_DEFINITIONS )
- message( STATUS " defs : [${${TPL}_DEFINITIONS}]" )
+ ecbuild_info(" defs : [${${TPL}_DEFINITIONS}]" )
endif()
endif()
endforeach()
if(WITH_PLOTTING)
- message(STATUS " Magics includes : [${MAGICS_INCLUDE_DIRS}]")
- message(STATUS " Magics libs : [${MAGICS_LIBRARIES}]")
- message(STATUS " Magics defs : [${MAGICS_DEFINITIONS}]")
+ ecbuild_info(" Magics includes : [${MAGICS_INCLUDE_DIRS}]")
+ ecbuild_info(" Magics libs : [${MAGICS_LIBRARIES}]")
+ ecbuild_info(" Magics defs : [${MAGICS_DEFINITIONS}]")
endif()
-message(STATUS " MARS access : " ${MARS_ACCESS})
-message(STATUS " UI : " ${ENABLE_UI})
-message(STATUS " Motif : " ${ENABLE_MOTIF})
-message(STATUS " Plotting : " ${ENABLE_PLOTTING})
-message(STATUS " OPERA Radar : " ${ENABLE_OPERA_RADAR})
-message(STATUS " MARS access : " ${ENABLE_MARS})
-message(STATUS " ODB : " ${ENABLE_ODB})
-message(STATUS " MARS_ODB : " ${ENABLE_MARS_ODB})
-message(STATUS " Usage log : " ${ENABLE_USAGE_LOG})
-message(STATUS " Log dir : " ${LOG_DIR})
-message(STATUS " INPE access : " ${ENABLE_INPE})
-message(STATUS " Weather Room : " ${ENABLE_WEATHER_ROOM})
-message(STATUS " Experimental : " ${ENABLE_EXPERIMENTAL})
-message(STATUS " Contrib : " ${ENABLE_CONTRIB})
+ecbuild_info(" MARS access : ${MARS_ACCESS}")
+ecbuild_info(" UI : ${ENABLE_UI}")
+ecbuild_info(" Motif : ${ENABLE_MOTIF}")
+ecbuild_info(" Plotting : ${ENABLE_PLOTTING}")
+ecbuild_info(" OPERA Radar : ${ENABLE_OPERA_RADAR}")
+ecbuild_info(" MARS access : ${ENABLE_MARS}")
+ecbuild_info(" ODB : ${ENABLE_ODB}")
+ecbuild_info(" MARS_ODB : ${ENABLE_MARS_ODB}")
+ecbuild_info(" Usage log : ${ENABLE_USAGE_LOG}")
+ecbuild_info(" Log dir : ${LOG_DIR}")
+ecbuild_info(" INPE access : ${ENABLE_INPE}")
+ecbuild_info(" Weather Room : ${ENABLE_WEATHER_ROOM}")
+ecbuild_info(" Experimental : ${ENABLE_EXPERIMENTAL}")
+ecbuild_info(" Contrib : ${ENABLE_CONTRIB}")
-message(STATUS "")
-message(STATUS " Built ${PROJECT_NAME} version ${${PROJECT_NAME}_VERSION_STR}")
+ecbuild_info("")
+ecbuild_info(" Built ${PROJECT_NAME} version ${${PROJECT_NAME}_VERSION_STR}")
diff --git a/scripts/CMakeLists.txt b/scripts/CMakeLists.txt
index 0978023..e39966f 100644
--- a/scripts/CMakeLists.txt
+++ b/scripts/CMakeLists.txt
@@ -88,7 +88,7 @@ if(NOT GRIB_API_PATH)
endif()
endif()
endif()
- message(STATUS "Computed GRIB_PATH: ${GRIB_API_PATH}")
+ ecbuild_info("Computed GRIB_PATH: ${GRIB_API_PATH}")
endif()
@@ -234,9 +234,25 @@ ADD_CUSTOM_TARGET(mvs ALL DEPENDS ${FULL_STARTUP_SCRIPT_PATH} ${PROD_TEMPORARY_S
# when we install, we actually want to install the production script and rename it
+# NOTE: if building as part of a bundle, then we have the option (EXPOSE_SUBPACKAGES)
+# of installing everything apart from the startup script into a subdirectory so that
+# libs and executables from other packages don't clash with anything else on
+# the system. If we elect to do this (NOT EXPOSE_SUBPACKAGES) then we will have already
+# modified the CMAKE_INSTALL_PREFIX (in the bundle's top-level CMakeLists.txt file) to
+# put everything two levels deeper. But... we want the startup script to go
+# into the original CMAKE_INSTALL_PREFIX/bin directory
+
+if((DEFINED METVIEW_BUNDLE OR DEFINED METVIEW_BUNDLE_TYPE) AND (NOT ENABLE_EXPOSE_SUBPACKAGES))
+ set (STARTUP_SCRIPT_INSTALL_DIR "../../bin")
+else()
+ set (STARTUP_SCRIPT_INSTALL_DIR bin)
+endif()
+ecbuild_info("Startup script will be installed to: ${STARTUP_SCRIPT_INSTALL_DIR}")
+
+
install( FILES ${PROD_TEMPORARY_STARTUP_SCRIPT}
RENAME ${METVIEW_SCRIPT}
- DESTINATION bin # NOT ${MV_BIN_DIR}!
+ DESTINATION ${STARTUP_SCRIPT_INSTALL_DIR} # NOT ${MV_BIN_DIR}!
PERMISSIONS OWNER_WRITE OWNER_READ GROUP_READ WORLD_READ OWNER_EXECUTE GROUP_EXECUTE WORLD_EXECUTE)
diff --git a/scripts/CMakeLists.txt.orig b/scripts/CMakeLists.txt.orig
deleted file mode 100644
index fe1301a..0000000
--- a/scripts/CMakeLists.txt.orig
+++ /dev/null
@@ -1,260 +0,0 @@
-
-set(scripts
- dump metview-mail mvrun mvrun_c mvrun_lnx
- logrun metview_stat metview_create_user_dir
- metview_patches
- mvusage metview_help set_mars_env
- document_macros.pl mv_grib_dump
- metview_local.${MV_ENVIRON} metview_local2.${MV_ENVIRON}
- MarsTiggeWrapper
- MarsOdbWrapper
- generate_video
- mv_compress mv_mail mv_uniquename
- mv_odbsql mv_obstat
- mv_mars_catalog.py
- mv_flextra_prep.mv mv_flextra_prep mv_flextra_run
- mv_flexpart_run
- mv_rttov_run
- mv_scm_run mv_scm_vis.mv
- mv_vapor_prep.mv mv_vapor_gui
- select_mars_config
-)
-
-if(AT_ECMWF)
- list(APPEND scripts mv_debug_env.sh metgram.py)
-endif()
-
-
-
-# handle these script files
-metview_script_files(SCRIPT_FILES ${scripts})
-
-
-
-
-##############################################################
-#
-# generate the 'compile' script for inline C/Fortran in Macro
-
-
-# find the actual path to the emoslib library
-get_property(EMOS_LIB_PATH TARGET emos PROPERTY LOCATION)
-
-
-# for ECCODES, we *might* get something like
-# eccodes;eccodes_f77;eccodes_f90;/usr/lib64/libjasper.so;/usr/lib64/libjpeg.so;/usr/lib64/libm.so
-# which is not all that we need to link. So we convert 'eccodes' into '-leccodes'
-# and for the Fortran libraries.
-
-set(ECCODES_LIBRARIES_STR " ${ECCODES_LIBRARIES}") # add a space to the beginning
-list(REMOVE_ITEM ECCODES_LIBRARIES_STR "debug") # remove non-compiler items from the string
-list(REMOVE_ITEM ECCODES_LIBRARIES_STR "optimized") # remove non-compiler items from the string
-
-string (REPLACE ";" " " ECCODES_LIBRARIES_STR "${ECCODES_LIBRARIES_STR}")
-string (REPLACE " eccodes" " -leccodes" ECCODES_LIBRARIES_STR "${ECCODES_LIBRARIES_STR}")
-string (REPLACE ";" " " EMOS_LIBRARIES_STR "${EMOS_LIB_PATH}")
-
-
-set(ECCODES_LIBRARIES_STR "${ECCODES_LIBRARIES_STR} ${PTHREAD_LIB}") # add pthread in case needed
-set(ECCODES_LIBRARIES_STR_ORIGINAL "${ECCODES_LIBRARIES_STR}") # keep a backup for later
-
-# if we are linking with shared ECCODES libraries, then in order to be able
-# to run compiled inline Fortran/C/Macro programs, we will need to set
-# LD_LIBRARY_PATH to where ECCODES was installed (this should only be
-# needed if ECCODES was installed in a non-default location).
-# ECCODES_LIB_DIR will be added to METVIEW_LD_PATHS and used in compile.in.
-
-# first, if ECCODES_PATH is not defined, then we need to compute the path
-if(NOT ECCODES_PATH)
- get_property(GRIB_LIB_PATH TARGET eccodes PROPERTY LIBRARY_OUTPUT_DIRECTORY)
- if(GRIB_LIB_PATH)
- set(ECCODES_PATH ${GRIB_LIB_PATH}/..)
- else()
- if (eccodes_BASE_DIR)
- set(ECCODES_PATH ${eccodes_BASE_DIR})
- else()
- if(CMAKE_PREFIX_PATH)
- set(ECCODES_PATH ${CMAKE_PREFIX_PATH})
- endif()
- endif()
- endif()
- message(STATUS "Computed GRIB_PATH: ${ECCODES_PATH}")
-endif()
-
-
-if(ECCODES_PATH)
- if(EXISTS "${ECCODES_PATH}/lib")
- set(ECCODES_LIB_DIR "${ECCODES_PATH}/lib")
- else()
- endif()
-
- if(EXISTS "${ECCODES_PATH}/lib64")
- set(ECCODES_LIB_DIR "${ECCODES_PATH}/lib64")
- endif()
-
- set(ECCODES_LIBRARIES_STR "-L${ECCODES_PATH}/lib -L${ECCODES_PATH}/lib64 -Wl,-rpath,${ECCODES_PATH}/lib:${ECCODES_PATH}/lib64 ${ECCODES_LIBRARIES_STR}")
-endif()
-
-
-foreach (inc ${ECCODES_INCLUDE_DIRS})
- set(ECCODES_INCLUDE_DIRS_STR "${ECCODES_INCLUDE_DIRS_STR} -I${inc}")
-endforeach()
-
-
-
-list(APPEND METVIEW_INLINE_DEFINITIONS ${ECCODES_DEFINITIONS})
-
-
-
-configure_file(compile.in ${CMAKE_BINARY_DIR}/bin/compile @ONLY)
-
-
-
-# in the case of a bundle, the ECCODES and emoslib locations will have been
-# set to their build directories, which is correct when running from
-# the build directory, but not once installed, so we have to change these
-# to the location where they will be installed, and create another 'compile'
-# script which is the one that will actually be installed. In the case where
-# we're not building a bundle, these two compile scripts will be identical.
-
-<<<<<<< HEAD
-if(DEFINED METVIEW_BUNDLE)
- set(ECCODES_LIBRARIES_STR "-L${CMAKE_INSTALL_PREFIX}/lib ${ECCODES_LIBRARIES_STR_ORIGINAL}")
- set(ECCODES_INCLUDE_DIRS_STR "-I${CMAKE_INSTALL_PREFIX}/include")
-=======
-if(DEFINED METVIEW_BUNDLE OR METVIEW_BUNDLE_TYPE STREQUAL "MMG")
- set(GRIB_API_LIBRARIES_STR "-L${CMAKE_INSTALL_PREFIX}/lib ${GRIB_API_LIBRARIES_STR_ORIGINAL}")
- set(GRIB_API_INCLUDE_DIRS_STR "-I${CMAKE_INSTALL_PREFIX}/include")
->>>>>>> develop
- string(REPLACE "${CMAKE_BINARY_DIR}/lib" "${CMAKE_INSTALL_PREFIX}/lib" EMOS_LIBRARIES_STR "${EMOS_LIBRARIES_STR}")
- set(GRIB_API_PATH ${CMAKE_INSTALL_PREFIX})
-endif()
-
-configure_file(compile.in ${CMAKE_BINARY_DIR}/bin/compile_install @ONLY)
-
-
-
-install( FILES ${CMAKE_BINARY_DIR}/bin/compile_install
- DESTINATION ${MV_BIN_DIR}
- RENAME compile
- PERMISSIONS OWNER_WRITE OWNER_READ GROUP_READ WORLD_READ OWNER_EXECUTE GROUP_EXECUTE WORLD_EXECUTE)
-
-
-
-
-##################
-#
-# CONFIG.site
-
-if( DEFINED NETCDF_PATH )
- set(NETCDF_BIN "${NETCDF_PATH}/bin")
-else()
- set(NETCDF_BIN "")
-endif()
-
-if(DEFINED METVIEW_BUNDLE)
- set(METVIEW_BUNDLE_SRC ${CMAKE_SOURCE_DIR})
-endif()
-
-if(DEFINED METVIEW_BUNDLE_MAGICS)
- set(MV_BUNDLE_MAGICS_SRC ${CMAKE_SOURCE_DIR}/magics)
-endif()
-
-
-
-ecbuild_get_date(TODAYS_DATE)
-
-
-# # Add certain paths to LD_LIBRARY_PATH.
-# # If the given path is not a standard system one, then add it to our list
-# # of paths to add to LD_LIBRARY_PATH on Metview's startup. We want to
-# # avoid adding system paths here because they can override non-default
-# # paths (case in point: the wrong OpenGL library has been known to be
-# # picked up - used by VAPOR).
-#
-# NO - this is not really needed with the rpath, and it can lead, in the
-# case of a bundle, to the build directory (Magics) going into the
-# LD_LIBRARY_PATH even when installed (no harmful effect seen though).
-#
-# set(SYS_LIBDIRS "/usr/lib64" "/usr/lib64/" "/usr/lib" "/usr/lib/" "")
-# set(METVIEW_LD_PATHS "")
-#
-# foreach(LIBPATH ${MAGICS_LIB_DIR} ${ODB_API_LIB_DIR} ${ECCODES_LIB_DIR})
-# list(FIND SYS_LIBDIRS ${LIBPATH} IND)
-# if(IND EQUAL -1) # path not in the list of system paths
-# set(METVIEW_LD_PATHS "${LIBPATH}:${METVIEW_LD_PATHS}")
-# endif()
-# endforeach()
-
-
-
-# MAGPLUS_HOME - under normal circumstances, we link with a specific
-# Magics library which knows where it's been installed, so we don't
-# need (or want) to set MAGPLUS_HOME, and in fact we want to avoid
-# the situation where a user sets it to the wrong path (as can happen
-# if a Magics module is set up by default in a user's environment).
-# So the simplest thing is to unset MAGPLUS_HOME and let the library
-# find its own resource files. This works fine if Magics has been
-# installed, but not if we are linking with a Magics in the build tree.
-# In this case MAGPLUS_HOME will need to point to the Magics source(!)
-# directory. In Magics 2.27.0 onwards, this is all taken care of by the
-# CMake variable MAFPLUS_HOME. If this is not set (i.e. earlier version
-# of Magics) then we just unset it. MV_MAGPLUS_HOME_PATH_SET is used
-# in metview_base.in.
-
-if(DEFINED MAGPLUS_HOME)
- set(MV_MAGPLUS_HOME_PATH_SET "MAGPLUS_HOME=${MAGPLUS_HOME}")
-else()
- set(MV_MAGPLUS_HOME_PATH_SET "unset MAGPLUS_HOME")
-endif()
-
-
-
-# create the Metview startup script
-configure_file(metview_base.in ${FULL_STARTUP_SCRIPT_PATH} @ONLY)
-
-
-# create a 'production' version of this - just the same, but with
-# METVIEW_VERSION=prod instead of dev
-
-set(PROD_TEMPORARY_STARTUP_SCRIPT "${FULL_STARTUP_SCRIPT_PATH}_prod")
-
-add_custom_command(
- OUTPUT ${PROD_TEMPORARY_STARTUP_SCRIPT}
- COMMAND sed "s/METVIEW_VERSION=dev/METVIEW_VERSION=prod/g" ${FULL_STARTUP_SCRIPT_PATH} > ${PROD_TEMPORARY_STARTUP_SCRIPT}
- DEPENDS ${FULL_STARTUP_SCRIPT_PATH}
-)
-
-
-ADD_CUSTOM_TARGET(mvs ALL DEPENDS ${FULL_STARTUP_SCRIPT_PATH} ${PROD_TEMPORARY_STARTUP_SCRIPT})
-
-
-# when we install, we actually want to install the production script and rename it
-install( FILES ${PROD_TEMPORARY_STARTUP_SCRIPT}
- RENAME ${METVIEW_SCRIPT}
- DESTINATION bin # NOT ${MV_BIN_DIR}!
- PERMISSIONS OWNER_WRITE OWNER_READ GROUP_READ WORLD_READ OWNER_EXECUTE GROUP_EXECUTE WORLD_EXECUTE)
-
-
-
-## TODO
-## If we are building this outside ECMWF, then we want different proxy settings
-## (used currently by the OGC clients). We achieve this by simply changing the
-## default setting in the ConfigDef file. We can do this with a a search/replace
-## operation. This relies very much on the proxy setting having a uniqe 'signature'
-## so that the search/replace can operate on a single line.
-#
-#if test "x$SITE_NAME" != 'xecmwf'; then
-# configdef=share/metview/etc/ConfigDef
-# configtmp=${configdef}.tmp
-# echo "Not at ECMWF: resetting the default proxy setting in ${configdef}."
-# chmod u+w $configdef
-# sed "s/ } = yes/ } = no/g" $configdef > $configtmp
-# mv $configtmp $configdef
-#fi
-
-#ecbuild_dont_pack(FILES mv_cp metview_local.ecmwf metview_local2.ecmwf)
-
-ecbuild_dont_pack(REGEX "metview_local*.ecm*")
-ecbuild_dont_pack(FILES "mv_cp;mv_debug_env.sh;update_MetApps_files.sh")
-
diff --git a/scripts/metview_base.in b/scripts/metview_base.in
index 33b71ac..644beac 100755
--- a/scripts/metview_base.in
+++ b/scripts/metview_base.in
@@ -48,6 +48,17 @@ MV_BUNDLE_TYPE=@METVIEW_BUNDLE_TYPE@
MV_BUNDLE_SRC=@METVIEW_BUNDLE_SRC@
METVIEW_QT5=@METVIEW_QT5@
+
+# prevent environment variable disruptions caused by scripts
+# that are called from $BASH_ENV. We have seen a case where having
+# default modules set (with the 'module initadd' command) can cause
+# those modules to be loaded with each shell that Metview spawns,
+# overwriting MAGPLUS_HOME for example. See JIRA issue METV-1406.
+unset BASH_ENV
+
+
+
+
#
# Metview scripts are built automatically by 'make'.
#
diff --git a/scripts/mv_flextra_prep b/scripts/mv_flextra_prep
index 4be3c0d..427ff21 100755
--- a/scripts/mv_flextra_prep
+++ b/scripts/mv_flextra_prep
@@ -1,4 +1,4 @@
-#!/usr/bin/bash
+#!/bin/bash
# **************************** LICENSE START ***********************************
#
diff --git a/share/ecbuild/toolchains/ecmwf-XC30-Cray.cmake b/share/ecbuild/toolchains/ecmwf-XC30-Cray.cmake
index db045ee..52924b9 100644
--- a/share/ecbuild/toolchains/ecmwf-XC30-Cray.cmake
+++ b/share/ecbuild/toolchains/ecmwf-XC30-Cray.cmake
@@ -3,6 +3,9 @@
####################################################################
set( CMAKE_SIZEOF_VOID_P 8 )
+# Disable relative rpaths as aprun does not respect it
+set( ENABLE_RELATIVE_RPATHS OFF CACHE STRING "Disable relative rpaths" FORCE )
+
####################################################################
# COMPILER
####################################################################
@@ -17,6 +20,14 @@ set( ECBUILD_FIND_MPI OFF )
set( ECBUILD_TRUST_FLAGS ON )
####################################################################
+# MPI
+####################################################################
+
+set( MPIEXEC "aprun" )
+set( MPIEXEC_NUMPROC_FLAG "-n" )
+set( MPIEXEC_NUMTHREAD_FLAG "-d" )
+
+####################################################################
# OpenMP FLAGS
####################################################################
diff --git a/share/ecbuild/toolchains/ecmwf-XC30-GNU.cmake b/share/ecbuild/toolchains/ecmwf-XC30-GNU.cmake
index e09bc56..3f69f06 100644
--- a/share/ecbuild/toolchains/ecmwf-XC30-GNU.cmake
+++ b/share/ecbuild/toolchains/ecmwf-XC30-GNU.cmake
@@ -3,6 +3,9 @@
####################################################################
set( CMAKE_SIZEOF_VOID_P 8 )
+# Disable relative rpaths as aprun does not respect it
+set( ENABLE_RELATIVE_RPATHS OFF CACHE STRING "Disable relative rpaths" FORCE )
+
####################################################################
# COMPILER
####################################################################
@@ -17,6 +20,14 @@ set( ECBUILD_FIND_MPI OFF )
set( ECBUILD_TRUST_FLAGS ON )
####################################################################
+# MPI
+####################################################################
+
+set( MPIEXEC "aprun" )
+set( MPIEXEC_NUMPROC_FLAG "-n" )
+set( MPIEXEC_NUMTHREAD_FLAG "-d" )
+
+####################################################################
# OpenMP FLAGS
####################################################################
diff --git a/share/ecbuild/toolchains/ecmwf-XC30-Intel.cmake b/share/ecbuild/toolchains/ecmwf-XC30-Intel.cmake
index c569daf..01c6267 100644
--- a/share/ecbuild/toolchains/ecmwf-XC30-Intel.cmake
+++ b/share/ecbuild/toolchains/ecmwf-XC30-Intel.cmake
@@ -1,4 +1,13 @@
####################################################################
+# ARCHITECTURE
+####################################################################
+set( CMAKE_SIZEOF_VOID_P 8 )
+
+# Disable relative rpaths as aprun does not respect it
+set( ENABLE_RELATIVE_RPATHS OFF CACHE STRING "Disable relative rpaths" FORCE )
+
+
+####################################################################
# COMPILER
####################################################################
@@ -12,12 +21,20 @@ set( ECBUILD_FIND_MPI OFF )
set( ECBUILD_TRUST_FLAGS ON )
####################################################################
+# MPI
+####################################################################
+
+set( MPIEXEC "aprun" )
+set( MPIEXEC_NUMPROC_FLAG "-n" )
+set( MPIEXEC_NUMTHREAD_FLAG "-d" )
+
+####################################################################
# OpenMP FLAGS
####################################################################
-set( OMP_C_FLAGS "-qopenmp -qopenmp-threadprivate=compat -qopenmp-report=2 -qopt-report-phase=vec,openmp" )
-set( OMP_CXX_FLAGS "-qopenmp -qopenmp-threadprivate=compat -qopenmp-report=2 -qopt-report-phase=vec,openmp" )
-set( OMP_Fortran_FLAGS " -openmp -openmp-threadprivate=compat -openmp-report=2 -opt-report-phase=vec,openmp" ) # -[q] is missing on purpose, ifort does not take -q as flag
+set( OMP_C_FLAGS "-openmp -openmp-threadprivate=compat" )
+set( OMP_CXX_FLAGS "-openmp -openmp-threadprivate=compat" )
+set( OMP_Fortran_FLAGS "-openmp -openmp-threadprivate=compat" )
####################################################################
# COMMON FLAGS
@@ -28,7 +45,7 @@ set( OMP_Fortran_FLAGS " -openmp -openmp-threadprivate=compat -openmp-re
set( ECBUILD_C_FLAGS "-fp-speculation=strict -fp-model precise -traceback")
set( ECBUILD_CXX_FLAGS "-fp-speculation=strict -fp-model precise -traceback" )
-set( ECBUILD_Fortran_FLAGS "-fp-speculation=strict -fp-model precise -convert big_endian -assume byterecl -traceback -fpe0" )
+set( ECBUILD_Fortran_FLAGS "-fp-speculation=strict -fp-model source -convert big_endian -assume byterecl -traceback -fpe0" )
####################################################################
# BIT REPRODUCIBLE FLAGS
diff --git a/share/metview/app-defaults/CMakeLists.txt b/share/metview/app-defaults/CMakeLists.txt
index a853c19..80c0c98 100644
--- a/share/metview/app-defaults/CMakeLists.txt
+++ b/share/metview/app-defaults/CMakeLists.txt
@@ -70,7 +70,7 @@ foreach( dir ${dirs})
OUTPUT_VARIABLE outv
ERROR_VARIABLE errv)
if(NOT res EQUAL 0)
- message(FATAL_ERROR "Could not create symbolic link to ${dir} : ${res} ${outv} , ${errv}")
+ ecbuild_critical("Could not create symbolic link to ${dir} : ${res} ${outv} , ${errv}")
endif()
diff --git a/share/metview/etc/CMakeLists.txt b/share/metview/etc/CMakeLists.txt
index 3c634a5..336c165 100644
--- a/share/metview/etc/CMakeLists.txt
+++ b/share/metview/etc/CMakeLists.txt
@@ -1,8 +1,3 @@
-### TODO:
-### ObjectListAll
-### Macro Editor resource files
-### LOTS MORE!
-
set(files
AnnotationViewDef AnnotationViewRules
@@ -141,6 +136,7 @@ set(files
set(metview_core_targets
macro
+ ObjectListAllTarget
)
@@ -269,7 +265,7 @@ add_custom_command(
COMMAND cat ${CMAKE_CURRENT_SOURCE_DIR}/${MARS_ACCESS} > ObjectListAll.temp \; echo 'cat <<\@' >> ObjectListAll.temp \; cat ${ObjectListAllComponents} >> ObjectListAll.temp \; echo '\@' >> ObjectListAll.temp \; grep -v "^#" ObjectListAll.temp > ${CMAKE_BINARY_DIR}/share/${PROJECT_NAME}/etc/ObjectListAll \; rm -f ObjectListAll.temp
# COMMAND cat $(MARS_ACCESS) > ObjectListAll.temp \; echo "cat <<@ " >> ObjectListAll.temp \; cat Services ObjectList uPlotTable >> ObjectListAll.temp \; cat `ls ObjectSpec.* | grep -v \~` >> ObjectListAll.temp \; echo "@" >> ObjectListAll.temp \; grep -v '^#' ObjectListAll.temp > ObjectListAll
DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/ObjectList ${ObjectListAllComponents})
-add_custom_target(ObjectListAll DEPENDS ${CMAKE_BINARY_DIR}/share/${PROJECT_NAME}/etc/ObjectListAll)
+add_custom_target(ObjectListAllTarget DEPENDS ${CMAKE_BINARY_DIR}/share/${PROJECT_NAME}/etc/ObjectListAll)
install( FILES ${CMAKE_BINARY_DIR}/share/${PROJECT_NAME}/etc/ObjectListAll
@@ -281,7 +277,7 @@ install( FILES ${CMAKE_BINARY_DIR}/share/${PROJECT_NAME}/etc/ObjectListAll
add_custom_command(
OUTPUT defs_created.txt
COMMAND touch defs_created.txt
- DEPENDS ${dependencies} ${CMAKE_BINARY_DIR}/share/${PROJECT_NAME}/etc/ObjectListAll
+ DEPENDS ${dependencies} ObjectListAllTarget
)
add_custom_target( all_defs ALL DEPENDS defs_created.txt )
diff --git a/share/metview/etc/ObjectList b/share/metview/etc/ObjectList
index a32be7b..cc67d63 100644
--- a/share/metview/etc/ObjectList
+++ b/share/metview/etc/ObjectList
@@ -1780,7 +1780,7 @@ state,
SAMPLE_FORMULA_FDN/
SAMPLE_FORMULA_FND/
SAMPLE_FORMULA_FNN,
- output_class = GRIB/GEOPOINTS,
+ output_class = GRIB/GEOPOINTS/BUFR,
service = macro
state,
diff --git a/share/metview/etc/ecmwf.def b/share/metview/etc/ecmwf.def
index 676466c..cf7aeeb 100755
--- a/share/metview/etc/ecmwf.def
+++ b/share/metview/etc/ecmwf.def
@@ -719,7 +719,6 @@ TOTAL AEROSOL OPTICAL DEPTH AT 1240NM ; AOD1240 ; 216.210
CERA20C ; CERA-20C ; EP
EURO4M ; RM
- UERRA ; UR
20CR ; NCEP 20CR ; NR
JRA55 ; J5
CERASAT ; CERA-SAT ; ET
@@ -1868,6 +1867,12 @@ ARCHIVE ; Archives data ; MARS
"
} = ""
+ OPTIMISE
+ {
+ ON
+ OFF
+ } = OFF
+
DATABASE [ priority = 1 ]
{
@
@@ -4057,6 +4062,16 @@ RETRIEVE ; Retrieval of data ; MARS
NO ; N
} = N
+ OPTIMISE [ java_control = CHOICE,
+ java_section = OTHER,
+ hidden = TRUE,
+ check = false,
+ java_hidden = FALSE ]
+ {
+ ON
+ OFF
+ } = OFF
+
PROCESS [ java_control = CHOICE,
java_section = OTHER,
hidden = TRUE,
diff --git a/share/metview/etc/tigge.def b/share/metview/etc/tigge.def
index 5679898..65c2ae4 100755
--- a/share/metview/etc/tigge.def
+++ b/share/metview/etc/tigge.def
@@ -109,6 +109,12 @@ SNOW ALBEDO ; ASN ; 228032
TIME INTEGRATED SURFACE NET SOLAR RADIATION DOWNWARDS ; SSRD ; 169
TIME INTEGRATED SURFACE NET THERMAL RADIATION DOWNWARDS ; STRD ; 175
+# Additions for UERRA
+SPECIFIC CLOUD LIQUID WATER CONTENT ; CLWC ; 246
+SPECIFIC CLOUD ICE WATER CONTENT ; CIWC ; 247
+RELATIVE HUMIDITY ; R ; 157
+CLOUD COVER ; CC ; 248
+
*
/
} = T
diff --git a/src/Desktop/Parameter.cc b/src/Desktop/Parameter.cc
index 9f905ed..d95154a 100644
--- a/src/Desktop/Parameter.cc
+++ b/src/Desktop/Parameter.cc
@@ -144,6 +144,19 @@ Parameter::Parameter(Language& l,parameter* p):
if(ev !=0 && (*ev == 'F' || *ev == 'f'))
multiple_ = true;
}
+ else if(strcmp(h,"any") == 0)
+ {
+ // if 'exclusive' is set, then do not split elements into a list
+ // - interface=text does this spltting; string does not
+ const char * ev=get_value(param_->interface,"exclusive",0);
+ if(ev !=0 && (*ev == 'F' || *ev == 'f'))
+ multiple_ = true;
+
+ if(multiple_)
+ set_value(param_->interface,"interface","text");
+ else
+ set_value(param_->interface,"interface","string");
+ }
}
//No helper if the interface is "none"
diff --git a/src/Macro/misc.cc b/src/Macro/misc.cc
index 421fc7a..05035fa 100644
--- a/src/Macro/misc.cc
+++ b/src/Macro/misc.cc
@@ -12,6 +12,10 @@
#include <MvRequest.h>
#include <MvVersionInfo.h>
+#if defined(METVIEW_ODB)
+ #include "odb_api/odbcapi.h"
+#endif
+
#include "macro.h"
#include "script.h"
@@ -795,6 +799,13 @@ Value MetviewVersionFunction::Execute(int arity,Value *arg)
emos_version = emosnum_(&konoff);
set_value(r, "emos_version", "%d", emos_version);
+
+#if defined(METVIEW_ODB)
+ const char *odbapi_version = odb_api_version();
+ set_value(r, "odb_api_version", "%s", odbapi_version);
+#endif
+
+
return Value(r);
}
diff --git a/src/OdbExaminer/OdbExaminer.cc b/src/OdbExaminer/OdbExaminer.cc
index e78abd9..1919868 100755
--- a/src/OdbExaminer/OdbExaminer.cc
+++ b/src/OdbExaminer/OdbExaminer.cc
@@ -31,6 +31,7 @@
#ifdef METVIEW_ODB_NEW
#include "MvOdb.h"
+#include "odb_api/odbcapi.h"
#endif
#include "MvQAbout.h"
@@ -519,7 +520,13 @@ void OdbExaminer::slotTabIndexChanged(int index)
void OdbExaminer::slotShowAboutBox()
{
- MvQAbout about("ODB Examiner","",MvQAbout::MetviewVersion );
+ const char *odbapi_version = odb_api_version();
+ QString odbapiVersion(odbapi_version);
+
+ QMap<MvQAbout::Version,QString> text;
+ text[MvQAbout::OdbApiVersion]=odbapiVersion;
+
+ MvQAbout about("ODB Examiner","",MvQAbout::MetviewVersion | MvQAbout::OdbApiVersion,text);
about.exec();
}
diff --git a/src/libMars/CMakeLists.txt b/src/libMars/CMakeLists.txt
index e5a8407..3f1e193 100644
--- a/src/libMars/CMakeLists.txt
+++ b/src/libMars/CMakeLists.txt
@@ -83,7 +83,7 @@ endif()
if ( NOT LIBEMOS_FOUND )
add_definitions(-DNOPPROC)
- message(FATAL_ERROR "No emoslib found - should not have got this far!")
+ ecbuild_critical("No emoslib found - should not have got this far!")
endif()
diff --git a/src/libMarsClient/CMakeLists.txt b/src/libMarsClient/CMakeLists.txt
index 3f831a5..dca4423 100644
--- a/src/libMarsClient/CMakeLists.txt
+++ b/src/libMarsClient/CMakeLists.txt
@@ -150,9 +150,8 @@ ecbuild_add_library(
GENERATED mars_client_version.c
SOURCES ${mars_client_src_files} mars_client_version.c
DEPENDS marsxdr marslex
- PUBLIC_INCLUDES
- ${GRIB_API_INCLUDE_DIRS}
PRIVATE_INCLUDES
+ ${GRIB_API_INCLUDE_DIRS}
${CURL_INCLUDE_DIRS}
DEFINITIONS ${GRIB_API_DEFINITIONS}
LIBS grib_api ${MARS_FEATURE_LIBRARIES} ${CURL_LIBRARIES} ${CMATH_LIBRARIES} ${CMAKE_THREAD_LIBS_INIT} )
@@ -160,9 +159,10 @@ ecbuild_add_library(
set_directory_properties( ADDITIONAL_MAKE_CLEAN_FILES rpcmars.h marsxdr.c langl.c langy.c )
ecbuild_add_executable(
- TARGET mars.bin
+ TARGET mars.bin
+ INCLUDES ${GRIB_API_INCLUDE_DIRS}
SOURCES mars.c
- LIBS mars
+ LIBS mars
)
add_subdirectory( tools )
diff --git a/src/libMarsClient/environ.c b/src/libMarsClient/environ.c
index 4f94882..4f23bb6 100644
--- a/src/libMarsClient/environ.c
+++ b/src/libMarsClient/environ.c
@@ -244,7 +244,7 @@ request *get_environ(void)
if(env) return env;
- if(EQ(who,"bamboo") || EQ(who,"deploy"))
+ if(EQ(who,"bamboo") || EQ(who,"deploy") || (EQ(who,"worker") && !mars.marslite_mode) )
who = user("max");
if(useTest && EQ(who,"max"))
diff --git a/src/libMarsClient/request.c b/src/libMarsClient/request.c
index c139afd..c3531be 100644
--- a/src/libMarsClient/request.c
+++ b/src/libMarsClient/request.c
@@ -452,6 +452,7 @@ static char *names[] = {
"IDENT",
"OBSTYPE",
+ "INSTRUMENT",
"REPORTYPE",
/* For 2-d wave-spectra products */
@@ -507,6 +508,7 @@ static namecmp cmpnames[] = {
eq_integer, /* IDENT */
eq_integer, /* OBSTYPE */
+ eq_integer, /* INSTRUMENT */
eq_integer, /* REPORTYPE */
eq_integer, /* FREQUENCY */
@@ -1658,7 +1660,7 @@ static boolean chk_152(int count,char *names[],char *vals[])
}
}
- if(EQ(names[i],"LEVELIST") && vals[i] && !EQ(vals[i],"1"))
+ if(EQ(names[i],"LEVELIST") && vals[i] && !(EQ(vals[i],"1") || EQ(vals[i],"01")))
flg++;
}
diff --git a/src/libMarsClient/tools.c b/src/libMarsClient/tools.c
index 4e301a3..6510be5 100644
--- a/src/libMarsClient/tools.c
+++ b/src/libMarsClient/tools.c
@@ -1591,13 +1591,15 @@ long _readany(FILE *f, char *b, long *l)
{
size_t len = *l;
long e = wmo_read_any_from_file(f,(unsigned char*)b,&len);
- *l = len;
- if(e && e != GRIB_END_OF_FILE)
- marslog(LOG_EROR|LOG_PERR,"wmo_read_any_from_file: error %d (%s) l=%ld, len=%ld",e,
- grib_get_error_message(e),len);
+ if(e && e != GRIB_END_OF_FILE) {
+ marslog(LOG_EROR|LOG_PERR,"wmo_read_any_from_file: error %d (%s) l=%ld, len=%ld", e,
+ grib_get_error_message(e), l, len);
+ }
- return e;
+ *l = len;
+
+ return e;
}
long _readgrib(FILE *f, char *b, long *l)
diff --git a/src/libMetview/MvObsSet.cc b/src/libMetview/MvObsSet.cc
index 74f3f09..701a530 100644
--- a/src/libMetview/MvObsSet.cc
+++ b/src/libMetview/MvObsSet.cc
@@ -207,92 +207,100 @@ MvObsSet :: rewind()
MvObs
MvObsSet::next()
{
- const int EOF_STATUS = -1;
+ const int EOF_STATUS = -1;
+ bool readAnotherMessage = true;
- if( ! _bufrFile )
- return MvObs( NULL ); // nothing if file not ok
+ if( ! _bufrFile )
+ return MvObs( NULL ); // nothing if file not ok
- if( _IO_mode == WRITE )
- return MvObs( NULL ); // no next when writing !
+ if( _IO_mode == WRITE )
+ return MvObs( NULL ); // no next when writing !
- _msgLen = MAX_MESSAGE_LENGTH;
+ _msgLen = MAX_MESSAGE_LENGTH;
- _msgNumber++;
+ _msgNumber++;
- long lastPos = ftell(_bufrFile);
- long myError = _readbufr( _bufrFile, _message, &_msgLen );
+ long lastPos = ftell(_bufrFile);
+ long myError = _readbufr( _bufrFile, _message, &_msgLen );
- if ( myError == -3 ) // Bufr too small
- {
- // Go back to previous and allocate memory
- fseek(_bufrFile,lastPos,SEEK_SET);
- delete [] _message;
- MAX_MESSAGE_LENGTH = _msgLen + 8;
- _message = new char[ MAX_MESSAGE_LENGTH ];
- _msgLen = MAX_MESSAGE_LENGTH;
+ while (readAnotherMessage)
+ {
+ readAnotherMessage = false; // might be set to true in the PREPBufr part
- if ( ! _message )
- {
- cerr << "MvObsSet::next: Cannot allocate memory for next BUFR message" << endl;
+ if ( myError == -3 ) // Bufr too small
+ {
+ // Go back to previous and allocate memory
+ fseek(_bufrFile,lastPos,SEEK_SET);
+ delete [] _message;
+ MAX_MESSAGE_LENGTH = _msgLen + 8;
+ _message = new char[ MAX_MESSAGE_LENGTH ];
+ _msgLen = MAX_MESSAGE_LENGTH;
+
+ if ( ! _message )
+ {
+ cerr << "MvObsSet::next: Cannot allocate memory for next BUFR message" << endl;
#ifdef METVIEW
- marslog( LOG_EROR, "Cannot allocate memory for next BUFR message" );
+ marslog( LOG_EROR, "Cannot allocate memory for next BUFR message" );
#endif
- _msgLen = MAX_MESSAGE_LENGTH = 0;
- _IO_buffer_OK = false;
- return MvObs( NULL );
- }
- else
- {
- cout << "MvObsSet::next: Allocated more memory for BUFR msg" << endl;
- myError = _readbufr( _bufrFile, _message, &_msgLen );
- }
- }
+ _msgLen = MAX_MESSAGE_LENGTH = 0;
+ _IO_buffer_OK = false;
+ return MvObs( NULL );
+ }
+ else
+ {
+ cout << "MvObsSet::next: Allocated more memory for BUFR msg" << endl;
+ myError = _readbufr( _bufrFile, _message, &_msgLen );
+ }
+ }
- if( myError )
- {
- if( myError != EOF_STATUS )
- {
- cerr << "MvObsSet::next: Failed reading next BUFR msg, returned status=" << myError << endl;
+ if( myError )
+ {
+ if( myError != EOF_STATUS )
+ {
+ cerr << "MvObsSet::next: Failed reading next BUFR msg, returned status=" << myError << endl;
#ifdef METVIEW
- marslog( LOG_EROR, "Failed reading next BUFR msg, status = %ld", myError );
+ marslog( LOG_EROR, "Failed reading next BUFR msg, status = %ld", myError );
#endif
- }
- _IO_buffer_OK = false;
- return MvObs( NULL );
- }
+ }
+ _IO_buffer_OK = false;
+ return MvObs( NULL );
+ }
#ifdef METVIEW_PREPBUFR
- //--
- //-- NCEP PrepBUFR files may contain msgs with ZERO subsets!!!
- //-- 'bufrex' cannot handle such illegal msgs, if so we must skip it
- //--
- MvBufr tmpBufr( _message, _msgLen, _msgNumber ); //-- make BUFR octets into an object
- if( tmpBufr.subsetCount() == 0 )
- {
- ostringstream os;
- os << "Original BUFR msg " << _msgNumber
- << " has ZERO subsets - ignoring (not counting) this illegal msg!"
- << ends;
+ //--
+ //-- NCEP PrepBUFR files may contain msgs with ZERO subsets!!!
+ //-- 'bufrex' cannot handle such illegal msgs, if so we must skip it
+ //--
+ MvBufr tmpBufr( _message, _msgLen, _msgNumber ); //-- make BUFR octets into an object
+ if( tmpBufr.subsetCount() == 0 )
+ {
+ ostringstream os;
+ os << "Original BUFR msg " << _msgNumber
+ << " has ZERO subsets - ignoring (not counting) this illegal msg!"
+ << ends;
- cout << os.str() << endl;
+ cout << os.str() << endl;
#ifdef METVIEW
- //-- why this marslog crashes ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?
-// marslog( LOG_WARN, "%s", os.str().c_str() );
- //-- why this marslog crashes ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?
+ //-- why this marslog crashes ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?
+ // marslog( LOG_WARN, "%s", os.str().c_str() );
+ //-- why this marslog crashes ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?
#endif
- //-- get next msg and cross your fingers it fits into current _message array
- _msgLen = MAX_MESSAGE_LENGTH;
- myError = _readbufr( _bufrFile, _message, &_msgLen );
+ //-- get next msg and cross your fingers it fits into current _message array
+ _msgLen = MAX_MESSAGE_LENGTH;
+ myError = _readbufr( _bufrFile, _message, &_msgLen );
+ lastPos = ftell(_bufrFile);
+ readAnotherMessage = true;
- //_msgNumber++;
- }
+ //_msgNumber++;
+ }
#endif
+ }
- _IO_buffer_OK = true;
- return MvObs( new MvBufr( _message, _msgLen, _msgNumber ) );
+ _IO_buffer_OK = true;
+ return MvObs( new MvBufr( _message, _msgLen, _msgNumber ) );
}
//____________________________________________________________________ add
diff --git a/src/libMetview/MvScanFileType.cc b/src/libMetview/MvScanFileType.cc
index 595fe2a..a18b511 100644
--- a/src/libMetview/MvScanFileType.cc
+++ b/src/libMetview/MvScanFileType.cc
@@ -400,8 +400,25 @@ static const char *scan_file(const char *file)
//-- Check for IFS fortran namelists
-
-
+
+
+ // if it's binary then it might actually be a GRIB file with some extra
+ // header bits at the start e.g. GTS). GRIB_API has functionality to
+ // bypass these, so if it can get a GRIB handle then it must be a GRIB file.
+ // This may not be the most efficient way to find out, but it's a last resort.
+
+ if( fileType == eBinaryFile )
+ {
+ grib_handle *gh;
+ int ge;
+ gh = grib_handle_new_from_file(NULL, f.f_, &ge);
+ if (gh != NULL)
+ {
+ grib_handle_delete(gh);
+ return "GRIB";
+ }
+ }
+
//We have to do this check at this point, after
//FLEXTRA was checked!
diff --git a/src/libMvQtGui/MvQAbout.cc b/src/libMvQtGui/MvQAbout.cc
index 52c13eb..fa55d3f 100644
--- a/src/libMvQtGui/MvQAbout.cc
+++ b/src/libMvQtGui/MvQAbout.cc
@@ -90,6 +90,14 @@ MvQAbout::MvQAbout(QString title, QString description, Versions version,
}
}
+ if(version.testFlag(OdbApiVersion))
+ {
+ if(text.contains(OdbApiVersion))
+ {
+ str << "<p><b>ODB_API version:</b> " << text[OdbApiVersion];
+ }
+ }
+
if(version.testFlag(NetcdfVersion))
{
str << "<p><b>NetCDF version:</b> ";
diff --git a/src/libMvQtGui/MvQAbout.h b/src/libMvQtGui/MvQAbout.h
index 35004a6..30fa1a7 100644
--- a/src/libMvQtGui/MvQAbout.h
+++ b/src/libMvQtGui/MvQAbout.h
@@ -17,7 +17,8 @@
class MvQAbout : public QDialog
{
public:
- enum Version {NoVersion = 0x0, MetviewVersion = 0x1, GribApiVersion = 0x2, EmosVersion = 0x3, MagicsVersion = 0x4, NetcdfVersion = 0x5};
+ enum Version {NoVersion = 0x0, MetviewVersion = 0x1, GribApiVersion = 0x2, EmosVersion = 0x4, MagicsVersion = 0x8,
+ NetcdfVersion = 0x10, OdbApiVersion = 0x20};
Q_DECLARE_FLAGS(Versions,Version);
typedef QMap<Version,QString> VersionTextMap;
diff --git a/src/libUtil/CMakeLists.txt.orig b/src/libUtil/CMakeLists.txt.orig
deleted file mode 100644
index b0de1c0..0000000
--- a/src/libUtil/CMakeLists.txt.orig
+++ /dev/null
@@ -1,73 +0,0 @@
-
-set(libUtil_srcs
-Box.cc
-Cached.cc
-Grib.cc
-GribMetaData.cc
-LogHandler.cc
-MtInputEvent.cc
-MvAlmostObsoleteRequest.cc
-MvElement.cc
-MvException.cc
-MvFileInfo.cc
-MvFlextra.cc
-MvKeyProfile.cc
-MvKeyManager.cc
-MvList.cc
-MvMiscelaneous.cc
-MvPath.cc
-MvProfileData.cc
-MvRequestUtil.cc
-MvRttov.cc
-MvScm.cc
-MvStopWatch.cc
-MvVersionInfo.cc
-Point.cc
-proj_braz.cc
-MvGribParC.c
-Request.cc
-TableReader.cc
-Tokenizer.cc
-UtilitiesC.c
-Cached.h GribMetaData.h LogHandler.h MagicsColours.h MtInputEvent.h MvException.h
-MvFileInfo.h MvFlextra.h MvGribParC.h MvKeyManager.h MvKeyProfile.h MvMessageMetaData.h MvMsg.h MvOdb.h
-MvSTL.h MvStopWatch.h MvVersionInfo.h Rectangle.h Request.h UtilitiesC.h auto_ptr.h
-bits.h gdefines.h inc_iostream.h inc_stl.h min_max_macros.h
-xec.h
-Assertions.hpp Box.hpp Factory.hpp Grib.hpp
-MvAlmostObsoleteRequest.hpp MvCommandHistory.h MvElement.hpp MvList.hpp
-MvMiscelaneous.h MvParTable.hpp MvPath.hpp
-MvProfileData.h
-MvRequestUtil.hpp MvRttov.h MvScm.h Point.hpp Projection.hpp Prototype.hpp
-Types.hpp griddoc.hpp imagedoc.hpp proj_braz.hpp stypes.hpp
-TableReader.h
-Tokenizer.h)
-
-
-#foreach( file ${_libUtil_srcs} )
-# list( APPEND libUtil_srcs libUtil/${file} )
-#endforeach()
-
-if (METVIEW_ODB)
- list(APPEND libUtil_srcs MvOdb.cc)
- set(LOCAL_EXTRA_INCLUDE_DIRS ${METVIEW_ODB_API_INCLUDE_DIRS})
-endif()
-
-
-###set( libUtil_srcs ${libUtil_srcs} PARENT_SCOPE )
-
-ecbuild_add_library( TARGET Util
- TYPE STATIC
- NOINSTALL
- SOURCES ${libUtil_srcs}
- TEMPLATES ${common_templates}
- INCLUDES ${METVIEW_STANDARD_INCLUDES} ${LOCAL_EXTRA_INCLUDE_DIRS}
- DEFINITIONS ${METVIEW_EXTRA_DEFINITIONS}
- LIBS ${METVIEW_EXTRA_LIBRARIES}
-<<<<<<< HEAD
-# LIBS ${METVIEW_EXTRA_LIBRARIES} MvMars Metview ${ECCODES_LIBRARIES}
-=======
-# LIBS ${METVIEW_EXTRA_LIBRARIES} MvMars Metview ${GRIB_API_LIBRARIES}
- DEPENDS mvmarsxdr
->>>>>>> develop
-)
diff --git a/src/uPlot/CMakeLists.txt b/src/uPlot/CMakeLists.txt
index dce9046..a128b8f 100644
--- a/src/uPlot/CMakeLists.txt
+++ b/src/uPlot/CMakeLists.txt
@@ -150,7 +150,7 @@ ecbuild_add_executable( TARGET uPlot
LIBS ${METVIEW_QT_LIBRARIES} ${STANDARD_METVIEW_LIBS} MagPlus MagWrapper ${METVIEW_ODB_API_LIBRARIES} ${X11_LIBRARIES}
)
-MESSAGE( STATUS "UPLOT CMAKE_INCLUDE_PATH: " ${CMAKE_INCLUDE_PATH} )
+ecbuild_debug("UPLOT CMAKE_INCLUDE_PATH: " ${CMAKE_INCLUDE_PATH})
###nodist_bin_uPlot_SOURCES = ${uPlot_COMMON_QT_SOURCES_nodist} ${uPlot_COMMON_UI_SOURCES_nodist} \
### uPlot.moc.cpp
diff --git a/src/uPlot/MagicsTranslator.cc b/src/uPlot/MagicsTranslator.cc
index a54640f..47357ae 100644
--- a/src/uPlot/MagicsTranslator.cc
+++ b/src/uPlot/MagicsTranslator.cc
@@ -433,6 +433,12 @@ PageTranslator::Execute ( const MvRequest& viewRequest )
magicsRequest( "SUBPAGE_UPPER_RIGHT_LONGITUDE")= (double)metviewRequest ( "AREA", 3 );
}
+ // Magics sets SUBPAGE_MINIMAL_AREA to 0.1 degrees to avoid issues with zooming into infinitesimally
+ // small areas in ecCharts, but we don't need to be so cautious in Metview and at least one user
+ // has requested the ability to zoom into smaller areas, so we set this to 0.001.
+ magicsRequest( "SUBPAGE_MINIMAL_AREA" ) = 0.001;
+
+
// Translate MAP to SUBPAGE_MAP parameters
CopySomeParameters ( metviewRequest,magicsRequest,"MAP_","SUBPAGE_MAP_" );
}
diff --git a/src/uPlot/uPlotBase.cc b/src/uPlot/uPlotBase.cc
index a7a6852..f4b0133 100644
--- a/src/uPlot/uPlotBase.cc
+++ b/src/uPlot/uPlotBase.cc
@@ -54,6 +54,11 @@
#include <X11/Xatom.h>
#endif
+#ifdef METVIEW_ODB_NEW
+ #include "odb_api/odbcapi.h"
+#endif
+
+
#include "MagPlusService.h"
#include "ObjectList.h"
#include "Root.h"
@@ -1026,8 +1031,14 @@ void uPlotBase::slotShowAboutBox()
QMap<MvQAbout::Version,QString> text;
text[MvQAbout::MagicsVersion]=magicsVersion;
+#if defined METVIEW_ODB
+ const char *odbapi_version = odb_api_version();
+ QString odbapiVersion(odbapi_version);
+ text[MvQAbout::OdbApiVersion]=odbapiVersion;
+#endif
+
MvQAbout about("uPlot","",
- MvQAbout::GribApiVersion | MvQAbout::MetviewVersion | MvQAbout::MagicsVersion,
+ MvQAbout::GribApiVersion | MvQAbout::MetviewVersion | MvQAbout::MagicsVersion | MvQAbout::OdbApiVersion,
text);
about.exec();
diff --git a/test/data/odb_test_set.odb b/test/data/odb_test_set.odb
new file mode 100644
index 0000000..dcf46e2
Binary files /dev/null and b/test/data/odb_test_set.odb differ
diff --git a/test/macros/CMakeLists.txt b/test/macros/CMakeLists.txt
index 98cd93e..1b8c6d6 100644
--- a/test/macros/CMakeLists.txt
+++ b/test/macros/CMakeLists.txt
@@ -77,6 +77,11 @@ if(ENABLE_MARS)
endif()
+if(METVIEW_ODB)
+ metview_macro_test(MACRO odb_read.mv
+ RESOURCES ../data/odb_test_set.odb )
+endif()
+
# generate a script which can be used to run the tests on the installed version
set(METVIEW_COMMAND "${CMAKE_INSTALL_PREFIX}/bin/${METVIEW_SCRIPT}")
set(TESTS_DIR "${CMAKE_CURRENT_BINARY_DIR}")
diff --git a/test/macros/odb_read.mv b/test/macros/odb_read.mv
new file mode 100644
index 0000000..167ba4e
--- /dev/null
+++ b/test/macros/odb_read.mv
@@ -0,0 +1,53 @@
+# Metview Macro
+
+# **************************** LICENSE START ***********************************
+#
+# Copyright 2016 ECMWF. This software is distributed under the terms
+# of the Apache License version 2.0. In applying this license, ECMWF does not
+# waive the privileges and immunities granted to it by virtue of its status as
+# an Intergovernmental Organization or submit itself to any jurisdiction.
+#
+# ***************************** LICENSE END ************************************
+
+
+# read the original data file
+f = read('odb_test_set.odb')
+
+
+# check it is the correct type
+t = type(f)
+if (t <> 'odb') then
+ fail('Type of ODB file is "' & t & '" instead of "odb"')
+else
+ print('Correct type: ', t)
+end if
+
+
+
+# check that there are the right number of data points
+numrows = count(f)
+if (numrows <> 717) then
+ fail('ODB file is reported has having ' & numrows & ' points instead of 717')
+else
+ print('Correct num rows: ', numrows)
+end if
+
+lats = values(f, 'lat')
+numpoints = count(lats)
+if (numpoints <> 717) then
+ fail('ODB file is reported has having ' & numpoints & ' points instead of 717')
+else
+ print('Correct num points: ', numpoints)
+end if
+
+
+
+# check some statistics on the values
+
+minlat = minvalue(lats)
+maxlat = maxvalue(lats)
+if (minlat < 30) or (maxlat > 75) then
+ fail('lat range is wrong: ' & minlat & ' to ' & maxlat & ' (should be between 30 and 75)')
+else
+ print('Correct lat range: ' & minlat & ' to ' & maxlat)
+end if
diff --git a/test/macros/plot_coast_order.mv b/test/macros/plot_coast_order.mv
deleted file mode 100644
index 810e2cc..0000000
--- a/test/macros/plot_coast_order.mv
+++ /dev/null
@@ -1 +0,0 @@
-#Metview Macro
\ No newline at end of file
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/debian-science/packages/metview.git
More information about the debian-science-commits
mailing list