You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I noticed that the main definition of seastar in cmakelist.txt under some configurations fails to import pthread for boost:
target_link_libraries (seastar
PUBLIC
Boost::boost
Boost::program_options
Boost::thread
# .................. I can add `pthread` here and everything works
c-ares::c-ares
cryptopp::cryptopp
fmt::fmt
lz4::lz4
PRIVATE
${CMAKE_DL_LIBS}
Boost::filesystem
GnuTLS::gnutls
StdAtomic::atomic
StdFilesystem::filesystem
lksctp-tools::lksctp-tools
protobuf::libprotobuf
rt::rt
yaml-cpp::yaml-cpp)
I am not sure if the issue is coming from our own boost cmake module - from the comments
# The following :prop_tgt:`IMPORTED` targets are also defined::
#
# Boost::boost - Target for header-only dependencies
# (Boost include directory)
# Boost::<C> - Target for specific component dependency
# (shared or static library); <C> is lower-
# case
# Boost::diagnostic_definitions - interface target to enable diagnostic
# information about Boost's automatic linking
# during compilation (adds BOOST_LIB_DIAGNOSTIC)
# Boost::disable_autolinking - interface target to disable automatic
# linking with MSVC (adds BOOST_ALL_NO_LIB)
# Boost::dynamic_linking - interface target to enable dynamic linking
# linking with MSVC (adds BOOST_ALL_DYN_LINK)
#
# Implicit dependencies such as Boost::filesystem requiring
# Boost::system will be automatically detected and satisfied, even
# if system is not specified when using find_package and if
# Boost::system is not added to target_link_libraries. If using
# Boost::thread, then Threads::Threads will also be added automatically.
#
But it actually is not pulling in Threads::Threads which in normal speak means -lpthread
I can fix the problem for all platforms by adding the pthread as I mentioned in the context above, but not sure if there is a more elegant solution.
Maybe someone w/ a bit more cmake-foo experience can help.
The issue is that on an application that is just pulling cmake as an ExternalProject_add the -lpthread isn't added to the link.txt files (using the -GMake generator for cmake).
I'm not sure if there is a preference.
In summary
There is a problem with externalproject_add importing seastar.
There are 2 fixes.
We push the user to always add -DSeastar_LD_FLAGS=-pthread
We add -pthread after boost::thread in the main cmakelist.txt file
The text was updated successfully, but these errors were encountered:
Ok, further digging shows I was right, we'll just need to fix our boost for newer versions
CMake Warning at build/debug/v_deps_install/lib64/cmake/Seastar/FindBoost.cmake:839 (message):
New Boost version may have incorrect or missing dependencies and imported
targets
We use boost 1.70.0 from source
We can either close this ticket, or I can submit a patch with the -pthread fix i mentioned above
Ok, further digging shows I was right, we'll just need to fix our boost for newer versions
```
CMake Warning at build/debug/v_deps_install/lib64/cmake/Seastar/FindBoost.cmake:839 (message):
New Boost version may have incorrect or missing dependencies and imported
targets
./cmake/bundled_boost/FindBoost.cmake is simply a copy from cmake. We
did that to support older versions of cmake I think. Maybe we can just
delete our copy now and require that users have a cmake version that
supports the boost version they are using?
Cheers,
Rafael
given a cmake project definition of
I noticed that the main definition of seastar in cmakelist.txt under some configurations fails to import pthread for boost:
I am not sure if the issue is coming from our own boost cmake module - from the comments
But it actually is not pulling in
Threads::Threads
which in normal speak means-lpthread
I can fix the problem for all platforms by adding the pthread as I mentioned in the context above, but not sure if there is a more elegant solution.
Maybe someone w/ a bit more cmake-foo experience can help.
The problem is manifested like so:
on a
link.txt
produced by cmake on a-GMake
Notice the
-lpthread
afterboost_atomic
The issue is that on an application that is just pulling cmake as an
ExternalProject_add
the -lpthread isn't added to thelink.txt
files (using the -GMake generator for cmake).I'm not sure if there is a preference.
In summary
There is a problem with externalproject_add importing seastar.
There are 2 fixes.
-DSeastar_LD_FLAGS=-pthread
-pthread
afterboost::thread
in the main cmakelist.txt fileThe text was updated successfully, but these errors were encountered: