MATLAB Answers

SuiteSparse Installation: Cannot open include file: 'regex.h'

58 views (last 30 days)
Dylan Zaluski
Dylan Zaluski on 19 Oct 2018
Commented: Dylan Zaluski on 16 May 2020 at 18:11
I am having issues installing SuiteSparse in Matlab. I am using the 5.3 version, downloaded from, and using the Visual Studio 2017 C++ compiler. When I run SuiteSparse_install, I get the following error:
c:\users\dylan\documents\school\masters\suitesparse\metis-5.1.0\gklib\GKlib.h(68): fatal error C1083: Cannot open include file: 'regex.h': No such file or directory
And UMFPACK, KLU, CHOLMOD, SuiteSparseQR fail to install. Has anyone got any experience with this, or could point me in the right direction for assistance? I need the sparse2 and spqr functions for my code, as I have a very large over-determined, sparse system to solve, and it is giving Matlab's mldivide a rough time. Thanks!


Jorge Barrasa Fano
Jorge Barrasa Fano on 4 Mar 2019
Hi Dylan,
I've the exact same problem. Have you managed to solve it so far?
Dylan Zaluski
Dylan Zaluski on 4 Mar 2019
Hi Jorge,
Yes, I actually did get this resolved some time ago, after talking to Tim Davis (SuiteSparse's creator). The issue lies with the METIS package that is included with SuiteSparse. When you download a copy, before building the package, delete the entire folder named "METIS" (might be a version number along with the name), and then try building it again. That worked like a charm for me.
Jorge Barrasa Fano
Jorge Barrasa Fano on 6 Mar 2019
Hi Dylan,
Thanks for your reply :) I ended up doing the same and it worked.

Sign in to comment.

Answers (1)

Royi Avital
Royi Avital on 25 Apr 2019
Edited: Royi Avital on 16 May 2020 at 6:08
Why would you need SuiteSparse in MATLAB?
I though MATLAB uses SuiteSparse to begin with.


Show 2 older comments
Dylan Zaluski
Dylan Zaluski on 16 May 2020 at 6:17
The SuiteSparse package has several additional features and performance enhancements over the versions implemented in the current MATLAB distribution I believe. The sparse2 function is faster for sparse matrix allocation, and more memory efficient. It includes sparse linear solvers that have been successful for me when MATLAB's included solvers (backslash) have failed. I also use its csltsolve and cslsolve functions for quickly solving lower and upper triangular systems in preconditioned conjugate gradient codes.
Royi Avital
Royi Avital on 16 May 2020 at 9:48
Interesting. Does it have an equivalent of \ which is faster? Does it have iterative solver as well? Does it handle Mat Vec / Mat Mat multiplication as well?
Dylan Zaluski
Dylan Zaluski on 16 May 2020 at 18:11
This really depends on your situation, and the structure of your matrix. It has faster cholesky decomposition functions, as well as a faster QR method. For my own work, I needed the spqr_solve function for solving least-squares problems, and the performance benefit was substantial. You'll just need to try it out for yourself and see if it provides a speedup. It is very easy to install and use. Check the documentation out to find out if it has what you need. And no, it does not provide any improved Mat Vec or Mat Mat product functions. Check out the Intel MKL BLAS library for that.

Sign in to comment.

Sign in to answer this question.

Translated by