wsl --install -d debianterminal command as detailed here, or alternately open the Control Panel, then Programs and Features, then Turn Windows Features On or Off, and tick the box for Windows Subsystem for Linux.
debianin search box, install the free Debian app (or Ubuntu, or your favourite other Linux distribution, MS has a few); launch the app. Skip this step if you used
-d debianabove.
In your newly opened Linux terminal enter the following commands. (Left-click in the orange box to copy, right-click in your terminal to paste.)
sudo apt update && sudo apt upgrade
sudo apt install gcc make info curl
curl -fsS -o /tmp/unpack-cpl.sh https://CPLcode.net/version-archive/unpack-cpl.sh && sh /tmp/unpack-cpl.sh
You are all set! Please notice that steps 1-2 are enough if you only want to run a CPL executable provided to you. You actually need to install the gcc compiler and the CPL tools if you want to edit, compile or interpret a CPL program.
Possible quirks and their remedies: The first time you run it, the Debian terminal may refuse to start, and instruct you to install additional components provided by Microsoft. Just follow such instructions.
You may need to close and re-open the Debian window before the newly installed commands become available at the command prompt. You can open as many Debian terminals as you like; for instance, one to edit and one to run your new CPL program.
When using the cpl editor, or for any other purpose, you may prefer black text on a white background; you can personalize colors in the Properties menu of the Debian console.
Mouse clicks over the right bottom corner of the Debian window are used by Windows and are not transmitted to the running program; this makes the |Info| button of the cpl editor nonfunctional. You can still access the same info manual and context-sensitive help in the editor by the Esc I
key sequence, or outside the editor by the cpl info edit
command.
Notice about graphics: Under Windows 10, Microsoft's Windows Subsystem for Linux provides a terminal-only experience of a Linux distribution, deprived of its Graphical User Interface. The CPL compiler, interpreter and editor all natively run in a terminal and will fit in seamlessly, but if your CPL program draws graphics and needs the additional gnuplot
package to do so, installing it via Debian (as in apt install gnuplot
) will not work. Instead you may want to install the Windows version of gnuplot, freely available from gnuplot's own repository, and then
ln -s '/mnt/c/Program Files/gnuplot/bin/gnuplot.exe' bin/gnuplot
Now you can access gnuplot simply as gnuplot
in your Debian terminal, and graph-drawing CPL programs will automatically find and use it just as well.
Windows 11 GUI update: Starting with Windows 11 Build 22000, WSL supports graphical user interfaces and applications. More details here.