CentOS 8: How to build toxcore Library


toxcore – Library for the Tox encrypted messenger protocol

Home page: https://github.com/irungentoo/toxcore

Step 1: install Development Tools

[root@tutorialspots ~]# dnf groupinstall "Development Tools"
Last metadata expiration check: 2:29:18 ago on Fri 14 Aug 2020 07:00:54 AM CEST.
Dependencies resolved.
================================================================================
 Package           Architecture     Version             Repository         Size
================================================================================
Installing Groups:
 Development Tools

Transaction Summary
================================================================================

Is this ok [y/N]: y
...
Complete!


[root@tutorialspots ~]# dnf install libtool autoconf automake check check-devel
Last metadata expiration check: 2:29:59 ago on Fri 14 Aug 2020 07:00:54 AM CEST.
Package libtool-2.4.6-25.el8.x86_64 is already installed.
Package autoconf-2.69-27.el8.noarch is already installed.
Package automake-1.16.1-6.el8.noarch is already installed.
Dependencies resolved.
================================================================================
 Package            Architecture  Version                Repository        Size
================================================================================
Installing:
 check              x86_64        0.12.0-2.el8           AppStream         89 k
 check-devel        x86_64        0.12.0-2.el8           AppStream         35 k

Transaction Summary
================================================================================
Install  2 Packages

Total download size: 124 k
Installed size: 256 k
Is this ok [y/N]: y
Downloading Packages:
(1/2): check-devel-0.12.0-2.el8.x86_64.rpm      101 kB/s |  35 kB     00:00
(2/2): check-0.12.0-2.el8.x86_64.rpm            253 kB/s |  89 kB     00:00
--------------------------------------------------------------------------------
Total                                           325 kB/s | 124 kB     00:00
Running transaction check
Transaction check succeeded.
Running transaction test
Transaction test succeeded.
Running transaction
  Preparing        :                                                        1/1
  Installing       : check-0.12.0-2.el8.x86_64                              1/2
  Running scriptlet: check-0.12.0-2.el8.x86_64                              1/2
  Installing       : check-devel-0.12.0-2.el8.x86_64                        2/2
  Running scriptlet: check-devel-0.12.0-2.el8.x86_64                        2/2
  Verifying        : check-0.12.0-2.el8.x86_64                              1/2
  Verifying        : check-devel-0.12.0-2.el8.x86_64                        2/2

Installed:
  check-0.12.0-2.el8.x86_64           check-devel-0.12.0-2.el8.x86_64

Complete!

Step 2:

cd /usr/local/src
yum install libsodium-devel -y
[root@tutorialspots src]# yum install libsodium-devel -y
Last metadata expiration check: 2:32:52 ago on Fri 14 Aug 2020 07:00:54 AM CEST.
Dependencies resolved.
================================================================================
 Package                 Architecture   Version              Repository    Size
================================================================================
Installing:
 libsodium-devel         x86_64         1.0.18-2.el8         epel         1.1 M
Installing dependencies:
 libsodium               x86_64         1.0.18-2.el8         epel         162 k

Transaction Summary
================================================================================
Install  2 Packages

Total download size: 1.3 M
Installed size: 4.0 M
Downloading Packages:
(1/2): libsodium-1.0.18-2.el8.x86_64.rpm        2.1 MB/s | 162 kB     00:00
(2/2): libsodium-devel-1.0.18-2.el8.x86_64.rpm  8.3 MB/s | 1.1 MB     00:00
--------------------------------------------------------------------------------
Total                                           2.2 MB/s | 1.3 MB     00:00
Running transaction check
Transaction check succeeded.
Running transaction test
Transaction test succeeded.
Running transaction
  Preparing        :                                                        1/1
  Installing       : libsodium-1.0.18-2.el8.x86_64                          1/2
  Installing       : libsodium-devel-1.0.18-2.el8.x86_64                    2/2
  Running scriptlet: libsodium-devel-1.0.18-2.el8.x86_64                    2/2
  Verifying        : libsodium-1.0.18-2.el8.x86_64                          1/2
  Verifying        : libsodium-devel-1.0.18-2.el8.x86_64                    2/2

