Skip to content

Commit

Permalink
Merge pull request #1170 from sys-bio/develop
Browse files Browse the repository at this point in the history
Update docs.
  • Loading branch information
luciansmith authored Dec 13, 2023
2 parents ea600f8 + 4d8807a commit 4ed3408
Show file tree
Hide file tree
Showing 73 changed files with 4,821 additions and 1,685 deletions.
8 changes: 4 additions & 4 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ cmake_minimum_required(VERSION 3.16)
# Version information and include modules

set(ROADRUNNER_VERSION_MAJOR 2)
set(ROADRUNNER_VERSION_MINOR 4)
set(ROADRUNNER_VERSION_MINOR 5)
set(ROADRUNNER_VERSION_PATCH 0)

set(ROADRUNNER_VERSION "${ROADRUNNER_VERSION_MAJOR}.${ROADRUNNER_VERSION_MINOR}.${ROADRUNNER_VERSION_PATCH}")
Expand Down Expand Up @@ -472,9 +472,9 @@ find_package(SUNDIALS CONFIG REQUIRED)
# not for windows. So not required, but we throw error if not win and not found.
find_package(Curses)

if (NOT WIN32 AND NOT ${CURSES_FOUND})
message(FATAL_ERROR "ncurses library not found. Please install it with your native package manager")
endif ()
#if (NOT WIN32 AND NOT ${CURSES_FOUND})
# message(FATAL_ERROR "ncurses library not found. Please install it with your native package manager")
#endif ()


set(BUILD_SHARED_LIBS OFF)
Expand Down
25 changes: 10 additions & 15 deletions azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -137,8 +137,7 @@ stages:
# for example, it looks like this:
# - https://dev.azure.com/TheRoadrunnerProject/libroadrunner-deps/_build?definitionId=9
pipeline: 9
runVersion: 'latestFromBranch'
runBranch: 'refs/heads/release'
runVersion: 'latest'
artifact: libroadrunner-deps-$(Agent.OS)-$(BuildType)
path: $(DEPS_INSTALL_PREFIX)
displayName: Download libroadrunner-deps install artifacts
Expand Down Expand Up @@ -272,8 +271,7 @@ stages:
source: 'specific'
project: 'libroadrunner-deps'
pipeline: 9
runVersion: 'latestFromBranch'
runBranch: 'refs/heads/release'
runVersion: 'latest'
artifact: libroadrunner-deps-$(Agent.OS)-Release
path: $(DEPS_INSTALL_PREFIX)
displayName: Download libroadrunner-deps install artifacts
Expand Down Expand Up @@ -503,8 +501,7 @@ stages:
source: 'specific'
project: 'libroadrunner-deps'
pipeline: 9
runVersion: 'latestFromBranch'
runBranch: 'refs/heads/release'
runVersion: 'latest'
artifact: libroadrunner-deps-$(Agent.OS)-$(BuildType)
path: $(DEPS_INSTALL_PREFIX)
displayName: Download libroadrunner-deps install artifacts
Expand Down Expand Up @@ -594,7 +591,7 @@ stages:
- powershell: |
where.exe conda
where.exe python
conda update conda -y -c conda-forge
# conda update conda -y -c conda-forge
conda install numpy
conda install python=3.11 -c conda-forge
conda --version
Expand Down Expand Up @@ -637,8 +634,7 @@ stages:
source: 'specific'
project: 'libroadrunner-deps'
pipeline: 9
runVersion: 'latestFromBranch'
runBranch: 'refs/heads/release'
runVersion: 'latest'
artifact: libroadrunner-deps-$(Agent.OS)-Release
path: $(DEPS_INSTALL_PREFIX)
displayName: Download libroadrunner-deps install artifacts
Expand Down Expand Up @@ -776,13 +772,13 @@ stages:
BuildDocs: OFF
variables:
MinicondaRoot : '/usr/share/miniconda'
PythonRoot: '$(MinicondaRoot)/envs/$(PythonName)'
PythonRoot: '$(MinicondaRoot)/'
PythonLibDir: '$(PythonRoot)/lib'
PythonExecutable: '$(PythonRoot)/bin/python'
PipExecutable: '$(PythonRoot)/bin/pip'
SphinxExecutable: '$(PythonRoot)/bin/sphinx-build'
PythonName: 'py39'
PythonVersion: '3.9'
PythonName: 'py311'
PythonVersion: '3.11'
LLVM_DOWNLOAD_LINK: 'https://github.com/sys-bio/llvm-13.x/releases/download/llvmorg-13.0.0/llvm13-ubuntu-gcc10-rel.tar.gz'
steps:
- checkout: self
Expand Down Expand Up @@ -849,7 +845,7 @@ stages:
displayName: Install g++10 and doxygen
- script: |
eval "$(conda shell.bash hook)"
conda create -y --name $(PythonName) python=$(PythonVersion)
# conda create -y --name $(PythonName) python=$(PythonVersion)
$(PipExecutable) install requests
displayName: "Install Python via conda"
- script: |
Expand All @@ -867,8 +863,7 @@ stages:
source: 'specific'
project: 'libroadrunner-deps'
pipeline: 9
runVersion: 'latestFromBranch'
runBranch: 'refs/heads/release'
runVersion: 'latest'
artifact: libroadrunner-deps-$(Agent.OS)-$(BuildType)
path: $(DEPS_INSTALL_PREFIX)
displayName: Download libroadrunner-deps install artifacts
Expand Down
4 changes: 2 additions & 2 deletions cmake/FindLLVM.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -210,13 +210,13 @@ correct location. ")
#message("UNIX true")
# message("LLVM VERSION >= 3.4, looking for curses library")
# sudo apt-get install libncurses5-dev libncursesw5-dev
find_package(Curses REQUIRED)
#find_package(Curses REQUIRED)
# message(STATUS "curses: ${CURSES_FOUND}")
# message(STATUS "curdir: ${CURSES_INCLUDE_DIR}")
# message(STATUS "curlib: ${CURSES_LIBRARIES}")
# message(STATUS "LLVM_LIBRARIES: ${LLVM_LIBRARIES}")

set(LLVM_LIBRARIES "${LLVM_LIBRARIES};${CURSES_LIBRARIES}")
#set(LLVM_LIBRARIES "${LLVM_LIBRARIES};${CURSES_LIBRARIES}")


# LLVM 3.5 seems to require zlib, at least on OSX 10.9.
Expand Down
10 changes: 5 additions & 5 deletions source/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -416,9 +416,9 @@ set(INCLUDE_DIRS "$<BUILD_INTERFACE:${LLVM_INCLUDE_DIRS}>"
"$<BUILD_INTERFACE:${DEPENDENCY_INCLUDE_DIR}/libexpat>"
"$<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>"
"$<BUILD_INTERFACE:${CMAKE_CURRENT_BINARY_DIR}>")
if (NOT WIN32)
set(INCLUDE_DIRS ${INCLUDE_DIRS} "$<BUILD_INTERFACE:${CURSES_INCLUDE_DIRS}>")
endif ()
#if (NOT WIN32)
# set(INCLUDE_DIRS ${INCLUDE_DIRS} "$<BUILD_INTERFACE:${CURSES_INCLUDE_DIRS}>")
#endif ()

target_include_directories(
${target}-static PUBLIC ${INCLUDE_DIRS}
Expand All @@ -430,12 +430,12 @@ target_include_directories(
set(PLATFORM_SPECIFIC_LIBS)
if (UNIX)
# icui18n icuuc (can be used instead of iconv)
set(PLATFORM_SPECIFIC_LIBS ${PLATFORM_SPECIFIC_LIBS} pthread dl m ${CURSES_LIBRARIES})
set(PLATFORM_SPECIFIC_LIBS ${PLATFORM_SPECIFIC_LIBS} pthread dl m)
elseif (WIN32)
set(PLATFORM_SPECIFIC_LIBS ${PLATFORM_SPECIFIC_LIBS} Ws2_32)

elseif (APPLE AND NOT UNIX)
set(PLATFORM_SPECIFIC_LIBS ${PLATFORM_SPECIFIC_LIBS} ${CURSES_LIBRARIES})
set(PLATFORM_SPECIFIC_LIBS ${PLATFORM_SPECIFIC_LIBS})

endif ()

Expand Down
2 changes: 1 addition & 1 deletion source/CVODEIntegrator.h
Original file line number Diff line number Diff line change
Expand Up @@ -243,7 +243,7 @@ namespace rr {
*
* The absolute tolerance vector is either set directly by the user as a vector, or is generated from the single absolute tolerance value (either default or set by the user) multiplied by the initial value of every element in the state vector (independent floating species, and elements controlled by rate rules). If that initial value is zero, the corresponding element of the absolute tolerance vector is the single value multiplied by the compartment volume for species, or by one for all other values.
*/
virtual std::vector<double> getAbsoluteToleranceVector();
std::vector<double> getAbsoluteToleranceVector() override;


private:
Expand Down
18 changes: 0 additions & 18 deletions source/GillespieIntegrator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -61,23 +61,13 @@ namespace rr

assert(floatingSpeciesStart >= 0);

// get rows and columns
mModel->getStoichiometryMatrix(&stoichRows, &stoichCols, nullptr);
stoichData = new double[stoichRows * stoichCols];

// fill stoichData
mModel->getStoichiometryMatrix(&stoichRows, &stoichCols, &stoichData);

setEngineSeed(getValue("seed").get<std::uint64_t>());
}

GillespieIntegrator::GillespieIntegrator(ExecutableModel* m)
: Integrator(m),
timeScale(1.0),
stoichScale(1.0),
stoichRows(0),
stoichCols(0),
stoichData(nullptr),
reactionRates(nullptr),
reactionRatesBuffer(nullptr),
stateVector(nullptr),
Expand All @@ -98,12 +88,10 @@ namespace rr
delete[] reactionRatesBuffer;
delete[] stateVector;
delete[] stateVectorRate;
delete[] stoichData;
reactionRates = nullptr;
reactionRatesBuffer = nullptr;
stateVector = nullptr;
stateVectorRate = nullptr;
stoichData = nullptr;
}
}

