Ziti-tunnel-sdk-c cmake install failure

Hi team,

Observing below error while doing a cmake install.
[root@testvm ziti-tunnel-sdk-c]# cmake --install .
– Install configuration: “”
– Up-to-date: /usr/local/include
– Up-to-date: /usr/local/include/ziti
– Up-to-date: /usr/local/include/ziti/netif_driver.h
– Up-to-date: /usr/local/include/ziti/ziti_tunnel.h
– Up-to-date: /usr/local/include/ziti/ziti_tunnel_cbs.h
CMake Error at cmake_install.cmake:50 (file):

  • file INSTALL cannot find “/home/arjun/ziti-tunnel-sdk-c/lib/liblwipcore.a”:*
  • No such file or directory.*

Prior to this i had cross-compiled using below command
cmake -DCMAKE_TOOLCHAIN_FILE=toolchains/mips-openwrt.cmake …

I am building ziti edge tunnel for an openwrt system (MIPS). Could you kindly help out.

Thanks in advance.

Regards,
Arjun

Arjun,
There is no need to run the install step – if your build is successful ziti-edge-tunnel executable will be in programs/ziti-edge-tunnel.

1 Like

Hi Eugene,

Thanks a lot for quick response. I did not see any error or failure message during compilation. Below is the snapshot of last few lines of compilation.

----------------------------------------------------------------------
Libraries have been installed in:
*** /home/arjun/ziti-tunnel-sdk-c/_deps/libsodium-build/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.
----------------------------------------------------------------------
make[4]: Nothing to be done for install-data-am'.*** ***make[4]: Leaving directory /home/arjun/ziti-tunnel-sdk-c/_deps/libsodium-build/src/libsodium'
make[3]: Leaving directory /home/arjun/ziti-tunnel-sdk-c/_deps/libsodium-build/src/libsodium'*** ***make[2]: Leaving directory /home/arjun/ziti-tunnel-sdk-c/_deps/libsodium-build/src/libsodium'
make[2]: Entering directory /home/arjun/ziti-tunnel-sdk-c/_deps/libsodium-build/src'*** ***make[3]: Entering directory /home/arjun/ziti-tunnel-sdk-c/_deps/libsodium-build/src'
make[3]: Nothing to be done for install-exec-am'.*** ***make[3]: Nothing to be done for install-data-am'.
make[3]: Leaving directory /home/arjun/ziti-tunnel-sdk-c/_deps/libsodium-build/src'*** ***make[2]: Leaving directory /home/arjun/ziti-tunnel-sdk-c/_deps/libsodium-build/src'
make[1]: Leaving directory /home/arjun/ziti-tunnel-sdk-c/_deps/libsodium-build/src'*** ***Making install in test*** ***make[1]: Entering directory /home/arjun/ziti-tunnel-sdk-c/_deps/libsodium-build/test'
Making install in default
make[2]: Entering directory /home/arjun/ziti-tunnel-sdk-c/_deps/libsodium-build/test/default'*** ***make[3]: Entering directory /home/arjun/ziti-tunnel-sdk-c/_deps/libsodium-build/test/default'
make[3]: Nothing to be done for install-exec-am'.*** ***make[3]: Nothing to be done for install-data-am'.
make[3]: Leaving directory /home/arjun/ziti-tunnel-sdk-c/_deps/libsodium-build/test/default'*** ***make[2]: Leaving directory /home/arjun/ziti-tunnel-sdk-c/_deps/libsodium-build/test/default'
make[2]: Entering directory /home/arjun/ziti-tunnel-sdk-c/_deps/libsodium-build/test'*** ***make[3]: Entering directory /home/arjun/ziti-tunnel-sdk-c/_deps/libsodium-build/test'
make[3]: Nothing to be done for install-exec-am'.*** ***make[3]: Nothing to be done for install-data-am'.
make[3]: Leaving directory /home/arjun/ziti-tunnel-sdk-c/_deps/libsodium-build/test'*** ***make[2]: Leaving directory /home/arjun/ziti-tunnel-sdk-c/_deps/libsodium-build/test'
make[1]: Leaving directory /home/arjun/ziti-tunnel-sdk-c/_deps/libsodium-build/test'*** ***make[1]: Entering directory /home/arjun/ziti-tunnel-sdk-c/_deps/libsodium-build'
make[2]: Entering directory /home/arjun/ziti-tunnel-sdk-c/_deps/libsodium-build'*** ***make[2]: Nothing to be done for install-exec-am'.
*** /usr/bin/mkdir -p '/home/arjun/ziti-tunnel-sdk-c/_deps/libsodium-build/lib/pkgconfig'***
*** /usr/bin/install -c -m 644 libsodium.pc '/home/arjun/ziti-tunnel-sdk-c/_deps/libsodium-build/lib/pkgconfig'***
make[2]: Leaving directory /home/arjun/ziti-tunnel-sdk-c/_deps/libsodium-build'*** ***make[1]: Leaving directory /home/arjun/ziti-tunnel-sdk-c/_deps/libsodium-build'
CMake Warning at /usr/local/share/cmake-3.19/Modules/CPack.cmake:412 (message):
*** CPack.cmake has already been included!!***
Call Stack (most recent call first):
*** _deps/ziti-sdk-c-src/CMakeLists.txt:66 (include)***

-- Found Doxygen: /usr/bin/doxygen (found version "1.8.5") found components: doxygen missing components: dot
Doxygen build started
-- Configuring done
-- Generating done
-- Build files have been written to: /home/arjun/ziti-tunnel-sdk-c
[root@testvm ziti-tunnel-sdk-c]# cd programs/ziti-edge-tunnel/
[root@testvm ziti-edge-tunnel]# ls -ltr
total 40
-rw-r--r--. 1 root root 11384 Oct 30 00:40 ziti-edge-tunnel.c
drwxr-xr-x. 4 root root 75 Oct 30 00:40 netif_driver
-rw-r--r--. 1 root root 1535 Oct 30 00:40 dnsmasq_manager.c
-rw-r--r--. 1 root root 908 Oct 30 00:40 CMakeLists.txt
-rw-r--r--. 1 root root 12642 Oct 30 00:44 Makefile
-rw-r--r--. 1 root root 1349 Oct 30 00:44 cmake_install.cmake
drwxr-xr-x. 4 root root 130 Oct 30 00:44 CMakeFiles
[root@testvm ziti-edge-tunnel]#

I could not see the executable either. Below is the command i used.

Request you to kindly let me know in case of further information and what i could be missing here.

Thanks and regards,
Arjun

thats just the first step, after this you need to build the project, just run make from the project root

Ah! my bad. Missed out to mention. Tried that, but observed an error.

*/home/arjun/openwrt/staging_dir/toolchain-mips_24kc_gcc-8.4.0_musl/include/time.h:57:12: note: expected ‘const time_t *’ {aka ‘const long int *’} but argument is of type ‘int64_t *’ {aka 'long long int '}

  • struct tm *gmtime (const time_t );
  •        ^~~~~~*
    

[ 87%] Building C object _deps/ziti-sdk-c-build/library/CMakeFiles/ziti.dir/ziti.c.o
In file included from /home/arjun/ziti-tunnel-sdk-c/_deps/ziti-sdk-c-src/library/…/inc_internal/zt_internal.h:29,

  •             from /home/arjun/ziti-tunnel-sdk-c/_deps/ziti-sdk-c-src/library/ziti.c:24:*
    

/home/arjun/ziti-tunnel-sdk-c/_deps/ziti-sdk-c-src/library/…/inc_internal/metrics.h:33:13: fatal error: bits/atomic.h: No such file or directory

  • include <bits/atomic.h>*

  •         ^~~~~~~~~~~~~~~*
    

compilation terminated.
make[2]: *** [_deps/ziti-sdk-c-build/library/CMakeFiles/ziti.dir/ziti.c.o] Error 1
make[1]: *** [_deps/ziti-sdk-c-build/library/CMakeFiles/ziti.dir/all] Error 2

And since the last line of cmake log said build files have been written, i just missed. Apologies.

Thanks again for response. Am i missing any package/library here? or the machine arch where i am compiling is an issue? Kindly suggest.

@arjunsundararajan just checking in… did you figure out the missing dependency?

1 Like

@TheLumberjack, unfortunately no. i could figure out bits/atomic.h would be a part of ulibc, though i had compiled the toolchain enabling ulibc, i am not able to find the file.

Any help on this regard would be much appreciated. Kindly do the needful.

Hi… I could see there is a compiled binary for Teltonika RUT240. Could you kindly share the details of toolchain used for it?

Thanks and regards,
Arjun

How did you build your toolchain?

The best way to do it is to:

  • use Ubuntu 16.04 VM
  • get teltonica SDK
  • run $ make menuconfig and enable ‘Package OpenWRT toolchain’
  • run make (get lunch — it will take a while)
  • after it’s done toolchain tarball should be under bin/
  • you can copy that tarball anywhere and extract it and set TOOLCHAIN environment variable to its location
1 Like

Hi,

Thanks a lot for the response/suggestion. I had cloned the openwrt repo and built toolchain. Will try the above and update. Thanks again.

Hi @ekoby,

The proposed suggestion worked. Thanks a lot.