This repository has been archived on 2023-08-20. You can view files and clone it, but cannot push or open issues or pull requests.
yap-6.3/INSTALL.md
Joseph Lee Nunn III de693e2095 Fixed no rule for target bug, Cleaned up INSTALL.md compile instr.
Project would not build with error: [ 64%] Built target libYap
Scanning dependencies of target yap-bin
make[2]: *** No rule to make target `CMakeFiles/yap-bin.dir/build'.
Stop.
make[1]: *** [CMakeFiles/yap-bin.dir/all] Error 2
make: *** [all] Error 2

Cleaned up compilation instructions in INSTALL.md & added special
advice for OSX.
2016-05-31 14:47:10 -07:00

5.7 KiB

Installing YAP

YAP-6.3.4 is a cmake based system. We discuss how to use cmake to install YAP, and what are the major options.

Compiling YAP

To compile YAP it should be sufficient to:

0: Install a version of cmake 3.0 or above, if you don't have it, and add it to your path, you can find it here: https://cmake.org/ * OSX: Create a symbolic link to the command line executables in /usr/local/bin (which should be on your path) with sudo ln -s /Applications/CMake.app/Contents/bin/* /usr/local/bin/

1: Create a directory, say Build and cd to the directory (cd Build). * Avoid compiling YAP in the src 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. * In most systems you will need to be superuser in order to do make install and make info on the standard directories.

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:

  • CMAKE_BUILD_TYPE: the two main options are Debug, for system development, and Release. to use the system.

  • CMAKE_INSTALL_PREFIX: where to install YAP, by default /usr/local.

  • WITH_DEPTH_LIMIT allows depth limited evaluation, say for implementing iterative deepening (default)

  • WITH_CALL_TRACER allows support for tracing all calls, retries, and backtracks in the system. This can help in debugging your application, but results in performance loss (enabled in Debug).

  • WITH_WAM_PROFILER allows profiling of abstract machine instructions. This is useful when developing YAP, should not be so useful for normal users (not currently supportted)

  • WITH_YAP_CONDOR allows using the Condor system that support High Throughput Computing (HTC) on large collections of distributively owned computing resources (not yet available)

  • WITH_TABLING allows tabling support (default)

  • WITH_YAPOR_COPY allows or-parallelism according to the Muse-based, YapOR model. This option is still highly experimental.

  • WITH_GMP give a path to where one can find the GMP library if not installed in the default path. It is highly advised to have GMP in your compilation environment.

  • WITH_READLINE give a path to where one can find the readline library if not installed in the default path. It is highly advised in Unix-like environments but not useful in Windows.

  • -WITH_Threads allows using of the multi-threading predicates provided by YAP.

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
  1. To use R, you must download the R distribution from one of the many R mirrors.

  2. To use Java, you should download the Oracle distributed JDK.

  3. When installing Python, verify which python you are using.

  4. 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
  1. Get the GMP-android port.

  2. 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