-
Notifications
You must be signed in to change notification settings - Fork 105
Installation
The installation steps here work for the newest GHC, and I hope others can improve this installation tutorial, esp. for windows os.
sudo dnf install blas-devel
sudo dnf install lapack-devel
sudo dnf install gsl-devel
cabal install hmatrix-tests
In the shell, after running the above command, hmatrix and hmatrix-gsl are installed.
On windows OS, according to the original installation help, OpenBLAS is recommended. So the first step is to install openblas. In the installation help, it tells to download the compiled openblas from http://www.openblas.net/. However, if you install hmatrix according to that tutorial, hmatrix can be installed, but an error telling that the libopenblas.dll can't be accessed will be shown when you implement some code in GHCi. So you need to compile and install openblas from the source manully. As for compiling openblas, please refer to the OpenBLAS wiki. Since there are more information on the OpenBLAS wiki, I'll give the simple steps that work for compiling openblas and installing hmatrix.
- Install MinGW (GCC) compiler suite, either either 32-bit (http://www.mingw.org/) or 64-bit (http://mingw-w64.sourceforge.net/), and install msys with MinGW. Note: there are some problems if you use mingw-w64 through msys2 to compile
openblas. For details, please see issue 1503. So make sure you install MinGW and msys from http://mingw-w64.sourceforge.net/, which is important. - Download the
openblassource either bygit cloneor by zip-file. - Open
msysterminal, in whichcdto theopenblasfolder, and compile the souce bymakecommand
cd ~/OpenBLAS
make
- Install the library to a certain location.
make PREFIX=/your/installation/path install
- Copy
- the compiled
libopenblas.dll---> C:\Users{yourname}\AppData\Local\Programs\stack\x86_64-windows\msys2-20161025\mingw64\bin, - files in include ---> C:\Users{yourname}\AppData\Local\Programs\stack\x86_64-windows\msys2-20161025\mingw64\include,
- files in lib ---> C:\Users{yourname}\AppData\Local\Programs\stack\x86_64-windows\msys2-20161025\mingw64\lib,
- or any locations that are in the search path.
- Install
hmatrix.
stack install hmatrix --flag hmatrix:openblas
Or you can use cabal to install it.
After that, if the installation succeeds, it will work in GHCi without any errors.