mit-dci / opencbdc-tx

A transaction processor for a hypothetical, general-purpose, central bank digital currency

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Multiple occurences of unresolved symbols from snappy in leveldb

pr4u4t opened this issue · comments

Affected Branch

trunk

Basic Diagnostics

  • I've pulled the latest changes on the affected branch and the issue is still present.

  • The issue is reproducible in docker

Description

Only example of error message from build. Multiple unresolved symbols from snappy library when building on Arch Linux.

[ 73%] Building CXX object src/uhs/twophase/sentinel_2pc/CMakeFiles/sentineld-2pc.dir/sentineld_2pc.o
/usr/bin/ld: /usr/local/lib/libleveldb.a(table_builder.cc.o): in function `leveldb::port::Snappy_Compress(char const*, unsigned long, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >*)':
/home/prauat/projects/opencbdc-tx/leveldb-1.22-Debug/port/port_stdcxx.h:91: undefined reference to `snappy::MaxCompressedLength(unsigned long)'
/usr/bin/ld: /home/prauat/projects/opencbdc-tx/leveldb-1.22-Debug/port/port_stdcxx.h:93: undefined reference to `snappy::RawCompress(char const*, unsigned long, char*, unsigned long*)'
/usr/bin/ld: /usr/local/lib/libleveldb.a(format.cc.o): in function `leveldb::port::Snappy_GetUncompressedLength(char const*, unsigned long, unsigned long*)':
/home/prauat/projects/opencbdc-tx/leveldb-1.22-Debug/port/port_stdcxx.h:109: undefined reference to `snappy::GetUncompressedLength(char const*, unsigned long, unsigned long*)'
/usr/bin/ld: /usr/local/lib/libleveldb.a(format.cc.o): in function `leveldb::port::Snappy_Uncompress(char const*, unsigned long, char*)':
/home/prauat/projects/opencbdc-tx/leveldb-1.22-Debug/port/port_stdcxx.h:121: undefined reference to `snappy::RawUncompress(char const*, unsigned long, char*)'
collect2: error: ld returned 1 exit status
make[2]: *** [src/uhs/atomizer/archiver/CMakeFiles/archiverd.dir/build.make:108: src/uhs/atomizer/archiver/archiverd] Błąd 1
make[1]: *** [CMakeFiles/Makefile2:774: src/uhs/atomizer/archiver/CMakeFiles/archiverd.dir/all] Błąd 2
make[1]: *** Oczekiwanie na niezakończone zadania....
/usr/bin/ld: /usr/local/lib/libleveldb.a(table_builder.cc.o): in function `leveldb::port::Snappy_Compress(char const*, unsigned long, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >*)':
/home/prauat/projects/opencbdc-tx/leveldb-1.22-Debug/port/port_stdcxx.h:91: undefined reference to `snappy::MaxCompressedLength(unsigned long)'
/usr/bin/ld: /home/prauat/projects/opencbdc-tx/leveldb-1.22-Debug/port/port_stdcxx.h:93: undefined reference to `snappy::RawCompress(char const*, unsigned long, char*, unsigned long*)'
/usr/bin/ld: /usr/local/lib/libleveldb.a(format.cc.o): in function `leveldb::port::Snappy_GetUncompressedLength(char const*, unsigned long, unsigned long*)':
/home/prauat/projects/opencbdc-tx/leveldb-1.22-Debug/port/port_stdcxx.h:109: undefined reference to `snappy::GetUncompressedLength(char const*, unsigned long, unsigned long*)'
/usr/bin/ld: /usr/local/lib/libleveldb.a(format.cc.o): in function `leveldb::port::Snappy_Uncompress(char const*, unsigned long, char*)':
/home/prauat/projects/opencbdc-tx/leveldb-1.22-Debug/port/port_stdcxx.h:121: undefined reference to `snappy::RawUncompress(char const*, unsigned long, char*)'
collect2: error: ld returned 1 exit status
make[2]: *** [src/uhs/twophase/locking_shard/CMakeFiles/locking-shardd.dir/build.make:108: src/uhs/twophase/locking_shard/locking-shardd] Błąd 1
make[1]: *** [CMakeFiles/Makefile2:1281: src/uhs/twophase/locking_shard/CMakeFiles/locking-shardd.dir/all] Błąd 2

In order to reproduce the issue, follow these steps:

  1. scripts/configure.sh
  2. scripts/build.sh

Well it looks like snappy should be added to CMakeList.txt in multiple files using check_library_exists() and target_link_libraries().

Proposed changes can be viewed arch-linux-snappy. Let me know if pull request is desired.

Code of Conduct

  • I agree to follow this project's Code of Conduct

Mmm, that is indeed not ideal. In particular, on any platform where leveldb is being built-from-source (cf. #162, will be all platforms soon), we need to ensure we're handling the dependencies correctly.

To that end, your branch looks good, but should also probably include snappy as a package to install in ./scripts/configure.sh.

cc @metalicjames; do you think we should pull in these changes as a part of #162?

Mmm, that is indeed not ideal. In particular, on any platform where leveldb is being built-from-source (cf. #162, will be all platforms soon), we need to ensure we're handling the dependencies correctly.

To that end, your branch looks good, but should also probably include snappy as a package to install in ./scripts/configure.sh.

Added snappy to apt-get/homebrew,opening pull request.