Installed:
  libsodium-1.0.18-2.el8.x86_64       libsodium-devel-1.0.18-2.el8.x86_64

Complete!

Step 3:
Download source:

[root@tutorialspots src]# git clone https://github.com/irungentoo/toxcore.git
Cloning into 'toxcore'...
remote: Enumerating objects: 1, done.
remote: Counting objects: 100% (1/1), done.
remote: Total 19309 (delta 0), reused 0 (delta 0), pack-reused 19308
Receiving objects: 100% (19309/19309), 8.29 MiB | 4.00 MiB/s, done.
Resolving deltas: 100% (13201/13201), done.

Step 4:

cd toxcore
autoreconf -i
[root@tutorialspots src]# cd toxcore
[root@tutorialspots toxcore]# autoreconf -i
libtoolize: putting auxiliary files in AC_CONFIG_AUX_DIR, 'configure_aux'.
libtoolize: copying file 'configure_aux/ltmain.sh'
libtoolize: putting macros in AC_CONFIG_MACRO_DIRS, 'm4'.
libtoolize: copying file 'm4/libtool.m4'
libtoolize: copying file 'm4/ltoptions.m4'
libtoolize: copying file 'm4/ltsugar.m4'
libtoolize: copying file 'm4/ltversion.m4'
libtoolize: copying file 'm4/lt~obsolete.m4'
configure.ac:291: installing 'configure_aux/ar-lib'
configure.ac:212: installing 'configure_aux/compile'
configure.ac:292: installing 'configure_aux/config.guess'
configure.ac:292: installing 'configure_aux/config.sub'
configure.ac:9: installing 'configure_aux/install-sh'
configure.ac:9: installing 'configure_aux/missing'
build/Makefile.am: installing 'configure_aux/depcomp'
parallel-tests: installing 'configure_aux/test-driver'

Step 5:

./configure
...
checking for clock_gettime in -lrt... yes
checking for the pthreads library -lpthreads... no
checking whether pthreads work without any flags... no
checking whether pthreads work with -Kthread... no
checking whether pthreads work with -kthread... no
checking for the pthreads library -llthread... no
checking whether pthreads work with -pthread... yes
checking for joinable pthread attribute... PTHREAD_CREATE_JOINABLE
checking if more special flags are required for pthreads... no
checking for PTHREAD_PRIO_INHERIT... yes
checking for pthread_self in -lpthread... yes
checking for OPUS... no
configure: WARNING: disabling AV support Package 'opus', required by 'virtual:world', not found
checking for CHECK... yes
checking that generated files are newer than configure... done
configure: creating ./config.status
config.status: creating Makefile
config.status: creating build/Makefile
config.status: creating libtoxcore.pc
config.status: creating tox.spec
config.status: creating config.h
config.status: executing depfiles commands
config.status: executing libtool commands

Step 6:

make

  CC       ../toxcore/libtoxcore_la-TCP_connection.lo
  CC       ../toxcore/libtoxcore_la-list.lo
  CCLD     libtoxcore.la
  CCLD     DHT_bootstrap
  CC       ../testing/DHT_test-DHT_test.o
  CCLD     DHT_test
  CC       ../testing/Messenger_test-Messenger_test.o
  CCLD     Messenger_test
  CC       ../testing/dns3_test-dns3_test.o
  CC       ../toxdns/libtoxdns_la-toxdns.lo
  CCLD     libtoxdns.la
  CCLD     dns3_test
  CC       ../testing/tox_sync-tox_sync.o
  CCLD     tox_sync
  CC       ../testing/tox_shell-tox_shell.o
  CCLD     tox_shell
  CC       ../testing/irc_syncbot-irc_syncbot.o
  CCLD     irc_syncbot
  CC       ../toxencryptsave/libtoxencryptsave_la-toxencryptsave.lo
  CCLD     libtoxencryptsave.la
