Commit dc3b03d0 authored by Ronan Trepos's avatar Ronan Trepos
Browse files

Initial commit for vle-2.0 version

parents
Authors
-------
- first name last name < yourmail @ your server >
SET(CPACK_GENERATOR "ZIP")
SET(CPACK_SOURCE_GENERATOR "ZIP")
SET(CPACK_PACKAGE_NAME "${PROJECT_NAME}")
SET(CPACK_PACKAGE_VENDOR "VLE Development Team")
SET(CPACK_PACKAGE_DESCRIPTION_SUMMARY "Package Virtual Laboratory Environment")
SET(CPACK_PACKAGE_CONTACT "Gauthier Quesnel <quesnel@users.sourceforge.net>")
SET(CPACK_PACKAGE_DESCRIPTION_FILE "${PROJECT_SOURCE_DIR}/Readme.txt")
SET(CPACK_RESOURCE_FILE_LICENSE "${PROJECT_SOURCE_DIR}/License.txt")
SET(CPACK_PACKAGE_VERSION_MAJOR "${MODEL_MAJOR}")
SET(CPACK_PACKAGE_VERSION_MINOR "${MODEL_MINOR}")
SET(CPACK_PACKAGE_VERSION_EXTRA "${MODEL_EXTRA}")
SET(CPACK_PACKAGE_INSTALL_DIRECTORY "${VLE_NAME}")
SET(CPACK_INCLUDE_TOPLEVEL_DIRECTORY 0)
SET(CPACK_SOURCE_PACKAGE_FILE_NAME "${VLE_NAME}")
SET(CPACK_PACKAGE_FILE_NAME "${VLE_NAME}-${CMAKE_SYSTEM_NAME}-${CMAKE_SYSTEM_PROCESSOR}")
SET(CPACK_SOURCE_IGNORE_FILES "\\\\.swp$;/\\\\.gitignore;/build/;/buildvle/;/plugins/;/lib/;/doc/html/;/output/;/\\\\.git/")
INCLUDE(CPack)
# vim:tw=0:ts=8:tw=0:sw=2:sts=2
CMAKE_MINIMUM_REQUIRED(VERSION 2.6)
PROJECT(AZODYN CXX C)
set (CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake ${CMAKE_MODULE_PATH})
ENABLE_TESTING()
SET(MODEL_MAJOR 0)
SET(MODEL_MINOR 1)
SET(MODEL_PATCH 0)
SET(MODEL_NAME "${PROJECT_NAME}-${MODEL_MAJOR}.${MODEL_MINOR}.${MODEL_PATCH}")
SET(VLE_NAME "${PROJECT_NAME}-${MODEL_MAJOR}.${MODEL_MINOR}")
##
## Options for compilation of package
##
option(WITH_TEST "will build the test [default: ON]" ON)
option(WITH_DOC "will compile doc and install it [default: OFF]" OFF)
option(WITH_WARNINGS "will compile with g++ warnings [default: ON]" ON)
option(WITH_GVLE "use the GVLE [default: on]" ON)
##
## Flags
##
if (CMAKE_BUILD_TYPE STREQUAL "")
SET(CMAKE_BUILD_TYPE "Debug" CACHE STRING "Choose the type of build" FORCE)
endif ()
if (CMAKE_COMPILER_IS_GNUCC AND CMAKE_COMPILER_IS_GNUCXX)
if (NOT WITH_WARNINGS)
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -w")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -w")
else (NOT WITH_WARNINGS)
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall -Wextra")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wextra")
endif (NOT WITH_WARNINGS)
if ("${CMAKE_BUILD_TYPE}" STREQUAL "Debug" OR
"${CMAKE_BUILD_TYPE}" STREQUAL "RelWithDebInfo")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -ggdb3")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -ggdb3")
endif ()
endif ()
##
## Modules
##
include(CheckIncludeFileCXX)
include(CheckIncludeFile)
include(CheckLibraryExists)
include(CMakeDetermineCCompiler)
include(CheckCXXCompilerFlag)
CHECK_CXX_COMPILER_FLAG("-std=c++14" COMPILER_SUPPORTS_CXX14)
CHECK_CXX_COMPILER_FLAG("-std=c++1y" COMPILER_SUPPORTS_CXX1Y)
if (COMPILER_SUPPORTS_CXX14)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++14")
elseif(COMPILER_SUPPORTS_CXX1Y)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++1y")
else()
message(STATUS "The compiler ${CMAKE_CXX_COMPILER} has no C++14/1y support.
Please use a different C++ compiler.")
endif()
##
## cmake policy
##
if (COMMAND CMAKE_POLICY)
cmake_policy(SET CMP0020 NEW)#for qt link
endif (COMMAND CMAKE_POLICY)
##
## Check VLE and package dependencies
##
set(VLE_DEBUG 0)
set(VLE_ABI_VERSION 2.0)
find_package(VLE REQUIRED)
set (VleUtils_DIR "${VLE_SHARE_DIR}/cmake")
set (CMAKE_MODULE_PATH ${VLE_SHARE_DIR}/cmake ${CMAKE_MODULE_PATH})
find_package(VleUtils REQUIRED)
VleCheckDependencies()
##
## Check GVLE and package dependencies
##
if (WITH_GVLE)
set(GVLE_DEBUG 0)
find_package(GVLE)
if (GVLE_FOUND)
set (HAVE_GVLE 1 CACHE INTERNAL "" FORCE)
else ()
message (WARNING "GVLE not found!")
endif ()
endif ()
##
## Find Qt
##
if (HAVE_GVLE)
set(QMAKE_QUERY_LIBPATH qmake -query QT_INSTALL_LIBS)
execute_process(COMMAND ${QMAKE_QUERY_LIBPATH} OUTPUT_VARIABLE
CMAKE_PREFIX_PATH)
find_package(Qt5 COMPONENTS Widgets Gui Xml)
if (NOT Qt5_FOUND)
message(FATAL_ERROR "Qt5 is required")
endif (NOT Qt5_FOUND)
if (NOT Qt5Widgets_FOUND)
message(FATAL_ERROR "Qt5Widgets is required")
endif (NOT Qt5Widgets_FOUND)
if (NOT Qt5Gui_FOUND)
message(FATAL_ERROR "Qt5Gui is required")
endif (NOT Qt5Gui_FOUND)
if (NOT Qt5Xml_FOUND)
message(FATAL_ERROR "Qt5Xml is required")
endif (NOT Qt5Xml_FOUND)
endif ()
##
## Generate the doxygen
##
if (WITH_DOC)
FIND_PACKAGE(Doxygen)
if (DOXYGEN)
SET(DOXYGEN_SOURCE_DIR "${PROJECT_SOURCE_DIR}/src")
SET(DOXYGEN_OUTPUT_MODELING_DIR "${PROJECT_BINARY_DIR}/doxygen/modeling")
SET(DOXYGEN_OUTPUT_SOURCE_DIR "${PROJECT_BINARY_DIR}/doxygen/sources")
CONFIGURE_FILE("cmake/doxygen-modeling.conf.in"
"${PROJECT_BINARY_DIR}/doxygen-modeling.conf")
CONFIGURE_FILE("cmake/doxygen-sources.conf.in"
"${PROJECT_BINARY_DIR}/doxygen-sources.conf")
FILE(MAKE_DIRECTORY "${PROJECT_BINARY_DIR}/doxygen")
FILE(MAKE_DIRECTORY "${PROJECT_BINARY_DIR}/doxygen/modeling")
FILE(MAKE_DIRECTORY "${PROJECT_BINARY_DIR}/doxygen/sources")
ADD_CUSTOM_COMMAND(
OUTPUT "${PROJECT_BINARY_DIR}/doxygen/modeling/index.html"
DEPENDS "${PROJECT_BINARY_DIR}/doxygen-modeling.conf"
COMMAND "${DOXYGEN}"
ARGS "${PROJECT_BINARY_DIR}/doxygen-modeling.conf")
ADD_CUSTOM_COMMAND(
OUTPUT "${PROJECT_BINARY_DIR}/doxygen/sources/index.html"
DEPENDS "${PROJECT_BINARY_DIR}/doxygen-sources.conf"
COMMAND "${DOXYGEN}"
ARGS "${PROJECT_BINARY_DIR}/doxygen-sources.conf")
ADD_CUSTOM_TARGET(doc_modeling ALL DEPENDS
"${PROJECT_BINARY_DIR}/doxygen-modeling.conf"
"${PROJECT_BINARY_DIR}/doxygen/modeling/index.html" VERBATIM)
ADD_CUSTOM_TARGET(doc_sources ALL DEPENDS
"${PROJECT_BINARY_DIR}/doxygen-sources.conf"
"${PROJECT_BINARY_DIR}/doxygen/sources/index.html" VERBATIM)
INSTALL(DIRECTORY "${PROJECT_BINARY_DIR}/doxygen/modeling/html" DESTINATION
"doc/html/modeling")
INSTALL(DIRECTORY "${PROJECT_BINARY_DIR}/doxygen/sources/html" DESTINATION
"doc/html/sources")
endif (DOXYGEN)
endif ()
##
## Subdirectory
##
if (IS_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/data")
add_subdirectory(data)
endif ()
if (IS_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/metadata")
add_subdirectory(metadata)
endif ()
if (WITH_DOC)
if (IS_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/doc")
add_subdirectory(doc)
endif ()
endif ()
if (IS_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/exp")
add_subdirectory(exp)
endif ()
if (IS_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/src")
add_subdirectory(src)
endif ()
if (WITH_TEST)
if (IS_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/test")
add_subdirectory(test)
endif ()
endif ()
##
## CPack configuration
##
INSTALL(FILES Authors.txt Description.txt License.txt News.txt Readme.txt
DESTINATION .)
INCLUDE(CMakeCPack.cmake)
Package: AZODYN
Version: 0.1.0
Depends:
Build-Depends: vle.discrete-time
Conflicts:
Maintainer: Ronan Trépos <ronan.trepos@inra.fr>
Description: Still in progress
.
Tags: record crop model
Url: http://recordb.toulouse.inra.fr/distributions/2.0
Size: 0
MD5sum: xxxx
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
- Redistributions of source code must retain the above copyright notice, this
list of conditions and the following disclaimer.
- Redistributions in binary form must reproduce the above copyright notice, this
list of conditions and the following disclaimer in the documentation and/or
other materials provided with the distribution.
- The name of the author may not be used to endorse or promote products derived
from this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED
WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT
OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY
OF SUCH DAMAGE.
Changes from previous versions of the examples
==============================================
Initial version 0.1.0
---------------------
- initial packaging.
###
#example fo simulations of AZODYN using vle.recursive R API
##
library(rvle)
source(paste(sep="", Sys.getenv("VLE_HOME"),
"/pkgs-2.0/vle.recursive/R/vle.recursive.R"))
# init the zheat simulator
f = vle.recursive.init(pkg="AZODYN", file="AzodynWheat.vpz")
# show the content
vle.recursive.showEmbedded(f)
# build an experiment plan of 3 simulations zith different sowing density,
# and different max root depth
simData = data.frame(cPlant.densite_semis = c(200,215,230),
cPlant.ProfRacmax = c(1000,1300,1600));
# config the simulator with the simulations
simData = vle.recursive.parseSim(file_sim=simData, rvle_handle=f);
# get available simulqtion outputs
out_vars = vle.recursive.getAvailOutputs(f)
# configure selected outputs
vle.recursive.configOutputs(f,
output_vars = c(LAI=out_vars$LAI, MSpot=out_vars$MSpot),
integration='all')
# simulate
res = vle.recursive.simulate(rvle_handle=f)
# plot
vle.recursive.plot(res, output_vars = c("LAI","MSpot"))
Requirements
============
vle 2.0 http://www.vle-project.org
boost 1.49 http://www.boost.org
cmake 2.8 http://www.cmake.org
Installation
============
$ vle --package=MyProject configure
$ vle --package=MyProject build
# FindVLE.cmake
# =============
#
# Try to find VLE
#
# Copyright 2012-2016 INRA
# Gauthier Quesnel <quesnel@users.sourceforge.net>
# Ronan Trépos <ronan.trepos@toulouse.inra.fr>
#
# Distributed under the OS-approved BSD License (the "License");
# This software is distributed WITHOUT ANY WARRANTY; without even the
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
# See the License for more information.
#
# Once done this will define:
#
# VLE_FOUND - The system has VLE
# VLE_INCLUDE_DIRS - The VLE include directory
# VLE_LIBRARY_DIRS - Directories containing libraries to link
# VLE_LIBRARIES - Link these to use shared libraries of VLE
# VLE_SHARE_DIR - Base directory for VLE shared files
#
# CMake variables used by this module:
# VLE_ABI_VERSION - gives the VLE version to search for (e.g 1.1, 1.2)
# (REQUIRED)
# VLE_DEBUG - If true, prints debug traces
# (default OFF)
# VLE_USING_CMAKE - If true, on windows, use cmake for finding VLE,
# else use pkgconfig
# (default ON)
# VLE_BASEPATH_LOCAL - cmake variable for base path of vle
# (default NOT_DEFINED)
#
# Environment variables used by this module:
#
# VLE_BASEPATH - environment variable for base path of vle
#
#=============================================================================
#
# Usage
# -----
#
# set(VLE_ABI_VERSION 2.0)
# find_package(VLE REQUIRED)
#
#=============================================================================
#
# Check VLE_ABI_VERSION
#
if (NOT DEFINED VLE_ABI_VERSION)
message (FATAL_ERROR "Cmake variable VLE_ABI_VERSION is not set")
endif ()
#
# Set default behavior of find vle
#
if (WIN32)
if (DEFINED VLE_USING_CMAKE)
set (_find_vle_using_cmake ${VLE_USING_CMAKE})
else (DEFINED VLE_USING_CMAKE)
set (_find_vle_using_cmake 1)
endif (DEFINED VLE_USING_CMAKE)
else (WIN32)
set (_find_vle_using_cmake 0)
endif (WIN32)
if (DEFINED VLE_DEBUG)
set (_vle_debug ${VLE_DEBUG})
else ()
set (_vle_debug 0)
endif ()
#
# Find VLE
#
if (${_find_vle_using_cmake})
find_path(_vle_base_include vle-${VLE_ABI_VERSION}/vle/vle.hpp PATHS
$ENV{VLE_BASEPATH}/include
${VLE_BASEPATH_LOCAL}/include
"[HKEY_LOCAL_MACHINE\\SOFTWARE\\VLE Development Team\\VLE ${VLE_ABI_VERSION}.0;Path]/include"
"[HKEY_LOCAL_MACHINE\\SOFTWARE\\VLE Development Team\\VLE ${VLE_ABI_VERSION}.0;]/include"
"[HKEY_LOCAL_MACHINE\\SOFTWARE\\VLE Development Team\\Wow6432Node\\VLE ${VLE_ABI_VERSION}.0;]/include"
NO_DEFAULT_PATH)
find_path(_vle_base_bin vle.exe PATHS
$ENV{VLE_BASEPATH}/bin
${VLE_BASEPATH_LOCAL}/bin
"[HKEY_LOCAL_MACHINE\\SOFTWARE\\VLE Development Team\\VLE ${VLE_ABI_VERSION}.0;Path]/bin"
"[HKEY_LOCAL_MACHINE\\SOFTWARE\\VLE Development Team\\VLE ${VLE_ABI_VERSION}.0;]/bin"
"[HKEY_LOCAL_MACHINE\\SOFTWARE\\VLE Development Team\\Wow6432Node\\VLE ${VLE_ABI_VERSION}.0;]/bin"
NO_DEFAULT_PATH)
find_path(_vle_base_lib libvle-${VLE_ABI_VERSION}.a PATHS
$ENV{VLE_BASEPATH}/lib
${VLE_BASEPATH_LOCAL}/lib
"[HKEY_LOCAL_MACHINE\\SOFTWARE\\VLE Development Team\\VLE ${VLE_ABI_VERSION}.0;Path]/lib"
"[HKEY_LOCAL_MACHINE\\SOFTWARE\\VLE Development Team\\VLE ${VLE_ABI_VERSION}.0;]/lib"
"[HKEY_LOCAL_MACHINE\\SOFTWARE\\VLE Development Team\\Wow6432Node\\VLE ${VLE_ABI_VERSION}.0;]/lib"
NO_DEFAULT_PATH)
if (${_vle_debug})
message (" vle_debug _vle_base_include ${_vle_base_include}")
message (" vle_debug _vle_base_bin ${_vle_base_bin}")
message (" vle_debug _vle_base_lib ${_vle_base_lib}")
endif ()
if(NOT _vle_base_include OR NOT _vle_base_bin OR NOT _vle_base_lib)
message (FATAL_ERROR "Missing vle dependencies")
endif ()
set(VLE_INCLUDE_DIRS
${_vle_base_include}/vle-${VLE_ABI_VERSION}; ${_vle_base_include};
${_vle_base_include}/libxml2)
set(VLE_LIBRARY_DIRS
${_vle_base_bin};${_vle_base_lib})
set (VLE_LIBRARIES
vle-${VLE_ABI_VERSION} xml2 intl)
set (VLE_SHARE_DIR "${_vle_base_include}/../share/vle-${VLE_ABI_VERSION}")
else (${_find_vle_using_cmake})
find_package(PkgConfig REQUIRED)
PKG_CHECK_MODULES(VLE vle-${VLE_ABI_VERSION})
# select only the directory of vle, containing the pkgs directory
# to build VLE_SHARE_DIR
find_path(vle_lib_dir vle PATHS
${VLE_INCLUDE_DIRS} NO_DEFAULT_PATH)
set (VLE_SHARE_DIR "${vle_lib_dir}/../../share/vle-${VLE_ABI_VERSION}")
endif (${_find_vle_using_cmake})
# handle the QUIETLY and REQUIRED arguments and set VLE_FOUND to TRUE if all
# listed variables are TRUE
include(FindPackageHandleStandardArgs)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(VLE REQUIRED_VARS VLE_INCLUDE_DIRS
VLE_LIBRARIES VLE_SHARE_DIR)
if (${_vle_debug})
message (" vle_debug VLE_INCLUDE_DIRS ${VLE_INCLUDE_DIRS}")
message (" vle_debug VLE_LIBRARY_DIRS ${VLE_LIBRARY_DIRS}")
message (" vle_debug VLE_LIBRARIES ${VLE_LIBRARIES}")
message (" vle_debug VLE_SHARE_DIR ${VLE_SHARE_DIR}")
endif ()
#mark_as_advanced(VLE_INCLUDE_DIRS VLE_LIBRARIES VLE_LIBRARY_DIRS)
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
install(DIRECTORY . DESTINATION data FILES_MATCHING PATTERN "*.dat")
install(DIRECTORY . DESTINATION data FILES_MATCHING PATTERN "*.csv")
install(DIRECTORY . DESTINATION data FILES_MATCHING PATTERN "*.txt")
This diff is collapsed.
This diff is collapsed.
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment