Week 3 – Installing Prolog in OSX

It’s fair to say, installing Prolog in OSX is a tad tricky.

I tried installing from homebrew.

$ brew search prolog
gnu-prolog  swi-prolog

I first tried gnu-prolog but it seems the version it tries to fetch no longer exists.

A quick look on wikipedia told me that there’s not much difference between gnu-prolog and swi-prolog so i thought i’d give the latter a try. However, that one stalls on “make check” and never seems to get to the end.

So then i thought i’d try the .dmg installer found on gprolog.org. All seemed well until i tried loading up a prolog file:

$ /opt/local/bin/gprolog
GNU Prolog 1.3.1
By Daniel Diaz
Copyright (C) 1999-2009 Daniel Diaz
| ?- ['friends'].
uncaught exception: error(system_error('error trying to execute pl2wam (maybe not found)'),consult/1)

Sooooo … i give up. Now i am downloading Ubuntu which i’m going to install into a virtual machine. I’ve heard it’s a lot easier to install for Ubuntu.

If anyone knows how to install Prolog for OSX please comment below for others’ benefit!

Advertisements

18 comments on “Week 3 – Installing Prolog in OSX

  1. Prolog is fun, although the learning curve is like a brick wall. It doesn’t make sense and then, after a while, it clicks. I really enjoyed the courses on it at uni. Not really used it since though.

    Also, one of my favourite geeky jokes is prolog based:

    How many prolog programmers does it take to change a light bulb?
    Yes.

    (I’m afraid I can’t make this comment actually useful; I’ve no idea how to install prolog on OSX)

    • I also did prolog at university, but i didn’t appreciate it back then. It was just one of many languages we were taught a little bit. I didn’t get that it was really quite clever.

      In lieu of usefulness, a joke is very welcome! :) I installed Ubuntu in a virtual machine and did sudo apt-get install gprolog … everything works just nicely! :)

      Glad you’re following along! x

  2. Oh yeah Ubuntu was the definition of easy for gprolog! I bet Dirk will try on OSX and I’ll get him to see if he has any tips.
    Let me know what editor you end up using. I’ve been liking gedit for these small assignments, it’s *okay* with prolog, but it looks so plain.

    • I use vim for just about everything! :)

      However, it looks pretty plain for prolog too. Plus it keeps defaulting to PERL because they have the same extension! :p

  3. I’m afraid I can’t help you :S I’m did the same that you did on Mac Os X and it worked for me (and I don’t have a joke to compensate for a really not useful comment)

  4. SWI-Prolog is easy to install on OSX via Macports: sudo port install swi-prolog. It also compiles quite nicely from the source tarball or git repository. Check out SWI’s built-in editor, available via the query ?- emacs.

  5. I edited the Homebrew formula using ‘brew edit gnu-prolog’. Then I replaced lines 4 and 6 with the following:

    url ‘http://www.gprolog.org/gprolog-1.4.0.tar.gz’

    md5 ‘9d4fc311b7f6e37e524a5e7ccd0b6c28’

    Then saved it and re-ran ‘brew install gnu-prolog’. Ran without a problem.

  6. brew install gnu-prolog
    now works and installs the latest stable version (1.4.1)
    I learned how to search brew packages from this entry, thanks!

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s