1
0
mirror of https://github.com/mariadb-corporation/mariadb-columnstore-engine.git synced 2025-07-29 08:21:15 +03:00
Files
mariadb-columnstore-engine/cmake/boost.cmake
Sergei Golubchik f5cf7ebf7b fix boost compilation on aarch64-openeuler
__float128 related issues, specific to aarch64-openeuler,
don't happen on amd64-openeuler or aarch64-rhel

first, there's only dynamic libquadmath.so, and
config/has_float128.cpp for charconv doesn't specify
<link>shared; so charconv doesn't detect __float128.

But even if this is fixed (patched) it still doesn't find
__float128 later (may be missing includes?) and it's using
__float128 also when BOOST_CHARCONV_HAS_QUADMATH is not defined.

Considering that we don't actually need charconv, let's not
patch boost to fix it and simply disable it instead.

Also, let's disable mpi that we don't need and it also produces
(likely non-fatal) errors during compilation.

And don't redirect logs, let's have everything in CI stdout,
2025-07-21 19:55:16 +04:00

56 lines
2.0 KiB
CMake

find_package(Boost 1.88.0 COMPONENTS chrono filesystem program_options regex system thread)
if(Boost_FOUND)
add_custom_target(external_boost)
return()
endif()
include(ExternalProject)
if(CMAKE_CXX_COMPILER_ID MATCHES "GNU")
set(_toolset "gcc")
elseif(CMAKE_CXX_COMPILER_ID MATCHES ".*Clang")
set(_toolset "clang")
elseif(CMAKE_CXX_COMPILER_ID MATCHES "Intel")
set(_toolset "intel-linux")
endif()
set(INSTALL_LOCATION ${CMAKE_CURRENT_BINARY_DIR}/.boost/boost-lib)
set(BOOST_ROOT "${INSTALL_LOCATION}")
set(Boost_INCLUDE_DIRS "${INSTALL_LOCATION}/include")
set(Boost_LIBRARY_DIRS "${INSTALL_LOCATION}/lib")
link_directories("${Boost_LIBRARY_DIRS}")
set(_cxxargs "-fPIC -DBOOST_NO_AUTO_PTR -fvisibility=default")
set(_b2args cxxflags=${_cxxargs};cflags=-fPIC;threading=multi;${_extra};toolset=${_toolset}
--without-mpi;--without-charconv;--without-python;--prefix=${INSTALL_LOCATION}
)
set(byproducts)
foreach(name chrono filesystem program_options regex system thread)
set(lib boost_${name})
add_library(${lib} STATIC IMPORTED GLOBAL)
add_dependencies(${lib} external_boost)
set(loc "${Boost_LIBRARY_DIRS}/${CMAKE_STATIC_LIBRARY_PREFIX}${lib}${CMAKE_STATIC_LIBRARY_SUFFIX}")
set(byproducts ${byproducts} BUILD_BYPRODUCTS ${loc})
set_target_properties(${lib} PROPERTIES IMPORTED_LOCATION ${loc} EXCLUDE_FROM_ALL TRUE)
endforeach()
ExternalProject_Add(
external_boost
PREFIX .boost
URL https://archives.boost.io/release/1.88.0/source/boost_1_88_0.tar.gz
URL_HASH SHA256=3621533e820dcab1e8012afd583c0c73cf0f77694952b81352bf38c1488f9cb4
CONFIGURE_COMMAND ./bootstrap.sh
UPDATE_COMMAND ""
PATCH_COMMAND ${CMAKE_COMMAND} -E chdir <SOURCE_DIR> patch -p1 -i
${CMAKE_SOURCE_DIR}/storage/columnstore/columnstore/cmake/boost.1.88.named_proxy.hpp.patch
BUILD_COMMAND ./b2 -q ${_b2args}
BUILD_IN_SOURCE TRUE
INSTALL_COMMAND ./b2 -q install ${_b2args}
#LOG_BUILD TRUE
#LOG_INSTALL TRUE
EXCLUDE_FROM_ALL TRUE
${byproducts}
)