From deae6096f42696c825eeff6f379eb95c13b9a926 Mon Sep 17 00:00:00 2001 From: XanthosXanthopoulos Date: Fri, 24 Jan 2025 03:53:31 +0200 Subject: [PATCH] Specify LIBCPP_TYPEINFO_COMPARISON_IMPLEMENTATION for clang --- apis/python/setup.py | 5 +++++ libtiledbsoma/CMakeLists.txt | 4 +++- libtiledbsoma/src/soma/soma_column.h | 7 +++---- 3 files changed, 11 insertions(+), 5 deletions(-) diff --git a/apis/python/setup.py b/apis/python/setup.py index 37a1703008..4b6214911f 100644 --- a/apis/python/setup.py +++ b/apis/python/setup.py @@ -256,6 +256,11 @@ def run(self): if sys.platform == "darwin": CXX_FLAGS.append("-mmacosx-version-min=13.3") + # This is necessary for clang to enable templated function calls + # between pybind modules and libtiledbsoma where dynamic_cast or + # std::any_cast is involved + CXX_FLAGS.append("-D_LIBCPP_TYPEINFO_COMPARISON_IMPLEMENTATION=2") + if os.name == "posix" and sys.platform != "darwin": LIB_DIRS.append(str(tiledbsoma_dir / "lib" / "x86_64-linux-gnu")) LIB_DIRS.append(str(tiledbsoma_dir / "lib64")) diff --git a/libtiledbsoma/CMakeLists.txt b/libtiledbsoma/CMakeLists.txt index 6d0ff30125..ea70190ecd 100644 --- a/libtiledbsoma/CMakeLists.txt +++ b/libtiledbsoma/CMakeLists.txt @@ -89,6 +89,8 @@ set(CMAKE_CXX_EXTENSIONS OFF) # Don't use GNU extensions # Build with fPIC set(CMAKE_POSITION_INDEPENDENT_CODE ON) +set(CMAKE_VERBOSE_MAKEFILE ON) + # Set default builds/configuration to be Release. get_property(is_multi_config GLOBAL PROPERTY GENERATOR_IS_MULTI_CONFIG) if (is_multi_config) @@ -221,7 +223,7 @@ if(MSVC) ) else() - set(TILEDBSOMA_COMPILE_OPTIONS -Wall -Wextra -DSPDLOG_USE_STD_FORMAT) + set(TILEDBSOMA_COMPILE_OPTIONS -Wall -Wextra -DSPDLOG_USE_STD_FORMAT -D_LIBCPP_TYPEINFO_COMPARISON_IMPLEMENTATION=2) if(${TILEDBSOMA_ENABLE_WERROR}) set(TILEDBSOMA_WERROR_OPTION -Werror) diff --git a/libtiledbsoma/src/soma/soma_column.h b/libtiledbsoma/src/soma/soma_column.h index 96e01ec611..397759f696 100644 --- a/libtiledbsoma/src/soma/soma_column.h +++ b/libtiledbsoma/src/soma/soma_column.h @@ -430,11 +430,10 @@ class SOMAColumn { _non_empty_domain_slot_opt(ctx, array)); } catch (const std::exception& e) { throw TileDBSOMAError(std::format( - "[SOMAColumn][non_empty_domain_slot] Failed on \"{}\" with " - "error \"{}\", type '{}'", + "[SOMAColumn][non_empty_domain_slot_opt] Failed on \"{}\" with " + "error \"{}\"", name(), - e.what(), - typeid(T).name())); + e.what())); } }