Prerequisites for installation: Windows 10 (updates after September 2016) and Linux subsystem for windows. Linux subsystem is in fact Ubuntu 14.04 Trusty, so the instructions are similar. One could in fact use ubuntu instructions (via sudo apt-get install python3-numpy or pip3 install numpy), but the performance would be suboptimal. In order to get optimal perfomance, one needs to compile LAPACK libraries and numpy/scipy. Two ways are possible: manual installation and package manager (spack).
This way of installation has not been tested, but should be easier to do. Since we don't need binaries and ubuntu trusty is old, one needs a source package manager. One possible choice is spack - it gives a user installed packages complimentary to the system package manager. The steps are
- Get spack (https://github.com/LLNL/spack)
- git clone https://github.com/llnl/spack.git
- add this to .bash_profile
export SPACK_ROOT=${HOME}/spack
. $SPACK_ROOT/share/spack/setup-env.sh
- reload shell
spack install openblas
spack install [email protected] py-numpy py-scipy
-
(Optional : get mumps and scotch)
spack install scotch ~mpi spack install mumps +scotch ~mpi ~ptscotch
-
Get kwant:
- git clone https://git.kwant-project.org/kwant
- cd kwant
- edit build.conf
[lapack]
libraries = openblas gfortran
library_dirs = OPENBLAS_DIR/lib
extra_link_args = -Wl,-rpath=OPENBLAS_DIR/lib
[mumps]
libraries = zmumps mumps_common mpiseq pord scotchmetis esmumps scotch scotcherr scotcherrexit metis gfortran
library_dirs = MUMPS_DIR/lib SCOTCH_DIR/lib/ METIS_DIR/lib
include_dirs = MUMPS_DIR/include SCOTCH_DIR/include
extra_link_args = -Wl,-rpath=SCOTCH_DIR/lib
- the paths for openblas, mumps and scotch need to be looked up with
spack find -p mumps
(same for scotch, openblas and metis & scalapack if installed) - spack load [email protected]
- python3.5 setup.py build
- python3.5 setup.py install
Steps:
- Install python3.5 : (https://www.reddit.com/r/IPython/comments/3lf81w/using_python35_in_ubuntu_trusty/):
- sudo add-apt-repository ppa:fkrull/deadsnakes
- sudo apt-get update
- sudo apt-get install python3.5 python3.5-dev libpython3.5-dev
- Install pip (https://pip.pypa.io/en/stable/installing/):
- Download and sudo run https://bootstrap.pypa.io/get-pip.py
- Install openblas:
- git clone https://github.com/xianyi/OpenBLAS.git
- cd OpenBlas
- make
- sudo make install (this will install OpenBlas to /opt/openblas)
- Install numpy/scipy:
- sudo apt-get install libfftw3-dev libumfpack5.7.1 libamd2.3.1 (the versions might be different)
- Download .tar.gz archives from http://www.scipy.org/scipylib/download.html
- untar them (in my case these are numpy-1.11.2 and scipy-0.18.1 dirs)
- numpy:
- cd numpy-1.11.2
- edit site.cfg (openblas might be OpenBLAS):
# numpy site.cfg [amd] amd_libs = amd [umfpack] umfpack_libs = umfpack [fftw] libraries = fftw3 [default] include_dirs = /opt/openblas/include library_dirs = /opt/openblas/lib [openblas] openblas_libs = openblas library_dirs = /opt/openblas/lib [lapack] lapack_libs = openblas library_dirs = /opt/openblas/lib
- python3.5 setup.py build
- sudo python3.5 setup.py install
- scipy: very similar
- cd scipy-0.18.1
- copy site.cfg from numpy
- python3.5 setup.py build
- sudo python3.5 setup.pu install
- At this moment one can install kwant without mumps:
- git clone https://git.kwant-project.org/kwant
- cd kwant
- edit build.conf
[lapack]
libraries = openblas gfortran
library_dirs = /opt/openblas/lib
extra_link_args = -Wl,-rpath=/opt/openblas/lib
- python3.5 setup.py build
- sudo python3.5 setup.py install
- For kwant installation with mumps - look the last step of spack installation.
@aeantipov I know this page is a little old... do you have direct experience using Spack with WSL? Do you know if it makes a difference on WSL-1 vs. WSL-2? Thanks!