Running Pure on Windows

This document provides some information pertaining to the Windows version of Pure, available from the Pure website in the form of an MSI package. Please note that the Windows version has a custom directory layout which is more in line with standard Windows applications, and will by default be installed in the standard Program Files directory on your system.

  • The Pure interpreter requires the PURELIB environment variable to point to the directory containing the prelude and other library modules, available in the lib subdirectory of the Pure program directory. Also, the PATH environment variable should contain both the Pure program directory and the lib subdirectory, so that you can run the interpreter and compiled programs from the command line. Both environment variables are set automatically during installation. To make this work, you have to install the package with administrator rights.
  • The package includes a shortcut to run the Pure interpreter in a command window, as well as a shortcut for the online documentation that you’re looking at. After installation you can find these in the Pure submenu of the Program menu.
  • Pure scripts can be edited in any text editor. Syntax highlighting and programming modes are provided for Emacs, Vim and various other popular text editors. After installation you can find these in the etc subdirectory of the program directory.
  • The package also includes the PurePad application, a GUI frontend to the Pure interpreter which lets you edit and run Pure scripts on Windows.
  • The interpreter has a few interactive commands (ls, pwd, etc.) which require Unix-like utilities. To make these work, we recommend installing the CoreUtils package from the GnuWin32 project, and setting your PATH accordingly.

Running the Pure batch compiler on Windows

You can use the Pure interpreter to create native executables by running it with the -c option. To make this work on Windows, you need to install the LLVM toolchain for mingw32/x86, available from the LLVM download page. Only the LLVM binaries package is required. For your convenience, here is the corresponding download for the LLVM 2.5 release: LLVM Binaries for Mingw32/x86.

The installer assumes that you unpack this tarball in the root directory of your C: drive, so that the tools end up in C:\llvm-2.5, and sets up PATH accordingly. If you put them elsewhere or if you’re using the toolchain from a newer LLVM version then you’ll have to change PATH accordingly.

Finally, the Pure program directory needs to be added to the gcc LIBRARY_PATH environment variable, so that some Windows-specific addon libraries are found when linking compiled programs. This should be done automatically during installation as well. However, because of differences in filename conventions the result might not always be what you want, so you should check the value of LIBRARY_PATH after installation and edit it as needed.

Running pure-gen on Windows

This release also includes the pure-gen utility, which can be used to create Pure interfaces to C libraries from the corresponding C headers.

To make this work, you also need to have gcc installed; pure-gen uses this as its C preprocessor. gcc 4.3 or later is required. We recommend using the latest gcc version (gcc 4.4, at the time of this writing) from the mingw project. Instructions for installing mingw gcc 4.4 can be found here. There’s an installer program available at the mingw website which helps you to set up a working mingw installation on your system. Jiri Spitz’ instructions for setting up mingw for Pure may also be helpful.

pure-gen assumes that a suitable gcc version is on your PATH. If this is not the case then you can also set the PURECPP environment variable to point to the executables of a suitable gcc installation so that pure-gen finds the correct gcc program. (For instance, if you have installed gcc-4.4 under C:\gcc-4.4 then you should set PURECPP to C:\gcc-4.4\bin.)

Table Of Contents

Previous topic

pure-midi

Next topic

Using PurePad

This Page