[2022/4/16] - For various reasons, I've abandoned using the Windows Linux Subsystem.
[2022/4/24] - The following procedure works for me.
Open powershell in administrative mode.
Click the start menu.
Type "powershell", and then press Ctrl+Shift+Enter.
If done properly, the below User Account Control window opens.
Click Yes to run the Windows Command Prompt as Administrator.
Install WSL2
Enable-WindowsOptionalFeature -Online -FeatureName Microsoft-Windows-Subsystem-Linux
wsl --list --online
wsl --install --distribution Ubuntu-20.04
After installation an Ubuntu terminal screen will appear
provide your username (doesn't have to be the same as your user account
provide a password (twice)
sudo apt update && sudo apt upgrade -y
I would recommend clearing up your user folder because I will overlay a LINUX style directory structure within the user folder. This is known as /home/<username>
[1] "Installation Instructions for WSL 2." Link
[2] "Compiling LAMMPS in Bash on Windows" Link
Install some essential packages, I have not tested a Intel compiler toolchain and given the relatively limited support we can expect for WLS, it makes sense to go with an open source compile chain:
sudo apt install -y build-essential ccache gfortran openmpi-bin libopenmpi-dev libfftw3-dev libjpeg-dev libpng-dev libblas-dev liblapack-dev libhdf5-serial-dev hdf5-tools
mkdir ~/repos
mkdir ~/usr
mkdir ~/usr/local
Many times, you may find it useful and convenient to install software which have been developed and written by others. In this way, you can simply focus more on writing kernel parts of your main algorithms, leaving others to write the rest of numerical subroutines for you. Examples of such routines may vary depending on your needs, but in general, some of the popular choices are numerical linear algebra, I/O, parallel load distributions, mesh generations, etc. This approach not only saves your efforts and time, but also keeps your kernel algorithms computationally efficient and compatible on various platforms as long as the external libraries are continuously supported and maintained.
Typically, these libaries are maintained by a system administrator in an HPC environment. However, in this case we are working within a workstation environment. In addition, these linear algebra routines are often architecture specific and as a result, most environments use the Intel Math Kernel Library (MKL) which isn't fully supported by the Windows Linux System at the time of this writing.
As a result, it is necessary to install the necessary libraries from the reference implementations. While these implementations are possibly slower than the MKL, they also provide an instruction on how to get the necessary software we need using GNU compiler tools.
mkdir ~/packages
mkdir ~/usr
mkdir ~/usr/local
mkdir ~/usr/local/blas
cd ~/usr/local/blas
wget http://www.netlib.org/blas/blas-3.8.0.tgz
tar xvzf blas.3.8.0.tgz
mv blas-3.8.0.tz ~/packages/
cp BLAS-3.8.0 blas-3.8.0
cd blas-3.8.0
make
sudo cp blas_LINUX.a /usr/local/librefblas.a
sudo cp blas_LINUX.a /usr/local/libblas.a
The instructions here are modified from [4]
mkdir ~/usr/local/lapack
cd ~/usr/local/lapack
wget https://github.com/Reference-LAPACK/lapack/archive/v3.9.0.tar.gz
tar xvzf v3.9.0.tar.gz
mv v3.9.0.tar.gz ~/packages/lapack-3.9.0.tar.gz
cd lapack-3.9.0
cp make.inc.example make.inc
Now edit the make.inc file and change the following lines at the bottom of the page:
BLASLIB = libblas.a
# CBLASLIB = liblapack.a
LAPACKLIB = liblapack.a
TMGLIB = libtmglib.a
LAPACKELIB = liblapacke.a
make all
sudo cp ~/usr/local/lapack/lapck-3.9.0/liblapack.a /usr/local/lib/
# this is a necessary timing library
sudo cp ~/usr/local/lapack/lapack-3.9.0/TESTING/MATGEN/libtmglib.a /usr/local/lib/
mkdir ~/usr/local/scalapack
cd ~/usr/local/scalapack
wget http://www.netlib.org/scalapack/scalapack-2.1.0.tgz
tar xvzf scalapack-2.1.0.tgz
cd scalapack-2.1.0
cp makefile.inc.example makefile.inc
make
mv scalapack-2.1.0.tgz ~/packages
cp libscalapack.a /usr/local/lib/
FFTW is an open source fast fourier transform library. Since the Intel Math Kernel libary is not supported in Pythonma
mkdir ~/usr/local/fftw
cd ~/usr/local/fftw
wget http://www.fftw.org/fftw-3.3.8.tar.gz
tar xvzf fftw-3.3.8.tar.gz
mv fftw-3.3.8.tar.gz ~/packages/
cd fftw-3.3.8
./configure --enable-shared
make
make install
[1] Installing FFTW. Link
Open a WLS prompt (e.g. Ubuntu 18.04 LTS)
Go to https://repo.continuum.io/archive to find the list of Anaconda releases, and select the one you want. At the time of writing, the most current version of the Anaconda is Anaconda3-5.2.0-Linux-x86_64.sh, which is the installation script.. The following instructions are validated for Anaconda.
Run the following command to download the installation script: wget https://repo/continuum.io/archive/Anaconda3-5.2.0-Linux-x86_64.sh.
Run the installation script: bash Anaconda3-5.2.0-Linux-x86_64.sh, and follow the prompts, but install Anaconda in /home/<username>/opt/anaconda/Anaconda3.5.2.0
[1] "Steps to Install Anaconda on Windows Ubuntu Terminal." Link