Step by step instructions to use CPL with Microsoft Windows.
- 1 - Enable WSL:
- To enable the Windows Subsystem for Linux (WSL) of Microsoft Windows 10, you can use a sequence of Powershell terminal commands detailed here, or alternately open the Control Panel, then Programs and Features, then Turn Windows Features On or Off, and check 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 your favourite other Linux distribution); launch the app.
- 3 - Bring Debian up to date. In your new Debian terminal execute the following click-to-copy commands:
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 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 windows as you like; for instance, one to edit and one to execute your own CPL program.
You are all set!
Notice about graphics: 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 are all built to run in a terminal and will fit in seamlessly, but if your CPL program draws graphics and needs the additional
gnuplot package, installing it via Debian (as
apt install gnuplot) will not do. Instead you may want to install the Windows version of gnuplot, available from the official gnuplot site, and then
- 6 - link the gnuplot executable to your Debian home. After you have downloaded and installed gnuplot for Windows, paste and execute in a Debian terminal:
ln -s '/mnt/c/Program Files/gnuplot/bin/gnuplot.exe' bin/gnuplot
Now you can open gnuplot as just
in your Debian terminal, and CPL programs will automatically find it as well.