# Why source\_sink 'library(tipc/tipc)' does not exist?

**URL:** <https://swi-prolog.discourse.group/t/why-source-sink-library-tipc-tipc-does-not-exist/1887>\
**Category:** Installing\
**Created:** [February 20, 2020, 12:15pm UTC](https://swi-prolog.discourse.group/t/why-source-sink-library-tipc-tipc-does-not-exist/1887 "2020-02-20T12:15:32Z")\
**Posts on this page:** 12\
**Page:** 1

<div class="post-metadata">

**Author:** ![ArthurWang](https://yyz2.discourse-cdn.com/free1/user_avatar/swi-prolog.discourse.group/arthurwang/32/152_2.png) [@ArthurWang](https://swi-prolog.discourse.group/u/ArthurWang)\
**Post date:** [February 20, 2020, 12:15pm UTC](https://swi-prolog.discourse.group/t/why-source-sink-library-tipc-tipc-does-not-exist/1887/1 "2020-02-20T12:15:32Z")

</div>

Hi all,  
I’m trying to import tipc library but got error of ‘does not exist’. This occurs even in the latest stable release. Other libs seem ok.

```prolog
Welcome to SWI-Prolog (threaded, 64 bits, version 8.1.22)
SWI-Prolog comes with ABSOLUTELY NO WARRANTY. This is free software.
Please run ?- license. for legal details.

For online help and background, visit https://www.swi-prolog.org
For built-in help, use ?- help(Topic). or ?- apropos(Word).

?- use_module(library(tipc/tipc)).
ERROR: source_sink `library(tipc/tipc)' does not exist
ERROR: In:
ERROR: [19] throw(error(existence_error(source_sink,...),_3262))
ERROR: [15] '$resolve_source_path'(library(tipc/tipc),_3294,[if(not_loaded),...]) at /usr/local/Cellar/swi-prolog/HEAD-0bd221e_1/libexec/lib/swipl/boot/init.pl:2259
ERROR: [14] '$load_file'(library(tipc/tipc),user,[if(not_loaded),...]) at /usr/local/Cellar/swi-prolog/HEAD-0bd221e_1/libexec/lib/swipl/boot/init.pl:2236
ERROR: [9] <user>
ERROR:
ERROR: Note: some frames are missing due to last-call optimization.
ERROR: Re-run your program in debug mode (:- debug.) to get more detail.
?- use_module(library(pengines)).
true.
___________________________________
I'm working on MacOS catalina.

```

The latest swipl-devel was installed via ‘brew install swi-prolog --HEAD’ successfully.

In fact I’ve tried to compile swipl from the git repository but failed in ctest.

Thanks in advance for any helps.

Arthur Wang

---

<div class="post-metadata">

**Author:** ![EricGT](https://avatars.discourse-cdn.com/v4/letter/e/f1d935/32.png) [@EricGT](https://swi-prolog.discourse.group/u/EricGT)\
**Post date:** [February 20, 2020, 12:41pm UTC](https://swi-prolog.discourse.group/t/why-source-sink-library-tipc-tipc-does-not-exist/1887/2 "2020-02-20T12:41:38Z")

</div>

I have not tested this out as I am using Windows 10 and I believe you are on a Mac, but I am sure Jan will correct me if I make a mistake.

`tipc` is not a library in the library directory by default, ([GitHub](https://github.com/SWI-Prolog/swipl-devel/tree/master/library)), so it is not installed by default.

tipc is available for download at [https://github.com/SWI-Prolog/contrib-tipc](https://github.com/SWI-Prolog/contrib-tipc)  
This also has an install script [install-sh](https://github.com/SWI-Prolog/contrib-tipc/blob/5e3cd3a02cf849e336ee05d4875a5674d02131f2/install-sh)

After this the `use_module(library(tipc/tipc)).` should work. If not check the physical path on the disk with the path given in use\_module.

HTH

* * *

Side note

Missing from the list of packages in the documentation: [Packs](https://www.swi-prolog.org/pack/list) (add-ons) for SWI-Prolog

---

<div class="post-metadata">

**Author:** ![EricGT](https://avatars.discourse-cdn.com/v4/letter/e/f1d935/32.png) [@EricGT](https://swi-prolog.discourse.group/u/EricGT)\
**Post date:** [February 20, 2020, 1:55pm UTC](https://swi-prolog.discourse.group/t/why-source-sink-library-tipc-tipc-does-not-exist/1887/3 "2020-02-20T13:55:06Z")

</div>

3 posts were split to a new topic: [Library, packages and packs?](https://swi-prolog.discourse.group/t/library-packages-and-packs/1889)

---

<div class="post-metadata">

**Author:** ![Boris](https://yyz2.discourse-cdn.com/free1/user_avatar/swi-prolog.discourse.group/boris/32/7486_2.png) [@Boris](https://swi-prolog.discourse.group/u/Boris)\
**Post date:** [February 20, 2020, 1:21pm UTC](https://swi-prolog.discourse.group/t/why-source-sink-library-tipc-tipc-does-not-exist/1887/4 "2020-02-20T13:21:35Z")

</div>

> [@ArthurWang](#):
>
> In fact I’ve tried to compile swipl from the git repository but failed in ctest.

For me this would be a bad sign. What errors do you get?

tipc in particular is one of the submodules. If you follow the instructions for building from the sources, in theory, those should be available. If you use homebrew, the relevant instructions are [here](https://www.swi-prolog.org/build/macos.html), for the dependencies:

```prolog
brew install \
     cmake \
     ninja \
     gmp \
     openssl \
     libarchive \
     readline \
     ossp-uuid \
     libyaml \
     unixodbc \
     berkeley-db \
     pcre \
     jpeg

```

and then [here](https://github.com/SWI-Prolog/swipl-devel/blob/0bd221e8eecb39d9e9b61d0b482a7b4eac4c488e/CMAKE.md).

Are you sure you did

```prolog
git pull
git submodule update --init

```

?

I also notice that it says “Compatibility Linux only” in the docs. After I build (following the instructions available in CMAKE.md, linked above), inside the build directory, there is a file called `CMakeCache.txt`. In this file, I see:

```prolog
//TIPC_networking
SWIPL_PACKAGES_TIPC:BOOL=ON

```

---

<div class="post-metadata">

**Author:** ![ArthurWang](https://yyz2.discourse-cdn.com/free1/user_avatar/swi-prolog.discourse.group/arthurwang/32/152_2.png) [@ArthurWang](https://swi-prolog.discourse.group/u/ArthurWang)\
**Post date:** [February 20, 2020, 2:48pm UTC](https://swi-prolog.discourse.group/t/why-source-sink-library-tipc-tipc-does-not-exist/1887/5 "2020-02-20T14:48:48Z")

</div>

Thank you for response. I’ve found that tipc is in the list of ‘brew install swi-prolog --HEAD’:

% brew install swi-prolog --HEAD  
Warning: A newer Command Line Tools release is available.  
Update them from Software Update in System Preferences or  
[https://developer.apple.com/download/more/](https://developer.apple.com/download/more/).

==\> Cloning [https://github.com/SWI-Prolog/swipl-devel.git](https://github.com/SWI-Prolog/swipl-devel.git)  
Updating /Users/laowang/Library/Caches/Homebrew/swi-prolog–git  
From [https://github.com/SWI-Prolog/swipl-devel](https://github.com/SWI-Prolog/swipl-devel)  
f40f32e…0bd221e master -\> origin/master  
==\> Checking out branch master  
Already on ‘master’  
Your branch is behind ‘origin/master’ by 7 commits, and can be fast-forwarded.  
(use “git pull” to update your local branch)  
HEAD is now at 0bd221e Document the single NaN and fix nearest.  
Entering ‘bench’  
Entering ‘debian’  
Entering ‘packages/PDT’  
…  
Entering ‘packages/sgml’  
Entering ‘packages/ssl’  
Entering ‘packages/swipl-win’  
Entering ‘packages/table’  
**Entering 'packages/tipc’**  
Entering ‘packages/utf8proc’  
Entering ‘packages/windows’  
Entering ‘packages/xpce’  
…  
/Users/laowang/Library/Caches/Homebrew/swi-prolog–git/packages/swipl-win  
/Users/laowang/Library/Caches/Homebrew/swi-prolog–git/packages/table  
**/Users/laowang/Library/Caches/Homebrew/swi-prolog–git/packages/tipc**  
/Users/laowang/Library/Caches/Homebrew/swi-prolog–git/packages/utf8proc  
/Users/laowang/Library/Caches/Homebrew/swi-prolog–git/packages/windows  
…  
==\> cmake … -DCMAKE\_C\_FLAGS\_RELEASE=-DNDEBUG -DCMAKE\_CXX\_FLAGS\_RELEASE=-DNDEBUG -DCMAKE\_INSTALL\_PREFIX=/usr/local/Cellar/swi-pro  
==\> make install  
🍺 /usr/local/Cellar/swi-prolog/HEAD-0bd221e\_1: 906 files, 19.8MB, built in 2 minutes 10 seconds  
Removing: /Users/laowang/Library/Caches/Homebrew/swi-prolog–8.0.3\_1.catalina.bottle.tar.gz… (4.9MB)

It seems it is compiled and installed ok. But I haven’t found tipc.so and tipc.pl in the installed directories.

---

<div class="post-metadata">

**Author:** ![ArthurWang](https://yyz2.discourse-cdn.com/free1/user_avatar/swi-prolog.discourse.group/arthurwang/32/152_2.png) [@ArthurWang](https://swi-prolog.discourse.group/u/ArthurWang)\
**Post date:** [February 20, 2020, 3:49pm UTC](https://swi-prolog.discourse.group/t/why-source-sink-library-tipc-tipc-does-not-exist/1887/6 "2020-02-20T15:49:50Z")

</div>

I did as the document guides:

laowang@bogon build % cmake -DCMAKE\_INSTALL\_PREFIX=/opt/swipl -DCMAKE\_BUILD\_TYPE=Debug -G Ninja …  
…  
– Looking for rl\_event\_hook  
– Looking for rl\_event\_hook - found  
– Configuring done  
– Generating done  
– Build files have been written to: /Users/laowang/Downloads/swipl-devel/build  
laowang@bogon build % ninja  
[1925/2359] Building Java objects for jpl\_jar.jar  
注: org/jpl7/fli/atom\_t.java使用或覆盖了已过时的 API。  
注: 有关详细信息, 请使用 -Xlint:deprecation 重新编译。  
[2359/2359] Generating home/doc/manindex.db  
laowang@bogon build % ctest -j 8  
Test project /Users/laowang/Downloads/swipl-devel/build  
…  
61/61 Test #23: swipl:thread … Passed 18.66 sec

97% tests passed, 2 tests failed out of 61

Total Test time (real) = 24.13 sec

The following tests FAILED:  
58 - bdb:bdb (SEGFAULT)  
61 - ssl:ssl (Failed)  
Errors while running CTest  
laowang@bogon build % sudo ninja install  
Password:  
[3/4] Install the project…  
– Install configuration: “Debug”

* * *

ctest doesn’t include tipc.

## After installing, no tipc again.

Welcome to SWI-Prolog (threaded, 64 bits, version 8.1.22)  
SWI-Prolog comes with ABSOLUTELY NO WARRANTY. This is free software.  
Please run ?- license. for legal details.

For online help and background, visit [https://www.swi-prolog.org](https://www.swi-prolog.org)  
For built-in help, use ?- help(Topic). or ?- apropos(Word).

?- use\_module(library(tipc/tipc)).  
ERROR: source\_sink `library(tipc/tipc)’ does not exist  
ERROR: In:  
ERROR: [19] throw(error(existence\_error(source\_sink,…),\_4054))  
ERROR: [15] ‘$resolve\_source\_path’(library(tipc/tipc),\_4086,[if(not\_loaded),…]) at /usr/local/Cellar/swi-prolog/HEAD-0bd221e\_1/libexec/lib/swipl/boot/init.pl:2259  
ERROR: [14] ‘$load\_file’(library(tipc/tipc),user,[if(not\_loaded),…]) at /usr/local/Cellar/swi-prolog/HEAD-0bd221e\_1/libexec/lib/swipl/boot/init.pl:2236  
ERROR: [9]   
ERROR:  
ERROR: Note: some frames are missing due to last-call optimization.  
ERROR: Re-run your program in debug mode (:- debug.) to get more detail.  
?-

* * *

Then I entered packeges/tipc and tried to build there:  
laowang@bogon build % pwd  
/Users/laowang/Downloads/swipl-devel/packages/tipc/build  
laowang@bogon build % cmake …  
CMake Error at CMakeLists.txt:6 (AC\_CHECK\_HEADERS):  
Unknown CMake command “AC\_CHECK\_HEADERS”.

– Configuring incomplete, errors occurred!  
See also “/Users/laowang/Downloads/swipl-devel/packages/tipc/build/CMakeFiles/CMakeOutput.log”.  
laowang@bogon build %

I did see install-sh script, but I don’t know how to use it to build the lib.

Further helps are appreciated!

---

<div class="post-metadata">

**Author:** ![Boris](https://yyz2.discourse-cdn.com/free1/user_avatar/swi-prolog.discourse.group/boris/32/7486_2.png) [@Boris](https://swi-prolog.discourse.group/u/Boris)\
**Post date:** [February 20, 2020, 4:12pm UTC](https://swi-prolog.discourse.group/t/why-source-sink-library-tipc-tipc-does-not-exist/1887/7 "2020-02-20T16:12:27Z")

</div>

After all, it seems that TIPC is indeed available on Linux only. It is documented, [see here](https://www.swi-prolog.org/pldoc/doc_for?object=section(%27packages/tipc.html%27)). Look for “compatibility”.

[Jan said the same](https://swi-prolog.discourse.group/t/library-packages-and-packs/1889/6) but the topic got split off so you probably didn’t see it.

I don’t know if you want to report the other test errors that you see. It could be caused by incorrectly installed dependencies, or maybe there are real problems.

PS: if tipc is not available on MacOS for sure, it should be removed from the Homebrew scripts I guess? @jan? I do not have a Mac at all so I don’t even know where to start.

PPS: The code for the Homebrew formula is [here I guess](https://github.com/Homebrew/homebrew-core/blob/8b84e893e2220b3c28ff6def1d441adb2e5a916f/Formula/swi-prolog.rb)? There isn’t a documented flag for _not_ trying to install TIPC, but in CMAKE.md I read:

> Note that packages for which the prerequisites cannot be found are dropped automatically, as are packages for which the sources are not installed.

---

<div class="post-metadata">

**Author:** ![ArthurWang](https://yyz2.discourse-cdn.com/free1/user_avatar/swi-prolog.discourse.group/arthurwang/32/152_2.png) [@ArthurWang](https://swi-prolog.discourse.group/u/ArthurWang)\
**Post date:** [February 21, 2020, 3:56am UTC](https://swi-prolog.discourse.group/t/why-source-sink-library-tipc-tipc-does-not-exist/1887/8 "2020-02-21T03:56:46Z")

</div>

Thank you all again. I didn’t notice the compatibility issue, since I found tipc is in the list of brew packages. I’d like to get a way to work around.

With regards,  
Arthur Wang

---

<div class="post-metadata">

**Author:** ![Boris](https://yyz2.discourse-cdn.com/free1/user_avatar/swi-prolog.discourse.group/boris/32/7486_2.png) [@Boris](https://swi-prolog.discourse.group/u/Boris)\
**Post date:** [February 21, 2020, 4:39am UTC](https://swi-prolog.discourse.group/t/why-source-sink-library-tipc-tipc-does-not-exist/1887/9 "2020-02-21T04:39:19Z")

</div>

From what I understand, the obvious work-around is to use Linux…

---

<div class="post-metadata">

**Author:** ![ArthurWang](https://yyz2.discourse-cdn.com/free1/user_avatar/swi-prolog.discourse.group/arthurwang/32/152_2.png) [@ArthurWang](https://swi-prolog.discourse.group/u/ArthurWang)\
**Post date:** [February 21, 2020, 9:26am UTC](https://swi-prolog.discourse.group/t/why-source-sink-library-tipc-tipc-does-not-exist/1887/10 "2020-02-21T09:26:18Z")

</div>

First I’ll try library(socket) for compatibility consideration. If it’s too much to do I’d resort to linux with sacrifying compatibility.

Boris Vassilev via SWI-Prolog [swiprolog@discoursemail.com](mailto:swiprolog@discoursemail.com) 于2020年2月21日周五 下午12:49写道：

---

<div class="post-metadata">

**Author:** ![EricGT](https://avatars.discourse-cdn.com/v4/letter/e/f1d935/32.png) [@EricGT](https://swi-prolog.discourse.group/u/EricGT)\
**Post date:** [February 21, 2020, 10:11am UTC](https://swi-prolog.discourse.group/t/why-source-sink-library-tipc-tipc-does-not-exist/1887/11 "2020-02-21T10:11:36Z")

</div>

This is a pure guess but something I have not seen you mention and something I would try if this were my problem.

A Docker container might work. See: [SWI-Prolog Docker images](https://www.swi-prolog.org/Docker.html)

My concern would be that the [C code](https://github.com/SWI-Prolog/contrib-tipc/blob/5e3cd3a02cf849e336ee05d4875a5674d02131f2/tipc.c) for `tipc` might try to access some part of the system calls that the Docker container will not allow.

HTH

---

<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:** [February 21, 2020, 10:42am UTC](https://swi-prolog.discourse.group/t/why-source-sink-library-tipc-tipc-does-not-exist/1887/12 "2020-02-21T10:42:52Z")

</div>

> [@EricGT](#):
>
> My concern would be that the [C code](https://github.com/SWI-Prolog/contrib-tipc/blob/5e3cd3a02cf849e336ee05d4875a5674d02131f2/tipc.c) for `tipc` might try to access some part of the system calls that the Docker container will not allow.

Also in Linux, you need a kernel module. Before using TIPC networking you need to do

```
 sudo modprobe tipc

```

I do not know how this works for Docker. Possibly you have to do the modprobe in the hosting Linux OS. If all this works the Docker virtual network also needs to forward the TIPC packages. Searching for “docker tipc” will probably give answers.

Yes, TIPC has some interesting properties when compared to UDP networking but it might be hard to use on anything except for a cluster of bare metal Linux machines connected in a LAN.
