I seem to have built SWI-Prolog without support for PceEmacs

I built SWI-Prolog on my Linux computer (openSUSE Tumbleweed) by running these exact commands:

git clone https://github.com/SWI-Prolog/swipl-devel.git
cd swipl-devel
git submodule update --init

cd swipl-devel
mkdir build
cd build
cmake -DCMAKE_INSTALL_PREFIX=/usr/local/logic ..
make
ctest -j 4
sudo make install

I passed every test from the ctest -j 4 command.

Now when I start swipl and run emacs. I get this error: ERROR: Unknown procedure: emacs/0 (DWIM could not correct goal). On my previous install of SWI-Prolog I had once tried to use PceEmacs and gotten this same error but didn’t think much of it and moved on. That was several months ago.

The only information I can find on this error is from this Stack Overflow post, which doesn’t actually provide a solution to the problem.

Please let me know what I can do.

1 Like

Not that I know the exact file that is missing, Jan W. will know, but what does the following Prolog predicate return?

check_installation.

A valid result can be seen in this post.

@?- check_installation.
% Checking your SWI-Prolog kit for common issues ...
% 
% Version: ............. 8.3.10-10-gc2e4524a3
% Address bits: ........ 64
% Architecture: ........ x86_64-linux
% Installed at: ........ /usr/local/logic/lib/swipl
% Cores: ............... 8
% 
% Checking tcmalloc ............................ not present
Warning: See http://www.swi-prolog.org/build/issues/tcmalloc.html
% Checking gmp ................................. ok
% Loading library(archive) ..................... ok
%   Supported filters: bzip2, compress, gzip, grzip, lrzip, lzip, lzma, lzop, none, rpm, uu, xz
%   Supported formats: 7zip, ar, cab, cpio, empty, gnutar, iso9660, lha, mtree, rar, raw, tar, xar, zip
% Loading library(cgi) ......................... ok
% Loading library(crypt) ....................... ok
Warning: library(bdb) .......................... NOT FOUND
Warning: See http://www.swi-prolog.org/build/issues/bdb.html
% Loading library(double_metaphone) ............ ok
% Loading library(filesex) ..................... ok                                 
% Loading library(http/http_stream) ............ ok                                 
% Loading library(http/json) ................... ok                                 
% Loading library(http/jquery) ................. ok                                 
%   jQuery from /usr/local/logic/lib/swipl/library/http/web/js/jquery-1.11.3.min.js 
% Loading library(isub) ........................ ok                                 
Warning: library(jpl) .......................... NOT FOUND
Warning: See http://www.swi-prolog.org/build/issues/jpl.html                        
% Loading library(memfile) ..................... ok
Warning: library(odbc) ......................... NOT FOUND
Warning: See http://www.swi-prolog.org/build/issues/odbc.html                       
Warning: library(pce) .......................... NOT FOUND                          
Warning: See http://www.swi-prolog.org/build/issues/xpce.html                       
% Loading library(pcre) ........................ ok
% Loading library(pdt_console) ................. ok
% Loading library(porter_stem) ................. ok
% Loading library(process) ..................... ok
% Loading library(protobufs) ................... ok
Warning: library(editline) ..................... NOT FOUND
Warning: See http://www.swi-prolog.org/build/issues/editline.html
% Loading library(readline) .................... ok
% Loading library(readutil) .................... ok
% Loading library(rlimit) ...................... ok
% Loading library(semweb/rdf_db) ............... ok
% Loading library(semweb/rdf_ntriples) ......... ok
% Loading library(semweb/turtle) ............... ok
% Loading library(sgml) ........................ ok
% Loading library(sha) ......................... ok
% Loading library(snowball) .................... ok
% Loading library(socket) ...................... ok
% Loading library(ssl) ......................... ok
% Loading library(crypto) ...................... ok
% Loading library(syslog) ...................... ok
% Loading library(table) ....................... ok
% Loading library(time) ........................ ok
% Loading library(tipc/tipc) ................... ok
% Loading library(unicode) ..................... ok
% Loading library(uri) ......................... ok
Warning: library(uuid) ......................... NOT FOUND
Warning: See http://www.swi-prolog.org/build/issues/uuid.html
% Loading library(zlib) ........................ ok
Warning: library(yaml) ......................... NOT FOUND
Warning: See http://www.swi-prolog.org/build/issues/yaml.html
Warning: Found 8 issues.
true.

I rebuilt with

cmake -DCMAKE_INSTALL_PREFIX=/usr ..

and still have the same problem. I will now work on making sure I have everything that you listed installed, and then will build once again.

Sorry for not having the correct answer the first time but as I noted I am also learning the ropes of building SWI-Prolog.

After thinking about it, the Dockerfile build is for a basic server that does not have all of the GUI bells and whistles, e.g. PCE.

If I am correct, the answer was in the output of check_installation. which is to see https://www.swi-prolog.org/build/issues/xpce.html

which notes

apt-get install swi-prolog-x

I did not know those pages existed until using the URL from check_installation/0, then found many such pages.

ok I will try to figure out how to install swi-prolog-x onto my distribution. There seems to be nice instructions in the manual page you linked.

That is when you install from the package manager. The Docker list of dependencies is one start, the other is (Debian based) https://www.swi-prolog.org/build/Debian.html or (Fedora based) SWI-Prolog on Redhat (Fedora, RHEL, CentOS)

You need library(pce) for the tools. You probably also want library(editline) for the command line editing. The other reported problems are optional components.