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

Error when building from source code: /usr/bin/ld: cannot find -lzstd: No such file or directory #1020

Closed
leonqli opened this issue Jul 6, 2023 · 12 comments

Comments

@leonqli
Copy link

leonqli commented Jul 6, 2023

Please help! Thanks!

Linux 5.14.0-1033-oem #36-Ubuntu SMP Mon Apr 4 15:15:49 UTC 2022 x86_64 x86_64 x86_64 GNU/Linux

...
[ 52%] Building CXX object third_party/antlr4/runtime/Cpp/runtime/CMakeFiles/antlr4_static.dir/src/tree/pattern/ParseTreePatternMatcher.cpp.o
[ 52%] Building CXX object third_party/antlr4/runtime/Cpp/runtime/CMakeFiles/antlr4_static.dir/src/tree/pattern/RuleTagToken.cpp.o
[ 52%] Building CXX object third_party/antlr4/runtime/Cpp/runtime/CMakeFiles/antlr4_static.dir/src/tree/pattern/TagChunk.cpp.o
[ 52%] Building CXX object third_party/antlr4/runtime/Cpp/runtime/CMakeFiles/antlr4_static.dir/src/tree/pattern/TextChunk.cpp.o
[ 52%] Linking CXX executable StringUtilsTest
/usr/bin/ld: cannot find -lzstd: No such file or directory
/usr/bin/ld: cannot find -lzstd: No such file or directory
[ 52%] Linking CXX static library ../../lib/libSortPerformanceEstimator.a
collect2: error: ld returned 1 exit status
make[2]: *** [test/CMakeFiles/StringUtilsTest.dir/build.make:140: test/StringUtilsTest] Error 1
make[1]: *** [CMakeFiles/Makefile2:6628: test/CMakeFiles/StringUtilsTest.dir/all] Error 2
make[1]: *** Waiting for unfinished jobs....
[ 52%] Building CXX object third_party/antlr4/runtime/Cpp/runtime/CMakeFiles/antlr4_static.dir/src/tree/pattern/TokenTagToken.cpp.o
[ 52%] Built target SortPerformanceEstimator
[ 52%] Building CXX object third_party/antlr4/runtime/Cpp/runtime/CMakeFiles/antlr4_static.dir/src/tree/xpath/XPath.cpp.o
[ 54%] Building CXX object third_party/antlr4/runtime/Cpp/runtime/CMakeFiles/antlr4_static.dir/src/tree/xpath/XPathElement.cpp.o
[ 54%] Building CXX object third_party/antlr4/runtime/Cpp/runtime/CMakeFiles/antlr4_static.dir/src/tree/xpath/XPathLexer.cpp.o
[ 54%] Building CXX object third_party/antlr4/runtime/Cpp/runtime/CMakeFiles/antlr4_static.dir/src/tree/xpath/XPathLexerErrorListener.cpp.o
[ 54%] Building CXX object third_party/antlr4/runtime/Cpp/runtime/CMakeFiles/antlr4_static.dir/src/tree/xpath/XPathRuleAnywhereElement.cpp.o
[ 54%] Building CXX object third_party/antlr4/runtime/Cpp/runtime/CMakeFiles/antlr4_static.dir/src/tree/xpath/XPathRuleElement.cpp.o
[ 54%] Linking CXX static library ../../../lib/libparserData.a
[ 54%] Built target parserData
[ 54%] Building CXX object third_party/antlr4/runtime/Cpp/runtime/CMakeFiles/antlr4_static.dir/src/tree/xpath/XPathTokenAnywhereElement.cpp.o
[ 54%] Building CXX object third_party/antlr4/runtime/Cpp/runtime/CMakeFiles/antlr4_static.dir/src/tree/xpath/XPathTokenElement.cpp.o
[ 54%] Building CXX object third_party/antlr4/runtime/Cpp/runtime/CMakeFiles/antlr4_static.dir/src/tree/xpath/XPathWildcardAnywhereElement.cpp.o
[ 54%] Building CXX object third_party/antlr4/runtime/Cpp/runtime/CMakeFiles/antlr4_static.dir/src/tree/xpath/XPathWildcardElement.cpp.o
[ 54%] Linking CXX static library libantlr4-runtime.a
[ 54%] Linking CXX executable CacheTest
/usr/bin/ld: cannot find -lzstd: No such file or directory
/usr/bin/ld: cannot find -lzstd: No such file or directory
collect2: error: ld returned 1 exit status
make[2]: *** [test/CMakeFiles/CacheTest.dir/build.make:140: test/CacheTest] Error 1
make[1]: *** [CMakeFiles/Makefile2:6693: test/CMakeFiles/CacheTest.dir/all] Error 2
[ 54%] Built target antlr4_static
[ 54%] Linking CXX executable ConcurrentCacheTest
/usr/bin/ld: cannot find -lzstd: No such file or directory
/usr/bin/ld: cannot find -lzstd: No such file or directory
collect2: error: ld returned 1 exit status
make[2]: *** [test/CMakeFiles/ConcurrentCacheTest.dir/build.make:140: test/ConcurrentCacheTest] Error 1
make[1]: *** [CMakeFiles/Makefile2:6758: test/CMakeFiles/ConcurrentCacheTest.dir/all] Error 2
make: *** [Makefile:166: all] Error 2
...
@leonqli
Copy link
Author

