Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Multiple occurences of unresolved symbols from snappy in leveldb #171

Closed
2 of 3 tasks
pr4u4t opened this issue Sep 7, 2022 · 3 comments · Fixed by #190
Closed
2 of 3 tasks

Multiple occurences of unresolved symbols from snappy in leveldb #171

pr4u4t opened this issue Sep 7, 2022 · 3 comments · Fixed by #190
Assignees
Labels
fix/bug Fixes errant behavior

Comments

@pr4u4t
Copy link

pr4u4t commented Sep 7, 2022

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
@pr4u4t pr4u4t added the fix/bug Fixes errant behavior label Sep 7, 2022
@HalosGhost
Copy link
Collaborator

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.

@HalosGhost
Copy link
Collaborator

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

@pr4u4t
Copy link
Author

pr4u4t commented Sep 9, 2022

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.

@HalosGhost HalosGhost linked a pull request Sep 12, 2022 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
fix/bug Fixes errant behavior
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants