Search code examples
installationprologswi-prolog

Having touble installing SWI-Prolog on Linux


I am following the installation instructions from SWI-Prolog's site. I am on a Linux machine.

First I git-clone the repo and cd into swipl-devel.

Next I run the commands:

git submodule update --init
mkdir build
cd build
cmake -DCMAKE_INSTALL_PREFIX="${install_under}/swipl" -G Ninja ..
ninja

This all goes smoothly.

Next, when I run ctest -j 4 I get back:

98% tests passed, 1 tests failed out of 66

Total Test time (real) =  15.23 sec

The following tests FAILED:
     24 - swipl:xsb/nonmt_tests (Failed)
Errors while running CTest

I then become root and run ninja install. Here is what I get back:

[12/13] Install the project...
-- Install configuration: "RelWithDebInfo"
-- Set runtime path of "/home/nick/prolog/swipl-devel/build/install_under: command not found/swipl/lib/swipl/bin/x86_64-linux/swipl" to "/home/nick/prolog/swipl-devel/build/install_under: command not found/swipl/lib/swipl/lib/x86_64-linux"
-- Set runtime path of "/home/nick/prolog/swipl-devel/build/install_under: command not found/swipl/lib/swipl/lib/x86_64-linux/libswipl.so.8.3.6" to "/home/nick/prolog/swipl-devel/build/install_under: command not found/swipl/lib/swipl/lib/x86_64-linux"
-- Set runtime path of "/home/nick/prolog/swipl-devel/build/install_under: command not found/swipl/lib/swipl/bin/x86_64-linux/swipl-ld" to "/home/nick/prolog/swipl-devel/build/install_under: command not found/swipl/lib/swipl/lib/x86_64-linux"
CMake Error at src/cmake_install.cmake:509 (EXECUTE_PROCESS):
  EXECUTE_PROCESS given unknown argument "command".
Call Stack (most recent call first):
  cmake_install.cmake:70 (include)                                                                                                                                                             
                                                                                                                                                                                               
                                                                                                                                                                                               
FAILED: CMakeFiles/install.util                                                                                                                                                                
cd /home/nick/prolog/swipl-devel/build && /usr/bin/cmake -P cmake_install.cmake                                                                                                                
ninja: build stopped: subcommand failed.                                            

I am not sure what I am missing.


Solution

  • There is something really going wrong.

    I have never had the swipl:xsb/nonmt_tests tests failing (whatever they are).

    Is the shell variable install_under properly set when you run the above?

    For example, I always install under a directory like /usr/local/logic/swipl, so here you would have to say

    -DCMAKE_INSTALL_PREFIX=/usr/local/logic/swipl

    or

    export install_under=/usr/local/logic/

    in your case (not sure whether the export is needed, it sets an environment variable).