Commit e096f179 authored by Aaron Bray's avatar Aaron Bray
Browse files

Everything is building except th JNI bridge

I had to make everything static libs as google protobuf does not do well in a dynamic library
cdm unit tests run and look good
pulse unit tests don't run via java testsuite, but seem ok (i ran cv only)
the engine does not run though... somthing to do with cardiac output not getting set, because the left heart to aorta path is zero?!
parent 03e4adac
......@@ -4,8 +4,8 @@ set(BUILD_SHARED_LIBS ON)
set(CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake)
# Policy to address @foo@ variable expansion
set(_VERSION_MAJOR 6)
set(_VERSION_MINOR 2)
set(_VERSION_MAJOR 1)
set(_VERSION_MINOR 0)
set(_VERSION_PATCH 0)
set(_VERSION "${_VERSION_MAJOR}.${_VERSION_MINOR}.${_VERSION_PATCH}")
......@@ -31,6 +31,9 @@ if(UNIX)
set(CMAKE_INSTALL_RPATH "${CMAKE_INSTALL_RPATH}:\$ORIGIN")
endif()
# Build the core libraries as shared or static (DataModel, CDM, Engine)
set(BUILD_SHARED_LIBS OFF)
message(STATUS "Looking for modules here : ${CMAKE_PREFIX_PATH}")
set(CMAKE_CXX_STANDARD_LIBRARIES "" CACHE TYPE INTERNAL FORCE)
set(CMAKE_C_STANDARD_LIBRARIES "" CACHE TYPE INTERNAL FORCE)
......
Apache BioGears
Apache
Copyright 2014-2017 The Apache Software Foundation
This product includes software developed at Kitware.
......
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<BioGearsConfiguration xmlns="uri:/mil/tatrc/physiology/datamodel" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="">
<!-- You can override any of the engine defaults here, they will be used in both loading a state file and initializing an engine from a patient. -->
<!-- Don't edit these unless you know what you are doing! -->
<!-- This will change the time step -->
<!-- <TimeStep readOnly="false" unit="s" value="0.02"/> -->
</BioGearsConfiguration>
#This will change the time step
TimeStep {
ScalarTime { Value: 0.02 Unit: "s" }
}
DrugsConfiguration { PDModel: Off }
\ No newline at end of file
......@@ -11,7 +11,7 @@ log4j.appender.A1.layout.ConversionPattern=%-5p %m%n
# F1 is set to be a FileAppender.
log4j.appender.F1=org.apache.log4j.FileAppender
log4j.appender.F1.File=Biogears.log
log4j.appender.F1.File=Pulse.log
log4j.appender.F1.Name=LogFile
log4j.appender.F1.Append=false
log4j.appender.F1.Threshold=INFO
......
......@@ -22,7 +22,7 @@ endif()
# You tell me what JDK/JRE you want to use
#set(Java_JAVA_EXECUTABLE "/the_jdk_I_want/bin/java)
set(JAVA_CLASSPATH BioGears.jar
set(JAVA_CLASSPATH Pulse.jar
@DATA_ROOT@/jar/javassist-3.16.1-GA.jar
@DATA_ROOT@/jar/jcommon-1.0.16.jar
@DATA_ROOT@/jar/jdom-2.0.2.jar
......@@ -49,7 +49,7 @@ elseif(TYPE STREQUAL "PatientValidation")
execute_process(COMMAND "${Java_JAVA_EXECUTABLE}" -Xmx900m -classpath "${JAVA_CLASSPATH}" mil.tatrc.physiology.testing.TestDriver ValidationPatients.config)
execute_process(COMMAND "${Java_JAVA_EXECUTABLE}" -Xmx900m -classpath "${JAVA_CLASSPATH}" mil.tatrc.physiology.testing.validation.PatientValidation)
elseif(TYPE STREQUAL "genData")
execute_process(COMMAND "${Java_JAVA_EXECUTABLE}" -Xmx900m -classpath "${JAVA_CLASSPATH}" mil.tatrc.physiology.biogears.dataset.DataSetReader)
execute_process(COMMAND "${Java_JAVA_EXECUTABLE}" -Xmx900m -classpath "${JAVA_CLASSPATH}" mil.tatrc.physiology.pulse.dataset.DataSetReader)
elseif(TYPE STREQUAL "genStates")
execute_process(COMMAND "${Java_JAVA_EXECUTABLE}" -Xmx900m -classpath "${JAVA_CLASSPATH}" mil.tatrc.physiology.testing.TestDriver InitialPatientStates.config)
elseif(TYPE STREQUAL "doxygen")
......@@ -67,7 +67,7 @@ elseif(TYPE STREQUAL "doxygen")
#execute_process(COMMAND "${Java_JAVA_EXECUTABLE}" -Xmx900m -classpath "${JAVA_CLASSPATH}" mil.tatrc.physiology.testing.validation.PatientValidation)
execute_process(COMMAND "${Java_JAVA_EXECUTABLE}" -Xmx900m -classpath "${JAVA_CLASSPATH}" mil.tatrc.physiology.datamodel.doxygen.DoxygenPreprocessor @DATA_ROOT@/docs/Markdown ./docs/markdown)
execute_process(COMMAND "${Java_JAVA_EXECUTABLE}" -Xmx900m -classpath "${JAVA_CLASSPATH}" mil.tatrc.physiology.datamodel.doxygen.DoxygenPreprocessor @DATA_ROOT@/docs/Methodology ./docs/markdown)
execute_process(COMMAND "${Java_JAVA_EXECUTABLE}" -Xmx900m -classpath "${JAVA_CLASSPATH}" mil.tatrc.physiology.datamodel.doxygen.XSDToDoxygen ./xsd/BioGearsDataModel.xsd ./docs/markdown/xsd.ixx)
execute_process(COMMAND "${Java_JAVA_EXECUTABLE}" -Xmx900m -classpath "${JAVA_CLASSPATH}" mil.tatrc.physiology.datamodel.doxygen.XSDToDoxygen ./xsd/DataModel.xsd ./docs/markdown/xsd.ixx)
execute_process(COMMAND "${Java_JAVA_EXECUTABLE}" -Xmx900m -classpath "${JAVA_CLASSPATH}" mil.tatrc.physiology.datamodel.doxygen.CDM2MD ./docs/markdown)
execute_process(COMMAND "${Java_JAVA_EXECUTABLE}" -Xmx900m -classpath "${JAVA_CLASSPATH}" mil.tatrc.physiology.utilities.csv.plots.PlotDriver PlotRun.config)
execute_process(COMMAND doxygen ./docs/full.doxy)
......
......@@ -139,14 +139,16 @@ list(APPEND SOURCE ${UTILS_UCE_FILES})
#list(APPEND SOURCE ${UTILS_XPSTL_FILES})
# The DLL we are building
add_library(CommonDataModel SHARED ${SOURCE})
add_library(CommonDataModel ${SOURCE})
# Preprocessor Definitions and Include Paths
# Common Compile Flags
set(CDM_FLAGS)
set(CDM_FLAGS "${CDM_FLAGS} -D EIGEN_MPL2_ONLY")
set(CDM_FLAGS "${CDM_FLAGS} -D COMMONDATAMODEL_EXPORTS")
set(CDM_FLAGS "${CDM_FLAGS} -D UNICODE")
set(CDM_FLAGS "${CDM_FLAGS} -D _UNICODE")
if(${BUILD_SHARED_LIBS})
set(CDM_FLAGS "${CDM_FLAGS} -D SHARED_CDM")
endif()
if(MSVC)
set(CDM_FLAGS "${CDM_FLAGS} -Zm215")
if(EX_PLATFORM EQUAL 64)
......@@ -175,23 +177,25 @@ target_link_libraries(CommonDataModel log4cpp)
add_custom_command(TARGET CommonDataModel POST_BUILD
COMMAND ${CMAKE_COMMAND} -E make_directory ${INSTALL_BIN}/${CONFIGURATION}${EX_CONFIG}
COMMAND ${CMAKE_COMMAND} -E copy $<TARGET_FILE:CommonDataModel> ${INSTALL_BIN}/${CONFIGURATION}${EX_CONFIG})
if(WIN32)# Copy dll files to the bin
install(TARGETS CommonDataModel
RUNTIME CONFIGURATIONS Release DESTINATION ${INSTALL_BIN}/release${EX_CONFIG}
LIBRARY CONFIGURATIONS Release DESTINATION ${INSTALL_BIN}/release${EX_CONFIG})
install(TARGETS CommonDataModel
RUNTIME CONFIGURATIONS Debug DESTINATION ${INSTALL_BIN}/debug${EX_CONFIG}
LIBRARY CONFIGURATIONS Debug DESTINATION ${INSTALL_BIN}/debug${EX_CONFIG})
install(TARGETS CommonDataModel
RUNTIME CONFIGURATIONS RelWithDebInfo DESTINATION ${INSTALL_BIN}/relwithdebinfo${EX_CONFIG}
LIBRARY CONFIGURATIONS RelWithDebInfo DESTINATION ${INSTALL_BIN}/relwithdebinfo${EX_CONFIG})
else()# Copy so files to the bin
install(TARGETS CommonDataModel
LIBRARY CONFIGURATIONS Release DESTINATION ${INSTALL_BIN}/release${EX_CONFIG})
install(TARGETS CommonDataModel
LIBRARY CONFIGURATIONS Debug DESTINATION ${INSTALL_BIN}/debug${EX_CONFIG})
install(TARGETS CommonDataModel
LIBRARY CONFIGURATIONS RelWithDebInfo DESTINATION ${INSTALL_BIN}/relwithdebinfo${EX_CONFIG})
if(${BUILD_SHARED_LIBS})
if(WIN32)# Copy dll files to the bin
install(TARGETS CommonDataModel
RUNTIME CONFIGURATIONS Release DESTINATION ${INSTALL_BIN}/release${EX_CONFIG}
LIBRARY CONFIGURATIONS Release DESTINATION ${INSTALL_BIN}/release${EX_CONFIG})
install(TARGETS CommonDataModel
RUNTIME CONFIGURATIONS Debug DESTINATION ${INSTALL_BIN}/debug${EX_CONFIG}
LIBRARY CONFIGURATIONS Debug DESTINATION ${INSTALL_BIN}/debug${EX_CONFIG})
install(TARGETS CommonDataModel
RUNTIME CONFIGURATIONS RelWithDebInfo DESTINATION ${INSTALL_BIN}/relwithdebinfo${EX_CONFIG}
LIBRARY CONFIGURATIONS RelWithDebInfo DESTINATION ${INSTALL_BIN}/relwithdebinfo${EX_CONFIG})
else()# Copy so files to the bin
install(TARGETS CommonDataModel
LIBRARY CONFIGURATIONS Release DESTINATION ${INSTALL_BIN}/release${EX_CONFIG})
install(TARGETS CommonDataModel
LIBRARY CONFIGURATIONS Debug DESTINATION ${INSTALL_BIN}/debug${EX_CONFIG})
install(TARGETS CommonDataModel
LIBRARY CONFIGURATIONS RelWithDebInfo DESTINATION ${INSTALL_BIN}/relwithdebinfo${EX_CONFIG})
endif()
endif()
# Copy lib/so files to the sdk/lib
install(TARGETS CommonDataModel
......
......@@ -12,20 +12,19 @@ specific language governing permissions and limitations under the License.
#pragma once
#if defined (__clang__)
#define DLL_DECL
#define STL_DECL
#elif defined(__gnu_linux__)
#define DLL_DECL __attribute__ ((visibility ("default")))
#define STL_DECL extern
#else
#ifdef COMMONDATAMODEL_EXPORTS
#define DLL_DECL __declspec(dllexport)
#define STL_DECL
#else
#define DLL_DECL __declspec(dllimport)
#define STL_DECL extern
#endif
#define CDM_DECL
#ifdef SHARED_CDM
#if defined (__clang__)
#define CDM_DECL
#elif defined(__gnu_linux__)
#define CDM_DECL __attribute__ ((visibility ("default")))
#else
#ifdef SHARED_CDM
#define CDM_DECL __declspec(dllexport)
#else
#define CDM_DECL __declspec(dllimport)
#endif
#endif
#endif
#if (0)
......
......@@ -55,7 +55,7 @@ struct PhysiologyEngineException : public CommonDataModelException
: CommonDataModelException(_Message) {}
};
class DLL_DECL PhysiologyEngine
class CDM_DECL PhysiologyEngine
{
public:
virtual ~PhysiologyEngine() {}
......@@ -67,8 +67,9 @@ public:
/// It will be reflected in the GetSimulationTime method.
/// Return value indicates engine was able to load provided state file.
/// Engine will be in a cleared state if this method fails.
/// Note the provided configuration will overwrite any configuration options in the state with its contents (Use with caution!)
//--------------------------------------------------------------------------------------------------
virtual bool LoadState(const std::string& file, const SEScalarTime* simTime=nullptr) = 0;
virtual bool LoadState(const std::string& file, const SEScalarTime* simTime=nullptr, const SEEngineConfiguration* config = nullptr) = 0;
//--------------------------------------------------------------------------------------------------
/// \brief
......@@ -77,8 +78,9 @@ public:
/// It will be reflected in the GetSimulationTime method.
/// Return value indicates engine was able to load provided state file.
/// Engine will be in a cleared state if this method fails.
/// Note the provided configuration will overwrite any configuration options in the state with its contents (Use with caution!)
//--------------------------------------------------------------------------------------------------
virtual bool LoadState(const google::protobuf::Message& state, const SEScalarTime* simTime = nullptr) = 0;
virtual bool LoadState(const google::protobuf::Message& state, const SEScalarTime* simTime = nullptr, const SEEngineConfiguration* config = nullptr) = 0;
//--------------------------------------------------------------------------------------------------
/// \brief
......
......@@ -20,7 +20,7 @@ specific language governing permissions and limitations under the License.
#define CIRCUIT_CALCULATOR_TYPES CircuitType,NodeType,PathType,CapacitanceUnit,FluxUnit,InductanceUnit,PotentialUnit,QuantityUnit,ResistanceUnit
// These are the Eigen Solvers we can use for solving our circuits
struct DLL_DECL EigenCircuitSolver
struct CDM_DECL EigenCircuitSolver
{
enum Type { Direct, PartialPivLu, FullPivLu, JacobiSvd, HouseholderQr, Ldlt, Llt, SparseLU, SparseQR, BiCGSTAB, ConjugateGradient };
SMART_ENUM(EigenCircuitSolver, Type, 11);
......
......@@ -62,6 +62,7 @@ void SECircuitManager::SaveFile(const std::string& filename)
void SECircuitManager::Load(const cdm::CircuitManagerData& src, SECircuitManager& dst)
{
SECircuitManager::Serialize(src, dst);
dst.StateChange();
}
void SECircuitManager::Serialize(const cdm::CircuitManagerData& src, SECircuitManager& dst)
{
......
......@@ -43,7 +43,7 @@ public:
#define FLUID_LEDGER_TYPES SEFluidCircuitNode,SEFluidCircuitPath,SEFluidCircuit
#define THERMAL_LEDGER_TYPES SEThermalCircuitNode,SEThermalCircuitPath,SEThermalCircuit
class DLL_DECL SECircuitManager : public Loggable
class CDM_DECL SECircuitManager : public Loggable
{
public:
SECircuitManager(Logger* logger);
......@@ -51,6 +51,7 @@ public:
virtual void Clear(); //clear memory
virtual void StateChange() { };
bool LoadFile(const std::string& filename);
void SaveFile(const std::string& filename);
......
......@@ -16,7 +16,7 @@ specific language governing permissions and limitations under the License.
#include "circuit/electrical/SEElectricalCircuitPath.h"
class SECircuitManager;
class DLL_DECL SEElectricalCircuit : public SECircuit<cdm::ElectricalCircuitData, SEElectricalCircuitNode, cdm::ElectricalCircuitNodeData, SEElectricalCircuitPath, cdm::ElectricalCircuitPathData>
class CDM_DECL SEElectricalCircuit : public SECircuit<cdm::ElectricalCircuitData, SEElectricalCircuitNode, cdm::ElectricalCircuitNodeData, SEElectricalCircuitPath, cdm::ElectricalCircuitPathData>
{
friend class SECircuitManager;
protected:
......
......@@ -22,7 +22,7 @@ specific language governing permissions and limitations under the License.
#include "properties/SEScalarElectricPotential.h"
#include "properties/SEScalarElectricResistance.h"
class DLL_DECL SEElectricalCircuitCalculator : public SECircuitCalculator<SEElectricalCircuit, SEElectricalCircuitNode, SEElectricalCircuitPath, ElectricCapacitanceUnit, ElectricCurrentUnit, ElectricInductanceUnit, ElectricPotentialUnit, ElectricChargeUnit, ElectricResistanceUnit>
class CDM_DECL SEElectricalCircuitCalculator : public SECircuitCalculator<SEElectricalCircuit, SEElectricalCircuitNode, SEElectricalCircuitPath, ElectricCapacitanceUnit, ElectricCurrentUnit, ElectricInductanceUnit, ElectricPotentialUnit, ElectricChargeUnit, ElectricResistanceUnit>
{
public:
......
......@@ -15,7 +15,7 @@ specific language governing permissions and limitations under the License.
#include "properties/SEScalarElectricCharge.h"
#include "properties/SEScalarElectricPotential.h"
class DLL_DECL SEElectricalCircuitNode : public SECircuitNode<SEScalarElectricPotential, SEScalarElectricCharge>
class CDM_DECL SEElectricalCircuitNode : public SECircuitNode<SEScalarElectricPotential, SEScalarElectricCharge>
{
friend class SECircuitManager;
protected:
......
......@@ -20,7 +20,7 @@ specific language governing permissions and limitations under the License.
#include "properties/SEScalarElectricCharge.h"
#include "circuit/electrical/SEElectricalCircuitNode.h"
class DLL_DECL SEElectricalCircuitPath : public SECircuitPath<SEScalarElectricCurrent, SEScalarElectricResistance, SEScalarElectricCapacitance, SEScalarElectricInductance, SEScalarElectricPotential, SEScalarElectricCharge>
class CDM_DECL SEElectricalCircuitPath : public SECircuitPath<SEScalarElectricCurrent, SEScalarElectricResistance, SEScalarElectricCapacitance, SEScalarElectricInductance, SEScalarElectricPotential, SEScalarElectricCharge>
{
friend class SECircuitManager;
protected:
......
......@@ -17,7 +17,7 @@ specific language governing permissions and limitations under the License.
class SECircuitManager;
class DLL_DECL SEFluidCircuit : public SECircuit<cdm::FluidCircuitData, SEFluidCircuitNode, cdm::FluidCircuitNodeData, SEFluidCircuitPath, cdm::FluidCircuitPathData>
class CDM_DECL SEFluidCircuit : public SECircuit<cdm::FluidCircuitData, SEFluidCircuitNode, cdm::FluidCircuitNodeData, SEFluidCircuitPath, cdm::FluidCircuitPathData>
{
friend class SECircuitManager;
protected:
......
......@@ -22,7 +22,7 @@ specific language governing permissions and limitations under the License.
#include "properties/SEScalarVolume.h"
#include "properties/SEScalarFlowResistance.h"
class DLL_DECL SEFluidCircuitCalculator : public SECircuitCalculator<SEFluidCircuit, SEFluidCircuitNode, SEFluidCircuitPath, FlowComplianceUnit, VolumePerTimeUnit, FlowInertanceUnit, PressureUnit, VolumeUnit, FlowResistanceUnit>
class CDM_DECL SEFluidCircuitCalculator : public SECircuitCalculator<SEFluidCircuit, SEFluidCircuitNode, SEFluidCircuitPath, FlowComplianceUnit, VolumePerTimeUnit, FlowInertanceUnit, PressureUnit, VolumeUnit, FlowResistanceUnit>
{
public:
......
......@@ -15,7 +15,7 @@ specific language governing permissions and limitations under the License.
#include "properties/SEScalarPressure.h"
#include "properties/SEScalarVolume.h"
class DLL_DECL SEFluidCircuitNode : public SECircuitNode<FLUID_CIRCUIT_NODE>
class CDM_DECL SEFluidCircuitNode : public SECircuitNode<FLUID_CIRCUIT_NODE>
{
friend class SECircuitManager;
protected:
......
......@@ -20,7 +20,7 @@ specific language governing permissions and limitations under the License.
#include "properties/SEScalarVolume.h"
#include "circuit/fluid/SEFluidCircuitNode.h"
class DLL_DECL SEFluidCircuitPath : public SECircuitPath<FLUID_CIRCUIT_PATH>
class CDM_DECL SEFluidCircuitPath : public SECircuitPath<FLUID_CIRCUIT_PATH>
{
friend class SECircuitManager;
protected:
......
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