16.1 Setting up Sweep for local development

Since the Prolog and C parts of Sweep are distributed and installed along with SWI-Prolog (see Installation), the easiest way to set up Sweep for development is to start with a SWI-Prolog development setup. Clone the swipl-devel Git repository, go the subdirectory packages/sweep that contains Sweep as a Git submodule, and update it to the latest development version:

git clone --recursive https://github.com/SWI-Prolog/swipl-devel.git
cd swipl-devel/packages/sweep
git checkout master
git pull

The directory packages/sweep in the swipl-devel repository now contains the development version of Sweep. You can hack on Sweep’s source files and then (re)build SWI-Prolog to test your changes. See Building SWI-Prolog using cmake for more information about building SWI-Prolog from source.

If you only modify the Elisp library sweeprolog.el, you do not need to rebuild SWI-Prolog. You can simply evaluate and test your changes directly inside Emacs (see (emacs)Lisp Eval).

If you change sweep.c or otherwise want to rebuild SWI-Prolog, you can do that from the packages/sweep subdirectory by running the following command:

ninja -C ../../build