# Can't build on Ubuntu

**URL:** <https://swi-prolog.discourse.group/t/cant-build-on-ubuntu/9257>\
**Category:** Installing\
**Tags:** how-to, build, install\
**Created:** [September 8, 2025, 5:11pm UTC](https://swi-prolog.discourse.group/t/cant-build-on-ubuntu/9257 "2025-09-08T17:11:33Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![CarlosLang](https://yyz2.discourse-cdn.com/free1/user_avatar/swi-prolog.discourse.group/carloslang/32/7484_2.png) [@CarlosLang](https://swi-prolog.discourse.group/u/CarlosLang)\
**Post date:** [September 8, 2025, 5:11pm UTC](https://swi-prolog.discourse.group/t/cant-build-on-ubuntu/9257/1 "2025-09-08T17:11:33Z")

</div>

Right after cloning the latest swipl-devel repo, following CMAKE.md, I did

```prolog
    cd swipl-devel
    mkdir build
    cd build
    cmake -G Ninja ..

```

Which produced the following error messages

```prolog
CMake Error: CMake was unable to find a build program corresponding to "Ninja". CMAKE_MAKE_PROGRAM is not set. You probably need to select a different build tool.
CMake Error: CMAKE_C_COMPILER not set, after EnableLanguage
CMake Error: CMAKE_CXX_COMPILER not set, after EnableLanguage
-- Configuring incomplete, errors occurred!

```

How can I fix this, to proceed with the build and later installation.

Sorry, I’m new to CMAKE, if there is a resource I should read first, it will be welcome. On the other hand, if you have some quick-fix commands, that will really help.

Thanks.

---

<div class="post-metadata">

**Author:** ![peter.ludemann](https://yyz2.discourse-cdn.com/free1/user_avatar/swi-prolog.discourse.group/peter.ludemann/32/48_2.png) [@peter.ludemann](https://swi-prolog.discourse.group/u/peter.ludemann)\
**Post date:** [September 8, 2025, 5:37pm UTC](https://swi-prolog.discourse.group/t/cant-build-on-ubuntu/9257/2 "2025-09-08T17:37:17Z")

</div>

> [@CarlosLang](#):
>
> `CMake was unable to find a build program corresponding to "Ninja".`

Have you tried this:

```prolog
sudo apt install ninja-build

```

---

<div class="post-metadata">

**Author:** ![CarlosLang](https://yyz2.discourse-cdn.com/free1/user_avatar/swi-prolog.discourse.group/carloslang/32/7484_2.png) [@CarlosLang](https://swi-prolog.discourse.group/u/CarlosLang)\
**Post date:** [September 8, 2025, 6:36pm UTC](https://swi-prolog.discourse.group/t/cant-build-on-ubuntu/9257/3 "2025-09-08T18:36:09Z")

</div>

@peter.ludemann :

Thanks for the quick reply. That allows me to move one step forward. Still with some issues. I will try to summarize fixes, or issues if I reach a blocking one.

---

<div class="post-metadata">

**Author:** ![CarlosLang](https://yyz2.discourse-cdn.com/free1/user_avatar/swi-prolog.discourse.group/carloslang/32/7484_2.png) [@CarlosLang](https://swi-prolog.discourse.group/u/CarlosLang)\
**Post date:** [September 8, 2025, 7:26pm UTC](https://swi-prolog.discourse.group/t/cant-build-on-ubuntu/9257/4 "2025-09-08T19:26:50Z")

</div>

All running smoothly up to successful installation (after following all the installation instructions in full detail).

The only issue I still have is that after running check\_installation in swipl, I get this issue:

```prolog
% Loading library(janus) ....................... FAILED
Warning: Cannot load required shared library
Warning: See http://www.swi-prolog.org/build/issues/janus.html

```

I installed the ubuntu python packages mentioned in the above reference, but still get the same error, after repeating the whole build and installation sequence.

What I really need for my project is access from Python to Prolog, but it would be a lot nicer to have a completely clean installation, just in case I might need that package, eventually (might be likely).

Any further suggestions?

Thanks

---

<div class="post-metadata">

**Author:** ![brebs](https://avatars.discourse-cdn.com/v4/letter/b/e9c0ed/32.png) [@brebs](https://swi-prolog.discourse.group/u/brebs)\
**Post date:** [September 8, 2025, 10:04pm UTC](https://swi-prolog.discourse.group/t/cant-build-on-ubuntu/9257/5 "2025-09-08T22:04:08Z")

</div>

> [@CarlosLang](#):
>
> `Cannot load required shared library`

I think the instructions at [GitHub - SWI-Prolog/packages-swipy: Python interface for SWI-Prolog](https://github.com/SWI-Prolog/packages-swipy) are relevant, especially its mention of `pip install .` to compile Janus-swi.

---

<div class="post-metadata">

**Author:** ![CarlosLang](https://yyz2.discourse-cdn.com/free1/user_avatar/swi-prolog.discourse.group/carloslang/32/7484_2.png) [@CarlosLang](https://swi-prolog.discourse.group/u/CarlosLang)\
**Post date:** [September 9, 2025, 3:14am UTC](https://swi-prolog.discourse.group/t/cant-build-on-ubuntu/9257/6 "2025-09-09T03:14:47Z")

</div>

@brebs :

[Edited]

Thanks a lot for the suggestion. Yes, I ended up noticing that and made sure to install from the same source repo. I found something else: when I try to use the library from swipl, I get this message:

```prolog
ERROR: open_shared_object/3: libpython3.12.so.1.0: cannot open shared object file: No such file or directory

```

I installed python3.12, still with no better results.

After I removed all python3.12 components from my system, the build was completely successful, including package Janus. For your reference, I am running on python3.13.3

---

<div class="post-metadata">

**Author:** ![jan](https://yyz2.discourse-cdn.com/free1/user_avatar/swi-prolog.discourse.group/jan/32/4_2.png) [@jan](https://swi-prolog.discourse.group/u/jan)\
**Post date:** [September 9, 2025, 9:40am UTC](https://swi-prolog.discourse.group/t/cant-build-on-ubuntu/9257/7 "2025-09-09T09:40:42Z")

</div>

> [@CarlosLang](#):
>
> After I removed all python3.12 components from my system, the build was completely successful, including package Janus. For your reference, I am running on python3.13.3

I think it is particularly vital that the versions of the Python `dev` package matches the version of the running Python system. Embedding Python into Prolog links to a particular version of the Python `.so` file. There is unfortunately no way around that (AFAIK).

Anyway, great you fixed it! Happy hacking 🙂
