warthog-network / Warthog

Experimental cryptocurrency implementation
MIT License
21 stars 13 forks source link

Debian 12 - building from sources - wart-node: error while loading shared libraries: libwarthogsecp256k1.so: cannot open shared object file: No such file or directory #57

Closed blackmennewstyle closed 4 months ago

blackmennewstyle commented 4 months ago

Hello beautiful devs,

I'm trying to build the latest release from the sources. It went well except i think the ninja install forget to create some symlink.

wget https://github.com/warthog-network/Warthog/archive/refs/tags/0.4.24.tar.gz
tar -xvf 0.4.24.tar.gz
cd Warthog-0.4.24
meson setup build --buildtype=release
The Meson build system
Version: 1.0.1
Source dir: /home/ceedii/Warthog-0.4.24
Build dir: /home/ceedii/Warthog-0.4.24/build
Build type: native build
Project name: Warthog
Project version: 0.4.24
C compiler for the host machine: ccache cc (gcc 12.2.0 "cc (Debian 12.2.0-14) 12.2.0")
C linker for the host machine: cc ld.bfd 2.40
C++ compiler for the host machine: ccache c++ (gcc 12.2.0 "c++ (Debian 12.2.0-14) 12.2.0")
C++ linker for the host machine: c++ ld.bfd 2.40
Host machine cpu family: x86_64
Host machine cpu: x86_64

Executing subproject libuv 

libuv| Project name: libuv
libuv| Project version: 1.46.0
libuv| C compiler for the host machine: ccache cc (gcc 12.2.0 "cc (Debian 12.2.0-14) 12.2.0")
libuv| C linker for the host machine: cc ld.bfd 2.40
libuv| Fetching value of define "__QNX__" :
libuv| Fetching value of define "_AIX" :
libuv| Message: System: linux
libuv| Compiler for C supports arguments -fno-strict-aliasing: YES
libuv| Run-time dependency threads found: YES
libuv| Library dl found: YES
libuv| Library rt found: YES
libuv| Build targets in project: 1
libuv| Subproject libuv finished.

Executing subproject sqlite3 

sqlite3| Project name: sqlite3
sqlite3| Project version: 3.39.3
sqlite3| C compiler for the host machine: ccache cc (gcc 12.2.0 "cc (Debian 12.2.0-14) 12.2.0")
sqlite3| C linker for the host machine: cc ld.bfd 2.40
sqlite3| Run-time dependency dl found: YES
sqlite3| Library m found: YES
sqlite3| Dependency threads found: YES unknown (cached)
sqlite3| Build targets in project: 2
sqlite3| Subproject sqlite3 finished.

Dependency threads found: YES unknown (cached)
Configuring version.hpp using configuration
Build targets in project: 9

Warthog 0.4.24

  Subprojects
    libuv    : YES
    sqlite3  : YES

  User defined options
    buildtype: release

Found ninja-1.11.1 at /usr/bin/ninja
ninja
[69/215] Generating src/shared/commit_info.hpp with a custom command
fatal: not a git repository (or any of the parent directories): .git
[83/215] Compiling C++ object src/node/wart-node.p/asyncio_connection.cpp.o
In file included from /usr/include/c++/12/ios:40,
                 from /usr/include/c++/12/ostream:38,
                 from /usr/include/c++/12/bits/unique_ptr.h:41,
                 from /usr/include/c++/12/memory:76,
                 from ../thirdparty/json/include/nlohmann/json_fwd.hpp:6,
                 from ../src/shared/src/general/with_uint64.hpp:4,
                 from ../src/shared/src/general/funds.hpp:3,
                 from ../src/shared/src/block/chain/height.hpp:3,
                 from ../src/shared/src/block/body/container.hpp:2,
                 from ../src/node/communication/messages.hpp:2,
                 from ../src/node/communication/buffers/recvbuffer.hpp:3,
                 from ../src/node/asyncio/connection.hpp:2,
                 from ../src/node/asyncio/connection.cpp:1:
In static member function ‘static constexpr std::char_traits<char>::char_type* std::char_traits<char>::copy(char_type*, const char_type*, std::size_t)’,
    inlined from ‘static constexpr void std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::_S_copy(_CharT*, const _CharT*, size_type) [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>]’ at /usr/include/c++/12/bits/basic_string.h:423:21,
    inlined from ‘constexpr std::__cxx11::basic_string<_CharT, _Traits, _Allocator>& std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::_M_replace(size_type, size_type, const _CharT*, size_type) [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>]’ at /usr/include/c++/12/bits/basic_string.tcc:532:22,
    inlined from ‘constexpr std::__cxx11::basic_string<_CharT, _Traits, _Alloc>& std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::replace(size_type, size_type, const _CharT*, size_type) [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>]’ at /usr/include/c++/12/bits/basic_string.h:2171:19,
    inlined from ‘constexpr std::__cxx11::basic_string<_CharT, _Traits, _Alloc>& std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::insert(size_type, const _CharT*) [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>]’ at /usr/include/c++/12/bits/basic_string.h:1928:22,
    inlined from ‘constexpr std::__cxx11::basic_string<_CharT, _Traits, _Allocator> std::operator+(const _CharT*, __cxx11::basic_string<_CharT, _Traits, _Allocator>&&) [with _CharT = char; _Traits = char_traits<char>; _Alloc = allocator<char>]’ at /usr/include/c++/12/bits/basic_string.h:3541:36,
    inlined from ‘std::string Connection::to_string() const’ at ../src/node/asyncio/connection.cpp:361:16:
/usr/include/c++/12/bits/char_traits.h:431:56: warning: ‘void* __builtin_memcpy(void*, const void*, long unsigned int)’ accessing 9223372036854775810 or more bytes at offsets [2, 9223372036854775807] and 1 may overlap up to 9223372036854775813 bytes at offset -3 [-Wrestrict]
  431 |         return static_cast<char_type*>(__builtin_memcpy(__s1, __s2, __n));
      |                                        ~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~
[157/215] Compiling C++ object src/nod...ypto_verushash_verus_clhash_port.cpp.o
../src/shared/src/crypto/verushash/verus_clhash_port.cpp: In function ‘u128 {anonymous}::_mm_set_epi64x_emu(uint64_t, uint64_t)’:
../src/shared/src/crypto/verushash/verus_clhash_port.cpp:636:4: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing]
  636 |   ((uint64_t *)&result)[0] = lo;
      |   ~^~~~~~~~~~~~~~~~~~~~
../src/shared/src/crypto/verushash/verus_clhash_port.cpp: In function ‘u128 {anonymous}::_mm_cvtsi64_si128_emu(uint64_t)’:
../src/shared/src/crypto/verushash/verus_clhash_port.cpp:643:4: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing]
  643 |   ((uint64_t *)&result)[0] = lo;
      |   ~^~~~~~~~~~~~~~~~~~~~
../src/shared/src/crypto/verushash/verus_clhash_port.cpp: In function ‘u128 {anonymous}::_mm_cvtsi32_si128_emu(uint32_t)’:
../src/shared/src/crypto/verushash/verus_clhash_port.cpp:658:4: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing]
  658 |   ((uint32_t *)&result)[0] = lo;
      |   ~^~~~~~~~~~~~~~~~~~~~
../src/shared/src/crypto/verushash/verus_clhash_port.cpp: In function ‘u128 {anonymous}::_mm_set_epi64x_emu(uint64_t, uint64_t)’:
../src/shared/src/crypto/verushash/verus_clhash_port.cpp:638:10: warning: ‘result’ is used uninitialized [-Wuninitialized]
  638 |   return result;
      |          ^~~~~~
../src/shared/src/crypto/verushash/verus_clhash_port.cpp:635:11: note: ‘result’ declared here
  635 |   __m128i result;
      |           ^~~~~~
../src/shared/src/crypto/verushash/verus_clhash_port.cpp: In function ‘u128 {anonymous}::_mm_cvtsi64_si128_emu(uint64_t)’:
../src/shared/src/crypto/verushash/verus_clhash_port.cpp:645:10: warning: ‘result’ is used uninitialized [-Wuninitialized]
  645 |   return result;
      |          ^~~~~~
../src/shared/src/crypto/verushash/verus_clhash_port.cpp:642:11: note: ‘result’ declared here
  642 |   __m128i result;
      |           ^~~~~~
../src/shared/src/crypto/verushash/verus_clhash_port.cpp: In function ‘u128 {anonymous}::_mm_cvtsi32_si128_emu(uint32_t)’:
../src/shared/src/crypto/verushash/verus_clhash_port.cpp:674:10: warning: ‘result’ is used uninitialized [-Wuninitialized]
  674 |   return result;
      |          ^~~~~~
../src/shared/src/crypto/verushash/verus_clhash_port.cpp:657:11: note: ‘result’ declared here
  657 |   __m128i result;
      |           ^~~~~~
[195/215] Compiling C++ object src/wal...ypto_verushash_verus_clhash_port.cpp.o
../src/shared/src/crypto/verushash/verus_clhash_port.cpp: In function ‘u128 {anonymous}::_mm_set_epi64x_emu(uint64_t, uint64_t)’:
../src/shared/src/crypto/verushash/verus_clhash_port.cpp:636:4: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing]
  636 |   ((uint64_t *)&result)[0] = lo;
      |   ~^~~~~~~~~~~~~~~~~~~~
../src/shared/src/crypto/verushash/verus_clhash_port.cpp: In function ‘u128 {anonymous}::_mm_cvtsi64_si128_emu(uint64_t)’:
../src/shared/src/crypto/verushash/verus_clhash_port.cpp:643:4: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing]
  643 |   ((uint64_t *)&result)[0] = lo;
      |   ~^~~~~~~~~~~~~~~~~~~~
../src/shared/src/crypto/verushash/verus_clhash_port.cpp: In function ‘u128 {anonymous}::_mm_cvtsi32_si128_emu(uint32_t)’:
../src/shared/src/crypto/verushash/verus_clhash_port.cpp:658:4: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing]
  658 |   ((uint32_t *)&result)[0] = lo;
      |   ~^~~~~~~~~~~~~~~~~~~~
../src/shared/src/crypto/verushash/verus_clhash_port.cpp: In function ‘u128 {anonymous}::_mm_set_epi64x_emu(uint64_t, uint64_t)’:
../src/shared/src/crypto/verushash/verus_clhash_port.cpp:638:10: warning: ‘result’ is used uninitialized [-Wuninitialized]
  638 |   return result;
      |          ^~~~~~
../src/shared/src/crypto/verushash/verus_clhash_port.cpp:635:11: note: ‘result’ declared here
  635 |   __m128i result;
      |           ^~~~~~
../src/shared/src/crypto/verushash/verus_clhash_port.cpp: In function ‘u128 {anonymous}::_mm_cvtsi64_si128_emu(uint64_t)’:
../src/shared/src/crypto/verushash/verus_clhash_port.cpp:645:10: warning: ‘result’ is used uninitialized [-Wuninitialized]
  645 |   return result;
      |          ^~~~~~
../src/shared/src/crypto/verushash/verus_clhash_port.cpp:642:11: note: ‘result’ declared here
  642 |   __m128i result;
      |           ^~~~~~
../src/shared/src/crypto/verushash/verus_clhash_port.cpp: In function ‘u128 {anonymous}::_mm_cvtsi32_si128_emu(uint32_t)’:
../src/shared/src/crypto/verushash/verus_clhash_port.cpp:674:10: warning: ‘result’ is used uninitialized [-Wuninitialized]
  674 |   return result;
      |          ^~~~~~
../src/shared/src/crypto/verushash/verus_clhash_port.cpp:657:11: note: ‘result’ declared here
  657 |   __m128i result;
      |           ^~~~~~
[215/215] Linking target src/node/wart-node

With root privileges:

ninja install
[1/10] Generating src/shared/commit_info.hpp with a custom command
fatal: not a git repository (or any of the parent directories): .git
[1/2] Installing files.
Installing subprojects/libuv-v1.46.0/libuv.so.1.0.0 to /usr/local/lib/x86_64-linux-gnu
Installing subprojects/sqlite-amalgamation-3390300/libsqlite3.so.0.8.6 to /usr/local/lib/x86_64-linux-gnu
Installing ./thirdparty/./secp256k1/libwarthogsecp256k1.so to /usr/local/lib/x86_64-linux-gnu
Installing ./thirdparty/./uSockets/libusockets.so to /usr/local/lib/x86_64-linux-gnu
Installing ./thirdparty/./uvw/libuvw.so to /usr/local/lib/x86_64-linux-gnu
Installing ./src/node/wart-node to /usr/local/bin
Installing ./src/wallet/wart-wallet to /usr/local/bin
Installing /home/ceedii/Warthog-0.4.24/subprojects/libuv-v1.46.0/include/uv.h to /usr/local/include
Installing /home/ceedii/Warthog-0.4.24/subprojects/libuv-v1.46.0/include/uv/errno.h to /usr/local/include/uv
Installing /home/ceedii/Warthog-0.4.24/subprojects/libuv-v1.46.0/include/uv/threadpool.h to /usr/local/include/uv
Installing /home/ceedii/Warthog-0.4.24/subprojects/libuv-v1.46.0/include/uv/version.h to /usr/local/include/uv
Installing /home/ceedii/Warthog-0.4.24/subprojects/libuv-v1.46.0/include/uv/unix.h to /usr/local/include/uv
Installing /home/ceedii/Warthog-0.4.24/subprojects/libuv-v1.46.0/include/uv/linux.h to /usr/local/include/uv
Installing /home/ceedii/Warthog-0.4.24/subprojects/sqlite-amalgamation-3390300/sqlite3.h to /usr/local/include
Installing /home/ceedii/Warthog-0.4.24/build/meson-private/libuv.pc to /usr/local/lib/x86_64-linux-gnu/pkgconfig
Installing /home/ceedii/Warthog-0.4.24/build/meson-private/sqlite3.pc to /usr/local/lib/x86_64-linux-gnu/pkgconfig
Installing symlink pointing to libuv.so.1.0.0 to /usr/local/lib/x86_64-linux-gnu/libuv.so.1
Installing symlink pointing to libuv.so.1 to /usr/local/lib/x86_64-linux-gnu/libuv.so
Installing symlink pointing to libsqlite3.so.0.8.6 to /usr/local/lib/x86_64-linux-gnu/libsqlite3.so.0
Installing symlink pointing to libsqlite3.so.0 to /usr/local/lib/x86_64-linux-gnu/libsqlite3.so
root@europa:/home/ceedii/Warthog-0.4.24/build# whereis libsqlite3.so.0
libsqlite3.so.0: /usr/lib/x86_64-linux-gnu/libsqlite3.so.0 /usr/local/lib/x86_64-linux-gnu/libsqlite3.so.0

Sadly when i run:

wart-node --help
wart-node: error while loading shared libraries: libwarthogsecp256k1.so: cannot open shared object file: No such file or directory

Judging by the trace of ninja install, i think you forgot to create some necessary symlink.

blackmennewstyle commented 4 months ago

I can confirm, as soon as i created the missing symlink. Everything works:

ln -s /usr/local/lib/x86_64-linux-gnu/libwarthogsecp256k1.so /usr/lib/x86_64-linux-gnu/libwarthogsecp256k1.so
ln -s /usr/local/lib/x86_64-linux-gnu/libusockets.so /usr/lib/x86_64-linux-gnu/libusockets.so
ln -s /usr/local/lib/x86_64-linux-gnu/libuvw.so /usr/lib/x86_64-linux-gnu/libuvw.so
wart-node --help
Usage: wart-node [OPTION]...
The reference implementation node of the Warthog Network.

By Pumbaa, Timon & Rafiki

  -h, --help                 Print help and exit
      --detailed-help        Print help, including all details and hidden
                               options, and exit
  -V, --version              Print version and exit

Node options:
  -b, --bind=IP:PORT         Socket to listen on, defaults to "0.0.0.0:9186"
                               for main net and "0.0.0.0:9286" for test net
  -C, --connect=IP:PORT,...  Specify peer list
      --isolated             Do not allow peers (for testing purposes, do not
                               use in production)
      --temporary            Use temporary database (for testing purposes, do
                               not use in production)
      --testnet              Enable testnet

Data file options:
      --chain-db=STRING      specify chain data file
      --peers-db=STRING      specify data file

Logging options:
  -d, --debug                Enable debug messages

JSON RPC endpoint options:
  -r, --rpc=IP:PORT          JSON RPC endpoint socket, defaults to
                               "127.0.0.1:3000" for main net and
                               "127.0.0.1:3100" for test net
      --publicrpc=IP:PORT    Public JSON RPC endpoint socket, disabled by
                               default
      --stratum=IP:PORT      Solo mining stratum
      --enable-public        Shorthand for --publicrpc=0.0.0.0:3001

Configuration file options:
  -c, --config=FILENAME      Configuration file, default is "config.toml", in
                               testnet "testnet3_chain.db3"
  -t, --test                 test the configuration file (check for correct
                               syntax)
      --dump-config          dump the current configuration to stdout
ByPumbaa commented 4 months ago

You must add /usr/local/lib/x86_64-linux-gnu to your library path. Using symbolic links is possible but not a good way to solve the issue. Which OS?

ByPumbaa commented 4 months ago

You can read some more info here https://askubuntu.com/questions/165027/why-cant-my-program-find-the-libraries-in-usr-local-lib I am not sure why meson copies into a directory that is not part of the default library search paths. According to this issue it is a distro problem.

blackmennewstyle commented 4 months ago

meson seems to have a lot of issues like that one, it's the same with gcc detection.