Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
28 changes: 14 additions & 14 deletions .github/workflows/buildThirdPartyLibrary.yml
Original file line number Diff line number Diff line change
Expand Up @@ -63,27 +63,29 @@ jobs:
steps:
- name: Set the timezone to New Zealand
if: ${{ runner.os != 'Linux' }}
uses: szenius/[email protected]
with:
timezoneWindows: 'New Zealand Standard Time'
timezoneMacos: 'Pacific/Auckland'
shell: bash
run: |
case "${RUNNER_OS}" in
Windows) MSYS_NO_PATHCONV=1 tzutil /s "New Zealand Standard Time" ;;
macOS) sudo systemsetup -settimezone Pacific/Auckland ;;
esac
- name: Set up the manylinux container
if: ${{ runner.os == 'Linux' }}
shell: bash
run: |
echo "TZ=Pacific/Auckland" >> "$GITHUB_ENV"
dnf install -y git make openssl-libs perl-core
- name: Check out libOpenCOR
uses: actions/checkout@v4
uses: actions/checkout@v7
- name: Install CMake and Ninja
uses: lukka/get-cmake@latest
- name: Install buildcache
uses: opencor/buildcache-action@v1
uses: opencor/buildcache-action@v3
with:
cache_key: ${{ inputs.third_party_library_name }}-${{ matrix.os }}-${{ matrix.arch }}-${{ matrix.build_type }}
- name: Configure MSVC
if: ${{ runner.os == 'Windows' }}
uses: ilammy/msvc-dev-cmd@v1
uses: TheMrMilchmann/setup-msvc-dev@v4.1.0
with:
arch: ${{ matrix.arch }}
- name: Configure libOpenCOR (for LLVM)
Expand All @@ -98,7 +100,7 @@ jobs:
run: cmake -G Ninja -S . -B build -DBUILD_TYPE=${{ matrix.build_type }} -DONLY_BUILD_THIRD_PARTY_LIBRARIES=ON -DPREBUILT_LIBCELLML=OFF -DPREBUILT_LIBCOMBINE=OFF -DPREBUILT_LIBCURL=OFF -DPREBUILT_LIBNUML=OFF -DPREBUILT_LIBSBML=OFF -DPREBUILT_LIBSEDML=OFF -DPREBUILT_LIBXML2=OFF -DPREBUILT_OPENSSL=OFF -DPREBUILT_SUNDIALS=OFF -DPREBUILT_ZIPPER=OFF -DPREBUILT_ZLIB=OFF
- name: Upload library artifact
if: ${{ !startsWith(github.ref, 'refs/tags/v') }}
uses: actions/upload-artifact@v4
uses: actions/upload-artifact@v7
with:
name: ${{ matrix.name }}
path: ./build/*.tar.gz
Expand All @@ -113,15 +115,13 @@ jobs:
BUILDCACHE_LOG_FILE: ""
steps:
- name: Set the timezone to New Zealand
uses: szenius/[email protected]
with:
timezoneMacos: 'Pacific/Auckland'
run: sudo systemsetup -settimezone Pacific/Auckland
- name: Check out libOpenCOR
uses: actions/checkout@v4
uses: actions/checkout@v7
- name: Install CMake and Ninja
uses: lukka/get-cmake@latest
- name: Install buildcache
uses: opencor/buildcache-action@v1
uses: opencor/buildcache-action@v3
with:
cache_key: webassembly
- name: Install Emscripten
Expand All @@ -136,7 +136,7 @@ jobs:
run: cmake --build build
- name: Upload WebAssembly artifact
if: ${{ !startsWith(github.ref, 'refs/tags/v') }}
uses: actions/upload-artifact@v4
uses: actions/upload-artifact@v7
with:
name: WebAssembly
path: ./build/*.tar.gz
60 changes: 31 additions & 29 deletions .github/workflows/cd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -86,22 +86,24 @@ jobs:
BUILDCACHE_LOG_FILE: ""
steps:
- name: Set the timezone to New Zealand
uses: szenius/[email protected]
with:
timezoneWindows: 'New Zealand Standard Time'
timezoneLinux: 'Pacific/Auckland'
timezoneMacos: 'Pacific/Auckland'
shell: bash
run: |
case "${RUNNER_OS}" in
Windows) MSYS_NO_PATHCONV=1 tzutil /s "New Zealand Standard Time" ;;
Linux) sudo timedatectl set-timezone Pacific/Auckland ;;
macOS) sudo systemsetup -settimezone Pacific/Auckland ;;
esac
- name: Check out libOpenCOR
uses: actions/checkout@v4
uses: actions/checkout@v7
- name: Install CMake and Ninja
uses: lukka/get-cmake@latest
- name: Install buildcache
uses: opencor/buildcache-action@v1
uses: opencor/buildcache-action@v3
with:
cache_key: cd-${{ matrix.os }}-${{ matrix.build_type }}-${{ matrix.shared_libs }}
- name: Configure MSVC
if: ${{ runner.os == 'Windows' }}
uses: ilammy/msvc-dev-cmd@v1
uses: TheMrMilchmann/setup-msvc-dev@v4.1.0
with:
arch: ${{ matrix.arch }}
- name: Install GCC 16
Expand All @@ -124,13 +126,13 @@ jobs:
cpack
- name: Upload libOpenCOR artifacts
if: ${{ !startsWith(github.ref, 'refs/tags/v') }}
uses: actions/upload-artifact@v4
uses: actions/upload-artifact@v7
with:
name: ${{ matrix.name }}
path: ./build/libOpenCOR-*
- name: Release libOpenCOR
if: ${{ startsWith(github.ref, 'refs/tags/v') }}
uses: softprops/action-gh-release@v2
uses: softprops/action-gh-release@v3
with:
files: ./build/libOpenCOR-*
python_wheels:
Expand All @@ -156,21 +158,23 @@ jobs:
os: macos-15
steps:
- name: Set the timezone to New Zealand
uses: szenius/[email protected]
with:
timezoneWindows: 'New Zealand Standard Time'
timezoneLinux: 'Pacific/Auckland'
timezoneMacos: 'Pacific/Auckland'
shell: bash
run: |
case "${RUNNER_OS}" in
Windows) MSYS_NO_PATHCONV=1 tzutil /s "New Zealand Standard Time" ;;
Linux) sudo timedatectl set-timezone Pacific/Auckland ;;
macOS) sudo systemsetup -settimezone Pacific/Auckland ;;
esac
- name: Check out libOpenCOR
uses: actions/checkout@v4
uses: actions/checkout@v7
- name: Free disk space
if: ${{ runner.os == 'Linux' }}
run: |
sudo rm -rf /opt/hostedtoolcache
sudo docker image prune --all --force
- name: Configure MSVC
if: ${{ runner.os == 'Windows' }}
uses: ilammy/msvc-dev-cmd@v1
uses: TheMrMilchmann/setup-msvc-dev@v4.1.0
with:
arch: ${{ matrix.arch }}
- name: Build Python wheels
Expand All @@ -191,13 +195,13 @@ jobs:
# must be kept in sync with the above images (and the version of cibuildwheel that we use).
CIBW_SKIP: '*musllinux*'
- name: Upload Python wheel artifacts
uses: actions/upload-artifact@v4
uses: actions/upload-artifact@v7
with:
name: ${{ matrix.name }}
path: ./wheelhouse/*.whl
- name: Release Python wheels
if: ${{ startsWith(github.ref, 'refs/tags/v') }}
uses: softprops/action-gh-release@v2
uses: softprops/action-gh-release@v3
with:
files: ./wheelhouse/*.whl
python_pypi:
Expand All @@ -208,7 +212,7 @@ jobs:
if: ${{ startsWith(github.ref, 'refs/tags/v') }}
steps:
- name: Download Python wheels
uses: actions/download-artifact@v5
uses: actions/download-artifact@v8
with:
pattern: "*Python wheels*"
path: ./dist
Expand All @@ -226,13 +230,11 @@ jobs:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
steps:
- name: Set the timezone to New Zealand
uses: szenius/[email protected]
with:
timezoneLinux: 'Pacific/Auckland'
run: sudo timedatectl set-timezone Pacific/Auckland
- name: Check out libOpenCOR
uses: actions/checkout@v4
uses: actions/checkout@v7
- name: Install Node.js
uses: actions/setup-node@v4
uses: actions/setup-node@v7
with:
node-version: 'lts/*'
registry-url: 'https://registry.npmjs.org'
Expand All @@ -248,24 +250,24 @@ jobs:
- name: Install CMake and Ninja
uses: lukka/get-cmake@latest
- name: Install buildcache
uses: opencor/buildcache-action@v1
uses: opencor/buildcache-action@v3
with:
cache_key: cd-webassembly
- name: Install Emscripten
uses: mymindstorm/setup-emsdk@v14
uses: emscripten-core/setup-emsdk@v16
- name: Configure libOpenCOR
run: cmake -G Ninja -S . -B build -DBUILD_TYPE=Release -DCODE_ANALYSIS=OFF -DCODE_COVERAGE=OFF -DDOCUMENTATION=OFF -DJAVASCRIPT_BINDINGS=ON -DJAVASCRIPT_UNIT_TESTING=OFF -DMEMORY_CHECKS=OFF -DPYTHON_BINDINGS=OFF -DPYTHON_UNIT_TESTING=OFF -DSHARED_LIBS=OFF -DUNIT_TESTING=OFF
- name: Build WebAssembly
run: cmake --build build
- name: Upload WebAssembly artifact
if: ${{ !startsWith(github.ref, 'refs/tags/v') }}
uses: actions/upload-artifact@v4
uses: actions/upload-artifact@v7
with:
name: WebAssembly
path: ./build/libopencor-*.tgz
- name: Release WebAssembly
if: ${{ startsWith(github.ref, 'refs/tags/v') }}
uses: softprops/action-gh-release@v2
uses: softprops/action-gh-release@v3
with:
files: ./build/libopencor-*.tgz
- name: Compress WebAssembly using Brotli
Expand Down
36 changes: 17 additions & 19 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -334,27 +334,29 @@ jobs:
BUILDCACHE_LOG_FILE: ""
steps:
- name: Set the timezone to New Zealand
uses: szenius/[email protected]
with:
timezoneWindows: 'New Zealand Standard Time'
timezoneLinux: 'Pacific/Auckland'
timezoneMacos: 'Pacific/Auckland'
shell: bash
run: |
case "${RUNNER_OS}" in
Windows) MSYS_NO_PATHCONV=1 tzutil /s "New Zealand Standard Time" ;;
Linux) sudo timedatectl set-timezone Pacific/Auckland ;;
macOS) sudo systemsetup -settimezone Pacific/Auckland ;;
esac
- name: Check out libOpenCOR
uses: actions/checkout@v4
uses: actions/checkout@v7
- name: Install Python
if: ${{ matrix.documentation == 'ON' || matrix.python_support == 'ON' || matrix.target == 'python_check_code_formatting' }}
uses: actions/setup-python@v5
uses: actions/setup-python@v7
with:
python-version: '3.12'
- name: Install CMake and Ninja
uses: lukka/get-cmake@latest
- name: Install buildcache
uses: opencor/buildcache-action@v1
uses: opencor/buildcache-action@v3
with:
cache_key: ci-${{ matrix.os }}-${{ matrix.build_type }}-${{ matrix.code_analysis }}-${{ matrix.code_coverage }}-${{ matrix.documentation }}-${{ matrix.javascript_support }}-${{ matrix.memory_checks }}-${{ matrix.python_support }}-${{ matrix.shared_libs }}-${{ matrix.unit_testing }}-${{ matrix.target }}
- name: Configure MSVC
if: ${{ runner.os == 'Windows' }}
uses: ilammy/msvc-dev-cmd@v1
uses: TheMrMilchmann/setup-msvc-dev@v4.1.0
with:
arch: ${{ matrix.arch }}
- name: Install GCC 16
Expand Down Expand Up @@ -384,7 +386,7 @@ jobs:
sudo mv clang-tidy /usr/local/bin
- name: Install Emscripten
if: ${{ matrix.javascript_support == 'ON' }}
uses: mymindstorm/setup-emsdk@v14
uses: emscripten-core/setup-emsdk@v16
- name: Install Biome
if: ${{ matrix.target == 'javascript_check_code_formatting' }}
run: |
Expand All @@ -393,7 +395,7 @@ jobs:
mv biome /usr/local/bin
- name: Install uv
if: ${{ matrix.documentation == 'ON' || matrix.python_support == 'ON' || matrix.target == 'python_check_code_formatting' }}
uses: astral-sh/setup-uv@v6
uses: astral-sh/setup-uv@v10.2.0
- name: Install Ruff
if: ${{ matrix.target == 'python_check_code_formatting' }}
run: uv pip install --system ruff
Expand Down Expand Up @@ -508,11 +510,9 @@ jobs:
os: ubuntu-24.04-arm
steps:
- name: Set the timezone to New Zealand
uses: szenius/[email protected]
with:
timezoneLinux: 'Pacific/Auckland'
run: sudo timedatectl set-timezone Pacific/Auckland
- name: Check out libOpenCOR
uses: actions/checkout@v4
uses: actions/checkout@v7
- name: Free disk space
run: |
sudo rm -rf /opt/hostedtoolcache
Expand All @@ -530,11 +530,9 @@ jobs:
runs-on: ubuntu-24.04
steps:
- name: Set the timezone to New Zealand
uses: szenius/[email protected]
with:
timezoneLinux: 'Pacific/Auckland'
run: sudo timedatectl set-timezone Pacific/Auckland
- name: Check out libOpenCOR
uses: actions/checkout@v4
uses: actions/checkout@v7
- name: Spell check
uses: codespell-project/actions-codespell@v2
with:
Expand Down
1 change: 0 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,4 @@ You might also be interested in our [users](https://groups.google.com/forum/#!fo

Please [contact us](https://opencor.ws/libopencor/contactUs.html) if you have any questions about libOpenCOR.

[![Ask DeepWiki](https://deepwiki.com/badge.svg)](https://deepwiki.com/opencor/libopencor)
![Alt](https://repobeats.axiom.co/api/embed/e57859796c7c35c163c88238f9bfd3f2aad9649f.svg "Repobeats analytics image")
2 changes: 1 addition & 1 deletion VERSION.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1.20261009.3
1.20261009.4
4 changes: 3 additions & 1 deletion cmake/environmentchecks.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -168,12 +168,14 @@ if(Python_EXECUTABLE)
endif()

# Check some compiler flags.
# Note: we use -fprofile-update=atomic since some of our tests are multithreaded and non-atomic profile counters would
# then get corrupted (e.g., a covered branch could be reported as not covered).

include(CheckCXXCompilerFlag)

set(ORIG_CMAKE_REQUIRED_FLAGS ${CMAKE_REQUIRED_FLAGS})

set(CODE_COVERAGE_COMPILER_FLAGS "-fprofile-instr-generate -fcoverage-mapping")
set(CODE_COVERAGE_COMPILER_FLAGS "-fprofile-instr-generate -fcoverage-mapping -fprofile-update=atomic")
set(CODE_COVERAGE_LINKER_FLAGS "-fprofile-instr-generate")
set(CMAKE_REQUIRED_FLAGS ${CODE_COVERAGE_COMPILER_FLAGS})

Expand Down
12 changes: 8 additions & 4 deletions src/bindings/python/file.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,11 @@ void fileApi(nb::module_ &m)
.value("CombineArchive", libOpenCOR::File::Type::COMBINE_ARCHIVE)
.value("IrretrievableFile", libOpenCOR::File::Type::IRRETRIEVABLE_FILE);

file.def(nb::new_(&libOpenCOR::File::create), "Create a File object.", nb::arg("file_name_or_url"), nb::arg("retrieve_contents") = true)
// Note: we release the GIL when creating a file, as well as when retrieving managed files, since it may take a
// while (e.g., when downloading a remote file) and since it allows other Python threads to create files
// concurrently.

file.def(nb::new_(&libOpenCOR::File::create), "Create a File object.", nb::arg("file_name_or_url"), nb::arg("retrieve_contents") = true, nb::call_guard<nb::gil_scoped_release>())
.def_prop_ro("type", &libOpenCOR::File::type, "Return the type.")
.def_prop_ro("file_name", &libOpenCOR::File::fileName, "Return the file name.")
.def_prop_ro("url", &libOpenCOR::File::url, "Return the URL.")
Expand Down Expand Up @@ -63,9 +67,9 @@ void fileApi(nb::module_ &m)
.def("reset", &libOpenCOR::FileManager::reset, "Reset the file manager.")
.def_prop_ro("has_files", &libOpenCOR::FileManager::hasFiles, "Return whether there are some managed files.")
.def_prop_ro("file_count", &libOpenCOR::FileManager::fileCount, "Return the number of managed files.")
.def_prop_ro("files", &libOpenCOR::FileManager::files, "Return the managed files.")
.def("file", nb::overload_cast<size_t>(&libOpenCOR::FileManager::file, nb::const_), "Return the managed file at the given index.", nb::arg("index"))
.def("file", nb::overload_cast<const std::string &>(&libOpenCOR::FileManager::file, nb::const_), "Return the managed file with the given name or URL.", nb::arg("file_name_or_url"))
.def_prop_ro("files", &libOpenCOR::FileManager::files, "Return the managed files.", nb::call_guard<nb::gil_scoped_release>())
.def("file", nb::overload_cast<size_t>(&libOpenCOR::FileManager::file, nb::const_), "Return the managed file at the given index.", nb::arg("index"), nb::call_guard<nb::gil_scoped_release>())
.def("file", nb::overload_cast<const std::string &>(&libOpenCOR::FileManager::file, nb::const_), "Return the managed file with the given name or URL.", nb::arg("file_name_or_url"), nb::call_guard<nb::gil_scoped_release>())
.def("__len__", &libOpenCOR::FileManager::fileCount)
.def("__iter__", [](const libOpenCOR::FileManager &self) {
return nb::iter(nb::cast(self.files()));
Expand Down
Loading
Loading