make[2]: Leaving directory '/usr/local/src/toxcore/build'
make[2]: Entering directory '/usr/local/src/toxcore'
make[2]: Leaving directory '/usr/local/src/toxcore'
make[1]: Leaving directory '/usr/local/src/toxcore'

Step 7:

[root@tutorialspots toxcore]# sudo make install
make  install-recursive
make[1]: Entering directory '/usr/local/src/toxcore'
Making install in build
make[2]: Entering directory '/usr/local/src/toxcore/build'
make[3]: Entering directory '/usr/local/src/toxcore/build'
 /usr/bin/mkdir -p '/usr/local/lib'
 /bin/sh ../libtool   --mode=install /usr/bin/install -c   libtoxcore.la libtoxdns.la libtoxencryptsave.la '/usr/local/lib'
libtool: install: /usr/bin/install -c .libs/libtoxcore.so.0.0.0 /usr/local/lib/libtoxcore.so.0.0.0
libtool: install: (cd /usr/local/lib && { ln -s -f libtoxcore.so.0.0.0 libtoxcore.so.0 || { rm -f libtoxcore.so.0 && ln -s libtoxcore.so.0.0.0 libtoxcore.so.0; }; })
libtool: install: (cd /usr/local/lib && { ln -s -f libtoxcore.so.0.0.0 libtoxcore.so || { rm -f libtoxcore.so && ln -s libtoxcore.so.0.0.0 libtoxcore.so; }; })
libtool: install: /usr/bin/install -c .libs/libtoxcore.lai /usr/local/lib/libtoxcore.la
libtool: warning: relinking 'libtoxdns.la'
libtool: install: (cd /usr/local/src/toxcore/build; /bin/sh "/usr/local/src/toxcore/libtool"  --silent --tag CC --mode=relink gcc -I.. -I../toxcore -pthread -g -O2 -version-info 0:0:0 -lm -lrt -o libtoxdns.la -rpath /usr/local/lib ../toxdns/libtoxdns_la-toxdns.lo libtoxcore.la -lsodium )
libtool: install: /usr/bin/install -c .libs/libtoxdns.so.0.0.0T /usr/local/lib/libtoxdns.so.0.0.0
libtool: install: (cd /usr/local/lib && { ln -s -f libtoxdns.so.0.0.0 libtoxdns.so.0 || { rm -f libtoxdns.so.0 && ln -s libtoxdns.so.0.0.0 libtoxdns.so.0; }; })
libtool: install: (cd /usr/local/lib && { ln -s -f libtoxdns.so.0.0.0 libtoxdns.so || { rm -f libtoxdns.so && ln -s libtoxdns.so.0.0.0 libtoxdns.so; }; })
libtool: install: /usr/bin/install -c .libs/libtoxdns.lai /usr/local/lib/libtoxdns.la
libtool: warning: relinking 'libtoxencryptsave.la'
libtool: install: (cd /usr/local/src/toxcore/build; /bin/sh "/usr/local/src/toxcore/libtool"  --silent --tag CC --mode=relink gcc -I.. -I../toxcore -pthread -g -O2 -version-info 0:0:0 -lm -lrt -o libtoxencryptsave.la -rpath /usr/local/lib ../toxencryptsave/libtoxencryptsave_la-toxencryptsave.lo libtoxcore.la -lsodium )
libtool: install: /usr/bin/install -c .libs/libtoxencryptsave.so.0.0.0T /usr/local/lib/libtoxencryptsave.so.0.0.0
libtool: install: (cd /usr/local/lib && { ln -s -f libtoxencryptsave.so.0.0.0 libtoxencryptsave.so.0 || { rm -f libtoxencryptsave.so.0 && ln -s libtoxencryptsave.so.0.0.0 libtoxencryptsave.so.0; }; })
libtool: install: (cd /usr/local/lib && { ln -s -f libtoxencryptsave.so.0.0.0 libtoxencryptsave.so || { rm -f libtoxencryptsave.so && ln -s libtoxencryptsave.so.0.0.0 libtoxencryptsave.so; }; })
libtool: install: /usr/bin/install -c .libs/libtoxencryptsave.lai /usr/local/lib/libtoxencryptsave.la
libtool: install: /usr/bin/install -c .libs/libtoxcore.a /usr/local/lib/libtoxcore.a
libtool: install: chmod 644 /usr/local/lib/libtoxcore.a
libtool: install: ranlib /usr/local/lib/libtoxcore.a
libtool: install: /usr/bin/install -c .libs/libtoxdns.a /usr/local/lib/libtoxdns.a
libtool: install: chmod 644 /usr/local/lib/libtoxdns.a
libtool: install: ranlib /usr/local/lib/libtoxdns.a
libtool: install: /usr/bin/install -c .libs/libtoxencryptsave.a /usr/local/lib/libtoxencryptsave.a
libtool: install: chmod 644 /usr/local/lib/libtoxencryptsave.a
libtool: install: ranlib /usr/local/lib/libtoxencryptsave.a
libtool: finish: PATH="/sbin:/bin:/usr/sbin:/usr/bin:/sbin" ldconfig -n /usr/local/lib
----------------------------------------------------------------------
Libraries have been installed in:
   /usr/local/lib

