YAP 7.1.0
Installing YAP

Downloading YAP

The latest development version of Yap-7 is available source-only through GIT repositories The main reference repository is at

Please just use git clone to obtain the distribution Ie, to download YAP from the command line please type:

git clone https://github.com/vscosta/yap-6.3 yap

The first argument is the repository, the last argument is the (optional) target directory

There are a variety of graphical interfaces to git, including GitHub's own GitHub Desktop that supports Microsoft Windows and Apple OSX A list with GUI applications, editor integration, and much more can be found at the git Wiki,

Download Options

It may be useful to know:

## CompilingYAP

YAP-7.1.0 is a cmake based system We use cmake because it supports mosts popular software, can generate Makefiles, Ninja, Apple's XCode, VisualStudio and ANdroid Studio, and because it includes packaging suppport, The steps required to install core YAP under cmake:

<tt>C/C++</tt> compiler

Status as of early 2017

YAP should compile well under the GNU-CC and the [C-LANG]https://clang.llvm.org/() families, that are available across most configurations It sshould also compile well undder Intel icc

We do not recommend using Microoft's VC++ To the best of our knowledge MSC does not support threaded emulation, which YAP recquires for performance, You can still use the IDE, and experiment with the c-lang plugin

YAP compiles cleanly under cross-compilers, and we have used the crosss-compilation system mxe system with good results


All Linux and BSD distributions include cmake, so does Homebrew and MacPorts for the Mac, and MSYS2 and cygwin for WIN32 Android Studio has native support for cmakesince 2.1, although we advise to use 2.2 Last, there are excellent plugins for the Visual Codes In case you need a recent version, consider using pre-compiled binaries at the CMake site

If you have an older Linux you may need to compile from source, available at GitHub

Ensure that you have other necessary packages installed:

Compile and Install

1: Create a directory, say Build and cd to the directory (cd Build) *YAP should not be compiled at its root directory, some packages do not allow for that

2: Run cmake ../ from within Build (or equivalent)

3: Run make from within Build (or equivalent)

4: If the compilation succeeds, try /yap This is your executable

5: If you feel satisfied with the result, do make install

Tuning the Functionality of YAP

By default, YAP supports tabling, depth first search, and most features found in modern Prologs In some cases, you may want to suport extra features, or reduce system size cmakeprovides an graphical interface for doing so From the commmand line, a typical example could be:

cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=~ /users/vsc/src/yap

The first argument says that this is a release, compiled with full optimisation The second argument says YAP should install under the ~ drectory In this case, YAP will add the binaries to /users/vsc/bin, include files to /users/vsc/include/Yap, Prolog files to /users/vsc/share/Yap, and ay DLL to /users/vsc/lib/Yap

Options include:

You may also want to use a different compilation environment As an example:

cmake -GXcode ..

will generate files for compilation of YAP within Apple's Xcode IDE You can also use xcodebuild from the command line

Bext follow instructions to fully compile YAP:

Compilation Notes for OSX/Brew

Next follows a detailed description of a full install of YAP, including all the packages that YAP can use:

  1. Install the XCode toolkit from the Apple App Store (you may have to register as a developer)
  2. Install a package manager, such as brew,
  3. You will need cmake and gmp: both are available in brew
  4. other brew packages you may want to install: gecode, libxml2, openssl, mariadb, openmpi, postgresql, raptor, sqlite3, swig, unixodbc Note that some of them may be preconditions to other packages
  5. to install cudd, a package used by ProbLog and cplint, just use:
    brew tap mht208/formal
    brew install cudd
  6. To use R, you must download the R distribution from one of the many R mirrors
  1. To use Java, you should download the Oracle distributed JDK
  1. When installing Python, verify which python you are using
  2. There may be conflict between original OSX and the brew packages (eg, openssl, python, and sqlite3 If you prefer leaning on brew:
    cmake -DOPENSSL_ROOT_DIR=/usr/local/opt/openssl ..

Compilation Notes for Android

Next we present the compilation process for Android The environment is an OSX, but steps should be similar for Linux machines We assume you have downloaded both the Android NDK and the Android SDK

  1. Reserve a directory for compilation:
    mkdir android
    cd android
  2. Get the GMP-android port
  1. Call cmake: ~~~~~ export ANDROID_NDK=/Volumes/Transcend/vsc/android-ndk-r11c; \ export ANDROID_SDK=/Volumes/Transcend/vsc/AndroidSDK;\ export ANDROID_PORT=1;\ export PATH=$PATH:/Volumes/Transcend/vsc/AndroidSDK/tools/;\ cmake \ -DGMP_INCLUDE_DIRS=/Users/vsc/github/gmp/armeabi-v7a \ -DGMP_LIBRARIES=/Users/vsc/github/gmp/armeabi-v7a/libgmp.so\ -DCMAKE_TOOLCHAIN_FILE=/users/vsc/github/yap-6.3/cmake/android.toolchain.cmake \ -DANDROID_ABI=armeabi-v7a -DANDROID_NATIVE_API_LEVEL=android-23 \ && make -j ```