Using Other Solvers

Author

Anqi Fu and Balasubramanian Narasimhan

Introduction

CVXR supports 13 solvers, including several bundled open source solvers and optional commercial ones.

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.

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, and mixed-integer programs.

Solver Capabilities

The table below shows each solver, its R package dependency, and the problem classes it supports.

Solver Capabilities
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

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.5.2 (2025-10-31)
Platform: aarch64-apple-darwin20
Running under: macOS Tahoe 26.3

Matrix products: default
BLAS:   /Library/Frameworks/R.framework/Versions/4.5-arm64/Resources/lib/libRblas.0.dylib 
LAPACK: /Library/Frameworks/R.framework/Versions/4.5-arm64/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.8.1      

loaded via a namespace (and not attached):
 [1] gmp_0.7-5.1        clarabel_0.11.2    xml2_1.5.2         slam_0.1-55       
 [5] stringi_1.8.7      lattice_0.22-9     digest_0.6.39      magrittr_2.0.4    
 [9] evaluate_1.0.5     grid_4.5.2         RColorBrewer_1.1-3 fastmap_1.2.0     
[13] jsonlite_2.0.0     Matrix_1.7-4       ECOSolveR_0.6.1    backports_1.5.0   
[17] scs_3.2.7          Rmosek_11.1.1      viridisLite_0.4.3  scales_1.4.0      
[21] codetools_0.2-20   textshaping_1.0.4  cli_3.6.5          rlang_1.1.7       
[25] Rglpk_0.6-5.1      yaml_2.3.12        otel_0.2.0         tools_4.5.2       
[29] osqp_1.0.0         Rcplex_0.3-8       checkmate_2.3.4    gurobi_13.0-1     
[33] vctrs_0.7.1        R6_2.6.1           lifecycle_1.0.5    stringr_1.6.0     
[37] htmlwidgets_1.6.4  pkgconfig_2.0.3    cccp_0.3-3         pillar_1.11.1     
[41] glue_1.8.0         Rcpp_1.1.1         systemfonts_1.3.1  xfun_0.56         
[45] tibble_3.3.1       rstudioapi_0.18.0  knitr_1.51         dichromat_2.0-0.1 
[49] highs_1.12.0-3     farver_2.1.2       htmltools_0.5.9    rmarkdown_2.30    
[53] svglite_2.2.2      piqp_0.6.2         compiler_4.5.2     S7_0.2.1          

References