Expand All @@ -114,12 +102,10 @@ namespace rr
delete[] reactionRatesBuffer;
delete[] stateVector;
delete[] stateVectorRate;
delete[] stoichData;
reactionRates = nullptr;
reactionRatesBuffer = nullptr;
stateVector = nullptr;
stateVectorRate = nullptr;
stoichData = nullptr;

mModel = m;
mModel->reset();
Expand All @@ -130,10 +116,6 @@ namespace rr
timeScale = 1.;
stoichScale = 1.;

stoichRows = 0;
stoichCols = 0;
stoichData = nullptr;

initializeFromModel();
}

Expand Down
8 changes: 1 addition & 7 deletions source/GillespieIntegrator.h
Original file line number Diff line number Diff line change
Expand Up @@ -133,11 +133,6 @@ namespace rr
int stateVectorSize;
double* stateVector;
double* stateVectorRate;
// m rows x n cols
// offset = row*NUMCOLS + column
int stoichRows;
int stoichCols;
double* stoichData;
std::vector<unsigned char> eventStatus;
std::vector<unsigned char> previousEventStatus;

Expand All @@ -146,11 +141,10 @@ namespace rr

double urand();
void setEngineSeed(std::uint64_t seed);
std::uint64_t getSeed() const;

inline double getStoich(uint species, uint reaction)
{
return stoichData[species * stoichCols + reaction];
return mModel->getStoichiometry(species, reaction);
}

/**
Expand Down
3 changes: 3 additions & 0 deletions source/SBMLValidator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,9 @@ namespace rr
if (err)
{
errmsg = " Error from libsbml:\n" + err->getMessage();
if (err->getErrorId() == 10103) {
throw std::domain_error("Invalid SBML, but valid XML. It's possible that this is not an SBML file at all, but something else.");
}
}
throw std::runtime_error("SBML document unable to be read." + errmsg);
}
Expand Down
1 change: 0 additions & 1 deletion source/conservation/ConservedMoietyConverter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@
#include "rrRoadRunner.h"

#include <sbml/math/ASTNode.h>
#include <sbml/AlgebraicRule.h>
#include <sbml/AssignmentRule.h>
#include <sbml/RateRule.h>
#include <sbml/InitialAssignment.h>
Expand Down
1 change: 0 additions & 1 deletion source/llvm/AssignmentRuleEvaluator.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@

#include <sbml/Model.h>
#include <sbml/SBMLVisitor.h>
#include <sbml/AlgebraicRule.h>
#include <sbml/AssignmentRule.h>

namespace rrllvm
Expand Down
2 changes: 1 addition & 1 deletion source/llvm/EvalInitialConditionsCodeGen.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,7 @@ void EvalInitialConditionsCodeGen::codeGenStoichiometry(
Value *stoich = builder.CreateLoad(stoichEP, "stoichiometry");

std::list<LLVMModelDataSymbols::SpeciesReferenceInfo> stoichEntries =
dataSymbols.getStoichiometryIndx();
dataSymbols.getStoichiometryList();

for (std::list<LLVMModelDataSymbols::SpeciesReferenceInfo>::iterator i =
stoichEntries.begin(); i != stoichEntries.end(); i++)
Expand Down
Loading

0 comments on commit 4ed3408

Please sign in to comment.