leonqli commented Jul 7, 2023

I will answer my question. It was because of the missing package: libzstd-dev.

@joka921
Copy link
Member

joka921 commented Jul 7, 2023

Thanks for finding this out yourself, In our timezone it was the middle of the night:).
Have you checked out the qlever control script (linked at the start page of this project), It also has commands to print the installation instructions for a manual installation.
But I agree, that we currently lack the detailed instructions for manual compilation which is only present in the Dockerfile and the GitHub workflows. Did you find all the required dependencies in the meantime?

@leonqli
Copy link
Author

leonqli commented Jul 7, 2023

Yes, I compiled it successfully in my personal ubuntu. But I'm really suffering to compile it on CentOS (CentOS Linux release 7.9.2009 (Core)). It will be highly appreciated if you could help with that. Thank you in advance!

@leonqli
Copy link
Author

leonqli commented Jul 7, 2023

The error went like this on CentOS 7.9.2009:

...

In file included from /../qlever/qlever-code/third_party/googletest/googletest/include/gtest/gtest-message.h:55,
                 from /../qlever/qlever-code/third_party/googletest/googletest/include/gtest/gtest-assertion-result.h:46,
                 from /../qlever/qlever-code/third_party/googletest/googletest/include/gtest/gtest.h:59,
                 from /../qlever/qlever-code/src/util/../parser/TokenizerCtre.h:8,
                 from /../qlever/qlever-code/src/util/Conversions.cpp:17:
/../qlever/qlever-code/third_party/googletest/googletest/include/gtest/internal/gtest-port.h:927:3: error: 'regex_t' does not name a type
  927 |   regex_t full_regex_;     // For FullMatch().
      |   ^~~~~~~
/../qlever/qlever-code/third_party/googletest/googletest/include/gtest/internal/gtest-port.h:928:3: error: 'regex_t' does not name a type
  928 |   regex_t partial_regex_;  // For PartialMatch().
      |   ^~~~~~~
make[2]: *** [src/util/CMakeFiles/util.dir/build.make:104: src/util/CMakeFiles/util.dir/Conversions.cpp.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:6065: src/util/CMakeFiles/util.dir/all] Error 2
make: *** [Makefile:166: all] Error 2
...

@hannahbast
Copy link
Member

@leonqli Any progress on this?

@leonqli
Copy link
Author

leonqli commented Aug 28, 2023

@hannahbast Unfortunately, No. I'm still waiting for documentation that could cover compiling for different platforms.

@hannahbast
Copy link
Member

@leonqli For Ubuntu 22.04, the following packages need to be installed (see the Dockerfile):

build-essential cmake libicu-dev tzdata pkg-config uuid-runtime uuid-dev git libjemalloc-dev ninja-build libzstd-dev libssl-dev libboost1.81-dev libboost-program-options1.81-dev libboost-iostreams1.81-dev

Did you install the corresponding packages on your CentOS?

And is there a reason why you don't run everything in docker? It's certainly the easiest way.

@hannahbast
Copy link
Member

hannahbast commented Sep 7, 2023

Here are some hints for compiling it on your CentOS, have you tried them?

  1. Try #include <regex.h> in the file producing the error with type regex_t.

  2. If that doesn't work, try sudo yum install glibc-headers and compile again.

  3. Which version of the g++ compiler are you using? Try updating it.

@hannahbast
Copy link
Member

If this does not help, please let us know the exact sequence of packages you installed. In particular, how did you install cmake and boost

@JervenBolleman
Copy link

@leonqli Just want to note that the boost version shipping as a package with cent-os 7 series and the equivalent 8 series is not compatible with the one required by QLever, so that must be installed from scratch.

I find that using podman is rather the easiest way to run and build QLever on Cent-OS derivatives.

@joka921
Copy link
Member

joka921 commented Sep 13, 2023

@leonqli: In case podman is not working for you (It is compatible to Docker but without the security concerns as it always runs in userspace as far as I understand (thanks @JervenBolleman for the hint), then you can also try
to install the dependencies via the conan package manager.
If you are not familiar with it, you can either try to extract the necessary commands from
https://github.com/ad-freiburg/qlever/blob/master/.github/workflows/native-build-conan.yml

or just suggest a good time for a meeting with me, then we can do this together and then immediately write the instructions, s.t. future users have it easier. (Times would be "your morning" s.t. it is "my afternoon".

@joka921
Copy link
Member

joka921 commented May 10, 2024

I am closing this as stale, and I think that we have fixed these issues in a 1-to-1 meeting

@joka921 joka921 closed this as completed May 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants