I am having the hardest trouble trying to run SWI-prolog on my Mac.
When I type:
/opt/bin/local/swipl
I get an error saying:
/opt/local/bin/swipl: No such file or directory
When I just type "swipl" I get:
swipl: command not found
I've tried this on both terminal and XQuartz. I've even gone into
/Applications/SWI-Prolog.app/Contents/MacOS
to see if that would do anything, however the prolog "Welcome" text never appears. Quite possibly the closest I ever got it to work was when I typed "pl" when inside the MacOS folder. However I was left with my terminal doing nothing and had to use Crtl-D.
Is there something I'm doing wrong? Did I install something incorrectly?
I'm running on a Mac OS X 10.9.1 Mavericks. I placed the SWI-Prolog application into my application folder and I also downloaded XQuartz per recommendation by the website.
Open a terminal (Ctrl+Alt+T) and navigate to the directory where you stored your program. Open SWI-Prolog by invoking swipl . In SWI-Prolog, type [program] to load the program, i.e. the file name in brackets, but without the ending. In order to query the loaded program, type goals and watch the output.
Then check your installation, call SWI-Prolog from a terminal shell as follows: - In the shell, type in …> ./swipl which should open the interpreter, i.e., you should see something like … ?- If you get an error that the command swipl is not known, check that your PATH variable includes a path to SWI-Prolog.
If you have Homebrew installed, you can simply run
brew install swi-prolog
from Terminal, which will build it from source in one command.
You can then run the interpreter using swipl
.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With