Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
46 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
a6005dd
CI: temporarily allow CI tests to be run on PRs to the `staging` branch.
agarny Dec 17, 2025
9b686da
CMake: find and use SymEngine.
agarny Dec 15, 2025
192b717
CI: use SymEngine as a dependency.
agarny Dec 17, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
115 changes: 83 additions & 32 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: CI

on:
pull_request:
branches: [ main ]
branches: [ main, staging ]
workflow_dispatch:

env:
Expand All @@ -22,17 +22,19 @@ 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" -DSymEngine_DIR="C:\symengine\CMake" -DZLIB_DIR="C:\zlib\lib\cmake\ZLIB-1.2.12"
- 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" -DSymEngine_DIR="C:\symengine\CMake" -DZLIB_DIR="C:\zlib\lib\cmake\ZLIB-1.2.12"
- 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
Expand Down Expand Up @@ -62,12 +64,44 @@ jobs:
- name: Configure MSVC (Windows only)
if: ${{ runner.os == 'Windows' }}
uses: ilammy/msvc-dev-cmd@v1
- name: Install GMP (Windows only)
if: ${{ runner.os == 'Windows' }}
run: |
cd C:\
curl -L https://github.com/cellml/gha/releases/download/gha/gmp-Windows.tar.gz -o gmp.tar.gz -s
tar -xzf gmp.tar.gz
- name: Install GMP (Linux only)
if: ${{ runner.os == 'Linux' }}
run: |
cd $HOME
wget https://github.com/cellml/gha/releases/download/gha/gmp-Linux.tar.gz -O - | tar -xz
- name: Install GMP (macOS only)
if: ${{ runner.os == 'macOS' }}
run: |
cd $HOME
wget https://github.com/cellml/gha/releases/download/gha/gmp-macOS.tar.gz -O - | tar -xz
- name: Install libxml2 (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 SymEngine (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
- name: Install SymEngine (Linux only)
if: ${{ runner.os == 'Linux' }}
run: |
cd $HOME
wget https://github.com/cellml/gha/releases/download/gha/symengine-Linux.tar.gz -O - | tar -xz
- name: Install SymEngine (macOS only)
if: ${{ runner.os == 'macOS' }}
run: |
brew update
brew install symengine
- name: Install zlib (Windows only)
if: ${{ runner.os == 'Windows' }}
run: |
Expand Down Expand Up @@ -97,17 +131,25 @@ jobs:
uses: cscouto/buildcache-action@v1
- name: Install Emscripten
run: brew install --overwrite emscripten
- name: Install GMP
run: |
cd $HOME
wget https://github.com/cellml/gha/releases/download/gha/gmp-WASM.tar.gz -O - | tar -xz
- name: Install libxml2
run: |
cd $HOME
wget https://github.com/cellml/gha/releases/download/gha/libxml2-WASM.tar.gz -O - | tar -xz
- name: Install SymEngine
run: |
cd $HOME
wget https://github.com/cellml/gha/releases/download/gha/symengine-WASM.tar.gz -O - | tar -xz
- name: Install zlib
run: |
cd $HOME
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
emcmake cmake -G Ninja -S . -B build-wasm -DBUILD_TYPE=Release -DLIBXML2_DIR=$HOME/libxml2/lib/cmake -DSymEngine_DIR=$HOME/symengine/lib/cmake -DZLIB_DIR=$HOME/zlib/lib/cmake
- name: Build libCellML
run: cmake --build build-wasm
- name: Unit testing
Expand All @@ -126,15 +168,18 @@ jobs:
sudo apt install clang-format
- name: Install CMake and Ninja
uses: lukka/get-cmake@latest
- name: Configure libCellML
- name: Install GMP
run: |
mkdir build
cd build
cmake -G Ninja ..
- name: Code formatting
cd $HOME
wget https://github.com/cellml/gha/releases/download/gha/gmp-Linux.tar.gz -O - | tar -xz
- name: Install SymEngine
run: |
cd build
ninja test_clang_format
cd $HOME
wget https://github.com/cellml/gha/releases/download/gha/symengine-Linux.tar.gz -O - | tar -xz
- name: Configure libCellML
run: cmake -G Ninja -S . -B build -DCMAKE_PREFIX_PATH="$HOME"
- name: Code formatting
run: cmake --build build --target test_clang_format
coverage:
name: Code coverage
runs-on: macos-latest
Expand All @@ -151,16 +196,16 @@ jobs:
run: |
brew install --overwrite llvm
echo 'export PATH="/opt/homebrew/opt/llvm/bin:$PATH"' >> ~/.bash_profile
- name: Configure libCellML
- name: Install SymEngine
run: |
mkdir build
cd build
cmake -G Ninja -DBINDINGS_PYTHON=OFF ..
brew update
brew install symengine
- name: Configure libCellML
run: cmake -G Ninja -S . -B build -DBINDINGS_PYTHON=OFF
- 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
runs-on: ubuntu-latest
Expand All @@ -177,15 +222,18 @@ jobs:
run: |
sudo apt update
sudo apt install valgrind
- name: Configure libCellML
- name: Install GMP
run: |
mkdir build
cd build
cmake -G Ninja -DBINDINGS_PYTHON=OFF ..
- name: Memory leaks
cd $HOME
wget https://github.com/cellml/gha/releases/download/gha/gmp-Linux.tar.gz -O - | tar -xz
- name: Install SymEngine
run: |
cd build
ninja memcheck
cd $HOME
wget https://github.com/cellml/gha/releases/download/gha/symengine-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: cmake --build build --target memcheck
documentation:
name: Documentation
runs-on: ubuntu-latest
Expand All @@ -205,12 +253,15 @@ jobs:
- name: Install Sphinx
run: |
pip3 install sphinx
- name: Configure libCellML
- name: Install GMP
run: |
mkdir build
cd build
cmake -G Ninja -DBINDINGS_PYTHON=OFF ..
- name: Documentation
cd $HOME
wget https://github.com/cellml/gha/releases/download/gha/gmp-Linux.tar.gz -O - | tar -xz
- name: Install SymEngine
run: |
cd build
ninja docs
cd $HOME
wget https://github.com/cellml/gha/releases/download/gha/symengine-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: cmake --build build --target docs
9 changes: 9 additions & 0 deletions cmake/environmentchecks.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -183,6 +183,15 @@ if(NOT DEFINED _ZLIB_FIND_REPORTED)
message(STATUS "Found ZLIB: ${ZLIB_LIBRARIES} (found version \"${ZLIB_VERSION_STRING}\").")
endif()

# 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)
message(STATUS "Found SymEngine: ${SYMENGINE_LIBRARIES} (found version \"${SymEngine_VERSION}\").")

if(BUILDCACHE_EXE OR CLCACHE_EXE OR CCACHE_EXE)
set(COMPILER_CACHE_AVAILABLE TRUE CACHE INTERNAL "Executable required to cache compilations.")
endif()
Expand Down
22 changes: 22 additions & 0 deletions src/3rdparty/symengine/symenginebegin.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
/*
Copyright libOpenCOR contributors.
Copy link

Copilot AI Dec 18, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The copyright notice attributes the code to "libOpenCOR contributors" but this is a libCellML repository. The copyright should be "libCellML Contributors" to be consistent with the rest of the codebase, as seen in other files like tests/analyser/analysersymengine.cpp.

Suggested change
Copyright libOpenCOR contributors.
Copyright libCellML Contributors.

Copilot uses AI. Check for mistakes.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/

#ifdef __clang__
# pragma clang diagnostic push
# pragma clang diagnostic ignored "-Wdeprecated-literal-operator"
# pragma clang diagnostic ignored "-Wsign-compare"
# pragma clang diagnostic ignored "-Wunused-parameter"
#endif
19 changes: 19 additions & 0 deletions src/3rdparty/symengine/symengineend.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
/*
Copyright libOpenCOR contributors.
Copy link

Copilot AI Dec 18, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The copyright notice attributes the code to "libOpenCOR contributors" but this is a libCellML repository. The copyright should be "libCellML Contributors" to be consistent with the rest of the codebase.

Copilot uses AI. Check for mistakes.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/

#ifdef __clang__
# pragma clang diagnostic pop
#endif
7 changes: 7 additions & 0 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -203,6 +203,13 @@ endif()

apply_libxml2_settings(cellml)

target_link_libraries(cellml PRIVATE ${SYMENGINE_LIBRARIES})
target_include_directories(cellml
PRIVATE
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/3rdparty/symengine>
${SYMENGINE_INCLUDE_DIRS}
)

# Use target compile features to propagate features to consuming projects.
target_compile_features(cellml PUBLIC cxx_std_17)

Expand Down
Loading
Loading