Skip to content
ylp1332Public

About

A Customized CVX Package for MATLAB on Win64 with 5 Internal Solvers: ECOS, SDPT3, Sedumi, Mosek, and Gurobi.

Resources

Stars

1 star

Watchers

0 watching

Forks

Repository files navigation

CVX-W64: A system for disciplined convex programming on win64

Introduction

This repository is a customized version of the official repository for CVX. It is based on the latest release of CVX, that is 2.2.2, which was released on April 24, 2024. It is just for Windows 7/8/10/11 on amd64, because I have only PC with Microsoft Windows, and I am not very familiar with Linux or MacOS.

I have been working with cvx-w64.zip for about 10 years. Since the latest release of CVX does not provide some internal solvers such as ECOS, MOSEK and Gurobi, I have made this repository for me and someone else. In this repository, ECOS was added, MOSEK and Gurobi were updated to 9.3.22 and 9.52, and the associating shims were modified. All of the changes can be seen by comparing this repository with the official repository.

The use of MOSEK requires a license file from Mosek, and academic users can obtain such a key free of charge. The use of Gurobi also requires a license key from Gurobi as well; again, academic users can obtain such a key free of charge.

How to

If you have obtained a license file for MOSEK, copy it to the directory: C:\Users\your-username\mosek\mosek.lic. If the directory mosek does not exist, create it with mkdir.

If you have obtained a license file for Gurobi, copy it to the directory: cvx-w64\gurobi\w64\gurobi.lic. If this file exists, just replace it.

First run cvx_setup.m, you will see like this:

>> cvx_setup

---------------------------------------------------------------------------
CVX: Software for Disciplined Convex Programming       (c)2014 CVX Research
Version 2.2, Build   9 (a0a77590)                  Tue Apr 23 19:28:09 2024
---------------------------------------------------------------------------
Installation info:
    Path: C:\MatlabShared\cvx-w64
    MATLAB version: 9.5 (R2018b)
    OS: Windows 7 amd64 version 6.1
    Java version: 1.8.0_152
Verfying CVX directory contents:
    No missing files.
Preferences: none found; defaults loaded.
---------------------------------------------------------------------------
Setting CVX paths...done.
Saving updated path...done.
Searching for solvers...5 shims found.
5 solvers initialized (* = default):
    ECOS     2.0.10    {cvx}\ecos
    Gurobi   9.52      {cvx}\gurobi\w64
    Mosek    9.3.22    {cvx}\mosek\w64
 *  SDPT3    4.0       {cvx}\sdpt3
    SeDuMi   1.3.8     {cvx}\sedumi
Saving updated preferences...done.
Testing with a simple model...done!
---------------------------------------------------------------------------
To change the default solver, type "cvx_solver <solver_name>".
To save this change for future sessions, type "cvx_save_prefs".
Please consult the users' guide for more information.
---------------------------------------------------------------------------

>> 

Then change the default solver, you will see like this:

>> cvx_solver Mosek
>> cvx_save_prefs
Saving prefs...done.
>> 

Run cvx_setup.m again, you will see like this:

>> cvx_setup

---------------------------------------------------------------------------
CVX: Software for Disciplined Convex Programming       (c)2014 CVX Research
Version 2.2, Build   9 (a0a77590)                  Tue Apr 23 19:28:09 2024
---------------------------------------------------------------------------
Installation info:
    Path: C:\MatlabShared\cvx-w64
    MATLAB version: 9.5 (R2018b)
    OS: Windows 7 amd64 version 6.1
    Java version: 1.8.0_152
Verfying CVX directory contents:
    No missing files.
Preferences: 
    Path: C:\Users\gwtd\AppData\Roaming\MathWorks\MATLAB\cvx_prefs.mat
---------------------------------------------------------------------------
Setting CVX paths...already set!
Searching for solvers...5 shims found.
5 solvers initialized (* = default):
    ECOS     2.0.10    {cvx}\ecos
    Gurobi   9.52      {cvx}\gurobi\w64
 *  Mosek    9.3.22    {cvx}\mosek\w64
    SDPT3    4.0       {cvx}\sdpt3
    SeDuMi   1.3.8     {cvx}\sedumi
Saving updated preferences...done.
Testing with a simple model...done!
---------------------------------------------------------------------------
To change the default solver, type "cvx_solver <solver_name>".
To save this change for future sessions, type "cvx_save_prefs".
Please consult the users' guide for more information.
---------------------------------------------------------------------------

