Cholmod is a powerful package for sparse matrix calculation and Scikit-Sparse is a python interface. It is convenient to set up the Cholmod and Scikit-Sparse (CSC) environment in Linux and Mac OS, but it may be troublesome in Windows. Thanks to jlblancoc's package suitesparse-metis-for-windows, I make a modification for the python interface. Here are the instructions.
It takes two steps to set up the CSC environment.
*.h
, *.lib
and *.dll
files of Cholmod. It can be included and linked for C/C++.This repository has been tested on
This repository is not applicable to Python 2 (Anaconda 2) on Windows 10. Because in the Step II, compiling C codes for Python 2 requires VC 9.0 (VS 2008), which can not be installed on Windows 10. The compiler used in the Step I is supposed to be the same as the one used in the Step II.
Because metis package has many errors when compiling, I removed the metis package and modified the CSC_ROOT/CMakeLists.txt
.
CSC_ROOT
. If you require the latest version, just download them and merge them with the target folders.
setup.py
to link the headers and libraries.suitesparse-metis-for-windows-1.3.1/
CSC_ROOT/suitesparse-metis-for-windows-1.3.1
.CSC_ROOT/suitesparse-metis-for-windows-1.3.1/build
.cholmod.lib
.)CSC_ROOT/suitesparse-metis-for-windows-1.3.1/build/install
contains the generated libraries.
*.h
header files are in CSC_ROOT/suitesparse-metis-for-windows-1.3.1/build/install/include/suitesparse
*.lib
libraries are in CSC_ROOT/suitesparse-metis-for-windows-1.3.1/build/install/lib64
and CSC_ROOT/suitesparse-metis-for-windows-1.3.1/build/install/lib64/lapack_blas_windows
*.dll
dynamic libraries are in CSC_ROOT/suitesparse-metis-for-windows-1.3.1/build/install/lib64/lapack_blas_windows
.cd scikit-sparse-0.4.4
.python setup.py build
to compile the package. The setup.py
has been modified to link the headers and libraries.python setup.py install
to copy the executable code into the Anaconda folders.Congratulations! Everything is done! In python command. Type
from sksparse.cholmod import cholesky
If nothing happens, the installation is done! For detailed usage and test, please refer to scikit-sparse-0.4.4/sksparse/test_cholmod.py
.
Give me a star if you like this repository. Feel free to open an issue or start an pull request.