From 774e90700f1170369d39794ebf0567fbed3a6698 Mon Sep 17 00:00:00 2001 From: Martin Quinson Date: Sun, 5 Nov 2023 16:56:46 +0100 Subject: [PATCH] Try to survive to undefined preprocessor symbols --- src/kernel/context/ContextBoost.hpp | 6 ++++ src/smpi/internals/smpi_global.cpp | 54 ++++++++++++++--------------- 2 files changed, 33 insertions(+), 27 deletions(-) diff --git a/src/kernel/context/ContextBoost.hpp b/src/kernel/context/ContextBoost.hpp index 22295c55a1..ca190cd60e 100644 --- a/src/kernel/context/ContextBoost.hpp +++ b/src/kernel/context/ContextBoost.hpp @@ -6,6 +6,10 @@ #ifndef SIMGRID_KERNEL_CONTEXT_BOOST_CONTEXT_HPP #define SIMGRID_KERNEL_CONTEXT_BOOST_CONTEXT_HPP +/* Boost uses undef preprocessor symbols on FreeBSD, so disable our Werror for this file */ +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wundef" + #include #if BOOST_VERSION < 106100 #include @@ -13,6 +17,8 @@ #include #endif +#pragma clang diagnostic pop + #include #include #include diff --git a/src/smpi/internals/smpi_global.cpp b/src/smpi/internals/smpi_global.cpp index 36a3e39101..10203cbca8 100644 --- a/src/smpi/internals/smpi_global.cpp +++ b/src/smpi/internals/smpi_global.cpp @@ -59,51 +59,51 @@ XBT_LOG_NEW_DEFAULT_SUBCATEGORY(smpi_kernel, smpi, "Logging specific to SMPI (ke * See https://www.akkadia.org/drepper/dsohowto.pdf * and https://lists.freebsd.org/pipermail/freebsd-current/2016-March/060284.html */ -#if !RTLD_DEEPBIND || HAVE_SANITIZER_ADDRESS || HAVE_SANITIZER_THREAD +#if !defined(RTLD_DEEPBIND) || !RTLD_DEEPBIND || HAVE_SANITIZER_ADDRESS || HAVE_SANITIZER_THREAD #define WANT_RTLD_DEEPBIND 0 #else #define WANT_RTLD_DEEPBIND RTLD_DEEPBIND #endif #if HAVE_PAPI -std::map> units2papi_setup; + std::map> units2papi_setup; #endif -std::unordered_map location2speedup; + std::unordered_map location2speedup; -static int smpi_exit_status = 0; -static xbt_os_timer_t global_timer; -static std::vector privatize_libs_paths; + static int smpi_exit_status = 0; + static xbt_os_timer_t global_timer; + static std::vector privatize_libs_paths; -// No instance gets manually created; check also the smpirun.in script as -// this default name is used there as well (when the tag is generated). -static const std::string smpi_default_instance_name("smpirun"); + // No instance gets manually created; check also the smpirun.in script as + // this default name is used there as well (when the tag is generated). + static const std::string smpi_default_instance_name("smpirun"); -static simgrid::config::Flag - smpi_hostfile("smpi/hostfile", - "Classical MPI hostfile containing list of machines to dispatch " - "the processes, one per line", - ""); + static simgrid::config::Flag + smpi_hostfile("smpi/hostfile", + "Classical MPI hostfile containing list of machines to dispatch " + "the processes, one per line", + ""); -static simgrid::config::Flag smpi_replay("smpi/replay", - "Replay a trace instead of executing the application", ""); + static simgrid::config::Flag smpi_replay("smpi/replay", + "Replay a trace instead of executing the application", ""); -static simgrid::config::Flag smpi_np("smpi/np", "Number of processes to be created", 0); + static simgrid::config::Flag smpi_np("smpi/np", "Number of processes to be created", 0); -static simgrid::config::Flag smpi_map("smpi/map", "Display the mapping between nodes and processes", 0); + static simgrid::config::Flag smpi_map("smpi/map", "Display the mapping between nodes and processes", 0); -std::function smpi_comm_copy_data_callback = - &smpi_comm_copy_buffer_callback; + std::function smpi_comm_copy_data_callback = + &smpi_comm_copy_buffer_callback; -simgrid::smpi::ActorExt* smpi_process() -{ - simgrid::s4u::ActorPtr me = simgrid::s4u::Actor::self(); + simgrid::smpi::ActorExt* smpi_process() + { + simgrid::s4u::ActorPtr me = simgrid::s4u::Actor::self(); - if (me == nullptr) // This happens sometimes (eg, when linking against NS3 because it pulls openMPI...) - return nullptr; + if (me == nullptr) // This happens sometimes (eg, when linking against NS3 because it pulls openMPI...) + return nullptr; - return me->extension(); -} + return me->extension(); + } simgrid::smpi::ActorExt* smpi_process_remote(simgrid::s4u::ActorPtr actor) { -- 2.20.1