CPL

CPL-on-Debian-on-Windows howto

Step-by-step instructions to use CPL, Linux in Microsoft Windows

1 - Enable WSL:
To enable the Windows Subsystem for Linux (WSL) of Microsoft Windows 10 or 11 you can use the wsl --install -d debian terminal 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.
2 - Install Debian on WSL:
Open Microsoft Store, enter debian in 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 debian above.

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.)

3 - Bring Debian up to date:
sudo apt update && sudo apt upgrade
4 - Install needed packages gcc, make, info, curl:
sudo apt install gcc make info curl
5 - Download and unpack the CPL archive:
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

6 - link the gnuplot executable to your Debian home. After you have successfully downloaded and installed gnuplot for Windows, in a Debian terminal paste and execute:
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.

copied.