command-line use of SWI-Prolog on a Mac

377 views
Skip to first unread message

Louis Steinberg

unread,
Apr 15, 2018, 12:54:27 AM4/15/18
to SWI-Prolog
Is there a way to run SWI-Prolog from the command line on a Mac, short of the Macports or Homebrew versions?

Thank you

Kuniaki Mukai

unread,
Apr 15, 2018, 1:32:53 AM4/15/18
to Louis Steinberg, SWI-Prolog

On Apr 15, 2018, at 13:54, Louis Steinberg <louis.i....@gmail.com> wrote:

Is there a way to run SWI-Prolog from the command line on a Mac, short of the Macports or Homebrew versions?

Thank you

Although I use the git version because of personal historical reasons,
once I installed  a Homebrew version of SWI-Prolog for curious, and it worked well without no prolem. 
Unless you have to  use a git version,  it might  be a good choice to use Homebrew version for quick installation.

I am far from unix expert but  fortunately, I managed to install Apache, Gnu Emacs, MacTex (Texlive), sshfs, ...
within hobbyist level of  efforts. Also it should be  noted  that latest macOS exploits SIP policy for security reason.
I forgot details and still don’t know it. 

( macOS High Shierra )
% brew info swi-prolog
swi-prolog: stable 7.6.4 (bottled), devel 7.7.9, HEAD
ISO/Edinburgh-style Prolog interpreter
Not installed
==> Dependencies
Build: pkg-config
Required: readline , gmp , openssl
Optional: libarchive
==> Options
--with-jpl
Enable JPL (Java Prolog Bridge)
--with-libarchive
Build with libarchive support
--with-lite
Disable all packages
--with-xpce
Enable XPCE (Prolog Native GUI Library)
--devel
Install development version 7.7.9
--HEAD
Install HEAD version

Hope this help. Good luck. 

-km


--
You received this message because you are subscribed to the Google Groups "SWI-Prolog" group.
To unsubscribe from this group and stop receiving emails from it, send an email to swi-prolog+...@googlegroups.com.
Visit this group at https://groups.google.com/group/swi-prolog.
For more options, visit https://groups.google.com/d/optout.

Jan Wielemaker

unread,
Apr 17, 2018, 12:47:43 AM4/17/18
to Kuniaki Mukai, Louis Steinberg, SWI-Prolog
On 14/04/18 22:32, Kuniaki Mukai wrote:
>
>
>> On Apr 15, 2018, at 13:54, Louis Steinberg
>> <louis.i....@gmail.com <mailto:louis.i....@gmail.com>> wrote:
>>
>> Is there a way to run SWI-Prolog from the command line on a Mac, short
>> of the Macports or Homebrew versions?
>>
>> Thank you

The binary installer contains the commandline executables. Forgot the
package structure, but AFAIK this is explained in the Readme.html of the
disk image.

If you want these, as Kuniaki states, using Homebrew or Macports give
more flexibility to get exactly what you want.

Cheers --- Jan

>
> Although I use the git version because of personal historical reasons,
> once I installed  a Homebrew version of SWI-Prolog for curious, and it
> worked well without no prolem.
> Unless you have to  use a git version,  it might  be a good choice to
> use Homebrew version for quick installation.
>
> I am far from unix expert but  fortunately, I managed to install Apache,
> Gnu Emacs, MacTex (Texlive), sshfs, ...
> within hobbyist level of  efforts. Also it should be  noted  that latest
> macOS exploits SIP policy for security reason.
> I forgot details and still don’t know it.
>
> ( macOS High Shierra )
> % brew info swi-prolog
> swi-prolog: stable 7.6.4 (bottled), devel 7.7.9, HEAD
> ISO/Edinburgh-style Prolog interpreter
> http://www.swi-prolog.org/
> Not installed
> From:
> https://github.com/Homebrew/homebrew-core/blob/master/Formula/swi-prolog.rb
> ==>*Dependencies*
> Build: *pkg-config **✔*
> Required: *readline **✔*, *gmp **✔*, *openssl **✔*
> Optional: *libarchive **✔*
> ==>*Options*
> --with-jpl
> Enable JPL (Java Prolog Bridge)
> --with-libarchive
> Build with libarchive support
> --with-lite
> Disable all packages
> --with-xpce
> Enable XPCE (Prolog Native GUI Library)
> --devel
> Install development version 7.7.9
> --HEAD
> Install HEAD version
> %
>
> Hope this help. Good luck.
>
> -km
>
>>
>> --
>> You received this message because you are subscribed to the Google
>> Groups "SWI-Prolog" group.
>> To unsubscribe from this group and stop receiving emails from it, send
>> an email to swi-prolog+...@googlegroups.com
>> <mailto:swi-prolog+...@googlegroups.com>.
>> Visit this group at https://groups.google.com/group/swi-prolog.
>> For more options, visit https://groups.google.com/d/optout.
>
> --
> You received this message because you are subscribed to the Google
> Groups "SWI-Prolog" group.
> To unsubscribe from this group and stop receiving emails from it, send
> an email to swi-prolog+...@googlegroups.com
> <mailto:swi-prolog+...@googlegroups.com>.

Louis Steinberg

unread,
Apr 19, 2018, 12:50:55 AM4/19/18
to SWI-Prolog
I now have access to SWI Prolog on linux.  Next problem:
   On the Mac I can use library predicates like nth1 without doing anything special -  just call the predicate.  On linux, however, it asks me if I want to correct it to lists:nth1.  How can I get the linux version to behave like the mac version and just autoload the library predicates that it needs?


Thank you for your help.

Jan Wielemaker

unread,
Apr 19, 2018, 11:14:40 AM4/19/18
to Louis Steinberg, SWI-Prolog
Should be out of the box. If not, it is no correctly installed. Where
did you get it from?

--- Jan

Louis Steinberg

unread,
Apr 19, 2018, 4:04:38 PM4/19/18
to SWI-Prolog
Thank you.  I have got it working on the Mac, using the executable in /Applications/SWI-Prolog.app/Contents/MacOS/swipl rather than the one in

/Applications/SWI-Prolog.app/Contents/swipl/bin/x86_64-darwin15.6.0/swipl

Reply all
Reply to author
Forward
0 new messages