When your computational workflow environment is an HPC environment, the differences between the Windows OS and the UNIX OS can make the context switching between the two environments somewhat difficult. I used to use virtualization technology on Windows OS, which was frustrating to the point where I would just do development and work on a shell account. Eventually, I got a Apple Mac for OSX and the relative indifference between the two environments.
[2022/10/18 - I currently need a Linux environment at APL, so I developed these notes]
You will want to follow the instructions for WSL for x86. You will also when prompted want the Ubuntu LTS (Long-Term Support)
https://learn.microsoft.com/en-us/windows/wsl/install-manual
The first thing you will want to do is update the installation.
$ sudo apt update
Open up a powershell prompt with administrative privileges.
Windows -> run -> "powershell" -> C
wsl --install -d Ubuntu and follow the prompt
You might have some issues:
No networking. https://visualgdb.com/documentation/wsl2/
On powershell
New-NetFirewallRule -DisplayName "WSL" -Direction Inbound -InterfaceAlias "vEthernet (WSL)" -Action Allow
On Ubuntu, create the /etc/wsl.conf file
cd /etc
echo "[network]" | sudo tee wsl.conf
echo "generateResolvConf = false" | sudo tee -a wsl.conf
On powershell, reboot WSL
wsl --terminate Ubuntu
On Ubuntu, edit the /etc/resolv.conf file
sudo vi /etc/resolv.conf
remove existing nameservers (this points to the wrong nameserver)
add new nameservers (e.g. for google's)
nameserver 8.8.8.8
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
Get the download link you need (right click, copy link) from https://repo.anaconda.com/archive/
[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
So that your scripts look like mine, it will be easier that you setup your directories like mine. If you choose to have a different directory structure, then you will likely have to edit all scripts which I provide you.
First move to your home directory using the change directory command (cd), The cd command has two parts one consisting of the command and the other part the destination. If you do not provide a destination, then it will be your home directory.
$ cd
$ pwd
Your home directory will typically be /home/<username> but you typically see ~/ used as the shortcut to your home directory
(mkdir) - Make directory
$ mkdir ~/opt
$ mkdir ~/bin
In your windows home directory, typically C:\Users\<username> you will want to create a repos directory and a projects directory. Back in your Ubuntu,
$ ln -s /mnt/c/Users/<username>/repos ~/repos
$ ln -s /mnt/c/Users/<username>/projects ~/projects
In my environment, i can move files on the HPC system to a "U drive" which is shared on windows. It maybe convenient to link it
$ ln -s /mnt/u ~/udrive
wget https://repo.continuum.io/archive/Anaconda3-5.0.1-Linux-x86_64.sh
By default, Anaconda will use the Intel Math Kernel Library (MKL) to accelerate numeric computation in Python. Unfortunately, MKL is not yet fully compatible with WSL, so we’ll need to disable some MKL features. MKL for WSL is incompatable with a feature known as kernel thread affinity, so we’ll disable that feature now.
$ printf "set KMP_AFFINITY=disabled\nexport KMP_AFFINITY" >> ~/.bashrc
$ source ~/.bashrc
The rest of the stack should be installable just like as indicated in "Setting up python"
[created 4/6/2020 - ejr]
wget http://www.netlib.org/blas/blas-3.8.0.tgz
tar xvzf blas-3.8.0.tgz
mv BLAS-3.8.0 blas-3.8.0
cd blas-3.8.0
make
sudo mv blas_LINUX.a /usr/local/libblas.a
[1] Jie Lu. "Install LAPACK and BLAS on Linux-Based Systems" Link
[2] "External Libraries For External Computing" Link
Installing LAPACK
cd ~/usr/local
mkdir ~/usr/local/lapack
cd ~/usr/local/lapack
wget https://github.com/Reference-LAPACK/lapack/archive/v3.9.0.tar.gz
tar xvzf
[1] Jie Lu. "Install LAPACK and BLAS on Linux-Based Systems" Link
[2] "External Libraries For External Computing" Link
Installing ScaLAPACK
wget http://www.netlib.org/scalapack/scalapack-2.1.0.tgz
FFTW is an open source fast fourier transform library. Since the Intel Math Kernel libary is not supported in Pythonma
wget http://www.fftw.org/fftw-3.3.8.tar.gz
tar xvzf fftw-3.3.8.tar.gz
./configure --enable-shared
make
make install
[1] Installing FFTW. Link