| Solver | R Package | LP | QP | SOCP | SDP | EXP | MIP |
|---|---|---|---|---|---|---|---|
| CLARABEL | clarabel |
✓ | ✓ | ✓ | ✓ | ✓ | |
| SCS | scs |
✓ | ✓ | ✓ | ✓ | ✓ | |
| MOSEK | Rmosek |
✓ | ✓ | ✓ | ✓ | ✓ | ✓ |
| ECOS | ECOSolveR |
✓ | ✓ | ✓ | |||
| ECOS_BB | ECOSolveR |
✓ | ✓ | ✓ | ✓ | ||
| GUROBI | gurobi |
✓ | ✓ | ✓ | ✓ | ||
| GLPK | Rglpk |
✓ | |||||
| GLPK_MI | Rglpk |
✓ | ✓ | ||||
| HIGHS | highs |
✓ | ✓ | ✓ | |||
| CVXOPT | cccp |
✓ | ✓ | ||||
| OSQP | osqp |
✓ | ✓ | ||||
| CPLEX | Rcplex |
✓ | ✓ | ✓ | |||
| PIQP | piqp |
✓ | ✓ | ||||
| SCIP | scip |
✓ | ✓ | ✓ | |||
| XPRESS | xpress |
✓ | ✓ | ✓ | ✓ |
Using Other Solvers
Introduction
CVXR supports 15 conic and quadratic-program solvers, including several open-source solvers and optional commercial ones, plus two nonlinear-programming (NLP) solvers for disciplined nonlinear programs.
Open Source Solvers (on CRAN)
- Clarabel, a versatile conic solver written in Rust (default solver).
- SCS, a conic solver using operator splitting, effective for large-scale problems.
- OSQP, for quadratic and linear programs.
- HiGHS, for linear, quadratic, and mixed-integer programs.
- ECOS / ECOS_BB, an interior-point solver for second-order cone programs (ECOS_BB adds mixed-integer support).
- GLPK / GLPK_MI, for linear programs and mixed-integer linear programs.
- CVXOPT, for linear and second-order cone programs.
- PIQP, a proximal interior-point solver for quadratic programs.
- SCIP, for LP, mixed-integer LP, and (mixed-integer) second-order cone programs. Free for academic and non-commercial use; installed from r-universe.
Commercial Solvers
- MOSEK, supporting LP, QP, SOCP, SDP, and exponential/power cone programs. Free academic licenses available.
- Gurobi, supporting LP, QP, SOCP, and mixed-integer programs. Free academic licenses available.
- CPLEX, supporting LP, QP, SOCP, and mixed-integer programs.
- FICO Xpress, supporting LP, QP, SOCP, and mixed-integer programs.
Nonlinear (NLP) Solvers
For smooth nonlinear programs — see the DNLP Tutorial, solved with psolve(prob, nlp = TRUE) — CVXR supports two open-source NLP solvers, each via an optional R package in Enhances (not installed by default; CVXR checks for them at solve time and errors informatively if one is missing):
- Uno (the
Unopackage), Unifying Nonlinear Optimization. On CRAN and self-contained (bundles its own MUMPS/HiGHS), so it is the practical default for R users; it also recoversdual_value(). - IPOPT (the
ipoptpackage), an interior-point solver. Not on CRAN owing to licensing, so installed only by determined users; when present,nlp = TRUEprefers it (matching CVXPY).
Solver Capabilities
The table below shows each solver, its R package dependency, and the problem classes it supports.
Installing Commercial Solvers
MOSEK
MOSEK provides an academic version that is free of charge: one can obtain the free academic license after registering. Once the license for the product has been activated, the Rmosek documentation provides all the details for installation. A quick check to ensure things are working is to run the example:
library(Rmosek)
example(mosek)Gurobi
Gurobi offers free academic licenses. After installing Gurobi and the gurobi R package (bundled with the Gurobi installation), verify with:
library(gurobi)
model <- list(A = matrix(c(1, 1), nrow = 1),
obj = c(1, 1), sense = "<=", rhs = 1)
gurobi(model)CPLEX
IBM CPLEX is available through IBM’s academic initiative. Install the Rcplex package from CRAN after installing the CPLEX library.
Once a commercial solver is installed, you can use it by passing solver = "MOSEK", solver = "GUROBI", or solver = "CPLEX" to psolve().
Session Info
R version 4.6.0 (2026-04-24)
Platform: aarch64-apple-darwin23
Running under: macOS Tahoe 26.5.1
Matrix products: default
BLAS: /Library/Frameworks/R.framework/Versions/4.6/Resources/lib/libRblas.0.dylib
LAPACK: /Library/Frameworks/R.framework/Versions/4.6/Resources/lib/libRlapack.dylib; LAPACK version 3.12.1
locale:
[1] en_US.UTF-8/en_US.UTF-8/en_US.UTF-8/C/en_US.UTF-8/en_US.UTF-8
time zone: America/Los_Angeles
tzcode source: internal
attached base packages:
[1] stats graphics grDevices utils datasets methods base
other attached packages:
[1] kableExtra_1.4.0 CVXR_1.9.1
loaded via a namespace (and not attached):
[1] Matrix_1.7-5 jsonlite_2.0.0 compiler_4.6.0 highs_1.12.0-3
[5] Rcpp_1.1.1-1.1 xml2_1.5.2 stringr_1.6.0 dichromat_2.0-0.1
[9] systemfonts_1.3.2 scales_1.4.0 textshaping_1.0.5 yaml_2.3.12
[13] fastmap_1.2.0 clarabel_0.11.2 here_1.0.2 lattice_0.22-9
[17] R6_2.6.1 knitr_1.51 htmlwidgets_1.6.4 backports_1.5.1
[21] tibble_3.3.1 checkmate_2.3.4 rprojroot_2.1.1 osqp_1.0.0
[25] svglite_2.2.2 pillar_1.11.1 RColorBrewer_1.1-3 rlang_1.2.0
[29] stringi_1.8.7 xfun_0.57 S7_0.2.2 otel_0.2.0
[33] viridisLite_0.4.3 cli_3.6.6 magrittr_2.0.5 digest_0.6.39
[37] grid_4.6.0 rstudioapi_0.18.0 gmp_0.7-5.1 lifecycle_1.0.5
[41] vctrs_0.7.3 scs_3.2.7 evaluate_1.0.5 glue_1.8.1
[45] farver_2.1.2 rmarkdown_2.31 pkgconfig_2.0.3 tools_4.6.0
[49] htmltools_0.5.9