Skip to content

Commit e571396

Browse files
authored
Merge pull request #16 from oxfordcontrol/v0.10.0
v0.10.0 update
2 parents 13219b9 + c042560 commit e571396

File tree

15 files changed

+357
-95
lines changed

15 files changed

+357
-95
lines changed

.Rbuildignore

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@
99
^src/rust/modified_files.csv
1010
^src/rust/vendor.sh
1111
^src/rust/fix_hash.R
12-
^src/rust/Cargo.lock
1312
^src/rust/vendor$
1413
^src/*.o
1514
^src/*.so

.github/workflows/R-CMD-check.yaml

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -28,19 +28,21 @@ jobs:
2828

2929
steps:
3030
- uses: actions/checkout@v4
31+
32+
- name: Set up R
33+
uses: r-lib/actions/setup-r@v2
34+
with:
35+
r-version: ${{ matrix.config.r }}
36+
rtools-version: ${{ matrix.config.rtools-version }}
37+
# TODO: enable RSPM when all the packages are available
38+
use-public-rspm: false
3139

3240
- uses: r-lib/actions/setup-pandoc@v2
3341

3442
- uses: dtolnay/rust-toolchain@master
3543
with:
3644
toolchain: ${{ matrix.config.rust }}
3745

38-
- uses: r-lib/actions/setup-r@v2
39-
with:
40-
r-version: ${{ matrix.config.r }}
41-
rtools-version: ${{ matrix.config.rtools-version }}
42-
use-public-rspm: true
43-
4446
- uses: r-lib/actions/setup-r-dependencies@v2
4547
with:
4648
cache-version: 2

DESCRIPTION

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,15 @@
11
Package: clarabel
22
Type: Package
33
Title: Interior Point Conic Optimization Solver
4-
Version: 0.9.0.1
5-
Authors@R: c(person("Balasubramanian", "Narasimhan", role=c("aut", "cre"),
4+
Version: 0.10.0
5+
Authors@R: c(person("Balasubramanian", "Narasimhan", role = c("aut", "cre"),
66
email = "naras@stanford.edu"),
7-
person("Paul", "Goulart", role=c("aut", "cph")),
8-
person("Yuwen", "Chen", role=c("aut")),
7+
person("Paul", "Goulart", role = c("aut", "cph")),
8+
person("Yuwen", "Chen", role = c("aut")),
9+
person("Hiroaki", "Yutani", role = c("ctb"),
10+
comment = "For vendoring/Makefile hints/R scripts for generating crate authors/licenses"),
11+
person("David", "Zimmermann-Kollenda", role = c("ctb"),
12+
comment = "For configure scripts and tools/msvr.R lifted from rtitoken package"),
913
person("Hiroaki", "Yutani", role = c("ctb"),
1014
comment = "For vendoring/Makefile hints/R scripts for generating crate authors/licenses"),
1115
person(given = "The authors of the dependency Rust crates", role = c("ctb"),
@@ -14,8 +18,7 @@ Description: A versatile interior point solver that solves linear programs (LPs)
1418
License: Apache License (== 2.0)
1519
Encoding: UTF-8
1620
Roxygen: list(markdown = TRUE)
17-
Config/rextendr/version: 0.3.1
18-
RoxygenNote: 7.3.1
21+
RoxygenNote: 7.3.2
1922
URL: https://oxfordcontrol.github.io/clarabel-r/
2023
BugReports: https://github.com/oxfordcontrol/clarabel-r/issues
2124
Suggests:

NEWS.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,12 @@
1+
# clarabel 0.10.0
2+
3+
- Synced up to v0.10.0 of `Clarabel.rs`
4+
- Fixed up to use new `r-src` that detects R being used correctly (thank you, Ivan Krylov!)
5+
6+
# clarabel 0.9.0.1
7+
8+
- Explicit system requirements for Rust and Cargo added.
9+
110
# clarabel 0.9.0
211

312
- Synced up to version 0.9.0 of Clarabel.rs

R/clarabel.R

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -176,6 +176,7 @@ clarabel <- function(A, b, q, P = NULL, cones, control = list(),
176176
#' @param linesearch_backtrack_step linesearch backtracking (`0.8`)
177177
#' @param min_switch_step_length minimum step size allowed for asymmetric cones with PrimalDual scaling (`1e-1`)
178178
#' @param min_terminate_step_length minimum step size allowed for symmetric cones && asymmetric cones with Dual scaling (`1e-4`)
179+
#' @param max_threads maximum solver threads for multithreaded KKT solvers, 0 lets the solver choose for itself (`0L`)
179180
#' @param direct_kkt_solver use a direct linear solver method (required true) (`TRUE`)
180181
#' @param direct_solve_method direct linear solver (`"qdldl"`, `"mkl"` or `"cholmod"`) (`"qdldl"`)
181182
#' @param static_regularization_enable enable KKT static regularization (`TRUE`)
@@ -225,6 +226,9 @@ clarabel_control <- function(
225226
linesearch_backtrack_step = 0.8,
226227
min_switch_step_length = 1e-1,
227228
min_terminate_step_length = 1e-4,
229+
## maximum solver threads for multithreaded KKT solvers
230+
## choosing 0 lets the solver choose for itself
231+
max_threads = 0L,
228232
## Linear solver settings
229233
direct_kkt_solver = TRUE,
230234
direct_solve_method = c("qdldl", "mkl", "cholmod"),
@@ -262,7 +266,7 @@ clarabel_control <- function(
262266
"chordal_decomposition_enable", "chordal_decomposition_compact",
263267
"chordal_decomposition_complete_dual")
264268

265-
int_params <- c("max_iter", "equilibrate_max_iter", "iterative_refinement_max_iter")
269+
int_params <- c("max_iter", "max_threads", "equilibrate_max_iter", "iterative_refinement_max_iter")
266270

267271
string_params <- c("direct_solve_method", "chordal_decomposition_merge_method") # Might need to uncomment character coercion below, if length > 1
268272

configure

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
1+
#!/usr/bin/env sh
2+
: "${R_HOME=`R RHOME`}"
3+
"${R_HOME}/bin/Rscript" tools/msrv.R
4+
15
if [ "$(uname)" = "Emscripten" ]; then
26
TARGET="wasm32-unknown-emscripten"
37
fi
48

5-
sed -e "s/@TARGET@/${TARGET}/" src/Makevars.in > src/Makevars
9+
sed -e "s/@TARGET@/${TARGET}/" -e "s|@R_HOME@|${R_HOME}|" src/Makevars.in > src/Makevars

configure.win

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
#!/usr/bin/env sh
2+
## Report Rust and Cargo versions
3+
"${R_HOME}/bin${R_ARCH_BIN}/Rscript.exe" tools/msrv.R

man/clarabel_control.Rd

Lines changed: 3 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/Makevars.in

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
TARGET = @TARGET@
2+
R_HOME = @R_HOME@
23
VENDORING = yes
34
VENDOR_SRC = ./rust/vendor.tar.xz
45
VENDOR_DIR = ./rust/vendor
@@ -13,8 +14,9 @@ PKG_LIBS = -L$(LIBDIR) -lclarabel $(LAPACK_LIBS) $(BLAS_LIBS) $(FLIBS)
1314

1415
CARGOTMP = $(CURDIR)/rust/.cargo
1516
CARGO_BUILD_ARGS = -j 2 --lib --manifest-path=./rust/Cargo.toml --target-dir $(TARGET_DIR)
17+
RUST_BACKTRACE=1
1618

17-
all: C_clean
19+
all: $(SHLIB)
1820

1921
$(SHLIB): $(STATLIB)
2022

@@ -31,13 +33,15 @@ $(STATLIB):
3133
cp ./rust/cargo_vendor_config.toml $(CARGOTMP)/config.toml; \
3234
$(TAR) --extract --xz -f $(VENDOR_SRC) -C ./rust ; \
3335
export CARGO_HOME=$(CARGOTMP); \
36+
export R_HOME=$(R_HOME); \
3437
export PATH="$(PATH):$(HOME)/.cargo/bin"; \
3538
cargo build $(CARGO_BUILD_ARGS) --release --offline; \
3639
else \
3740
cargo build $(CARGO_BUILD_ARGS); \
3841
fi \
3942
else \
4043
export CC="$(CC)" && \
44+
export R_HOME="$(R_HOME)" && \
4145
export CFLAGS="$(CFLAGS)" && \
4246
export CARGO_PROFILE_DEV_PANIC="abort" && \
4347
export CARGO_PROFILE_RELEASE_PANIC="abort" && \

src/Makevars.win

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,11 +27,9 @@ $(STATLIB):
2727
mkdir -p $(LIBDIR)/libgcc_mock && touch $(LIBDIR)/libgcc_mock/libgcc_eh.a
2828
mkdir -p $(CARGOTMP) && cp ./rust/cargo_vendor_config.toml $(CARGOTMP)/config.toml
2929
$(TAR) --extract --xz -f ./rust/vendor.tar.xz -C ./rust
30-
echo "Rust version:" `rustc --version`
31-
echo "Cargo version:" `cargo --version`
32-
3330
export CARGO_HOME="$(CARGOTMP)" && \
3431
export CARGO_TARGET_X86_64_PC_WINDOWS_GNU_LINKER="$(CARGO_LINKER)" && \
32+
export R_HOME="$(R_HOME)" && \
3533
export LIBRARY_PATH="$${LIBRARY_PATH};$(LIBDIR)/libgcc_mock" && \
3634
cargo build -j 2 --target $(TARGET) --lib --offline --release --manifest-path ./rust/Cargo.toml --target-dir $(TARGET_DIR)
3735
rm -Rf $(CARGOTMP)

0 commit comments

Comments
 (0)