Skip to content

Commit

Permalink
Merge pull request #143 from SwissTPH/develop
Browse files Browse the repository at this point in the history
Merge develop for release 'schema-34.0'
  • Loading branch information
tph-thuering committed Sep 14, 2015
2 parents ffb0219 + eebdb2a commit 2024ecf
Show file tree
Hide file tree
Showing 151 changed files with 27,880 additions and 20,685 deletions.
6 changes: 6 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
[submodule "zlib"]
path = zlib
url = https://github.com/commontk/zlib.git
[submodule "gsl"]
path = gsl
url = https://github.com/ampl/gsl
65 changes: 56 additions & 9 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,28 +1,75 @@
env:
global:
- BASE_URL="https://github.com/SwissTPH/openmalaria"

os:
- linux
- osx

matrix:
allow_failures:
- os: osx
- compiler: clang

sudo: false

language: cpp

compiler: gcc
compiler:
- gcc
- clang

addons:
apt:
packages:
- build-essential
- cmake
- python
- libboost-all-dev
- libgsl0-dev
- libxerces-c2-dev
- xsdcxx
- zlib1g-dev

before_install:
- sudo apt-get -qq install cmake build-essential python libgsl0-dev libboost-all-dev libxerces-c2-dev xsdcxx zlib1g-dev
- test "$TRAVIS_OS_NAME" == "osx" && util/install-dep-osx.sh || echo "not installing osx dependencies"

install:
- mkdir build && cd build
- mkdir build && pushd build
- cmake -DCMAKE_BUILD_TYPE=Release ..

script:
- make -j2
- ctest -j2
- ./openMalaria --version
- test "$TRAVIS_OS_NAME" == "linux" && ldd openMalaria || otool -L openMalaria
- ctest
- popd

notifications:
email:
- [email protected]
after_success:
- util/generate-checksums.sh build
- util/build-info.sh | tee travis-build.json

before_deploy:
- mv -v build/schema/scenario_current.xsd .
- mv -v build/openMalaria* .
- tar cvzf openMalaria-$TRAVIS_OS_NAME.tar.gz openMalaria* scenario_current.xsd test/autoRegressionParameters.csv test/densities.csv travis-build.json

deploy:
provider: releases
api_key:
secure: dOTDLZ10UHm3JoKODtlBMxChFaXOekUM69S2f6eoAt0ctjFPZXHic2aEUvabeZJqq8UX83xO1I0tGTX7DWMvxd7zPTQHcW9N3XxWvgChKxs4OSqRL7GnunI3iZPH8125ZCeMNuh+oCgf1DdfOy0uOgdygGKzvIYEFhd7c5gOH/I=
skip_cleanup: true
file:
openMalaria
file: openMalaria-$TRAVIS_OS_NAME.tar.gz
on:
tags: true

# blacklist
branches:
except:
- appveyor-build
- binary-archive

notifications:
email:
- [email protected]

19 changes: 9 additions & 10 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,14 @@ set (CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR})
# ----- Compile options -----

# C++11 would be nice, but we have to compile for relatively old platforms
set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++98")
if (NOT MSVC)
set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++98")
endif (NOT MSVC)

set (OM_STD_LIBS )

# Statically link libgcc; isn't going to work when other C++ libraries are dynamically linked
IF( ${CMAKE_COMPILER_IS_GNUCXX} )
if( ${CMAKE_COMPILER_IS_GNUCXX} )
# This doesn't show up in the cache, but it is passed to gcc:
set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall")

Expand All @@ -39,13 +41,13 @@ IF( ${CMAKE_COMPILER_IS_GNUCXX} )
link_directories (${CMAKE_SOURCE_DIR}/lib)
# Note: -static-libstdc++ is only available since GCC 4.5
# See: http://www.trilithium.com/johan/2005/06/static-libstdc/
ADD_DEFINITIONS(-static-libgcc -static-libstdc++)
SET(CMAKE_CXX_LINK_EXECUTABLE "${CMAKE_CXX_LINK_EXECUTABLE} -static-libgcc -static-libstdc++")
add_definitions(-static-libgcc -static-libstdc++)
set(CMAKE_CXX_LINK_EXECUTABLE "${CMAKE_CXX_LINK_EXECUTABLE} -static-libgcc -static-libstdc++")
endif (OM_STATICALLY_LINK)
ENDIF( ${CMAKE_COMPILER_IS_GNUCXX} )
endif( ${CMAKE_COMPILER_IS_GNUCXX} )

