diff --git a/.gitignore b/.gitignore index 1458c96a..24de750f 100644 --- a/.gitignore +++ b/.gitignore @@ -43,3 +43,6 @@ vignettes/*.pdf # My stuff inst/stuff + +# Makevars is generated +src/Makevars \ No newline at end of file diff --git a/docs/404.html b/docs/404.html index e3f50325..a11e1f49 100644 --- a/docs/404.html +++ b/docs/404.html @@ -12,7 +12,7 @@ - + @@ -39,7 +39,7 @@ clarabel - 0.5.1 + 0.9.0 @@ -98,7 +98,7 @@

Page not found (404)

-

Site built with pkgdown 2.0.7.

+

Site built with pkgdown 2.0.9.

diff --git a/docs/articles/clarabel.html b/docs/articles/clarabel.html index b258baa0..379f1a4a 100644 --- a/docs/articles/clarabel.html +++ b/docs/articles/clarabel.html @@ -12,7 +12,7 @@ - + @@ -40,7 +40,7 @@ clarabel - 0.5.1 + 0.9.0 @@ -89,8 +89,8 @@

Clarabel Solver Examples

Introduction

-

The first two examples are from the original Clarabel -documentation and the third is from SCS.

+

The first two examples are from the original Clarabel documentation and the third is +from SCS.

1. Basic Quadratic Program Example @@ -154,8 +154,9 @@

1.3. Solutions <- clarabel(A = A, b = b, q = q, P = P, cones = cones) cat(sprintf("Solution status, description: = (%d, %s)\n", s$status, solver_status_descriptions()[s$status])) -#> Solution status, description: = (2, Solver terminated with a solution.) -cat(sprintf("Solution: (x1, x2) = (%f, %f)\n", s$x[1], s$x[2])) +#> Solution status, description: = (2, Solver terminated with a solution.)

+
+cat(sprintf("Solution: (x1, x2) = (%f, %f)\n", s$x[1], s$x[2]))
 #> Solution: (x1, x2) = (0.428571, 0.214286)
@@ -202,7 +203,7 @@

2.2. Constraints

2.3. Solution

-
+
 P <- Matrix::Matrix(2 * c(0, 0, 0, 1), nrow = 2, ncol = 2, sparse = TRUE)
 P <- as(P, "symmetricMatrix") # P needs to be a symmetric matrix
 q <- c(0, 0)
@@ -212,8 +213,9 @@ 

2.3. Solutions <- clarabel(A = A, b = b, q = q, P = P, cones = cones) cat(sprintf("Solution status, description: = (%d, %s)\n", s$status, solver_status_descriptions()[s$status])) -#> Solution status, description: = (2, Solver terminated with a solution.) -cat(sprintf("Solution (x1, x2) = (%f, %f)\n", s$x[1], s$x[2])) +#> Solution status, description: = (2, Solver terminated with a solution.)

+
+cat(sprintf("Solution (x1, x2) = (%f, %f)\n", s$x[1], s$x[2]))
 #> Solution (x1, x2) = (1.000000, -1.000000)
@@ -269,8 +271,8 @@

3. Semidefinite Cone Programming\(1/\sqrt{2}\) and the upper triangular entries are filled in by copying the values of lower triangular entries. -Explicitly, the inverse operation takes vector \(s \in \mathbb{R}^{k(k+1)/2}\) and produces -the matrix

+Explicitly, the inverse operation takes vector \(s \in +\mathbb{R}^{k(k+1)/2}\) and produces the matrix

\[ \begin{aligned} \text{mat}(s) = \begin{bmatrix} @@ -291,7 +293,7 @@

3. Semidefinite Cone Programming

Below are two functions to implement both \(\text{vec}\) and \(\text{mat}\).

-
+
 #' Return an vectorization of symmetric matrix using the upper triangular part,
 #' still in column order.
 #' @param S a symmetric matrix
@@ -353,13 +355,16 @@ 

3.1. Example\(x \in \mathbb{R}^n\) and -\(S \in \mathbb{R}^{k \times k}\)

+\(S \in +\mathbb{R}^{k \times k}\)

\[ B - \sum_{i=1}^n \mathcal{A}_i x_i = S \succeq 0 \]

where data \(B, \mathcal{A}_1, \ldots, -\mathcal{A}_n \in \mathbb{R}^{k \times k}\) are symmetric. We can -write this in the canonical form over a new variable \(s \in \mathcal{S}_+^k\):

+\mathcal{A}_n \in \mathbb{R}^{k +\times k}\) are symmetric. We can write this in the canonical +form over a new variable \(s \in +\mathcal{S}_+^k\):

\[ \begin{aligned} \begin{align} @@ -371,8 +376,8 @@

3.1. Example\(\text{vec}\) -is linear, where \(b = \text{vec}(B)\) -and

+is linear, where \(b = +\text{vec}(B)\) and

\[ A = \begin{bmatrix} @@ -388,7 +393,7 @@

3.1. Example
+
 q <- c(1, -1, 1) # objective: x_1 - x2 + x_3
 A11 <- matrix(c(-7, -11, -11, 3), nrow = 2)
 A12 <- matrix(c(7, -18, -18, 8), nrow = 2)
@@ -407,22 +412,122 @@ 

3.1. Example) b <- c(vec(B1), vec(B2)) # stack both psd constraints cones <- list(s = c(2, 3)) # cone dimensions -s <- clarabel(A = A, b = b, q = q, cone = cones) +s <- clarabel(A = A, b = b, q = q, cones = cones) cat(sprintf("Solution status, description: = (%d, %s)\n", s$status, solver_status_descriptions()[s$status])) -#> Solution status, description: = (2, Solver terminated with a solution.) -cat(sprintf("Solution (x1, x2, x3) = (%f, %f, %f)\n", s$x[1], s$x[2], s$x[3])) -#> Solution (x1, x2, x3) = (-0.367752, 1.898333, -0.887460)

+#> Solution status, description: = (2, Solver terminated with a solution.)

+
+cat(sprintf("Solution (x1, x2, x3) = (%f, %f, %f)\n", s$x[1], s$x[2], s$x[3]))
+#> Solution (x1, x2, x3) = (-0.367746, 1.898333, -0.887466)
-

4. Control parameters +

4. Cone Specifications +

+

The following cones can be specified in Clarabel.

+ +++++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
ParameterTypeLengthDescriptionDefinition (per parameter element)
zinteger1Number of primal zero cones (dual free cones), which +corresponds to the primal equality constraints\(\{ 0 \}^{z}\)
linteger1Number of linear cones (non-negative cones)\(\{ x \in \mathbb{R}^{l} : +x_i \ge 0, \forall i=1,\dots,l \}\)
qinteger>= 1Vector of second-order cone sizes\(\{ (t,x) \in +\mathbb{R}^{q} : \lVert x\rVert_2 \leq t \}\)
sinteger>= 1Vector of positive semidefinite cone sizesUpper triangular part of the positive semidefinite cone +\(S^s_+\). The elements \(x\) of this cone represent the columnwise +stacking of the upper triangular part of a positive semidefinite matrix +\(X \in S^s_+\), so that \(x \in R^d\) with \(d = s(s+1)/2\) +
epinteger1Number of primal exponential cones\(\{(x, y, z) : y > 0,~~ +ye^{x/y} \le z \}\)
pnumeric>= 1Vector of primal power cone parameters +\(\{(x, y, z) : x^p y^{(1-p)} +\ge \lVert z\rVert,~ (x,y) \ge 0 \}\) with \(p \in (0,1)\) +
gplist>= 1List of named lists of two items, a : the +numeric vector of at least 2 exponent terms, and n : an +integer dimension of generalized power cone parameters +\(\{(x, y) \in R^{len(a)} +\times R^n : \prod\limits_{a_i \in a} x_i^{a_i} \ge \lVert y\rVert_2,~ x +\ge 0 \}\) with \(a_i \in +(0,1)\) and \(\sum a_i = +1\) +
+

Generalized power cone parameters are specified as list of two-item +lists, with component named \(a\) +denoting the exponents and the named component \(n\) denoting the dimension.

+

One can specify cones in any order if strict_cone_order +is set to FALSE in the call to clarabel() but +one has to ensure that parameter types are strictly specified for the +values, e.g. 5L for integers, 0. for reals +etc.

+
+
+

5. Control parameters

Clarabel has a number of parameters that control its behavior, including verbosity, time limits, and tolerances; see help on clarabel_control(). As an example, in the last problem, we can reduce the number of iterations.

-
+
 P <- Matrix::Matrix(2 * c(0, 0, 0, 1), nrow = 2, ncol = 2, sparse = TRUE)
 P <- as(P, "symmetricMatrix") # P needs to be a symmetric matrix
 q <- c(0, 0)
@@ -433,8 +538,9 @@ 

4. Control parameters= list(max_iter = 3)) ## Reduced number of iterations cat(sprintf("Solution status, description: = (%d, %s)\n", s$status, solver_status_descriptions()[s$status])) -#> Solution status, description: = (5, Solver terminated with a solution (reduced accuracy)) -cat(sprintf("Solution (x1, x2) = (%f, %f)\n", s$x[1], s$x[2])) +#> Solution status, description: = (5, Solver terminated with a solution (reduced accuracy))

+
+cat(sprintf("Solution (x1, x2) = (%f, %f)\n", s$x[1], s$x[2]))
 #> Solution (x1, x2) = (1.000000, -0.999998)

Note the different status, which should always be checked in code.

@@ -458,7 +564,7 @@

4. Control parameters

-

Site built with pkgdown 2.0.7.

+

Site built with pkgdown 2.0.9.

diff --git a/docs/articles/index.html b/docs/articles/index.html index 28bc6291..d764454e 100644 --- a/docs/articles/index.html +++ b/docs/articles/index.html @@ -1,5 +1,5 @@ -Articles • clarabelArticles • clarabel @@ -17,7 +17,7 @@ clarabel - 0.5.1 + 0.9.0
@@ -65,7 +65,7 @@

All vignettes

-

Site built with pkgdown 2.0.7.

+

Site built with pkgdown 2.0.9.

diff --git a/docs/authors.html b/docs/authors.html index cadd3396..dbea3b7e 100644 --- a/docs/authors.html +++ b/docs/authors.html @@ -1,5 +1,5 @@ -Authors and Citation • clarabelAuthors and Citation • clarabel @@ -17,7 +17,7 @@ clarabel - 0.5.1 + 0.9.0 @@ -47,7 +47,7 @@
@@ -80,15 +80,49 @@

Citation

-

Goulart P, Chen Y (2021). -“Clarabel: A Library for Optimization and Control.” -https://oxfordcontrol.github.io/ClarabelDocs/stable/. +

Goulart PJ, Chen Y (2024). +“Clarabel: An interior-point solver for conic programs with quadratic objectives.” +doi:10.48550/arXiv.2405.12762, 2405.12762.

-
@Misc{,
-  title = {Clarabel: A Library for Optimization and Control},
-  author = {Paul Goulart and Yuwen Chen},
-  year = {2021},
-  url = {https://oxfordcontrol.github.io/ClarabelDocs/stable/},
+    
@Misc{Clarabel_2024,
+  title = {Clarabel: An interior-point solver for conic programs with quadratic objectives},
+  author = {Paul J. Goulart and Yuwen Chen},
+  year = {2024},
+  eprint = {2405.12762},
+  archiveprefix = {arXiv},
+  doi = {10.48550/arXiv.2405.12762},
+  primaryclass = {math.OC},
+}
+

Garstka M, Cannon M, Goulart P (2020). +“A clique graph based merging strategy for decomposable SDPs.” +In IFAC-PapersOnLine, volume 53 number 2, 7355-7361. +doi:10.1016/j.ifacol.2020.12.1255, 21th IFAC World Congress. +

+
@InProceedings{Garstka_2020,
+  author = {Michael Garstka and Mark Cannon and Paul Goulart},
+  title = {A clique graph based merging strategy for decomposable {SDPs}},
+  booktitle = {IFAC-PapersOnLine},
+  year = {2020},
+  note = {21th IFAC World Congress},
+  number = {2},
+  pages = {7355-7361},
+  volume = {53},
+  doi = {10.1016/j.ifacol.2020.12.1255},
+  issn = {2405-8963},
+  journal = {IFAC-PapersOnLine},
+}
+

Chen Y, Goulart P (2023). +“An Efficient IPM Implementation for A Class of Nonsymmetric Cones.” +doi:10.48550/arXiv.2305.12275, 2305.12275. +

+
@Misc{chen2023efficient,
+  title = {An Efficient IPM Implementation for A Class of Nonsymmetric Cones},
+  author = {Yuwen Chen and Paul Goulart},
+  year = {2023},
+  eprint = {2305.12275},
+  archiveprefix = {arXiv},
+  doi = {10.48550/arXiv.2305.12275},
+  primaryclass = {math.OC},
 }
@@ -102,7 +136,7 @@

Citation

-

Site built with pkgdown 2.0.7.

+

Site built with pkgdown 2.0.9.

diff --git a/docs/index.html b/docs/index.html index 0ccd660d..6cd4db8a 100644 --- a/docs/index.html +++ b/docs/index.html @@ -12,13 +12,13 @@ - + - + Changelog • clarabelChangelog • clarabel @@ -17,7 +17,7 @@ clarabel - 0.5.1 + 0.9.0 @@ -51,7 +51,7 @@

Changelog

- +
diff --git a/docs/pkgdown.yml b/docs/pkgdown.yml index 6d318038..ca659a8d 100644 --- a/docs/pkgdown.yml +++ b/docs/pkgdown.yml @@ -1,7 +1,7 @@ -pandoc: 2.17.1.1 -pkgdown: 2.0.7 +pandoc: '3.2' +pkgdown: 2.0.9 pkgdown_sha: ~ articles: clarabel: clarabel.html -last_built: 2023-06-24T16:30Z +last_built: 2024-06-22T17:35Z diff --git a/docs/reference/clarabel-package.html b/docs/reference/clarabel-package.html index 00aef776..164bf3a5 100644 --- a/docs/reference/clarabel-package.html +++ b/docs/reference/clarabel-package.html @@ -1,5 +1,5 @@ -Interface to Clarabel solver implemented in Rust. — clarabel-package • clarabelInterface to Clarabel solver implemented in Rust. — clarabel-package • clarabel @@ -17,7 +17,7 @@ clarabel - 0.5.1 + 0.9.0 @@ -52,10 +52,16 @@

Interface to Clarabel solver implemented in Rust.

-

Clarabel is a versatile interior point solver for convex programs using a new homogeneous embedding. It solves solves linear programs (LPs), quadratic programs (QPs), second-order cone programs (SOCPs), and problems with exponential and power cone constraints. For quadratic objectives, unlike interior point solvers based on the standard homogeneous self-dual embedding (HSDE) model, Clarabel handles quadratic objective without requiring any epigraphical reformulation of its objective function. It can therefore be significantly faster than other HSDE-based solvers for problems with quadratic objective functions. Infeasible problems are detected using a homogeneous embedding technique. See https://oxfordcontrol.github.io/ClarabelDocs/stable/.

+

Clarabel is a versatile interior point solver for convex programs using a new homogeneous embedding. It solves solves linear programs (LPs), quadratic programs (QPs), second-order cone programs (SOCPs), and problems with exponential and power cone constraints. For quadratic objectives, unlike interior point solvers based on the standard homogeneous self-dual embedding (HSDE) model, Clarabel handles quadratic objective without requiring any epigraphical reformulation of its objective function. It can therefore be significantly faster than other HSDE-based solvers for problems with quadratic objective functions. Infeasible problems are detected using a homogeneous embedding technique. See https://clarabel.org/stable/.

+
+

See also

+ +

Author

Balasubramanian Narasimhan, Paul Goulart, Yuwen Chen

@@ -73,7 +79,7 @@

Author

-

Site built with pkgdown 2.0.7.

+

Site built with pkgdown 2.0.9.

diff --git a/docs/reference/clarabel.html b/docs/reference/clarabel.html index ecd01bb7..33c1e796 100644 --- a/docs/reference/clarabel.html +++ b/docs/reference/clarabel.html @@ -1,5 +1,5 @@ -Interface to 'Clarabel', an interior point conic solver — clarabel • clarabelInterface to 'Clarabel', an interior point conic solver — clarabel • clarabel clarabel - 0.5.1 + 0.9.0 @@ -149,7 +149,7 @@

Clarabel can solve

Cone Parameters

-

The table below shows the cone parameter specifications

ParameterTypeLengthDescription
zinteger\(1\)number of primal zero cones (dual free cones),
which corresponds to the primal equality constraints
linteger\(1\)number of linear cones (non-negative cones)
qinteger\(\geq1\)vector of second-order cone sizes
sinteger\(\geq1\)vector of positive semidefinite cone sizes
epinteger\(1\)number of primal exponential cones
pnumeric\(\geq1\)vector of primal power cone parameters

+

The table below shows the cone parameter specifications. Mathematical definitions are in the vignette.

ParameterTypeLengthDescription
zinteger\(1\)number of primal zero cones (dual free cones),
which corresponds to the primal equality constraints
linteger\(1\)number of linear cones (non-negative cones)
qinteger\(\ge 1\)vector of second-order cone sizes
sinteger\(\ge 1\)vector of positive semidefinite cone sizes
epinteger\(1\)number of primal exponential cones
pnumeric\(\ge 1\)vector of primal power cone parameters
gplist\(\ge 1\)list of named lists of two items, a : a numeric vector of at least 2 exponent terms in the product summing to 1, and n : an integer dimension of generalized power cone parameters

When the parameter strict_cone_order is FALSE, one can specify @@ -159,7 +159,8 @@

Cone Parameterslist(z = 2L, l = 2L, q = 2L, z = 3L, q = 3L), or, list(z1 = 2L, l1 = 2L, q1 = 2L, zb = 3L, qx = 3L), indicating a zero cone of size 2, followed by a linear cone of size 2, followed by a second-order cone of size 2, followed by a zero cone of size 3, and finally a second-order -cone of size 3.

+cone of size 3. Generalized power cones parameters have to specified as named lists, e.g., list(z = 2L, gp1 = list(a = c(0.3, 0.7), n = 3L), gp2 = list(a = c(0.5, 0.5), n = 1L)).

+

Note that when strict_cone_order = FALSE, types of cone parameters such as integers, reals have to be explicit since the parameters are directly passed to the Rust interface with no sanity checks.!

See also

@@ -186,14 +187,17 @@

Examples

#> $obj_val #> [1] 1 #> +#> $obj_val_dual +#> [1] 1 +#> #> $status #> [1] 2 #> #> $solve_time -#> [1] 4.5391e-05 +#> [1] 0.000108822 #> #> $iterations -#> [1] 3 +#> [1] 0 #> #> $r_prim #> [1] 0 @@ -201,6 +205,53 @@

Examples

#> $r_dual #> [1] 0 #> +#> $info +#> $info$μ +#> [1] 1 +#> +#> $info$sigma +#> [1] 1 +#> +#> $info$step_length +#> [1] 0 +#> +#> $info$cost_primal +#> [1] 1 +#> +#> $info$cost_dual +#> [1] 1 +#> +#> $info$res_primal +#> [1] 0 +#> +#> $info$res_dual +#> [1] 0 +#> +#> $info$res_primal_inf +#> [1] 1 +#> +#> $info$res_dual_inf +#> [1] 1.414214 +#> +#> $info$gap_abs +#> [1] 0 +#> +#> $info$gap_rel +#> [1] 0 +#> +#> $info$ktratio +#> [1] 1 +#> +#> $info$solve_time +#> [1] 0.000108822 +#> +#> $info$iterations +#> [1] 0 +#> +#> $info$status +#> [1] 2 +#> +#>
@@ -216,7 +267,7 @@

Examples

-

Site built with pkgdown 2.0.7.

+

Site built with pkgdown 2.0.9.

diff --git a/docs/reference/clarabel_control.html b/docs/reference/clarabel_control.html index 58d19b0c..e2fe59a7 100644 --- a/docs/reference/clarabel_control.html +++ b/docs/reference/clarabel_control.html @@ -1,5 +1,5 @@ -Control parameters with default values and types in parenthesis — clarabel_control • clarabelControl parameters with default values and types in parenthesis — clarabel_control • clarabel @@ -17,7 +17,7 @@ clarabel - 0.5.1 + 0.9.0 @@ -93,7 +93,11 @@

Control parameters with default values and types in parenthesis

iterative_refinement_abstol = 1e-12, iterative_refinement_max_iter = 10L, iterative_refinement_stop_ratio = 5, - presolve_enable = TRUE + presolve_enable = TRUE, + chordal_decomposition_enable = FALSE, + chordal_decomposition_merge_method = c("none", "parent_child", "clique_graph"), + chordal_decomposition_compact = FALSE, + chordal_decomposition_complete_dual = FALSE ) @@ -246,6 +250,22 @@

Arguments

presolve_enable

whether to enable presolvle (TRUE)

+ +
chordal_decomposition_enable
+

whether to enable chordal decomposition for SDPs (FALSE)

+ + +
chordal_decomposition_merge_method
+

chordal decomposition merge method, one of 'none', 'parent_child' or 'clique_graph', for SDPs ('none')

+ + +
chordal_decomposition_compact
+

a boolean flag for SDPs indicating whether to assemble decomposed system in compact form for SDPs (FALSE)

+ + +
chordal_decomposition_complete_dual
+

a boolean flag indicating complete PSD dual variables after decomposition for SDPs

+

Value

@@ -266,7 +286,7 @@

Value

-

Site built with pkgdown 2.0.7.

+

Site built with pkgdown 2.0.9.

diff --git a/docs/reference/index.html b/docs/reference/index.html index e3f4e88e..92e4da2d 100644 --- a/docs/reference/index.html +++ b/docs/reference/index.html @@ -1,5 +1,5 @@ -Function reference • clarabelFunction reference • clarabel @@ -17,7 +17,7 @@ clarabel - 0.5.1 + 0.9.0 @@ -54,10 +54,6 @@

All functions

-

clarabel-package

- -

Interface to Clarabel solver implemented in Rust.

-

clarabel()

Interface to 'Clarabel', an interior point conic solver

@@ -82,7 +78,7 @@

All functions
-

Site built with pkgdown 2.0.7.

+

Site built with pkgdown 2.0.9.

diff --git a/docs/reference/solver_status_descriptions.html b/docs/reference/solver_status_descriptions.html index 97ae90df..e35bdc98 100644 --- a/docs/reference/solver_status_descriptions.html +++ b/docs/reference/solver_status_descriptions.html @@ -1,5 +1,5 @@ -Return the solver status description as a named character vector — solver_status_descriptions • clarabelReturn the solver status description as a named character vector — solver_status_descriptions • clarabel @@ -17,7 +17,7 @@ clarabel - 0.5.1 + 0.9.0 @@ -88,7 +88,7 @@

Examples

-

Site built with pkgdown 2.0.7.

+

Site built with pkgdown 2.0.9.

diff --git a/src/.gitignore b/src/.gitignore index c23c7b36..780abd8e 100644 --- a/src/.gitignore +++ b/src/.gitignore @@ -3,3 +3,4 @@ *.dll target .cargo +Makevars \ No newline at end of file diff --git a/src/Makevars b/src/Makevars deleted file mode 100644 index d1f9ed37..00000000 --- a/src/Makevars +++ /dev/null @@ -1,53 +0,0 @@ -TARGET = -VENDORING = yes -VENDOR_SRC = ./rust/vendor.tar.xz -VENDOR_DIR = ./rust/vendor - -# catch DEBUG envvar, which is passed from pkgbuild::compile_dll() -PROFILE = $(subst x,release,$(subst truex,dev,$(DEBUG)x)) - -TARGET_DIR = $(CURDIR)/rust/target -LIBDIR = $(TARGET_DIR)/release -STATLIB = $(LIBDIR)/libclarabel.a -PKG_LIBS = -L$(LIBDIR) -lclarabel - -CARGOTMP = $(CURDIR)/rust/.cargo -CARGO_BUILD_ARGS = --verbose --lib --manifest-path=./rust/Cargo.toml --target-dir $(TARGET_DIR) - -all: C_clean - -$(SHLIB): $(STATLIB) - -$(STATLIB): - # In some environments, ~/.cargo/bin might not be included in PATH, so we need - # to set it here to ensure cargo can be invoked. It is appended to PATH and - # therefore is only used if cargo is absent from the user's PATH. - export PATH="$(PATH):$(HOME)/.cargo/bin" && \ - if [ "$(TARGET)" != "wasm32-unknown-emscripten" ]; then \ - if [ "$(VENDORING)" = "yes" ]; then \ - mkdir -p $(CARGOTMP); \ - cp ./rust/cargo_vendor_config.toml $(CARGOTMP)/config.toml; \ - $(TAR) --extract --xz -f $(VENDOR_SRC) -C ./rust ; \ - export CARGO_HOME=$(CARGOTMP); \ - export PATH="$(PATH):$(HOME)/.cargo/bin"; \ - cargo build $(CARGO_BUILD_ARGS) --release --offline; \ - else \ - cargo build $(CARGO_BUILD_ARGS); \ - fi \ - else \ - export CC="$(CC)" && \ - export CFLAGS="$(CFLAGS)" && \ - export CARGO_PROFILE_DEV_PANIC="abort" && \ - export CARGO_PROFILE_RELEASE_PANIC="abort" && \ - cargo +nightly build $(CARGO_BUILD_ARGS) -Zbuild-std=panic_abort,std; \ - fi - rm -Rf $(CARGOTMP) - rm -Rf $(VENDOR_DIR) - rm -Rf $(LIBDIR)/build - -C_clean: - rm -Rf $(SHLIB) $(STATLIB) $(OBJECTS) - -clean: - rm -Rf $(SHLIB) $(STATLIB) $(OBJECTS) rust/target - diff --git a/src/Makevars.in b/src/Makevars.in index ee51124e..e23da092 100644 --- a/src/Makevars.in +++ b/src/Makevars.in @@ -9,10 +9,10 @@ PROFILE = $(subst x,release,$(subst truex,dev,$(DEBUG)x)) TARGET_DIR = $(CURDIR)/rust/target LIBDIR = $(TARGET_DIR)/release STATLIB = $(LIBDIR)/libclarabel.a -PKG_LIBS = -L$(LIBDIR) -lclarabel +PKG_LIBS = -L$(LIBDIR) -lclarabel $(LAPACK_LIBS) $(BLAS_LIBS) $(FLIBS) CARGOTMP = $(CURDIR)/rust/.cargo -CARGO_BUILD_ARGS = --verbose --lib --manifest-path=./rust/Cargo.toml --target-dir $(TARGET_DIR) +CARGO_BUILD_ARGS = --jobs 2 --verbose --lib --manifest-path=./rust/Cargo.toml --target-dir $(TARGET_DIR) all: C_clean diff --git a/src/Makevars.win b/src/Makevars.win index 64577a5a..98ca41b1 100644 --- a/src/Makevars.win +++ b/src/Makevars.win @@ -31,7 +31,7 @@ $(STATLIB): export CARGO_HOME="$(CARGOTMP)" && \ export CARGO_TARGET_X86_64_PC_WINDOWS_GNU_LINKER="$(CARGO_LINKER)" && \ export LIBRARY_PATH="$${LIBRARY_PATH};$(LIBDIR)/libgcc_mock" && \ - cargo build --target $(TARGET) --lib --offline --release --manifest-path ./rust/Cargo.toml --target-dir $(TARGET_DIR) + cargo build --jobs 2 --target $(TARGET) --lib --offline --release --manifest-path ./rust/Cargo.toml --target-dir $(TARGET_DIR) rm -Rf $(CARGOTMP) rm -Rf $(VENDOR_DIR) rm -Rf $(LIBDIR)/build