Beginner help please

View: New views
2 Messages — Rating Filter:   Alert me  

Beginner help please

by Steve Kirkby :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

I have downloaded the Package file "swi-prolog-5.6.64-leopard-powerpc.mpkg",
and run it, and SWI-Prolog has installed somewhere on my apple Mac computer
(model G5, Operating System 10.5.7) but now what? I cannot locate the
SWI-Prolog application so cannot launch it!

The ReadMe file in the SWI-Prolog installer states:

"3 Running SWI-Prolog
Not being a Macintosh Application, SWI-Prolog must be started from a
terminal window. This can either be an X11 xterm or Terminal.app from
Utilities. For comfortable usage it is necessary to setup some environment
variables. The procedure depends on your shell of choice. On Tiger the
default is bash. Add the following lines to the file ~/.bashrc (or create
this file if it does not yet exist).
# This allows using Prolog graphics if you use Terminal.app
if [ -z "$DISPLAY" ]; then export DISPLAY=:0; fi

# This sets up the path
PATH=$PATH:/opt/local/bin"

I have programmed in BASIC for many years but apart from that I do not have
sufficient knowledge about the inner workings of the Mac to understand
anything about this or how to launch SWI-Prolog. I have never used the
Terminal, do not know "what is my shell of choice", nor what a "bash" is (my
Op. System is Leopard, not Tiger).

Do I need this "X-11" and why, what is it and where do I get it and how do I
install it?

What are "Darwinports", do I have them, how many are there? The Read Me file
states:

"Opening and installing the meta installer installs the required ports from
the Darwinports system. The programs are installed in the directory
/opt/local/bin. The main executable is named swipl."

I have found "swipl-5.6.64" on my Mac but don't know what to do with it.

Can anyone give me *detailed* step-by-step instructions on how to get
SWI-Prolog launched and running. After that I will be able to use it OK.

I have "Programming in Prolog" by Clocksin & Mellish 1994. I used "Micro
Prolog about 15 years ago and was successful with it, but I cannot even
launch SWI-Prolog, which is very frustrating. (But perhaps SWI-Prolog is
exclusively aimed at experienced computer programmers with lots of technical
knowledge and not at a wider audience.)

Any help to get me going would be appreciated.

Thanks

_______________________________________________
SWI-Prolog mailing list
SWI-Prolog@...
https://mailbox.iai.uni-bonn.de/mailman/listinfo.cgi/swi-prolog

Re: Beginner help please

by Nicolas Pelletier-3 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hello,

Here are some answers to your questions.

On Wed, Oct 21, 2009 at 7:04 AM, Steve Kirkby <winkley192@...> wrote:
> I have downloaded the Package file "swi-prolog-5.6.64-leopard-powerpc.mpkg",
> and run it, and SWI-Prolog has installed somewhere on my apple Mac computer
> (model G5, Operating System 10.5.7) but now what? I cannot locate the
> SWI-Prolog application so cannot launch it!

SWI-Prolog inatallation is not done in the traditional way for Mac OS
X applications. You will not find it under Applications, nor have an
icon to double-click to launch it, and you will have to learn a bit of
the Unix side of Mac OS X. First of all, the stable version of
SWI-Prolog, downloadable at http://swi-prolog.org/ , is 5.8.0, and the
packages for Mac OS X are for 10.5.x.

> The ReadMe file in the SWI-Prolog installer states:
>
> "3 Running SWI-Prolog
> Not being a Macintosh Application, SWI-Prolog must be started from a
> terminal window. This can either be an X11 xterm or Terminal.app from
> Utilities. For comfortable usage it is necessary to setup some environment
> variables. The procedure depends on your shell of choice. On Tiger the
> default is bash. Add the following lines to the file ~/.bashrc (or create
> this file if it does not yet exist).
> # This allows using Prolog graphics if you use Terminal.app
> if [ -z "$DISPLAY" ]; then export DISPLAY=:0; fi
>
> # This sets up the path
> PATH=$PATH:/opt/local/bin"

The shell is the command interpreter used inside terminal windows
(such as Terminal.app). By default, the program acting as the shell in
Mac OS X is called bash (so you already have it). When you start a
terminal, bash is executed and reads some initialization parameters
from a file called .bashrc (beware the dot at the start of the file
name), located in your "home directory" (for me, it is /Users/nicolas.
You can check by typing: 'echo $HOME' wthout the quotes, inside a
terminal). You should create a .bashrc file with the contents above
and store it in your home directory. The default, simple TextEdit will
do the job.

From that point, each time you start a terminal application, bash will
read the above commands and you should be able to use SWI-Prolog by
simply entering the command 'swipl' (again, without the quotes) in the
terminal.

> I have programmed in BASIC for many years but apart from that I do not have
> sufficient knowledge about the inner workings of the Mac to understand
> anything about this or how to launch SWI-Prolog. I have never used the
> Terminal, do not know "what is my shell of choice", nor what a "bash" is (my
> Op. System is Leopard, not Tiger).

I am still using 10.5.8 here, and I do not know how much Snow Leopard
is different. Others may be more helpful here.

> Do I need this "X-11" and why, what is it and where do I get it and how do I
> install it?

You need it to be able to use SWI-Prolog's graphical development tools
(debugger, editor, cross-referencer, etc...). X11 is a standard set of
libraries and servers used in the Unix world for graphical user
interfaces. Mac OS X is built upon Unix, so it comes with its own X11
installation. However, the X11 that ships with Mac OS X (and which is
available in the additional packages on the Mac OS X installation DVD)
lacks some features that are needed. So you will need to first install
the X11 that comes with Mac OS X, and then install the one that comes
with Xquartz (you will find a link from SWI-Prolog's download page).
You will find installation instructions on the Xquartz page.

With these installed, you will be able to run applications from the
Unix world which use X11, such as SWI-Prolog, and still get the Mac OS
X look'n feel (e.g. native window decorations, etc.).

> What are "Darwinports", do I have them, how many are there? The Read Me file
> states:

Darwinports is a development effort to port many useful Unix
applications to the Unix-like Mac OS X environment. Darwin is the name
of the MAC OS X operating system kernel, which is based on BSD Unix.

You do not have Darwinports by default, but you do not need to install
them in order to use SWI-Prolog. The installer already includes (and
installs) all the libraries from Darwinports that are needed.

> Can anyone give me *detailed* step-by-step instructions on how to get
> SWI-Prolog launched and running. After that I will be able to use it OK.

I hope the above explanations help steer you in the right direction.

> I have "Programming in Prolog" by Clocksin & Mellish 1994. I used "Micro
> Prolog about 15 years ago and was successful with it, but I cannot even
> launch SWI-Prolog, which is very frustrating. (But perhaps SWI-Prolog is
> exclusively aimed at experienced computer programmers with lots of technical
> knowledge and not at a wider audience.)

Nobody starts as an experienced programmer. SWI-Prolog is meant to be
shared, used, and spread. There is no wish to restrict who can use it.
Yet, on the Mac, it is not as polished as a native Mac OS X
application. And, believe me or not, things would be easier for
everyone if Apple had chosen to pay more attention to existing
standards.

--
Nicolas
_______________________________________________
SWI-Prolog mailing list
SWI-Prolog@...
https://mailbox.iai.uni-bonn.de/mailman/listinfo.cgi/swi-prolog