option (BUILD_SHARED_LIBS "Link xsdcxx, model, etc. libraries dynamically instead of statically (almost certainly not wanted)." OFF)
MARK_AS_ADVANCED (BUILD_SHARED_LIBS)
mark_as_advanced (BUILD_SHARED_LIBS)

if (MSVC)
# This is now the OM_STATICALLY_LINK for windows
Expand Down Expand Up @@ -153,7 +155,7 @@ endif (OM_BOINC_INTEGRATION)
# ----- Compile-time optional features -----
# (must come before add_subdirectory (model))

option (OM_STREAM_VALIDATOR "Compile in StreamValidator (see include/util/StreamValidator.h for usage notes)" OFF)
option (OM_STREAM_VALIDATOR "Compile in StreamValidator (see model/util/StreamValidator.h for usage notes)" OFF)
if (OM_STREAM_VALIDATOR)
add_definitions (-DOM_STREAM_VALIDATOR)
endif (OM_STREAM_VALIDATOR)
Expand Down Expand Up @@ -191,9 +193,6 @@ include_directories (
${CMAKE_SOURCE_DIR}/model ${CMAKE_BINARY_DIR}
)

file(STRINGS version.txt OM_VERSION)
configure_file(model/util/version.h.in ../model/util/version.h @ONLY)

add_executable (openMalaria model/openMalaria.cpp)

