# Install SWI on Catalina?

**URL:** <https://swi-prolog.discourse.group/t/install-swi-on-catalina/4391>\
**Category:** Installing\
**Created:** [September 6, 2021, 2:41am UTC](https://swi-prolog.discourse.group/t/install-swi-on-catalina/4391 "2021-09-06T02:41:04Z")\
**Posts on this page:** 15\
**Page:** 1

<div class="post-metadata">

**Author:** ![ChuckBrotman](https://yyz2.discourse-cdn.com/free1/user_avatar/swi-prolog.discourse.group/chuckbrotman/32/3702_2.png) [@ChuckBrotman](https://swi-prolog.discourse.group/u/ChuckBrotman)\
**Post date:** [September 6, 2021, 2:41am UTC](https://swi-prolog.discourse.group/t/install-swi-on-catalina/4391/1 "2021-09-06T02:41:04Z")

</div>

Hi,

I’m running Catalina on my IMac and would like to install, learn, and use SWI Prolog on that OS (10.15.7)  
I’ve tried a few times to install the latest stable release 8.x.y but keep getting told that My system is "too old” and that brew can’t run…  
Is there a binary/version/way that will install and run on Catalina?  
Thanks, Chuck

---

<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:** [September 6, 2021, 6:58am UTC](https://swi-prolog.discourse.group/t/install-swi-on-catalina/4391/2 "2021-09-06T06:58:26Z")

</div>

Did you just try to install using `brew`? If that doesn’t work it looks like an issue with `brew`. AFAIK, the binaries from [SWI-Prolog downloads](https://www.swi-prolog.org/Download.html) should work fine. Preferably take the _devel_ releases. It will become stable shortly anyway.

Note that these binaries are for Intel. If you have an M1 machine you must compile from source. The Intel binary runs on the M1, but is slow. The Macport build should work fine.

The M1 is still a bit problematic. We compile the binaries with gcc as this produces significantly (close to 2 times) faster code that clang. AFAIK gcc does not yet produce M1 binaries. We also need to figure out how to generate a universal binary in the CMake toolchain.

---

<div class="post-metadata">

**Author:** ![ChuckBrotman](https://yyz2.discourse-cdn.com/free1/user_avatar/swi-prolog.discourse.group/chuckbrotman/32/3702_2.png) [@ChuckBrotman](https://swi-prolog.discourse.group/u/ChuckBrotman)\
**Post date:** [September 7, 2021, 1:48am UTC](https://swi-prolog.discourse.group/t/install-swi-on-catalina/4391/3 "2021-09-07T01:48:05Z")

</div>

Jan,  
Yes, I think the problem was with homebrew. but I couldn’t decipher it at the time.  
Still can’t actually. I did however mange to get SWIPL installed and working on my intel machine, the old fashioned way. . .by downloading the appropriate macOS binary and running the installer. I don’t think I have the knowledge or toolset to compile from source and I don’t have M1 (yet!). thanks for the heads-up regarding compilation required on M1.

Just wondering, what do you use as an IDE?  
Now, to attempt to digest the manual. . .

Thanks!  
Chuck

---

<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:** [September 7, 2021, 6:03am UTC](https://swi-prolog.discourse.group/t/install-swi-on-catalina/4391/4 "2021-09-07T06:03:16Z")

</div>

> [@ChuckBrotman](#):
>
> Just wondering, what do you use as an IDE?

Did you try the IDE that comes with SWI-Prolog (the Emacs clone, graphical debugger and so on)? It works beautifully 🙂 there has been some mac-specific configurations some of us have had to do esp. for “retina” displays but it works.

---

<div class="post-metadata">

**Author:** ![peter.ludemann](https://yyz2.discourse-cdn.com/free1/user_avatar/swi-prolog.discourse.group/peter.ludemann/32/48_2.png) [@peter.ludemann](https://swi-prolog.discourse.group/u/peter.ludemann)\
**Post date:** [September 7, 2021, 6:05am UTC](https://swi-prolog.discourse.group/t/install-swi-on-catalina/4391/5 "2021-09-07T06:05:51Z")

</div>

> [@ChuckBrotman](#):
>
> Just wondering, what do you use as an IDE?

I’ve found [emacs](https://www.swi-prolog.org/pldoc/man?section=gemacs) to be sufficient for my needs; but I tend to write systems that process lots of data and whose test cases (which I run with `make` or similar) fit well with the [`*compilation*`](https://www.gnu.org/software/emacs/manual/html_node/emacs/Compilation.html) window.

---

<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:** [September 7, 2021, 7:39am UTC](https://swi-prolog.discourse.group/t/install-swi-on-catalina/4391/6 "2021-09-07T07:39:03Z")

</div>

> [@ChuckBrotman](#):
>
> Just wondering, what do you use as an IDE?

There are many options, such as the native tools, GNU-Emacs, PDT (for Eclipse), a VSC plugin and most likely more. There is also an experimental LSP (Language Server Protocol) that should allow using any editor of choice that supports LSP.

I use the native tools. Just run Prolog in a terminal ([terminator](https://gnometerminator.blogspot.com/)), normally starting it as

```
swipl myfile.pl

```

To edit the main file, use `?- edit.`. To edit anything else that has a name (predicates, modules, files, …), use `?- edit(Name).` To find stuff anywhere in the project I split the terminal and use `git grep` (always have my source under git). Then there is a script `edit` in the `customize` directory of the release. I install that in my `~/bin` and install a PceEmacs client from [https://raw.githubusercontent.com/SWI-Prolog/packages-xpce/master/src/unx/client.c](https://raw.githubusercontent.com/SWI-Prolog/packages-xpce/master/src/unx/client.c). Just compile that using `cc -o xpce-client client.c` should work on most machines. Install also in `~/bin`. Now, if the Prolog editor is open you can run from any terminal

```
edit file:line[:column]

```

To edit at that position. That works nicely with `git grep` as well as to copy paste locations of error messages for editing. Note that the commandline also allows for editing a file+line. Typically only use the plain file name, i.e. `myfile` to avoid the need for quotes.

```
?- edit(file:line).

```

> **edit** If you use terminator. consider adding the [editor plugin](https://github.com/mchelem/terminator-editor-plugin). See [Install SWI on Catalina? - #10 by jan](https://swi-prolog.discourse.group/t/install-swi-on-catalina/4391/10)

After editing sources I normally type `?- make.` in the Prolog console to update the compiled image and try again. You can also compile from the PceEmacs editor. Note that the editor runs in its own Prolog thread. This allows editing while the program runs. `Prolog/View threads` can come handy to see a dynamic chart of the resource usage if your program takes long. That also allows to profile suspect threads for a while to see what it is doing.

Ultimately I hope the LSP protocol will allow for a good user experience on any IDE of the user’s preference … The native IDE works well, but it is a bit unconventional and multiple IDEs for different tasks is a burden. You might still want to use the native editor for browsing around and fixing minor issues as the highlighting and context menus on predicates, calls, files, etc. are quite helpful. That is similar to what I did when using MS Visual Studio and MSVC on Wndows: I used VS for the final steps while I used Emacs for bulk editing.

P.s. The `brew` version is rather minimal. The `Macports` version is complete. If you need to go source the best option is typically to install the dependencies from Macports or brew and then just compile from the git sources. First might be a bit tricky. Once working you can update easily in less than a minute.

---

<div class="post-metadata">

**Author:** ![ChuckBrotman](https://yyz2.discourse-cdn.com/free1/user_avatar/swi-prolog.discourse.group/chuckbrotman/32/3702_2.png) [@ChuckBrotman](https://swi-prolog.discourse.group/u/ChuckBrotman)\
**Post date:** [September 7, 2021, 6:49pm UTC](https://swi-prolog.discourse.group/t/install-swi-on-catalina/4391/7 "2021-09-07T18:49:41Z")

</div>

Haven’t tried them yet, but I will now, thanks! Any hints as to how to best invoke them?

Chuck

---

<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:** [September 7, 2021, 7:13pm UTC](https://swi-prolog.discourse.group/t/install-swi-on-catalina/4391/8 "2021-09-07T19:13:04Z")

</div>

Check out Jan’s post he went into detail

---

<div class="post-metadata">

**Author:** ![peter.ludemann](https://yyz2.discourse-cdn.com/free1/user_avatar/swi-prolog.discourse.group/peter.ludemann/32/48_2.png) [@peter.ludemann](https://swi-prolog.discourse.group/u/peter.ludemann)\
**Post date:** [September 7, 2021, 10:58pm UTC](https://swi-prolog.discourse.group/t/install-swi-on-catalina/4391/9 "2021-09-07T22:58:23Z")

</div>

> [@jan](#):
>
> Just run Prolog in a terminal

I do something similar to Jan, except I use the Emacs term (M-x shell) and compilation windows (M-x compile) – the latter is convenient because I can scan for error messages (using the tab key) and jump to the source code (C-c C-c).

---

<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:** [September 8, 2021, 8:37am UTC](https://swi-prolog.discourse.group/t/install-swi-on-catalina/4391/10 "2021-09-08T08:37:49Z")

</div>

> [@peter.ludemann](#):
>
> the latter is convenient because I can scan for error messages (using the tab key) and jump to the source code (C-c C-c).

That is indeed the biggest advantage. I don’t like the Emacs terminal that much (although I must admit I haven’t used it for quite a while). In my (dated) experience, it is rather slow, there is no support for “raw” mode (non-echo, no-wait) as used by the Prolog debugger and toplevel and there is no support for color.

Just made me search a bit harder to find terminators [editor plugin](https://github.com/mchelem/terminator-editor-plugin), so patterns file:line and underlined when hovered and ctrl-click now opens them in the Prolog built-in editor 🙂 Almost as good as an Emacs shell 🙂 Only lacks a command to go through the error/warning locations (must click one-by-one) and if editing changes the lines, subsequent clicks end up in the wrong place. Well, that is bearable. The built-in editor on the fly checking of your code ensures you get very few messages when loading the code and in many cases one only wishes to fix the first issue and then reload because other issues are often caused by the first. I’m happy 🙂 Pushed an updated version of the `edit` script that cooperates better with terminator.

---

<div class="post-metadata">

**Author:** ![JCR](https://avatars.discourse-cdn.com/v4/letter/j/258eb7/32.png) [@JCR](https://swi-prolog.discourse.group/u/JCR)\
**Post date:** [September 9, 2021, 1:46pm UTC](https://swi-prolog.discourse.group/t/install-swi-on-catalina/4391/11 "2021-09-09T13:46:01Z")

</div>

With the graphical debugger i get a low resolution appearance on mac with retina display. Can i do something to fix that? The graphical debugger is nice!

---

<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:** [September 9, 2021, 2:17pm UTC](https://swi-prolog.discourse.group/t/install-swi-on-catalina/4391/12 "2021-09-09T14:17:38Z")

</div>

You can set preferences for the editor in a bit old fashioned way:

- Start `?- emacs.`
- Use the **Edit/Preferences** menu. That should (the first time) ask to install the default preferences file.
- Edit the file as you seem fit. Note that ! is comment. Notably at the end of the file you find `font.scale`. That scales all truetype fonts with this amount.
- Save the file, quit and restart Prolog.

That should make the system work reasonable on any screen resolution. Unfortunately the bitmaps are hard coded, so they do not scale. If anyone wants to make pretty icons and can generate them in a few sizes, please contribute them!

---

<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:** [September 9, 2021, 2:23pm UTC](https://swi-prolog.discourse.group/t/install-swi-on-catalina/4391/13 "2021-09-09T14:23:19Z")

</div>

Would it work if we found an MIT-licensed set of svg icons and used those as a starting point? A precursory internet search shows such things exist.

---

<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:** [September 9, 2021, 2:45pm UTC](https://swi-prolog.discourse.group/t/install-swi-on-catalina/4391/14 "2021-09-09T14:45:59Z")

</div>

> [@Boris](#):
>
> Would it work if we found an MIT-licensed set of svg icons and used those as a starting point?

Sure. Anything MIT, Apache, BSD and most (?) CC licenses are fine. In fact, these icons do not end up in final systems and thus any license that allows for them to be freely distributed is good enough.

You find all the icons in `packages/xpce/prolog/lib/trace/icons`. The idea would be to create several subdirectories with different sizes, e.g., `16x16`, `24x24` and `32x32`. Adding an `svg` dir for the SVG version is of course a good idea. I doubt xpce will ever support SVG though ☹

---

<div class="post-metadata">

**Author:** ![JCR](https://avatars.discourse-cdn.com/v4/letter/j/258eb7/32.png) [@JCR](https://swi-prolog.discourse.group/u/JCR)\
**Post date:** [September 9, 2021, 8:03pm UTC](https://swi-prolog.discourse.group/t/install-swi-on-catalina/4391/15 "2021-09-09T20:03:12Z")

</div>

> [@jan](#):
>
> - Edit the file as you seem fit. Note that ! is comment. Notably at the end of the file you find `font.scale` . That scales all truetype fonts with this amount.

Thanks Jan 🙂
