Skip to content

Commit

Permalink
Merge branch 'release/Version-4.44'
Browse files Browse the repository at this point in the history
  • Loading branch information
fbergmann committed Jul 19, 2024
2 parents 2cd7032 + e88bfb7 commit c5523d3
Show file tree
Hide file tree
Showing 58 changed files with 4,499 additions and 548 deletions.
8 changes: 8 additions & 0 deletions .github/workflows/copasi_se.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
name: Build and Test

on:
workflow_dispatch:
push:
paths:
- "**"
Expand Down Expand Up @@ -81,8 +82,15 @@ jobs:
curl -L http://bqfrank.spdns.org/Files/test-suite.zip -o test-suite.zip
unzip -n -qq test-suite.zip
- name: Configure COPASI (mac)
shell: bash
if: matrix.platform == 'macos-latest'
run: |
cmake -G Ninja -DCMAKE_BUILD_TYPE=$BUILD_TYPE -DCOPASI_INSTALL_C_API=ON -DSBML_TESTSUITE_RUN=ON -DBUILD_TESTS=ON -DBUILD_GUI=OFF -DENABLE_JIT=OFF -DCOPASI_DEPENDENCY_DIR=./dependencies/ -DCMAKE_INSTALL_PREFIX=./install/ -DBUILD_SBML_TESTSUITE:BOOL=ON -DSBML_TESTSUITE_CASES_DIR:PATH=$PWD/test-suite -S . -B ./build_copasi
- name: Configure COPASI
shell: bash
if: matrix.platform != 'macos-latest'
run: |
cmake -G Ninja -DCMAKE_BUILD_TYPE=$BUILD_TYPE -DCOPASI_INSTALL_C_API=ON -DSBML_TESTSUITE_RUN=ON -DBUILD_TESTS=ON -DBUILD_GUI=OFF -DCOPASI_DEPENDENCY_DIR=./dependencies/ -DCMAKE_INSTALL_PREFIX=./install/ -DBUILD_SBML_TESTSUITE:BOOL=ON -DSBML_TESTSUITE_CASES_DIR:PATH=$PWD/test-suite -S . -B ./build_copasi
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/copasi_se_mp.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ jobs:
- name: Configure COPASI
shell: bash
run: |
cmake -B build_copasi -DCMAKE_BUILD_TYPE=$BUILD_TYPE -DCOPASI_INSTALL_C_API=ON -DBUILD_TESTS=ON -DBUILD_GUI=OFF -DCOPASI_DEPENDENCY_DIR=./dependencies/ -DCMAKE_INSTALL_PREFIX=./install/ -DENABLE_OMP=ON -S .
cmake -B build_copasi -DCMAKE_BUILD_TYPE=$BUILD_TYPE -DCOPASI_INSTALL_C_API=ON -DBUILD_TESTS=ON -DBUILD_GUI=OFF -DCOPASI_DEPENDENCY_DIR=./dependencies/ -DCMAKE_INSTALL_PREFIX=./install/ -DENABLE_OMP=ON -DENABLE_JIT=OFF -S .
sed -i 's/libgomp.a/libgomp.so/g' build_copasi/CMakeCache.txt
sed -i 's/libpthread.a/libpthread.so/g' build_copasi/CMakeCache.txt
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/copasi_se_slackware.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ jobs:
- name: Configure COPASI
shell: bash
run: |
cmake -B build_copasi -DCMAKE_BUILD_TYPE=$BUILD_TYPE -DCOPASI_INSTALL_C_API=ON -DBUILD_TESTS=ON -DBUILD_GUI=OFF -DCOPASI_DEPENDENCY_DIR=./dependencies/ -DCMAKE_INSTALL_PREFIX=./install/ -DENABLE_OMP=ON -S .
cmake -B build_copasi -DCMAKE_BUILD_TYPE=$BUILD_TYPE -DCOPASI_INSTALL_C_API=ON -DBUILD_TESTS=ON -DBUILD_GUI=OFF -DCOPASI_DEPENDENCY_DIR=./dependencies/ -DCMAKE_INSTALL_PREFIX=./install/ -DENABLE_OMP=ON -DENABLE_JIT=OFF -S .
sed -i 's/libgomp.a/libgomp.so/g' build_copasi/CMakeCache.txt
sed -i 's/libpthread.a/libpthread.so/g' build_copasi/CMakeCache.txt
Expand Down
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -83,3 +83,5 @@ python_copasi.egg-info
/copasi-dependencies
TestSuite/distribution/out.txt
.~lock*

tests/opt.cps
3 changes: 3 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -460,7 +460,10 @@ endif(ENABLE_OMP)

# TODO raptor should be restricted to a version which is at least
# 1.4.18, but lower then 2.0
option(COPASI_USE_RAPTOR "Use Raptor (<2.0) for RDF support" ON)
if (COPASI_USE_RAPTOR)
find_package(RAPTOR REQUIRED)
endif()

# actually iconv is only needed on BSD like systems
find_package(ICONV)
Expand Down
16 changes: 13 additions & 3 deletions copasi/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -274,7 +274,6 @@ else()

target_link_libraries(libCOPASISE-core
${CROSSGUID_LIBRARY}
RAPTOR::RAPTOR
${LIBSBML_LIBRARY_NAME}
${LIBSEDML_LIBRARY_NAME}
${LIBCOMBINE_LIBRARY_NAME}
Expand All @@ -283,6 +282,10 @@ else()
${NATIVEJIT_LIBRARY}
${CPUFEATURES_LIBRARY}
)

if (COPASI_USE_RAPTOR)
target_link_libraries(libCOPASISE-core RAPTOR::RAPTOR)
endif()

add_library (libCOPASISE-static STATIC $<TARGET_OBJECTS:libCOPASISE-core>)

Expand All @@ -308,13 +311,16 @@ endif (APPLE)

target_link_libraries(libCOPASISE-static
${CROSSGUID_LIBRARY}
RAPTOR::RAPTOR
${LIBSBML_LIBRARY_NAME}
EXPAT::EXPAT
${CLAPACK_LIBRARIES}
${NATIVEJIT_LIBRARY}
${CPUFEATURES_LIBRARY})

if (COPASI_USE_RAPTOR)
target_link_libraries(libCOPASISE-static RAPTOR::RAPTOR)
endif()

if (EXTRA_LIBS)
target_link_libraries(libCOPASISE-static ${EXTRA_LIBS})
else ()
Expand Down Expand Up @@ -399,7 +405,11 @@ if(ENABLE_LIBCOPASISE_SHARED)

target_link_libraries(libCOPASISE-shared ${LIBSEDML_LIBRARY_NAME})

target_link_libraries(libCOPASISE-shared RAPTOR::RAPTOR ${LIBSBML_LIBRARY_NAME} EXPAT::EXPAT ${CLAPACK_LIBRARIES})
if (COPASI_USE_RAPTOR)
target_link_libraries(libCOPASISE-shared RAPTOR::RAPTOR)
endif()

target_link_libraries(libCOPASISE-shared ${LIBSBML_LIBRARY_NAME} EXPAT::EXPAT ${CLAPACK_LIBRARIES})

if (ENABLE_OMP)
target_link_libraries(libCOPASISE-shared OpenMP::OpenMP_CXX)
Expand Down
11 changes: 8 additions & 3 deletions copasi/CopasiDataModel/CDataModel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1082,9 +1082,14 @@ bool CDataModel::newModel(CProcessReport * pProcessReport,
// set content type to COPASI
mData.mContentType = ContentType::COPASI;

CRegisteredCommonName::setEnabled(false);
commonAfterLoad(pProcessReport, deleteOldData);
CRegisteredCommonName::setEnabled(true);
if (CRegisteredCommonName::isEnabled())
{
CRegisteredCommonName::setEnabled(false);
commonAfterLoad(pProcessReport, deleteOldData);
CRegisteredCommonName::setEnabled(true);
}
else
commonAfterLoad(pProcessReport, deleteOldData);

return true;
}
Expand Down
8 changes: 4 additions & 4 deletions copasi/CopasiSE/CopasiSE.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright (C) 2019 - 2023 by Pedro Mendes, Rector and Visitors of the
// Copyright (C) 2019 - 2024 by Pedro Mendes, Rector and Visitors of the
// University of Virginia, University of Heidelberg, and University
// of Connecticut School of Medicine.
// All rights reserved.
Expand Down Expand Up @@ -784,8 +784,10 @@ int validate()

try
{
std::ostream * pOstream = &std::cout;

success =
TaskList[i].initialize(CCopasiTask::OUTPUT_SE, pDataModel, NULL);
TaskList[i].initialize(CCopasiTask::OUTPUT_SE, pDataModel, pOstream);

// We need to check whether the result is saved in any form.
// If not we need to stop right here to avoid wasting time.
Expand All @@ -810,8 +812,6 @@ int validate()

retcode = 1;
}

pDataModel->finish();
}

return retcode;
Expand Down
57 changes: 32 additions & 25 deletions copasi/MIRIAM/CModelMIRIAMInfo.cpp
Original file line number Diff line number Diff line change
@@ -1,26 +1,26 @@
// Copyright (C) 2019 - 2022 by Pedro Mendes, Rector and Visitors of the
// University of Virginia, University of Heidelberg, and University
// of Connecticut School of Medicine.
// All rights reserved.

// Copyright (C) 2017 - 2018 by Pedro Mendes, Virginia Tech Intellectual
// Properties, Inc., University of Heidelberg, and University of
// of Connecticut School of Medicine.
// All rights reserved.

// Copyright (C) 2010 - 2016 by Pedro Mendes, Virginia Tech Intellectual
// Properties, Inc., University of Heidelberg, and The University
// of Manchester.
// All rights reserved.

// Copyright (C) 2008 - 2009 by Pedro Mendes, Virginia Tech Intellectual
// Properties, Inc., EML Research, gGmbH, University of Heidelberg,
// and The University of Manchester.
// All rights reserved.

// Copyright (C) 2007 by Pedro Mendes, Virginia Tech Intellectual
// Properties, Inc. and EML Research, gGmbH.
// All rights reserved.
// Copyright (C) 2019 - 2024 by Pedro Mendes, Rector and Visitors of the
// University of Virginia, University of Heidelberg, and University
// of Connecticut School of Medicine.
// All rights reserved.

// Copyright (C) 2017 - 2018 by Pedro Mendes, Virginia Tech Intellectual
// Properties, Inc., University of Heidelberg, and University of
// of Connecticut School of Medicine.
// All rights reserved.

// Copyright (C) 2010 - 2016 by Pedro Mendes, Virginia Tech Intellectual
// Properties, Inc., University of Heidelberg, and The University
// of Manchester.
// All rights reserved.

// Copyright (C) 2008 - 2009 by Pedro Mendes, Virginia Tech Intellectual
// Properties, Inc., EML Research, gGmbH, University of Heidelberg,
// and The University of Manchester.
// All rights reserved.

// Copyright (C) 2007 by Pedro Mendes, Virginia Tech Intellectual
// Properties, Inc. and EML Research, gGmbH.
// All rights reserved.

#include <iostream>
#include <fstream>
Expand All @@ -29,8 +29,8 @@
#include "copasi/copasi.h"

#include "copasi/MIRIAM/CModelMIRIAMInfo.h"
#include "copasi/MIRIAM/CRDFWriter.h"
#include "copasi/MIRIAM/CRDFLiteral.h"
#include "copasi/MIRIAM/CRDFWriter.h"
#include "copasi/MIRIAM/CRDFParser.h"
#include "copasi/MIRIAM/CConstants.h"
#include "copasi/MIRIAM/CRDFObject.h"
Expand Down Expand Up @@ -527,7 +527,11 @@ void CMIRIAMInfo::load(CDataContainer * pObject)
if (mpAnnotation != NULL &&
!mpAnnotation->getMiriamAnnotation().empty())
{
#ifdef COPASI_USE_RAPTOR
mpRDFGraph = CRDFParser::graphFromXml(mpAnnotation->getMiriamAnnotation());
#else
mpRDFGraph = CRDFGraph::fromString(mpAnnotation->getMiriamAnnotation());
#endif
}

if (mpRDFGraph == NULL)
Expand Down Expand Up @@ -564,8 +568,11 @@ bool CMIRIAMInfo::save()
{
mpRDFGraph->clean();
mpRDFGraph->updateNamespaces();

#ifdef COPASI_USE_RAPTOR
mpAnnotation->setMiriamAnnotation(CRDFWriter::xmlFromGraph(mpRDFGraph), mpAnnotation->getKey(), mpAnnotation->getKey());
#else
mpAnnotation->setMiriamAnnotation(mpRDFGraph->toXmlString(), mpAnnotation->getKey(), mpAnnotation->getKey());
#endif

return true;
}
Expand Down
Loading

0 comments on commit c5523d3

Please sign in to comment.