target_link_libraries (openMalaria
Expand Down
4 changes: 4 additions & 0 deletions FindXERCESC.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,9 @@ FIND_PATH(XERCESC_INCLUDE_DIRS xercesc/dom/DOMNode.hpp
"C:/Program Files/CodeSynthesis XSD 3.2/include"
"D:/Program Files/CodeSynthesis XSD 3.2/include"
"C:/Program Files/CodeSynthesis XSD 3.3/include"
"C:/Program Files/CodeSynthesis XSD 4.0/include"
"C:/Program Files (x86)/CodeSynthesis XSD 3.3/include"
"C:/Program Files (x86)/CodeSynthesis XSD 4.0/include"
${CMAKE_SOURCE_DIR}/../xsd/libxsd
)

Expand All @@ -23,7 +25,9 @@ set (XERCESC_LIB_PATHS
"C:/Program Files/CodeSynthesis XSD 3.2/lib/vc-8.0"
"D:/Program Files/CodeSynthesis XSD 3.2/lib/vc-8.0"
"C:/Program Files/CodeSynthesis XSD 3.3/lib/vc-8.0"
"C:/Program Files/CodeSynthesis XSD 4.0/lib64/vc-12.0"
"C:/Program Files (x86)/CodeSynthesis XSD 3.3/lib/vc-8.0"
"C:/Program Files (x86)/CodeSynthesis XSD 4.0/lib/vc-12.0"
)
find_library (XERCESC_LIB_OPT NAMES xerces-c xerces-c_3 xerces-c_2 xerces-c_static xerces-c_static_3 xerces-c_static_2
${XERCESC_LIB_PATHS}
Expand Down
8 changes: 8 additions & 0 deletions FindXSD.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,11 @@ FIND_PATH(XSD_INCLUDE_DIRS xsd/cxx/parser/elements.hxx
"C:/Program Files/CodeSynthesis XSD 3.2/include"
"D:/Program Files/CodeSynthesis XSD 3.2/include"
"C:/Program Files/CodeSynthesis XSD 3.3/include"
"C:/Program Files/CodeSynthesis XSD 4.0/include"
"C:/Program Files (x86)/CodeSynthesis XSD 3.3/include"
"C:/Program Files (x86)/CodeSynthesis XSD 4.0/include"
"/usr/local/Cellar/xsd/4.0.0/include"
${CMAKE_SOURCE_DIR}/../xsd/include
${CMAKE_SOURCE_DIR}/../xsd/libxsd
)

Expand All @@ -27,7 +31,11 @@ FIND_PROGRAM(XSD_EXECUTABLE
"C:/Program Files/CodeSynthesis XSD 3.2/bin"
"D:/Program Files/CodeSynthesis XSD 3.2/bin"
"C:/Program Files/CodeSynthesis XSD 3.3/bin"
"C:/Program Files/CodeSynthesis XSD 4.0/bin"
"C:/Program Files (x86)/CodeSynthesis XSD 3.3/bin"
"C:/Program Files (x86)/CodeSynthesis XSD 4.0/bin"
"/usr/local/Cellar/xsd/4.0.0/bin"
${CMAKE_SOURCE_DIR}/../xsd/bin
)

if (NOT XSD_INCLUDE_DIRS)
Expand Down
15 changes: 9 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,25 +6,28 @@ This git-repository contains source-code for Open Malaria, a simulator program f

For further documentation, take a look at our [wiki](https://github.com/SwissTPH/openmalaria/wiki).

The stable version of OpenMalaria supports schema [schema version 33](https://github.com/SwissTPH/openmalaria/wiki/GeneratedSchema33Doc) and is currently maintained in the __['master' branch](https://github.com/SwissTPH/openmalaria/tree/master)__.
Also find our code on zenodo, with DOI-references: [![DOI](https://zenodo.org/badge/15670/SwissTPH/openmalaria.svg)](https://zenodo.org/badge/latestdoi/15670/SwissTPH/openmalaria)

You can download the latest build [#200](https://travis-ci.org/SwissTPH/openmalaria/builds/73175741) here: [schema-33.1](https://github.com/SwissTPH/openmalaria/tree/schema-33.1)
The stable version of OpenMalaria supports schema [schema version 34](https://github.com/SwissTPH/openmalaria/wiki/GeneratedSchema34Doc) and is currently maintained in the __['master' branch](https://github.com/SwissTPH/openmalaria/tree/master)__.

You can download the latest build here: [schema-34.0](https://github.com/SwissTPH/openmalaria/releases/tag/schema-34.0)

Status of __[master](https://github.com/SwissTPH/openmalaria/tree/master)__ builds:

[![Linux Build Status](https://travis-ci.org/SwissTPH/openmalaria.svg?branch=master)](https://travis-ci.org/SwissTPH/openmalaria) [![Windows Build Status](https://ci.appveyor.com/api/projects/status/8el77m2gg4aqqnqg/branch/master?svg=true)](https://ci.appveyor.com/project/tph-thuering/openmalaria/branch/master)

The development version of OpenMalaria supports the upcoming [schema version 34](https://github.com/SwissTPH/openmalaria/wiki/GeneratedSchema34Doc) and is currently maintained in the __['develop' branch](https://github.com/SwissTPH/openmalaria/tree/develop)__.

Status of __[develop](https://github.com/SwissTPH/openmalaria/tree/develop)__ builds:


[![Build Status](https://travis-ci.org/SwissTPH/openmalaria.svg?branch=develop)](https://travis-ci.org/SwissTPH/openmalaria)
![Coverage Status](https://coveralls.io/repos/SwissTPH/openmalaria/badge.svg)
[![Build Status](https://travis-ci.org/SwissTPH/openmalaria.svg?branch=develop)](https://travis-ci.org/SwissTPH/openmalaria) [![Windows Build Status](https://ci.appveyor.com/api/projects/status/8el77m2gg4aqqnqg/branch/develop?svg=true)](https://ci.appveyor.com/project/tph-thuering/openmalaria/branch/develop)

Code Coverage: ![Coverage Status](https://coveralls.io/repos/SwissTPH/openmalaria/badge.svg)

License: [GPL v2](http://opensource.org/licenses/GPL-2.0) (see COPYING).

Installation instructions:
==================
See [INSTALLATION](https://github.com/openmalaria/wiki/Installation).

Build instructions:
===================
Expand Down
56 changes: 56 additions & 0 deletions appveyor.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
clone_depth: 30

environment:
VisualStudioVersion: 14.0

os: Visual Studio 2015

cache:
- xsd-4.0.msi -> appveyor.yml
- boost_1_55_0.zip -> appveyor.yml
- gsl-libs.zip -> appveyor.yml
- gsl-headers.zip -> appveyor.yml
- zlib.lib.zip -> appveyor.yml

install:
- git submodule init && git submodule update
- pushd util\install-dep-windows\ && install-dependencies-win.bat & popd
- pushd gsl && cmake . & popd
- pushd zlib && cmake . & popd
- cmd: echo "Dependencies installed and configured"
- cmd: echo "Configure openMalaria build and generate solution file 'OpenMalaria.sln' with CMake"
- mkdir build-win && pushd build-win && cmake .. -DGSL_LIB_OPT:FILEPATH="%APPVEYOR_BUILD_FOLDER%/lib/gsl.lib" -DZ_LIBRARIES:FILEPATH="%APPVEYOR_BUILD_FOLDER%/lib/zlib.lib" -DXERCESC_LIB_OPT:FILEPATH="%APPVEYOR_BUILD_FOLDER%/xsd/lib/vc-12.0/xerces-c_3.lib" -DZ_INCLUDE_DIRS:PATH="%APPVEYOR_BUILD_FOLDER%/zlib" -DXERCESC_INCLUDE_DIRS:PATH="%APPVEYOR_BUILD_FOLDER%/xsd/include/xercesc" -DBoost_INCLUDE_DIR:PATH="%APPVEYOR_BUILD_FOLDER%/boost_1_55_0" -DGSL_INCLUDE_DIR:PATH="%APPVEYOR_BUILD_FOLDER%/gsl" -DGSL_INCLUDE_DIR2:PATH="%APPVEYOR_BUILD_FOLDER%/gsl/gsl" -DGSL_CBLAS_LIB_OPT:FILEPATH="%APPVEYOR_BUILD_FOLDER%/lib/gslcblas.lib" -DXSD_INCLUDE_DIRS:PATH="%APPVEYOR_BUILD_FOLDER%/xsd/include" -DXSD_EXECUTABLE:FILEPATH="%APPVEYOR_BUILD_FOLDER%/xsd/bin/xsd.exe" & popd

configuration: Release

build:
project: build-win\OpenMalaria.sln
parallel: true
verbosity: normal

after_build:
- cmd: ECHO build-log":" https://ci.appveyor.com/project/tph-thuering/openmalaria/build/%APPVEYOR_BUILD_VERSION% >> %APPVEYOR_BUILD_FOLDER%\appveyor.log
- cmd: ECHO build-id":" %APPVEYOR_BUILD_ID% >> %APPVEYOR_BUILD_FOLDER%\appveyor.log
- cmd: ECHO build-name":" %APPVEYOR_BUILD_NAME% >> %APPVEYOR_BUILD_FOLDER%\appveyor.log
- ps: pushd "C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\bin"; .\dumpbin.exe /dependents $env:APPVEYOR_BUILD_FOLDER"\build-win\Release\openMalaria.exe" > $env:APPVEYOR_BUILD_FOLDER"\dependencies.txt"; popd
- 7z a openMalaria-windows.zip "%APPVEYOR_BUILD_FOLDER%\build-win\Release\openMalaria.exe" "%APPVEYOR_BUILD_FOLDER%\xsd\bin\xerces-c_3_1_vc120.dll" "%APPVEYOR_BUILD_FOLDER%\README.md" "%APPVEYOR_BUILD_FOLDER%\build-win\schema\scenario_current.xsd" "%APPVEYOR_BUILD_FOLDER%\appveyor.log" "%APPVEYOR_BUILD_FOLDER%\dependencies.txt" "%APPVEYOR_BUILD_FOLDER%\test\autoRegressionParameters.csv" "%APPVEYOR_BUILD_FOLDER%\test\densities.csv"

artifacts:
- path: openMalaria-windows.zip

notifications:
- provider: Email
to:
- [email protected]
on_build_success: true
on_build_failure: false
on_build_status_changed: true

deploy:
- provider: GitHub
auth_token:
secure: QDHrqei4LL5ihC0nST2nAf3uCpjvNyKHH11V53o/lpnX5JZLq/gY41iJm9FIQ+Vr
artifact: openMalaria-windows.zip
draft: true
on:
APPVEYOR_REPO_TAG: true
14 changes: 14 additions & 0 deletions doc/changelog.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,20 @@ This file lists significant changes in OpenMalaria from the point of view of
users. It is however far from complete. The more complete changelog is on the
wiki: https://github.com/SwissTPH/openmalaria/wiki/Changelog

— 2015-06-19 — Schema 34 —

## Vivax changes

<primaquine> has been renamed to <liverStageDrug>
Monitoring option nPQTreatments has been renamed to nLiverStageTreatments

## Backwards-compatible schema changes

Intervention usage:

<GVI> and <IRS> now have an optional <usage> element.
ITN's <usage> child element is now optional too.
It is assumed, that when no <usage> child is given, the usage modifier is 100% (proportion of use for a given intervention, which modifies the protectional effect).

— 2014-11-?? — Schema 33 —

Expand Down
1 change: 1 addition & 0 deletions gsl
Submodule gsl added at cd6d23
21 changes: 19 additions & 2 deletions model/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,16 @@
# Copyright © 2005-2009 Swiss Tropical Institute and Liverpool School Of Tropical Medicine
# Licence: GNU General Public Licence version 2 or later (see COPYING)

# Configure this file
file(STRINGS ${CMAKE_SOURCE_DIR}/version.txt OM_VERSION)
# make sure version.h gets rebuilt everytime cmake is run
unset(${CMAKE_CURRENT_BINARY_DIR}/util/version.h CACHE)
configure_file(
${CMAKE_CURRENT_SOURCE_DIR}/util/version.h.in
${CMAKE_CURRENT_BINARY_DIR}/util/version.h
@ONLY
)

# Don't use aux_source_directory on . because we don't want to compile openMalaria.cpp in to the lib.
set (Model_CPP
Simulator.cpp
Expand All @@ -27,6 +37,9 @@ set (Model_CPP

PkPd/LSTMModel.cpp
PkPd/Drug/LSTMDrug.cpp
PkPd/Drug/LSTMDrugOneComp.cpp
PkPd/Drug/LSTMDrugThreeComp.cpp
PkPd/Drug/LSTMDrugConversion.cpp
PkPd/Drug/LSTMDrugType.cpp
PkPd/Drug/LSTMDrugAllele.cpp
PkPd/LSTMTreatments.cpp
Expand Down Expand Up @@ -74,7 +87,6 @@ set (Model_CPP
util/ModelOptions.cpp
util/CommandLine.cpp
util/random.cpp
util/StreamValidator.cpp
util/AgeGroupInterpolation.cpp
util/sampler.cpp
util/SpeciesIndexChecker.cpp
Expand All @@ -90,6 +102,9 @@ set (Model_CPP
interventions/Vaccine.cpp
)

if (${OM_STREAM_VALIDATOR})
list(APPEND Model_CPP util/StreamValidator.cpp)
endif (${OM_STREAM_VALIDATOR})
# Headers - only included so they show up in IDEs:
# This misses loads of headers. Fix if you care.
file (GLOB_RECURSE Model_H "${CMAKE_SOURCE_DIR}/model/*.h")
Expand All @@ -103,7 +118,8 @@ include_directories (SYSTEM
${Boost_INCLUDE_DIRS}
${SPIRIT_INCLUDE_DIRS}
${BOINC_INCLUDE_DIRS}


${CMAKE_BINARY_DIR}/model
${CMAKE_SOURCE_DIR}/contrib
${CMAKE_SOURCE_DIR}/contrib/FastDelegate_src
${CMAKE_SOURCE_DIR}/contrib/floating_point_utilities_v3
Expand All @@ -115,6 +131,7 @@ include_directories (
add_library (model
${Model_CPP}
${Model_H}
${CMAKE_CURRENT_BINARY_DIR}/util/version.h
)

if (MSVC)
Expand Down
11 changes: 3 additions & 8 deletions model/Clinical/CMDecisionTree.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
#include "PkPd/LSTMTreatments.h"
#include "util/random.h"
#include "util/errors.h"
#include "util/ModelOptions.h"
#include "util/timeConversions.h"
#include "interventions/Interfaces.hpp"

#include <limits>
Expand Down Expand Up @@ -344,11 +344,6 @@ class CMDTTreatSimple : public CMDecisionTree {
if( durL < neg1 || durB < neg1 ){
throw util::xml_scenario_error( "treatSimple: cannot have durationBlood or durationLiver less than -1" );
}
if( util::ModelOptions::option( util::VIVAX_SIMPLE_MODEL ) ){
if( durL != sim::zero() || durB != neg1 )
throw util::unimplemented_exception( "vivax model only supports timestepsLiver=0, timestepsBlood=-1" );
// Actually, the model ignores these parameters; we just don't want somebody thinking it doesn't.
}
timeLiver = durL;
timeBlood = durB;
}catch( const util::format_error& e ){
Expand All @@ -367,8 +362,8 @@ class CMDTTreatSimple : public CMDecisionTree {
}

virtual CMDTOut exec( CMHostData hostData ) const{
hostData.withinHost().treatSimple( timeLiver, timeBlood );
return CMDTOut(true);
bool bsTreatment = hostData.withinHost().treatSimple( hostData.human, timeLiver, timeBlood );
return CMDTOut(bsTreatment);
}

private:
Expand Down
Loading

0 comments on commit 2024ecf

Please sign in to comment.