You are now at: Home / Support / FAQ / Garp3 troubleshooting

Garp3 Troubleshooting

Compiling the C-Code for MacOSX

MacOSX users using a SWI-Prolog version which is not recommended for use with Garp3, may experience problems simulating their models. Users on very new hardware (like 64-bits machines) may have the same problems. The issues are caused by a binary which refers to the SWI-prolog installation directory (which includes a version number). To solve these issues the Garp3 c-code has to be recompiled.

Preparations

On MacOSX it is possible that commands like xpce, plld and swipl are not available (eventhough SWI-Prolog is installed). To make these commands available the path to these executables has to be added to the $PATH variable. Depending on the shell you are using the configuration file and the command used is different. To check which shell you are using type: echo $SHELL. This writes the name of your shell to the console.

Changing your path variable in Bourne shells (bash, sh):
  • Edit your shell configuration file (.bashrc, .shrc).
  • Add a line: export PATH="$PATH:/opt/local/bin/"
Changing your path variable in csh shells (csh, tcsh):
  • Edit your shell configuration file (.cshrc, .tcshrc).
  • Add a line: setenv PATH $PATH:/opt/local/bin/

Another possible problem on MacOSX is that gcc (the compiler) is not available. In the worst-case scenario gcc has to be installed from the MacOSX installation disc. Usually the installer is already available via the menu (Installers/Applications/Xcode Tools/XcodeTools.mpkg).

Actually doing the compiling

  1. Find out the name of the architecture by typing in an X-window:
    xpce -arch
    On the mac, this command will display something like: powerpc-darwin8.3.0
  2. Make a directory with the name of the architecture, within the Garp3 directory engine/archlibs (if it doesn't exist already). Note: This has changed recently: instead of powerpc-darwin8.3.0 the name powerpc-darwin (without the version information) should be used.
  3. Compile c-code for Garp (pl-bit.c) into that directory for the mac, this goes as follows (assuming Garp3 is the directory where you installed Garp3):
    • cd Garp3/engine/archlibs/powerpc-darwin/
    • plld -shared -o pl-bit ../../standalone/pl-bit.c
    On the mac, this command will create a file named pl-bit.dylib. On unix, this command will create a file named pl-bit.so. The compiler gives some warnings concerning signedness, but these can be ignored.
  4. Try to run Garp3 again. It should be fine now, but if running a simulation still does not work, please email us.