If you ever happen to want to link against installed libraries
in a given directory, LIBDIR, you must either use libtool, and
specify the full pathname of the library, or use the '-LLIBDIR'
flag during linking and do at least one of the following:
   - add LIBDIR to the 'LD_LIBRARY_PATH' environment variable
     during execution
   - add LIBDIR to the 'LD_RUN_PATH' environment variable
     during linking
   - use the '-Wl,-rpath -Wl,LIBDIR' linker flag
   - have your system administrator add LIBDIR to '/etc/ld.so.conf'

See any operating system documentation about shared libraries for
more information, such as the ld(1) and ld.so(8) manual pages.
----------------------------------------------------------------------
 /usr/bin/mkdir -p '/usr/local/bin'
  /bin/sh ../libtool   --mode=install /usr/bin/install -c DHT_bootstrap '/usr/local/bin'
libtool: install: /usr/bin/install -c .libs/DHT_bootstrap /usr/local/bin/DHT_bootstrap
 /usr/bin/mkdir -p '/usr/local/include/tox'
 /usr/bin/install -c -m 644 ../toxcore/tox.h ../toxcore/tox_old.h '/usr/local/include/tox'
 /usr/bin/mkdir -p '/usr/local/include/tox'
 /usr/bin/install -c -m 644 ../toxdns/toxdns.h '/usr/local/include/tox'
 /usr/bin/mkdir -p '/usr/local/include/tox'
 /usr/bin/install -c -m 644 ../toxencryptsave/toxencryptsave.h '/usr/local/include/tox'
make[3]: Leaving directory '/usr/local/src/toxcore/build'
make[2]: Leaving directory '/usr/local/src/toxcore/build'
make[2]: Entering directory '/usr/local/src/toxcore'
make[3]: Entering directory '/usr/local/src/toxcore'
make[3]: Nothing to be done for 'install-exec-am'.
 /usr/bin/mkdir -p '/usr/local/lib/pkgconfig'
 /usr/bin/install -c -m 644 ./libtoxcore.pc '/usr/local/lib/pkgconfig'
make[3]: Leaving directory '/usr/local/src/toxcore'
make[2]: Leaving directory '/usr/local/src/toxcore'
make[1]: Leaving directory '/usr/local/src/toxcore'

Leave a Reply