# Starting SWIPL on Linux

**URL:** <https://swi-prolog.discourse.group/t/starting-swipl-on-linux/369>\
**Category:** Installing\
**Created:** [March 9, 2019, 4:20pm UTC](https://swi-prolog.discourse.group/t/starting-swipl-on-linux/369 "2019-03-09T16:20:30Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![martin](https://avatars.discourse-cdn.com/v4/letter/m/73ab20/32.png) [@martin](https://swi-prolog.discourse.group/u/martin)\
**Post date:** [March 9, 2019, 4:20pm UTC](https://swi-prolog.discourse.group/t/starting-swipl-on-linux/369/1 "2019-03-09T16:20:30Z")

</div>

Hi.  
I have just installed SWI Prolog on Linux, using GIT.  
It appears to have downloaded a lot of files, so it appears to have installed it.

But I can’t find any file named “swipl”, so I can’t find out how to start prolog.  
How can I start prolog?

I see that “prolog-devel/demo/README” says that to start Prolog I need to use “pl”, not “swipl”. Is this correct? The main SWI Prolog website says I need to use “swipl”.  
If I need to use a command called “pl”, this is not helpful, because I can’t find a file named “pl” either.

–  
Martin Sondergaard.

---

<div class="post-metadata">

**Author:** ![swi](https://avatars.discourse-cdn.com/v4/letter/s/51bf81/32.png) [@swi](https://swi-prolog.discourse.group/u/swi)\
**Post date:** [March 9, 2019, 5:07pm UTC](https://swi-prolog.discourse.group/t/starting-swipl-on-linux/369/2 "2019-03-09T17:07:37Z")

</div>

Martin,

Git usually is used to download source code, and not pre-built binaries that can be executed (like `swipl`).

1. I would recommend you install swi-prolog using your distributions package manager (`apt-get` on ubuntu or debian-like linuxes).

2. If you still want to build it from git (perhaps you want the latest and greatest version), you can follow the instructions in `CMAKE.md` which tell you how to build and install swi-prolog.

NOTE: yes, the reference to `pl` is quite outdated, it used to be the original name many centuries ago 🙂 It should probably be updated, but maybe it should be left there as a tribute to the length of time swi-prolog has been around 😄

---

<div class="post-metadata">

**Author:** ![CapelliC](https://yyz2.discourse-cdn.com/free1/user_avatar/swi-prolog.discourse.group/capellic/32/17_2.png) [@CapelliC](https://swi-prolog.discourse.group/u/CapelliC)\
**Post date:** [March 9, 2019, 10:14pm UTC](https://swi-prolog.discourse.group/t/starting-swipl-on-linux/369/3 "2019-03-09T22:14:03Z")

</div>

Hi Martin

On Ubuntu, I have a mini script that run the steps required to get executables **swipl** and **swipl-win** when Jan publishes a new release.

```auto
git clone https://github.com/SWI-Prolog/swipl-devel.git
cd swipl-devel
git submodule update --init
mkdir build
cd build
cmake -DCMAKE_INSTALL_PREFIX=$HOME ..
make -j
make install

```

The effect is to create (or update) 4 folders in $HOME: **swipl-devel** , **bin** , **share** and **lib**. Working in $HOME allows for unprivileged (non root) execution.

Usually I first rename the old ~/swipl-devel, and delete after a successful build.  
Note, your system must have the prerequisites listed [here](http://www.swi-prolog.org/build/Debian.txt) (for a Debian based installation).

HTH, Carlo

---

<div class="post-metadata">

**Author:** ![martin](https://avatars.discourse-cdn.com/v4/letter/m/73ab20/32.png) [@martin](https://swi-prolog.discourse.group/u/martin)\
**Post date:** [March 10, 2019, 12:27am UTC](https://swi-prolog.discourse.group/t/starting-swipl-on-linux/369/4 "2019-03-10T00:27:18Z")

</div>

Thank you for your replies.  
I have just installed SWI Prolog from the software repository for my distro. It was easy, doing it that way.

I have noticed that this version is very slow when running the GUI tracer.  
Is this still a problem with the latest version, or is that faster when running the tracer?

–  
Martin.

---

<div class="post-metadata">

**Author:** ![jan](https://yyz2.discourse-cdn.com/free1/user_avatar/swi-prolog.discourse.group/jan/32/4_2.png) [@jan](https://swi-prolog.discourse.group/u/jan)\
**Post date:** [March 10, 2019, 9:12am UTC](https://swi-prolog.discourse.group/t/starting-swipl-on-linux/369/5 "2019-03-10T09:12:05Z")

</div>

> [@martin](#):
>
> very slow when running the GUI tracer

The only problem I know is that the trace Windows and a few other windows of the GUI first show up empty and grey. This problem is related to some window managers, but unfortunately the more popular ones. The window draws if you move it a little or wait long enough.

That problem is still there and I have little clue on how to fix it. As far as I recall it is related to an X11 notification event that should happen but doesn’t.

---

<div class="post-metadata">

**Author:** ![jan](https://yyz2.discourse-cdn.com/free1/user_avatar/swi-prolog.discourse.group/jan/32/4_2.png) [@jan](https://swi-prolog.discourse.group/u/jan)\
**Post date:** [March 10, 2019, 9:25am UTC](https://swi-prolog.discourse.group/t/starting-swipl-on-linux/369/6 "2019-03-10T09:25:38Z")

</div>

That should work, but is rather slow. Some remarks:

- `make -j` requires a big machine. It does everything concurrently that can be done concurrently and that is a **lot** since the move to CMake. Better use `make -j N`, where _N_ is somewhat higher than the number of cores you have or lower if you want your machine to remain fast during the build.
- For comfortable build, use **ninja** , typically in a package `ninja.build` or something similar:
  - Adjusts concurrency automatically, so no need for `-j` with the right value
  - Feedback on the same line, only showing warnings and errors
  - Faster, in particular for an _update_
  - **add -G Ninja to the original cmake command to use Ninja**

- For update and specific builds, see `CMAKE.md`. Basically though

```auto
      git pull
      git submodule update --init
      cd build
      ninja
      ctest -j 8
      ninja install

```

`ctest` does require concurrency to be specified. You can of course also skip the test.

In the unlikely case it goes wrong, report, note the hash associated with the version before the update, do `git checkout <hash>` instead of the `git pull` above and rebuild the previous version.

---

<div class="post-metadata">

**Author:** ![Boris](https://yyz2.discourse-cdn.com/free1/user_avatar/swi-prolog.discourse.group/boris/32/7486_2.png) [@Boris](https://swi-prolog.discourse.group/u/Boris)\
**Post date:** [March 10, 2019, 5:28pm UTC](https://swi-prolog.discourse.group/t/starting-swipl-on-linux/369/7 "2019-03-10T17:28:39Z")

</div>

Just to confirm, `ninja` is about say 10 times faster than `Make` for updating? In particular, it seems much better at taking less time when less has changed.

BTW, I think Paulo mentioned this, it is possible to “help” discourse with the code block by specifying the language. For example, if I type this:

````
```
git submodule update --init
```

````

you see:

```auto
git submodule update --init

```

and if I type this:

````
```bash
git submodule update --init
```

````

you’ll see:

```bash
git submodule update --init

```

(it no longer thinks it’s SQL probably?)

PS: Found the post: [When posting using mail, please use markdown](https://swi-prolog.discourse.group/t/when-posting-using-mail-please-use-markdown/241/3?u=boris)

Is there a way to “pin” this some place that is easy to find?

---

<div class="post-metadata">

**Author:** ![jamesnvc](https://yyz2.discourse-cdn.com/free1/user_avatar/swi-prolog.discourse.group/jamesnvc/32/14_2.png) [@jamesnvc](https://swi-prolog.discourse.group/u/jamesnvc)\
**Post date:** [March 10, 2019, 9:18pm UTC](https://swi-prolog.discourse.group/t/starting-swipl-on-linux/369/8 "2019-03-10T21:18:09Z")

</div>

> [@Boris](#):
>
> PS: Found the post: [When posting using mail, please use markdown](https://swi-prolog.discourse.group/t/when-posting-using-mail-please-use-markdown/241/3)
> 
> Is there a way to “pin” this some place that is easy to find?

Good idea; I just set it as a pinned topic 👍
