I am trying to get a standalone executable for my Prolog program
program.pl on 64-bit Ubuntu. For this reason I am using the command:
$ swipl --stand_alone=true -o program_standalone -g main -c program.pl
According to the documentation page on Creating Executables in Linux, in order for this command to produce
program_standalone that works in a Prologless environment without moaning about missing shared libraries, SWI-Prolog must be statically linked which should be the default in 32-bit Linux distributions. Since my system is 64-bit, I had to link it statically.
According to this Thread, I should pass
-DSWIPL_SHARED_LIB=OFF to the building process to obtain the statically-linked SWI-Prolog I so long for.
So, I have included that juicy bit of information in the building process described in the page Installation on Linux, and the steps I performed (after obtaining a fresh copy today via
mkdir build cd build cmake -DCMAKE_INSTALL_PREFIX=$HOME -DSWIPL_SHARED_LIB=OFF -G Ninja .. ninja ctest -j 4 ninja install
However, after everything is done, I get the following.
$ ldd program_standalone linux-vdso.so.1 (0x00007ffc63bd3000)` libswipl.so.8 => /usr/lib/swi-prolog/lib/x86_64-linux/libswipl.so.8 (0x00007fde7107d000) libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007fde70c8c000) libtinfo.so.5 => /lib/x86_64-linux-gnu/libtinfo.so.5 (0x00007fde70a62000) libgmp.so.10 => /usr/lib/x86_64-linux-gnu/libgmp.so.10 (0x00007fde707e1000) libz.so.1 => /lib/x86_64-linux-gnu/libz.so.1 (0x00007fde705c4000) libpthread.so.0 => /lib/x86_64-linux-gnu/libpthread.so.0 (0x00007fde703a5000) libdl.so.2 => /lib/x86_64-linux-gnu/libdl.so.2 (0x00007fde701a1000) libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x00007fde6fe03000) librt.so.1 => /lib/x86_64-linux-gnu/librt.so.1 (0x00007fde6fbfb000) /lib64/ld-linux-x86-64.so.2 (0x00007fde715e0000)
If I understand things correctly – which is doubtful; I should get no dependencies after the
Where did I go wrong?