From de33cb1e68d9e3af4b74254b331499585af21d41 Mon Sep 17 00:00:00 2001 From: Brady Planden Date: Tue, 26 Aug 2025 18:17:53 +0100 Subject: [PATCH 1/4] infra: downgrade faer 0.22.6 -> 0.21.9, add x86 macos runner --- .github/workflows/rust.yml | 1 + Cargo.toml | 17 +++++------------ diffsol/Cargo.toml | 10 ++++++---- 3 files changed, 12 insertions(+), 16 deletions(-) diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml index 132a90d2..243b6da8 100644 --- a/.github/workflows/rust.yml +++ b/.github/workflows/rust.yml @@ -48,6 +48,7 @@ jobs: os: - ubuntu-latest - macos-latest + - macos-13 - windows-latest include: - toolchain: stable diff --git a/Cargo.toml b/Cargo.toml index f34d8694..25c495f6 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,14 +1,7 @@ [workspace] -members = [ - "diffsol", - "examples/*", -] -default-members = [ - "diffsol", -] -exclude = [ - "book", -] +members = ["diffsol", "examples/*"] +default-members = ["diffsol"] +exclude = ["book"] resolver = "2" [workspace.package] @@ -20,7 +13,7 @@ repository = "https://github.com/martinjrobins/diffsol" [workspace.dependencies] nalgebra = "0.33.2" -faer = "0.22.6" +faer = "0.21.9" cudarc = { version = "0.16.4", default-features = false } plotly = { version = "0.12.1" } @@ -32,4 +25,4 @@ ort-sys = { version = "=2.0.0-rc.9", default-features = false } [profile.profiling] inherits = "release" -debug = true \ No newline at end of file +debug = true diff --git a/diffsol/Cargo.toml b/diffsol/Cargo.toml index fcb6e669..405ba4d1 100644 --- a/diffsol/Cargo.toml +++ b/diffsol/Cargo.toml @@ -32,13 +32,16 @@ faer = { workspace = true } nalgebra-sparse = { version = "0.10", features = ["io"] } num-traits = "0.2.17" serde = { version = "1.0.219", features = ["derive"] } -diffsl = { package = "diffsl", version = "0.5.4", optional = true, features = ["rayon"] } +diffsl = { package = "diffsl", version = "0.5.4", optional = true, features = [ + "rayon", +] } petgraph = "0.8.1" suitesparse_sys = { version = "0.1.3", optional = true } thiserror = "2.0.12" -faer-traits = "0.22.1" +faer-traits = "0.21.5" cudarc = { workspace = true, optional = true, default-features = false, features = [ - "cuda-version-from-build-system", "cusolver", + "cuda-version-from-build-system", + "cusolver", "dynamic-linking", "std", "cublas", @@ -64,4 +67,3 @@ harness = false [package.metadata.docs.rs] features = ["diffsl-llvm15", "diffsl-cranelift"] - From cd715e4313267417bf91e1d51139140c9dddbc36 Mon Sep 17 00:00:00 2001 From: bradyplanden Date: Sat, 6 Sep 2025 10:50:54 +0100 Subject: [PATCH 2/4] infra: test LLVM install via homebrew --- .github/workflows/rust.yml | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml index 243b6da8..a7c22319 100644 --- a/.github/workflows/rust.yml +++ b/.github/workflows/rust.yml @@ -12,6 +12,7 @@ env: RUSTFLAGS: -D warnings -A unused-imports RUSTDOCFLAGS: -D warnings RUST_BACKTRACE: full + LLVM_VERSION: "17" jobs: rustfmt: @@ -112,9 +113,14 @@ jobs: run: rustc -Vv - name: Install LLVM and Clang uses: KyleMayes/install-llvm-action@v2 - if : (matrix.os == 'ubuntu-latest' || matrix.os == 'macos-13' || matrix.os == 'macos-latest') && matrix.book == false + if : (matrix.os == 'ubuntu-latest' || matrix.os == 'macos-latest') && matrix.book == false with: - version: "17.0" + version: ${{ env.LLVM_VERSION }} + - name: Install LLVM for macOS Intel (Homebrew) + if: matrix.os == 'macos-13' && matrix.book == false + run: | + brew install llvm@${{ env.LLVM_VERSION }} + echo /usr/local/opt/llvm@${{ env.LLVM_VERSION }}/bin >> $GITHUB_PATH - name: Set features variable and install dependencies (Ubuntu) if: matrix.os == 'ubuntu-latest' && matrix.book == false run: | From 91235806380165d47c4e1445b14c0c31648b4ed3 Mon Sep 17 00:00:00 2001 From: Brady Planden Date: Thu, 6 Nov 2025 18:07:24 +0000 Subject: [PATCH 3/4] infra: increment to macos-15 --- .github/workflows/rust.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml index a7c22319..a0471c0e 100644 --- a/.github/workflows/rust.yml +++ b/.github/workflows/rust.yml @@ -49,7 +49,7 @@ jobs: os: - ubuntu-latest - macos-latest - - macos-13 + - macos-15-intel - windows-latest include: - toolchain: stable @@ -117,7 +117,7 @@ jobs: with: version: ${{ env.LLVM_VERSION }} - name: Install LLVM for macOS Intel (Homebrew) - if: matrix.os == 'macos-13' && matrix.book == false + if: matrix.os == 'macos-15-intel' && matrix.book == false run: | brew install llvm@${{ env.LLVM_VERSION }} echo /usr/local/opt/llvm@${{ env.LLVM_VERSION }}/bin >> $GITHUB_PATH @@ -139,7 +139,7 @@ jobs: if: matrix.coverage == true run: cargo install cargo-tarpaulin - name: Set features variable and install dependencies (macOS) - if: matrix.os == 'macos-13' || matrix.os == 'macos-latest' + if: matrix.os == 'macos-15-intel' || matrix.os == 'macos-latest' run: | echo "ADDITIONAL_FEATURES_FLAGS=--features diffsl-llvm17 --features diffsl-cranelift" >> $GITHUB_ENV - name: Set features variable and install dependencies (Windows) From ec9f19703a7384b6c12134d0377300304e2bf5c8 Mon Sep 17 00:00:00 2001 From: Brady Planden Date: Mon, 10 Nov 2025 19:55:20 +0000 Subject: [PATCH 4/4] infra: skip neural-ode weather prediction --- .github/workflows/rust.yml | 5 ++++- examples/neural-ode-weather-prediction/Cargo.toml | 12 ++++++++++-- 2 files changed, 14 insertions(+), 3 deletions(-) diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml index a0471c0e..d62b35b2 100644 --- a/.github/workflows/rust.yml +++ b/.github/workflows/rust.yml @@ -149,8 +149,11 @@ jobs: - name: Run tests - default features if: matrix.tests == true run: cargo test --verbose + - name: Run tests - all features (macOS Intel) + if: matrix.tests == true && matrix.os == 'macos-15-intel' + run: cargo test --verbose ${{ env.ADDITIONAL_FEATURES_FLAGS || '' }} --workspace --exclude neural-ode-weather-prediction - name: Run tests - all features - if: matrix.tests == true + if: matrix.tests == true && matrix.os != 'macos-15-intel' run: cargo test --verbose ${{ env.ADDITIONAL_FEATURES_FLAGS || '' }} --workspace - name: Clippy - all features if: matrix.clippy == true diff --git a/examples/neural-ode-weather-prediction/Cargo.toml b/examples/neural-ode-weather-prediction/Cargo.toml index 7facf132..166d19c6 100644 --- a/examples/neural-ode-weather-prediction/Cargo.toml +++ b/examples/neural-ode-weather-prediction/Cargo.toml @@ -4,12 +4,20 @@ version = "0.1.0" edition.workspace = true publish = false +[features] +default = [] +onnx = ["dep:ort", "dep:ort-sys"] + +[[bin]] +name = "neural-ode-weather-prediction" +required-features = ["onnx"] + [dependencies] diffsol = { path = "../../diffsol" } nalgebra = { workspace = true } plotly = { workspace = true } -ort = { workspace = true } -ort-sys = { workspace = true } +ort = { workspace = true, optional = true } +ort-sys = { workspace = true, optional = true } ndarray = "0.16.1" csv = "1.3.1" rand = "0.9.0" \ No newline at end of file