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: cannot use 'typeid' with '-fno-rtti' when building on Debian 11 #977

Closed
pboguslawski opened this issue Jan 3, 2023 · 2 comments
Closed

Comments

@pboguslawski
Copy link

pboguslawski commented Jan 3, 2023

After recent Debian 11 updates manticoresearch 5.0.3 compilation failed with error...

-- Generate globalaliases.h from [...]/manticoresearch/manticoresearch/src/charsets/*.txt
CMake Error at /usr/lib/x86_64-linux-gnu/cmake/Boost-1.74.0/BoostConfig.cmake:141 (find_package):
  Could not find a package configuration file provided by "boost_filesystem"
  (requested version 1.74.0) with any of the following names:

    boost_filesystemConfig.cmake
    boost_filesystem-config.cmake
 
  Add the installation prefix of "boost_filesystem" to CMAKE_PREFIX_PATH or
  set "boost_filesystem_DIR" to a directory containing one of the above
  files.  If "boost_filesystem" provides a separate development package or
  SDK, be sure it has been installed.
Call Stack (most recent call first):
  /usr/lib/x86_64-linux-gnu/cmake/Boost-1.74.0/BoostConfig.cmake:258 (boost_find_component)
  /usr/share/cmake-3.21/Modules/FindBoost.cmake:594 (find_package)
  src/CMakeLists.txt:122 (find_package)

after installing libboost-filesystem-dev 5.0.3 compilation now fails with

[...]/manticoresearch/manticoresearch/src/std/thread_annotations.h:92:32: warning: backslash-newline at end of file
   92 | #define UNLOCK_FUNCTION( ... ) \
      |                                 
In file included from /usr/include/boost/asio/execution.hpp:19,
                 from /usr/include/boost/asio/system_executor.hpp:20,
                 from /usr/include/boost/asio/associated_executor.hpp:22,
                 from /usr/include/boost/asio/detail/bind_handler.hpp:20,
                 from /usr/include/boost/asio/detail/wrapped_handler.hpp:18,
                 from /usr/include/boost/asio/io_context.hpp:23,
                 from /usr/include/boost/asio/io_service.hpp:18,
                 from [...]/manticoresearch/manticoresearch/src/searchdbuddy.cpp:16:
/usr/include/boost/asio/execution/any_executor.hpp: In static member function 'static const std::type_info& boost::asio::execution::detail::any_executor_base::target_type_void()':
/usr/include/boost/asio/execution/any_executor.hpp:811:23: error: cannot use 'typeid' with '-fno-rtti'
  811 |     return typeid(void);
      |                       ^
/usr/include/boost/asio/execution/any_executor.hpp: In static member function 'static const std::type_info& boost::asio::execution::detail::any_executor_base::target_type_ex()':
/usr/include/boost/asio/execution/any_executor.hpp:851:21: error: cannot use 'typeid' with '-fno-rtti'
  851 |     return typeid(Ex);
      |                     ^
In file included from [...]/manticoresearch/manticoresearch/src/std/bitvec.h:68,
                 from [...]/manticoresearch/manticoresearch/src/sphinxstd.h:61,
                 from [...]/manticoresearch/manticoresearch/src/sphinxutils.h:22,
                 from [...]/manticoresearch/manticoresearch/src/searchdtask.h:18,
                 from [...]/manticoresearch/manticoresearch/src/searchdbuddy.cpp:13:
[...]/manticoresearch/manticoresearch/src/std/bitvec_impl.h: In instantiation of 'void BitVec_T<T, STATICBITS>::Swap(BitVec_T<T, STATICBITS>&) [with T = unsigned int; int STATICBITS = 128]':
[...]/manticoresearch/manticoresearch/src/std/bitvec_impl.h:85:2:   required from 'BitVec_T<T, STATICBITS>& BitVec_T<T, STATICBITS>::operator=(BitVec_T<T, STATICBITS>) [with T = unsigned int; int STATICBITS = 128]'
[...]/manticoresearch/manticoresearch/src/sphinxrt.h:370:78:   required from here
[...]/manticoresearch/manticoresearch/src/std/bitvec_impl.h:45:23: warning: comparison of integer expressions of different signedness: 'int' and 'const unsigned int' [-Wsign-compare]
   45 |   for ( auto i = 0; i < STATICSIZE; ++i )
      |                     ~~^~~~~~~~~~~~
[...]/manticoresearch/manticoresearch/src/std/bitvec_impl.h:51:23: warning: comparison of integer expressions of different signedness: 'int' and 'const unsigned int' [-Wsign-compare]
   51 |   for ( auto i = 0; i < STATICSIZE; ++i )
      |                     ~~^~~~~~~~~~~~
[...]/manticoresearch/manticoresearch/src/std/bitvec_impl.h:60:23: warning: comparison of integer expressions of different signedness: 'int' and 'const unsigned int' [-Wsign-compare]
   60 |   for ( auto i = 0; i < STATICSIZE; ++i )
      |                     ~~^~~~~~~~~~~~
gmake[2]: *** [src/CMakeFiles/lsearchd.dir/build.make:563: src/CMakeFiles/lsearchd.dir/searchdbuddy.cpp.o] Error 1
gmake[1]: *** [CMakeFiles/Makefile2:474: src/CMakeFiles/lsearchd.dir/all] Error 2
gmake: *** [Makefile:156: all] Error 2

Probably related with chriskohlhoff/asio#533

@sanikolaev
Copy link
Collaborator

Please use our building CI Docker as described here https://manual.manticoresearch.com/dev/Installation/Compiling_from_sources#Building-using-CI-docker as it includes everything needed for building.

I've just tested and it builds Debian 11 packages fine:

snikolaev@dev:~/manticore_gitlab$ cd dist/build_dockers/cross/external_toolchain
...
Successfully built 93ba969c68b2

snikolaev@dev:~/manticore_gitlab$ docker build .
snikolaev@dev:~/manticore_gitlab$ cd ~/manticore_gitlab
snikolaev@dev:~/manticore_gitlab$ docker run -it --rm -v $(pwd):/manticore -e DISTR=bullseye -e arch=x86_64 -e SYSROOT_URL=https://repo.manticoresearch.com/repository/sysroots -e boosboost=boost_nov22 -e sysroot=roots_nov22 93ba969c68b2 bash
root@dcef34af15d6:/sysroot/root [llvm-15 bullseye x86_64]$ cd /manticore/
root@dcef34af15d6:/manticore [llvm-15 bullseye x86_64]$ mkdir build && cd build
root@dcef34af15d6:/manticore/build [llvm-15 bullseye x86_64]$ cmake -DPACK=1 ..
root@dcef34af15d6:/manticore/build [llvm-15 bullseye x86_64]$ cmake --build . --target package

CPack: - package: /manticore/build/manticore-common_5.0.3-230104-541ed08ab_all.deb generated.
CPack: - package: /manticore/build/manticore-converter_5.0.3-230104-541ed08ab_amd64.deb generated.
CPack: - package: /manticore/build/manticore-converter-dbgsym_5.0.3-230104-541ed08ab_amd64.ddeb generated.
CPack: - package: /manticore/build/manticore-dev_5.0.3-230104-541ed08ab_all.deb generated.
CPack: - package: /manticore/build/manticore-icudata-65l.deb generated.
CPack: - package: /manticore/build/manticore_5.0.3-230104-541ed08ab_amd64.deb generated.
CPack: - package: /manticore/build/manticore-server-core_5.0.3-230104-541ed08ab_amd64.deb generated.
CPack: - package: /manticore/build/manticore-server-core-dbgsym_5.0.3-230104-541ed08ab_amd64.ddeb generated.
CPack: - package: /manticore/build/manticore-server_5.0.3-230104-541ed08ab_amd64.deb generated.
CPack: - package: /manticore/build/manticore-tools_5.0.3-230104-541ed08ab_amd64.deb generated.
CPack: - package: /manticore/build/manticore-tools-dbgsym_5.0.3-230104-541ed08ab_amd64.ddeb generated.

I'm closing the issue. Feel free to reopen in case the above fails for you.

@pboguslawski
Copy link
Author

For those that prefer using stock Debian tools for building manticoresearch - problem does not occur after:

(a)
patching /usr/include/boost/asio/execution/any_executor.hpp from Debian 11 stock libboost1.74-dev with solution described on

chriskohlhoff/asio#541
https://github.com/chriskohlhoff/asio/commit/e8b0445e9837e232047173ddf6b4d541b1585915.diff

and adding -DCMAKE_CXX_FLAGS='-DASIO_NO_TYPEID=1' to the first execution of cmake when building manticoresearch

or

(b)
removing $<${ONLYGNUCLANGCXX}:-fno-rtti> from line

target_compile_options ( lextra INTERFACE $<${ONLYGNUCLANGCXX}:-fno-rtti>$<${MSCXX}:/GR-> ) # no rtti

in manticoresearch/CMakeLists.txt before building manticoresearch.

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

2 participants