>> 

Credits

Michael Grant and Stephen Boyd


CVX: A system for disciplined convex programming

Click here to download a bundle of this repository, including pre-compiled MEX files.

Important Update

This repository is in the process of becoming the official source for CVX. We will be updating the original site and its download page with links back to this site. When this work is complete, the CVX bundles hosted here will provide pre-compiled Matlab MEX files for Windows, Linux, macOS Intel, and macOS Apple Silicon. Furtherore, open versions of the Mosek and Gurobi solver shims will be available. Please stay tuned, here and on the web site, for further developments.

Introduction

CVX is a Matlab package for convex optimizaton. To learn more about what CVX is and how to use it, please visit our web site, read the users' guide, and browse the example library.

The best way to obtain CVX is to visit the Releases Page of this repository, and download either cvx.tgz or cvx.zip. These archives contain:

  • The full CVX code base
  • Full copies of the SeDuMi and SDPT3 SDPT3 solvers
  • Additional shims for Gurobi, Mosek, and GLPK. The solvers (and any needed licenses) must be be supplied by the user.
  • Pre-compiled MEX files for Windows, macOS, and Linux
  • HTML and PDF versions of the documentation

About this repository

For now, this is a filtered mirror of the main branch of our internal development repository. This internal repository includes code not ready or available for redistribution. Some of that code will was built strictly to support our dual-source approach, and is therefore no longer needed. There remains some additional code there, however, that would likely be valuable to users, and we intend to bring that here over time.

Support

There are four primary mechanisms for obtaining support for CVX:

  • The user guide. PDF and HTML versions of this guide are included in cvx.zip and cvx.tgz bundles. The documentation source is available on the repository as well.

  • The example library. Many user problems can be solved as slight modifications to one of these examples. The example code is also included in the cvx.zip and cvx.tgz bundles, in the examples/ subdirectory, and in the repository.

  • The CVX Forum is a Discourse-based server that is focused completely on CVX usage.

  • The Computational Science Stack Exchange is a great community-driven Q&A site for a variety of computational science topics, including convex optimization. This would be a perfect choice for questions that are not necessarily specific to CVX.

Easily the most important page on the CVX Forum is the FAQ:

Why isn't CVX accepting my model? READ THIS FIRST!

Everyone who attempts to use CVX should read that page! It should save much frustration.

Supporting CVX users is a challenging exercise, because there are multiple categories of issues that occur when using the software; including, but not limited to:

  1. Generic challenges involving convex optimization, especially the challenge of determining whether or not a given model is convex. See the FAQ.
  2. Difficulties caused by the strictness imposed by the disciplined convex programming framwork. Once again, see the FAQ.
  3. Numerical issues caused by model scaling issues, or even bugs or limitations in the underling solver software. The forum can sometimes offer assistance here.
  4. Actual bugs caused by unintended behavior of the software.

Our experience is that the vast majority of user issues fall into one of the first three categories; a small fraction fall into category 4. In other words, most user issues are not bugs.

That does not mean CVX is bug-free! If you have truly eliminated issue categories 1-3 above from contention, including a thorough understanding of the FAQ, you may wish to submit a bug request to this repository's issue tracker.

Unfortunately, urgent attention to bugs cannot be promised, yet, but as the contributor community is cultivated, they will begin to be able to tackle issues and perhaps even offer new features. Furthermore, if we determine an issue is not a bug, it will be closed, often without a response. For this reason we truly commend users to the CVX Forum before considering filing an issue.

The original authors of this package are not available to assist directly. Support emails sent to the authors will go unanswered.

Citing CVX

Are you using CVX in research work to be published? If so, please include explicit mention of our work in your publication. We have provided example language, citation entries, and even BiBTeX citation code on the Citing CVX page of the documentation.

License

Most of the files in this repository are governed by the terms of our GPLv3-based CVX Standard License. Please see the files LICENSE.txt and GPL.txt, included with the distribution, for more details about the license.

The contents of the example library in the examples/ subdirectory are public domain. We do ask that if you use any of this content in your own work, that you acknowledge the source and any specific authors cited therein.

Thank you for your interest in CVX!
Michael Grant and Stephen Boyd

About

A Customized CVX Package for MATLAB on Win64 with 5 Internal Solvers: ECOS, SDPT3, Sedumi, Mosek, and Gurobi.

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages