The following sequence of posts will describe how to get NGSolve compiled and installed from source on Ubuntu (version 22.04) running under WSL (Windows Subsystem for Linux). Specifically, this is for WSL2.
I assume you are installing on your own windows machine. Thus, you should be able to run the “sudo” command (super user do). These instructions should also be useful for installing to a pure Linux Ubuntu. If you cannot run “sudo”, then some modification will be needed (I will try to point this out).
Note: this will take several posts to explain everything.
- install Windows Powershell (it’s useful to have anyway).
- install Windows Terminal, which is used for running the Ubuntu system.
- read up on the WSL system, e.g.
Install WSL | Microsoft Learn
Get WSL installed on your machine. This is done by opening Powershell (with admin rights) and entering:
Next, install Ubuntu:
wsl --install -d Ubuntu
(This will ask you to create a username and password.)
As of this writing, this will install Ubuntu 22.04. You can also specify (some) previous version of Ubuntu.
Next, use “Windows Terminal” (with admin rights) to start the Ubuntu shell. You can then type:
to see the Ubuntu version.
Note: you might want to start with a fresh Ubuntu install at some point. In some cases, you may need to completely uninstall the WSL. If you do this, to re-install, run
wsl --update again. Then, reinstall Ubuntu.
Before moving on, let’s make sure Ubuntu is fully up to date. Run this:
sudo apt update && sudo apt full-upgrade
After that, restart the Ubuntu shell and run:
A final note for this post: your Ubuntu distribution should be stored in:
(typing this in the file explorer should bring it up.)
and your home directory is: