Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
151 commits
Select commit Hold shift + click to select a range
af16cf6
Hardcoded installation of symengine and gmp
RLee64 Dec 12, 2025
9e2b0b3
Created basic rearrangement test case
RLee64 Dec 12, 2025
dafb56e
Basic implementation of equation rearrangement
RLee64 Dec 12, 2025
4331798
Change symEngineRepresentation to symEngineEquation
RLee64 Dec 11, 2025
3953282
Added TODO comments
RLee64 Dec 11, 2025
2de9098
Renamed equation to seEquation
RLee64 Dec 11, 2025
1238673
Defined type aliases for symengine maps
RLee64 Dec 11, 2025
539dbf7
Updated function parameters to use const and pass by reference
RLee64 Dec 11, 2025
f2cab14
Added support for parsing SymEngine integers to AST
RLee64 Dec 11, 2025
bdb3bd1
Assign parenthood to recreated ast tree
RLee64 Dec 11, 2025
3b2c5cc
Removed DAE test case and associated files
RLee64 Dec 11, 2025
060b815
Replaced exception use in symEngineEquation()
RLee64 Dec 12, 2025
685e1a1
Removed redundant map include
RLee64 Dec 12, 2025
81f5766
Change SymEngineEquationResult to use tuple instead of pair
RLee64 Dec 12, 2025
5dc3fcb
Added rearrangement test suite
RLee64 Dec 12, 2025
4d4ba97
Create new test cases for rearrangement
RLee64 Dec 12, 2025
d9c4d10
Remove old rearrangement test case
RLee64 Dec 12, 2025
3e8456d
Simple Equation Rearrangement.
agarny Dec 12, 2025
bd67b0c
Make SymEngine -> AST parsing work with 3+ children
RLee64 Dec 14, 2025
c8d2bd8
Updated unarranged addition cellml file
RLee64 Dec 14, 2025
080d5c3
Add/Sub symengine parsing support
RLee64 Dec 14, 2025
cce543f
Fixed unarranged multiplication cellml file
RLee64 Dec 14, 2025
41e85ce
Mult/div symengine parsing support
RLee64 Dec 14, 2025
4cbc787
Improved unarranged trig test cases
RLee64 Dec 14, 2025
a47ce0d
Simple trig rearrangement support
RLee64 Dec 15, 2025
e157f82
Updated unarranged constants cellml file
RLee64 Dec 15, 2025
4fdae53
Added support for various numbers and constants
RLee64 Dec 15, 2025
339a003
Fix unarranged polynomial test cases
RLee64 Dec 15, 2025
5caecad
Added support for rearranging polynomials
RLee64 Dec 15, 2025
5d9cd2f
Update unary +/- parsing
RLee64 Dec 15, 2025
3a553be
Made explicit types auto
RLee64 Dec 17, 2025
9efff06
Deleted unused test cases
RLee64 Dec 17, 2025
f8a39f5
Renamed symengine cellml test files
RLee64 Dec 17, 2025
d79d8fc
Cleaned up symengine trigonometric test case
RLee64 Dec 17, 2025
aab7d89
Fix issue with recreating unary functions for AST
RLee64 Dec 17, 2025
9c1e0b8
Fixed children not setting their parent AST
RLee64 Dec 17, 2025
fc1cf1c
Cleaned symengine test cases
RLee64 Dec 17, 2025
ec0ace2
Test expected generator equation code
RLee64 Dec 17, 2025
f50049e
Made childSeExpression retrieval inline
RLee64 Dec 17, 2025
5ca91b3
Fixed spelling error in symengine test files
RLee64 Dec 17, 2025
156bd52
Removed redundant symengine multiplication test case
RLee64 Dec 17, 2025
ef336d5
Manual simplification of symengine results
RLee64 Dec 18, 2025
7c34ff2
Extended rearrangement.
agarny Dec 18, 2025
1e11ef2
Cleaned up symengine parsing to AST
RLee64 Dec 18, 2025
c79d3fd
Added support for all trigonometric expressions
RLee64 Dec 18, 2025
38d35fc
Fixed issue with minus operator incorrectly applied
RLee64 Dec 18, 2025
4854bfe
Support for rearranging exponents and logarithms
RLee64 Dec 18, 2025
ad7b103
Analyser: some minor cleaning up.
agarny Dec 18, 2025
b82e75b
CI: temporarily allow CI tests to be run on PRs to the `staging` branch.
agarny Dec 17, 2025
2486b9d
Support for rearranging uncommon arithmetic operators
RLee64 Dec 18, 2025
12b4e01
Support for rearranging differential equations
RLee64 Dec 19, 2025
fcbe7ad
Catch symengine exceptions
RLee64 Dec 19, 2025
e6d9238
Testing for unrearrangeable equations
RLee64 Dec 19, 2025
d5cca31
Fixed issue with rearrangement with imported equations
RLee64 Dec 19, 2025
e429b4d
Rearrangement Restructure
RLee64 Jan 7, 2026
ea06c14
Algebraic loop test case
RLee64 Jan 7, 2026
8945d7e
Simple DAE to ODE solver.
RLee64 Jan 8, 2026
7d7dfc8
Bug fixes and clean-up to dae tearing
RLee64 Jan 8, 2026
9c74638
Fixed algebraic loop test case
RLee64 Jan 8, 2026
f7af1f3
GHA: allow code spelling check outside of cellml/libcellml.
agarny Dec 18, 2025
d891992
CMake: temporarily disable Python bindings.
agarny Dec 23, 2025
465abfd
CMake: find and use SymEngine.
agarny Dec 15, 2025
4af7d68
Analyser: a SymEngine rational should be converted to a division.
agarny Dec 23, 2025
6938ed9
CI: temporarily disable our JavaScript job.
agarny Dec 23, 2025
6505b65
Generator: temporarily disable some tests.
agarny Dec 23, 2025
0f563bc
Analyser: addressed an MSVC warning (and therefore error).
agarny Dec 24, 2025
ef06b52
Tests: put the analyser's SymEngine tests in their own category.
agarny Jan 6, 2026
dcbae1d
Analyser: SymEngine behaves slightly differently on different systems.
agarny Jan 7, 2026
f62218a
Analyser: some minor cleaning up.
agarny Jan 8, 2026
bcc01b9
Temporary changes to get 100% coverage.
agarny Jan 8, 2026
34f8d17
Allow for classification of basic NLA systems
RLee64 Jan 8, 2026
0074611
CMake: added support for SymEngine.
agarny Jan 8, 2026
e165b85
Merge remote-tracking branch 'origin/staging' into full-rearrangement…
RLee64 Jan 8, 2026
90f17de
Further fixes
RLee64 Jan 9, 2026
e1d91b1
Fixed rearrangement test case issue
RLee64 Jan 9, 2026
1f019f0
fix symengine derivative issues
RLee64 Jan 12, 2026
6c784a1
Removed faulty test case
RLee64 Jan 12, 2026
143c887
Commend out sine import test
RLee64 Jan 12, 2026
aea0ece
Revert Mac/Linux test case change
RLee64 Jan 12, 2026
d05f827
Merge branch 'full-rearrangement-support' into dae-to-ode-v2
RLee64 Jan 12, 2026
d49ac38
Assume initialised variables are constants
RLee64 Jan 12, 2026
581350f
Assume state variables used outside of DIFF elements as known
RLee64 Jan 12, 2026
86eb807
Improved isolated variable detection
RLee64 Jan 12, 2026
6b8a2e0
Cleaned up tearing comments
RLee64 Jan 12, 2026
fd1812a
Handling equivalent variables
RLee64 Jan 13, 2026
e149393
Move parsing functions to analyserimpl area
RLee64 Jan 13, 2026
d4b4038
Ignore VoI when matching relationships
RLee64 Jan 13, 2026
987a051
Treat should be state variables like state variables
RLee64 Jan 14, 2026
3b18017
Update symengine test cases for changed rearrangement
RLee64 Jan 15, 2026
324326d
Updated rearrangement test cases
RLee64 Jan 15, 2026
6cde3d4
Tearing refactor
RLee64 Jan 16, 2026
d923a13
Fixed DAE to ODE test cases
RLee64 Jan 16, 2026
9dce648
Improved NLA classification
RLee64 Jan 19, 2026
d6047fc
Switching back from dummy to symbol
RLee64 Jan 19, 2026
0504355
Added capillary network test case
RLee64 Jan 19, 2026
fbc1ac0
Fixed test cases (again)
RLee64 Jan 19, 2026
fbd2eac
Fixed computed constant equations being misinterpreted as constants
RLee64 Jan 19, 2026
39e274e
Use is_null() instead of SymEngine::null
RLee64 Jan 19, 2026
84070e9
Fixed issue with states not being tracked as dependencies
RLee64 Jan 20, 2026
08450c9
Original capillary dae to ode test case fix
RLee64 Jan 20, 2026
ec66ac9
Separated functionality for populating uncausalised
RLee64 Jan 23, 2026
2a5e5cf
Equation simplification
RLee64 Jan 23, 2026
349b420
Improved simplification
RLee64 Jan 28, 2026
b957280
Renaming matching and tearing
RLee64 Jan 28, 2026
f593df7
Reassigning local variable on matching
RLee64 Jan 28, 2026
79db406
Stop tracking matched variable as dependency
RLee64 Jan 28, 2026
04e6254
Track known variables as dependencies
RLee64 Jan 28, 2026
ff59bb6
Replace AST tree for all equations
RLee64 Jan 29, 2026
f506593
Extra internal equation considerations
RLee64 Jan 29, 2026
bfac9e0
Simplified dependency building
RLee64 Jan 30, 2026
e9558cd
Fixing external variable support
RLee64 Jan 30, 2026
33cc309
Test case equation sequence rearrangement
RLee64 Jan 30, 2026
c129c35
Bug fix
RLee64 Jan 30, 2026
c58b876
Lower priority of variable-based matching
RLee64 Jan 30, 2026
1f14cb6
Consider initialising externals
RLee64 Jan 30, 2026
83f6f4d
Sunset original check function
RLee64 Jan 30, 2026
fdc0f8d
Update generator test case files
RLee64 Jan 30, 2026
f9cbd32
Fixed error with incorrect population of dependency chain
RLee64 Jan 30, 2026
ca1e9d3
Reduced substitution
RLee64 Jan 30, 2026
cf9a903
Fixed bug with simplification not working
RLee64 Jan 30, 2026
924909c
Test case fixes
RLee64 Feb 4, 2026
d3aeecd
Block dangerous external variable matching
RLee64 Feb 4, 2026
26f6580
Tearing algorithm clean-up
RLee64 Feb 4, 2026
86d4965
Fix CI checks
RLee64 Feb 4, 2026
4ba4937
Tearing algorithm clean-up
RLee64 Feb 4, 2026
b6c42aa
Re-enable test case
RLee64 Feb 5, 2026
5a19b93
Merge branch 'dae-to-ode' of https://github.com/RLee64/libcellml into…
RLee64 Feb 5, 2026
7ad8f98
macOS: support macOS 14 and later.
agarny Apr 14, 2026
4a7d551
Improvements to the overall speed and memory use of libCellML.
agarny Apr 14, 2026
1a5236d
Analyser: can now detect global NLA systems.
agarny Apr 16, 2026
e5eb80c
Merge remote-tracking branch 'rayen/dae-to-ode' into issue1050
agarny Apr 24, 2026
6e53a5b
Merge branch 'main' into issue1368
agarny Apr 27, 2026
617f531
Merge branch 'main' into issue1368.
agarny May 25, 2026
7b3682b
Some cleaning up following the merging in of Rayen's DAE->ODE's work.
agarny Apr 23, 2026
84fa4c1
Removed our original C++20 standard code.
agarny May 25, 2026
3ffd4a8
Analyser: removed the use of some sets.
agarny May 25, 2026
c807f25
Removed the SHARED keyword from `add_library()` in `tests/CMakeLists.…
agarny May 25, 2026
07db850
Merge branch 'issue1368' into issue1050
agarny May 25, 2026
eb5d08a
Analyser: removed the use of some sets.
agarny May 25, 2026
6164f8f
Removed the SHARED keyword from `add_library()` in `tests/CMakeLists.…
agarny May 25, 2026
e3ce274
Merge branch 'issue1368' into issue1050
agarny May 25, 2026
72fbd7e
Formatting.
agarny May 25, 2026
c0cc876
Don't redeclare `rearrangedSEExpression`.
agarny May 25, 2026
c3db9b5
Merge branch 'main' into issue1050
agarny Jun 5, 2026
54059a0
CI: re-enabled memory leaks.
agarny Jun 5, 2026
eeb877e
Tests: account for differences between Windows/Linux and macOS.
agarny Jun 5, 2026
eb41356
Update libCellML's version to 0.7.0.
agarny Jun 5, 2026
e8413ff
Merge branch 'main' into issue1050
agarny Jun 5, 2026
fca33b3
Tests: account for differences between Windows/Linux and macOS.
agarny Jun 5, 2026
a5ffbc7
Python: make sure that SymEngine can be found.
agarny Jun 5, 2026
b8cb6fd
Added AnalyserEquationAst::clone() to our bindings.
agarny Jun 5, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
107 changes: 65 additions & 42 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,29 +21,39 @@ jobs:
- name: 'Windows static - C++'
os: windows-latest
python_bindings: OFF
additional_cmake_options: -DLibXml2_DIR="C:\libxml2\libxml2-2.9.10\CMake" -DZLIB_DIR="C:\zlib\lib\cmake\ZLIB-1.2.12"
additional_cmake_options: -DLibXml2_DIR=C:\libxml2\libxml2-2.9.10\CMake -DZLIB_DIR=C:\zlib\lib\cmake\ZLIB-1.2.12 -DSymEngine_DIR=C:\symengine\debug\CMake
- name: 'Windows shared - C++/Python'
os: windows-latest
python_bindings: ON
additional_cmake_options: -DLibXml2_DIR="C:\libxml2\libxml2-2.9.10\CMake" -DZLIB_DIR="C:\zlib\lib\cmake\ZLIB-1.2.12"
additional_cmake_options: -DLibXml2_DIR=C:\libxml2\libxml2-2.9.10\CMake -DZLIB_DIR=C:\zlib\lib\cmake\ZLIB-1.2.12 -DSymEngine_DIR=C:\symengine\debug\CMake
- name: 'Linux static - C++'
os: ubuntu-latest
python_bindings: OFF
additional_cmake_options: -DCMAKE_PREFIX_PATH=$HOME
- name: 'Linux shared - C++/Python'
os: ubuntu-latest
python_bindings: ON
additional_cmake_options: -DCMAKE_PREFIX_PATH=$HOME
- name: 'macOS static - C++ (Intel)'
os: macos-15-intel
python_bindings: OFF
architecture: Intel
additional_cmake_options: -DCMAKE_PREFIX_PATH=$HOME
- name: 'macOS shared - C++/Python (Intel)'
os: macos-15-intel
python_bindings: ON
architecture: Intel
additional_cmake_options: -DCMAKE_PREFIX_PATH=$HOME
- name: 'macOS static - C++ (ARM)'
os: macos-latest
python_bindings: OFF
architecture: ARM
additional_cmake_options: -DCMAKE_PREFIX_PATH=$HOME
- name: 'macOS shared - C++/Python (ARM)'
os: macos-latest
python_bindings: ON
architecture: ARM
additional_cmake_options: -DCMAKE_PREFIX_PATH=$HOME
steps:
- name: Check out libCellML
uses: actions/checkout@v6
Expand All @@ -61,18 +71,30 @@ jobs:
uses: TheMrMilchmann/setup-msvc-dev@v4
with:
arch: x64
- name: Install libxml2 (Windows only)
- name: Install dependencies (Windows only)
if: ${{ runner.os == 'Windows' }}
run: |
cd C:\
curl -L https://github.com/cellml/gha/releases/download/gha/libxml2-Windows.tar.gz -o libxml2.tar.gz -s
tar -xzf libxml2.tar.gz
- name: Install zlib (Windows only)
if: ${{ runner.os == 'Windows' }}
run: |
cd C:\
curl -L https://github.com/cellml/gha/releases/download/gha/symengine-Windows.tar.gz -o symengine.tar.gz -s
tar -xzf symengine.tar.gz
curl -L https://github.com/cellml/gha/releases/download/gha/zlib-Windows.tar.gz -o zlib.tar.gz -s
tar -xzf zlib.tar.gz
- name: Install dependencies (Linux only)
if: ${{ runner.os == 'Linux' }}
run: |
cd $HOME
wget https://github.com/cellml/gha/releases/download/gha/libxml2-Linux.tar.gz -O - | tar -xz
wget https://github.com/cellml/gha/releases/download/gha/symengine-Linux.tar.gz -O - | tar -xz
wget https://github.com/cellml/gha/releases/download/gha/zlib-Linux.tar.gz -O - | tar -xz
- name: Install dependencies (macOS only)
if: ${{ runner.os == 'macOS' }}
run: |
cd $HOME
wget https://github.com/cellml/gha/releases/download/gha/libxml2-macOS-${{ matrix.architecture }}.tar.gz -O - | tar -xz
wget https://github.com/cellml/gha/releases/download/gha/symengine-macOS-${{ matrix.architecture }}.tar.gz -O - | tar -xz
wget https://github.com/cellml/gha/releases/download/gha/zlib-macOS-${{ matrix.architecture }}.tar.gz -O - | tar -xz
- name: Install SWIG (macOS only and if needed)
if: ${{ runner.os == 'macOS' && matrix.python_bindings == 'ON' }}
run: brew install swig
Expand All @@ -96,17 +118,14 @@ jobs:
uses: lukka/get-cmake@latest
- name: Install Emscripten
run: brew install --overwrite emscripten
- name: Install libxml2
- name: Install dependencies
run: |
cd $HOME
wget https://github.com/cellml/gha/releases/download/gha/libxml2-WASM.tar.gz -O - | tar -xz
- name: Install zlib
run: |
cd $HOME
wget https://github.com/cellml/gha/releases/download/gha/symengine-WASM.tar.gz -O - | tar -xz
wget https://github.com/cellml/gha/releases/download/gha/zlib-WASM.tar.gz -O - | tar -xz
- name: Configure libCellML
run: |
emcmake cmake -G Ninja -S . -B build-wasm -DBUILD_TYPE=Release -DLIBXML2_INCLUDE_DIR=$HOME/libxml2/include/libxml2 -DLIBXML2_LIBRARY=$HOME/libxml2/lib/libxml2.a -DZLIB_INCLUDE_DIR=$HOME/zlib/include -DZLIB_LIBRARY=$HOME/zlib/lib/libz.a
run: emcmake cmake -G Ninja -S . -B build-wasm -DBUILD_TYPE=Release -DCMAKE_PREFIX_PATH=$HOME
- name: Build libCellML
run: cmake --build build-wasm
- name: Unit testing
Expand All @@ -127,15 +146,16 @@ jobs:
sudo apt install clang-format
- name: Install CMake and Ninja
uses: lukka/get-cmake@latest
- name: Configure libCellML
- name: Install dependencies
run: |
mkdir build
cd build
cmake -G Ninja ..
cd $HOME
wget https://github.com/cellml/gha/releases/download/gha/libxml2-Linux.tar.gz -O - | tar -xz
wget https://github.com/cellml/gha/releases/download/gha/symengine-Linux.tar.gz -O - | tar -xz
wget https://github.com/cellml/gha/releases/download/gha/zlib-Linux.tar.gz -O - | tar -xz
- name: Configure libCellML
run: cmake -G Ninja -S . -B build -DCMAKE_PREFIX_PATH=$HOME
- name: Code formatting
run: |
cd build
ninja test_clang_format
run: cmake --build build --target test_clang_format
coverage:
name: Code coverage
runs-on: macos-latest
Expand All @@ -152,19 +172,20 @@ jobs:
run: |
brew install --overwrite llvm
echo 'export PATH="/opt/homebrew/opt/llvm/bin:$PATH"' >> ~/.bash_profile
- name: Configure libCellML
- name: Install dependencies
run: |
mkdir build
cd build
cmake -G Ninja -DBINDINGS_PYTHON=OFF ..
cd $HOME
wget https://github.com/cellml/gha/releases/download/gha/libxml2-macOS-ARM.tar.gz -O - | tar -xz
wget https://github.com/cellml/gha/releases/download/gha/symengine-macOS-ARM.tar.gz -O - | tar -xz
wget https://github.com/cellml/gha/releases/download/gha/zlib-macOS-ARM.tar.gz -O - | tar -xz
- name: Configure libCellML
run: cmake -G Ninja -S . -B build -DBINDINGS_PYTHON=OFF -DCMAKE_PREFIX_PATH=$HOME
- name: Code coverage
run: |
cd build
ninja llvm_coverage
if [ `ninja llvm_coverage | grep TOTAL | sed 's/ /\n/g' | grep "100.00%" | wc -l | sed 's/ //g'` -eq 4 ]; then exit 0; else exit 1; fi
cmake --build build --target llvm_coverage
if [ `cmake --build build --target llvm_coverage | grep TOTAL | sed 's/ /\n/g' | grep "100.00%" | wc -l | sed 's/ //g'` -eq 4 ]; then exit 0; else exit 1; fi
memory_leaks:
name: Memory leaks
if: false # Temporarily disabled.
runs-on: ubuntu-latest
strategy:
fail-fast: false
Expand All @@ -179,15 +200,16 @@ jobs:
run: |
sudo apt update
sudo apt install valgrind
- name: Configure libCellML
- name: Install dependencies
run: |
mkdir build
cd build
cmake -G Ninja -DBINDINGS_PYTHON=OFF ..
cd $HOME
wget https://github.com/cellml/gha/releases/download/gha/libxml2-Linux.tar.gz -O - | tar -xz
wget https://github.com/cellml/gha/releases/download/gha/symengine-Linux.tar.gz -O - | tar -xz
wget https://github.com/cellml/gha/releases/download/gha/zlib-Linux.tar.gz -O - | tar -xz
- name: Configure libCellML
run: cmake -G Ninja -S . -B build -DBINDINGS_PYTHON=OFF -DCMAKE_PREFIX_PATH=$HOME
- name: Memory leaks
run: |
cd build
ninja memcheck
run: cmake --build build --target memcheck
documentation:
name: Documentation
runs-on: ubuntu-latest
Expand All @@ -207,12 +229,13 @@ jobs:
- name: Install Sphinx
run: |
pip3 install sphinx
- name: Configure libCellML
- name: Install dependencies
run: |
mkdir build
cd build
cmake -G Ninja -DBINDINGS_PYTHON=OFF ..
cd $HOME
wget https://github.com/cellml/gha/releases/download/gha/libxml2-Linux.tar.gz -O - | tar -xz
wget https://github.com/cellml/gha/releases/download/gha/symengine-Linux.tar.gz -O - | tar -xz
wget https://github.com/cellml/gha/releases/download/gha/zlib-Linux.tar.gz -O - | tar -xz
- name: Configure libCellML
run: cmake -G Ninja -S . -B build -DBINDINGS_PYTHON=OFF -DCMAKE_PREFIX_PATH=$HOME
- name: Documentation
run: |
cd build
ninja docs
run: cmake --build build --target docs
4 changes: 2 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,13 @@
cmake_minimum_required(VERSION 3.18.0)

if(APPLE)
set(CMAKE_OSX_DEPLOYMENT_TARGET 10.15 CACHE STRING "Minimum OS X deployment version.")
set(CMAKE_OSX_DEPLOYMENT_TARGET 14 CACHE STRING "Minimum OS X deployment version.")
endif()

set(PROJECT_NAME libCellML)
set(PROJECT_URL https://libcellml.org)
set(_PROJECT_VERSION 0.7.0)
set(PROJECT_DEVELOPER_VERSION -rc.1.post)
set(PROJECT_DEVELOPER_VERSION)
project(${PROJECT_NAME} VERSION ${_PROJECT_VERSION} LANGUAGES CXX)

# Set policies that affect the build.
Expand Down
13 changes: 13 additions & 0 deletions cmake/common.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -312,6 +312,19 @@ function(redhat_based _RESULT)
set(${_RESULT} ${_REDHAT_BASED} PARENT_SCOPE)
endfunction()

function(apply_dependency_settings _TARGET)
if(HAVE_ZLIB_TARGET)
target_link_libraries(${_TARGET} PUBLIC zlib)
else()
target_link_libraries(${_TARGET} PUBLIC ${ZLIB_LIBRARIES})
target_include_directories(${_TARGET} PUBLIC ${ZLIB_INCLUDE_DIRS})
endif()

target_include_directories(${_TARGET} SYSTEM PUBLIC ${SYMENGINE_INCLUDE_DIRS}
PRIVATE $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/3rdparty/symengine>)
target_link_libraries(${_TARGET} PUBLIC ${LIBXML2_TARGET} ${SYMENGINE_LIBRARIES} ${ZLIB_TARGET})
endfunction()

function(get_runtime_dlls_from_target target target_property out_var)
set(_result "")
get_target_property(_items ${target} INTERFACE_LINK_LIBRARIES)
Expand Down
13 changes: 13 additions & 0 deletions cmake/environmentchecks.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,19 @@ resolve_zlib(${LIBXML2_TARGET} ZLIB_TARGET)
get_target_property(ZLIB_TARGET_TYPE ${ZLIB_TARGET} TYPE)
get_target_property(LIBXML2_TARGET_TYPE ${LIBXML2_TARGET} TYPE)

# Set the minimum policy version to work around SymEngine's outdated CMake requirements.
if(NOT DEFINED CMAKE_POLICY_VERSION_MINIMUM OR CMAKE_POLICY_VERSION_MINIMUM VERSION_LESS "3.10")
set(CMAKE_POLICY_VERSION_MINIMUM 3.10)
endif()

# Find SymEngine.
find_package(SymEngine REQUIRED CONFIG)
if(TARGET symengine)
set(HAVE_SYMENGINE_TARGET TRUE)
get_target_property(SYMENGINE_TARGET_TYPE symengine TYPE)
message(STATUS "Found SymEngine: ${SYMENGINE_LIBRARIES} (found version \"${SymEngine_VERSION}\").")
endif()

if(BUILDCACHE_EXE OR CLCACHE_EXE OR CCACHE_EXE)
set(COMPILER_CACHE_AVAILABLE TRUE CACHE INTERNAL "Executable required to cache compilations.")
endif()
Expand Down
16 changes: 5 additions & 11 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ set(SOURCE_FILES
${CMAKE_CURRENT_SOURCE_DIR}/analyserequationast.cpp
${CMAKE_CURRENT_SOURCE_DIR}/analyserexternalvariable.cpp
${CMAKE_CURRENT_SOURCE_DIR}/analysermodel.cpp
${CMAKE_CURRENT_SOURCE_DIR}/analysersymengine.cpp
${CMAKE_CURRENT_SOURCE_DIR}/analyservariable.cpp
${CMAKE_CURRENT_SOURCE_DIR}/annotator.cpp
${CMAKE_CURRENT_SOURCE_DIR}/commonutils.cpp
Expand Down Expand Up @@ -194,14 +195,7 @@ target_include_directories(cellml
${CMAKE_CURRENT_BINARY_DIR}
)

if(HAVE_ZLIB_TARGET)
target_link_libraries(cellml PUBLIC zlib)
else()
target_link_libraries(cellml PUBLIC ${ZLIB_LIBRARIES})
target_include_directories(cellml PUBLIC ${ZLIB_INCLUDE_DIRS})
endif()

target_link_libraries(cellml PUBLIC ${LIBXML2_TARGET} ${ZLIB_TARGET})
apply_dependency_settings(cellml)

# Use target compile features to propagate features to consuming projects.
target_compile_features(cellml PUBLIC cxx_std_20)
Expand Down Expand Up @@ -237,7 +231,7 @@ target_include_directories(cellml_debug_utilities
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/api>
)

target_link_libraries(cellml_debug_utilities PUBLIC ${LIBXML2_TARGET})
apply_dependency_settings(cellml_debug_utilities)

set_target_properties(cellml_debug_utilities PROPERTIES
CXX_VISIBILITY_PRESET hidden
Expand Down Expand Up @@ -282,7 +276,7 @@ endfunction()

if(LIBCELLML_COVERAGE)
append_target_property(cellml COMPILE_FLAGS "-fprofile-arcs -ftest-coverage")
append_target_property(cellml LINK_FLAGS "-fprofile-arcs -ftest-coverage")
target_link_options(cellml PUBLIC $<BUILD_INTERFACE:-fprofile-arcs> $<BUILD_INTERFACE:-ftest-coverage>)

# Share some paths with interested parties (tests)
set(GCOV_ANALYSIS_PATH "${CMAKE_CURRENT_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/cellml.dir" PARENT_SCOPE)
Expand All @@ -300,7 +294,7 @@ endif()

if(LIBCELLML_LLVM_COVERAGE)
append_target_property(cellml COMPILE_FLAGS "-fprofile-instr-generate -fcoverage-mapping")
append_target_property(cellml LINK_FLAGS "-fprofile-instr-generate")
target_link_options(cellml PUBLIC $<BUILD_INTERFACE:-fprofile-instr-generate>)
endif()

install(TARGETS cellml EXPORT libcellml-targets
Expand Down
Loading
Loading