Skip to content

Commit c5523d3

Browse files
committed
Merge branch 'release/Version-4.44'
2 parents 2cd7032 + e88bfb7 commit c5523d3

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

58 files changed

+4499
-548
lines changed

.github/workflows/copasi_se.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
name: Build and Test
22

33
on:
4+
workflow_dispatch:
45
push:
56
paths:
67
- "**"
@@ -81,8 +82,15 @@ jobs:
8182
curl -L http://bqfrank.spdns.org/Files/test-suite.zip -o test-suite.zip
8283
unzip -n -qq test-suite.zip
8384
85+
- name: Configure COPASI (mac)
86+
shell: bash
87+
if: matrix.platform == 'macos-latest'
88+
run: |
89+
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
90+
8491
- name: Configure COPASI
8592
shell: bash
93+
if: matrix.platform != 'macos-latest'
8694
run: |
8795
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
8896

.github/workflows/copasi_se_mp.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ jobs:
5151
- name: Configure COPASI
5252
shell: bash
5353
run: |
54-
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 .
54+
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 .
5555
sed -i 's/libgomp.a/libgomp.so/g' build_copasi/CMakeCache.txt
5656
sed -i 's/libpthread.a/libpthread.so/g' build_copasi/CMakeCache.txt
5757

.github/workflows/copasi_se_slackware.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ jobs:
5050
- name: Configure COPASI
5151
shell: bash
5252
run: |
53-
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 .
53+
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 .
5454
sed -i 's/libgomp.a/libgomp.so/g' build_copasi/CMakeCache.txt
5555
sed -i 's/libpthread.a/libpthread.so/g' build_copasi/CMakeCache.txt
5656

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,3 +83,5 @@ python_copasi.egg-info
8383
/copasi-dependencies
8484
TestSuite/distribution/out.txt
8585
.~lock*
86+
87+
tests/opt.cps

CMakeLists.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -460,7 +460,10 @@ endif(ENABLE_OMP)
460460

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

465468
# actually iconv is only needed on BSD like systems
466469
find_package(ICONV)

copasi/CMakeLists.txt

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -274,7 +274,6 @@ else()
274274

275275
target_link_libraries(libCOPASISE-core
276276
${CROSSGUID_LIBRARY}
277-
RAPTOR::RAPTOR
278277
${LIBSBML_LIBRARY_NAME}
279278
${LIBSEDML_LIBRARY_NAME}
280279
${LIBCOMBINE_LIBRARY_NAME}
@@ -283,6 +282,10 @@ else()
283282
${NATIVEJIT_LIBRARY}
284283
${CPUFEATURES_LIBRARY}
285284
)
285+
286+
if (COPASI_USE_RAPTOR)
287+
target_link_libraries(libCOPASISE-core RAPTOR::RAPTOR)
288+
endif()
286289

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

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

309312
target_link_libraries(libCOPASISE-static
310313
${CROSSGUID_LIBRARY}
311-
RAPTOR::RAPTOR
312314
${LIBSBML_LIBRARY_NAME}
313315
EXPAT::EXPAT
314316
${CLAPACK_LIBRARIES}
315317
${NATIVEJIT_LIBRARY}
316318
${CPUFEATURES_LIBRARY})
317319

320+
if (COPASI_USE_RAPTOR)
321+
target_link_libraries(libCOPASISE-static RAPTOR::RAPTOR)
322+
endif()
323+
318324
if (EXTRA_LIBS)
319325
target_link_libraries(libCOPASISE-static ${EXTRA_LIBS})
320326
else ()
@@ -399,7 +405,11 @@ if(ENABLE_LIBCOPASISE_SHARED)
399405

400406
target_link_libraries(libCOPASISE-shared ${LIBSEDML_LIBRARY_NAME})
401407

402-
target_link_libraries(libCOPASISE-shared RAPTOR::RAPTOR ${LIBSBML_LIBRARY_NAME} EXPAT::EXPAT ${CLAPACK_LIBRARIES})
408+
if (COPASI_USE_RAPTOR)
409+
target_link_libraries(libCOPASISE-shared RAPTOR::RAPTOR)
410+
endif()
411+
412+
target_link_libraries(libCOPASISE-shared ${LIBSBML_LIBRARY_NAME} EXPAT::EXPAT ${CLAPACK_LIBRARIES})
403413

404414
if (ENABLE_OMP)
405415
target_link_libraries(libCOPASISE-shared OpenMP::OpenMP_CXX)

copasi/CopasiDataModel/CDataModel.cpp

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1082,9 +1082,14 @@ bool CDataModel::newModel(CProcessReport * pProcessReport,
10821082
// set content type to COPASI
10831083
mData.mContentType = ContentType::COPASI;
10841084

1085-
CRegisteredCommonName::setEnabled(false);
1086-
commonAfterLoad(pProcessReport, deleteOldData);
1087-
CRegisteredCommonName::setEnabled(true);
1085+
if (CRegisteredCommonName::isEnabled())
1086+
{
1087+
CRegisteredCommonName::setEnabled(false);
1088+
commonAfterLoad(pProcessReport, deleteOldData);
1089+
CRegisteredCommonName::setEnabled(true);
1090+
}
1091+
else
1092+
commonAfterLoad(pProcessReport, deleteOldData);
10881093

10891094
return true;
10901095
}

copasi/CopasiSE/CopasiSE.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright (C) 2019 - 2023 by Pedro Mendes, Rector and Visitors of the
1+
// Copyright (C) 2019 - 2024 by Pedro Mendes, Rector and Visitors of the
22
// University of Virginia, University of Heidelberg, and University
33
// of Connecticut School of Medicine.
44
// All rights reserved.
@@ -784,8 +784,10 @@ int validate()
784784

785785
try
786786
{
787+
std::ostream * pOstream = &std::cout;
788+
787789
success =
788-
TaskList[i].initialize(CCopasiTask::OUTPUT_SE, pDataModel, NULL);
790+
TaskList[i].initialize(CCopasiTask::OUTPUT_SE, pDataModel, pOstream);
789791

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

811813
retcode = 1;
812814
}
813-
814-
pDataModel->finish();
815815
}
816816

817817
return retcode;

copasi/MIRIAM/CModelMIRIAMInfo.cpp

Lines changed: 32 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,26 @@
1-
// Copyright (C) 2019 - 2022 by Pedro Mendes, Rector and Visitors of the
2-
// University of Virginia, University of Heidelberg, and University
3-
// of Connecticut School of Medicine.
4-
// All rights reserved.
5-
6-
// Copyright (C) 2017 - 2018 by Pedro Mendes, Virginia Tech Intellectual
7-
// Properties, Inc., University of Heidelberg, and University of
8-
// of Connecticut School of Medicine.
9-
// All rights reserved.
10-
11-
// Copyright (C) 2010 - 2016 by Pedro Mendes, Virginia Tech Intellectual
12-
// Properties, Inc., University of Heidelberg, and The University
13-
// of Manchester.
14-
// All rights reserved.
15-
16-
// Copyright (C) 2008 - 2009 by Pedro Mendes, Virginia Tech Intellectual
17-
// Properties, Inc., EML Research, gGmbH, University of Heidelberg,
18-
// and The University of Manchester.
19-
// All rights reserved.
20-
21-
// Copyright (C) 2007 by Pedro Mendes, Virginia Tech Intellectual
22-
// Properties, Inc. and EML Research, gGmbH.
23-
// All rights reserved.
1+
// Copyright (C) 2019 - 2024 by Pedro Mendes, Rector and Visitors of the
2+
// University of Virginia, University of Heidelberg, and University
3+
// of Connecticut School of Medicine.
4+
// All rights reserved.
5+
6+
// Copyright (C) 2017 - 2018 by Pedro Mendes, Virginia Tech Intellectual
7+
// Properties, Inc., University of Heidelberg, and University of
8+
// of Connecticut School of Medicine.
9+
// All rights reserved.
10+
11+
// Copyright (C) 2010 - 2016 by Pedro Mendes, Virginia Tech Intellectual
12+
// Properties, Inc., University of Heidelberg, and The University
13+
// of Manchester.
14+
// All rights reserved.
15+
16+
// Copyright (C) 2008 - 2009 by Pedro Mendes, Virginia Tech Intellectual
17+
// Properties, Inc., EML Research, gGmbH, University of Heidelberg,
18+
// and The University of Manchester.
19+
// All rights reserved.
20+
21+
// Copyright (C) 2007 by Pedro Mendes, Virginia Tech Intellectual
22+
// Properties, Inc. and EML Research, gGmbH.
23+
// All rights reserved.
2424

2525
#include <iostream>
2626
#include <fstream>
@@ -29,8 +29,8 @@
2929
#include "copasi/copasi.h"
3030

3131
#include "copasi/MIRIAM/CModelMIRIAMInfo.h"
32-
#include "copasi/MIRIAM/CRDFWriter.h"
3332
#include "copasi/MIRIAM/CRDFLiteral.h"
33+
#include "copasi/MIRIAM/CRDFWriter.h"
3434
#include "copasi/MIRIAM/CRDFParser.h"
3535
#include "copasi/MIRIAM/CConstants.h"
3636
#include "copasi/MIRIAM/CRDFObject.h"
@@ -527,7 +527,11 @@ void CMIRIAMInfo::load(CDataContainer * pObject)
527527
if (mpAnnotation != NULL &&
528528
!mpAnnotation->getMiriamAnnotation().empty())
529529
{
530+
#ifdef COPASI_USE_RAPTOR
530531
mpRDFGraph = CRDFParser::graphFromXml(mpAnnotation->getMiriamAnnotation());
532+
#else
533+
mpRDFGraph = CRDFGraph::fromString(mpAnnotation->getMiriamAnnotation());
534+
#endif
531535
}
532536

533537
if (mpRDFGraph == NULL)
@@ -564,8 +568,11 @@ bool CMIRIAMInfo::save()
564568
{
565569
mpRDFGraph->clean();
566570
mpRDFGraph->updateNamespaces();
567-
571+
#ifdef COPASI_USE_RAPTOR
568572
mpAnnotation->setMiriamAnnotation(CRDFWriter::xmlFromGraph(mpRDFGraph), mpAnnotation->getKey(), mpAnnotation->getKey());
573+
#else
574+
mpAnnotation->setMiriamAnnotation(mpRDFGraph->toXmlString(), mpAnnotation->getKey(), mpAnnotation->getKey());
575+
#endif
569576

570577
return true;
571578
}

0 commit comments

Comments
 (0)