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

#1845: bundled fmt library can conflict with fmt installed in the same prefix #1847

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion cmake/trace_only_functions.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ function(create_trace_only_target)
# we use INSTALL_DIR/include/vt-trace instead
# so we have to install FMT lib aswell
install(
FILES "${CMAKE_CURRENT_SOURCE_DIR}/../lib/fmt/include/fmt/core.h"
FILES "${CMAKE_CURRENT_SOURCE_DIR}/../lib/fmt/include/fmt-vt/core.h"
DESTINATION "include/vt-trace/fmt"
)

Expand Down
5 changes: 3 additions & 2 deletions lib/fmt/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ project(FMT CXX)
function(add_headers VAR)
set(headers ${${VAR}})
foreach (header ${ARGN})
set(headers ${headers} include/fmt/${header})
set(headers ${headers} include/fmt-vt/${header})
endforeach()
set(${VAR} ${headers} PARENT_SCOPE)
endfunction()
Expand All @@ -14,6 +14,7 @@ set(FMT_SOURCES src/format.cc)

add_library(fmt ${FMT_SOURCES} ${FMT_HEADERS})
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we change the CMake name as well? If a downstream code ends up picking this up, it'll be a bit confusing

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hmm yeah, there might be a problem with duplicate targets if they happen to also be including fmt as a subdirectory

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Overall I'd be more in favor of a more permanent solution which would be to optionally force vt to use external versions of these libraries. That would be ideal for the spack case. I'd like to get this merged now however because it is causing some breakages in some internal CI processes

add_library(fmt::fmt ALIAS fmt)
set_target_properties(fmt PROPERTIES OUTPUT_NAME fmt-vt)

target_include_directories(fmt SYSTEM PUBLIC
$<BUILD_INTERFACE:${PROJECT_SOURCE_DIR}/include>
Expand All @@ -25,7 +26,7 @@ set_target_properties(fmt PROPERTIES
DEBUG_POSTFIX "${FMT_DEBUG_POSTFIX}")

install(
DIRECTORY include/fmt
DIRECTORY include/fmt-vt
DESTINATION include
CONFIGURATIONS ${build_type_list}
FILES_MATCHING PATTERN "*"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2064,7 +2064,7 @@ FMT_INLINE std::basic_string<Char> vformat(

**Example**::

#include <fmt/core.h>
#include <fmt-vt/core.h>
std::string message = fmt::format("The answer is {}", 42);
\endrst
*/
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -3721,7 +3721,7 @@ arg_join<detail::iterator_t<Range>, detail::sentinel_t<Range>, wchar_t> join(

**Example**::

#include <fmt/format.h>
#include <fmt-vt/format.h>

std::string answer = fmt::to_string(42);
\endrst
Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion lib/fmt/src/format.cc
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
//
// For the license information refer to format.h.

#include "fmt/format-inl.h"
#include "fmt-vt/format-inl.h"

FMT_BEGIN_NAMESPACE
namespace detail {
Expand Down
2 changes: 1 addition & 1 deletion src/vt/configs/debug/debug_fmt.h
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@

#include "vt/config.h"

#include <fmt/core.h>
#include <fmt-vt/core.h>

#include <iosfwd>

Expand Down
2 changes: 1 addition & 1 deletion src/vt/configs/debug/debug_print.h
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@
#include "vt/configs/debug/debug_colorize.h"
#include "vt/configs/debug/debug_var_unused.h"

#include <fmt/core.h>
#include <fmt-vt/core.h>

/*
=== Debug file/line/func functionality ===
Expand Down
2 changes: 1 addition & 1 deletion src/vt/configs/error/assert_out.impl.h
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@
#include <string>
#include <cassert>

#include <fmt/core.h>
#include <fmt-vt/core.h>

namespace vt { namespace debug { namespace assert {

Expand Down
2 changes: 1 addition & 1 deletion src/vt/configs/error/assert_out_info.impl.h
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@
#include <string>
#include <sstream>

#include <fmt/core.h>
#include <fmt-vt/core.h>

namespace vt { namespace debug { namespace assert {

Expand Down
2 changes: 1 addition & 1 deletion src/vt/configs/error/error.impl.h
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@
#include <tuple>
#include <type_traits>

#include <fmt/core.h>
#include <fmt-vt/core.h>

namespace vt { namespace error {

Expand Down
2 changes: 1 addition & 1 deletion src/vt/configs/error/keyval_printer.impl.h
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@
#include <string>
#include <vector>

#include <fmt/core.h>
#include <fmt-vt/core.h>

namespace vt { namespace util { namespace error {

Expand Down
2 changes: 1 addition & 1 deletion src/vt/configs/error/pretty_print_message.cc
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@
#include <string>
#include <unistd.h> // gethostname

#include <fmt/core.h>
#include <fmt-vt/core.h>

namespace vt { namespace debug {

Expand Down
2 changes: 1 addition & 1 deletion src/vt/configs/error/soft_error.h
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@

#include <string>

#include <fmt/core.h>
#include <fmt-vt/core.h>

namespace vt {

Expand Down
2 changes: 1 addition & 1 deletion src/vt/elm/elm_id.h
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ struct hash<vt::elm::ElementIDStruct> {

} /* end namespace std */

#include <fmt/format.h>
#include <fmt-vt/format.h>

namespace fmt {

Expand Down
2 changes: 1 addition & 1 deletion src/vt/epoch/epoch_manip.cc
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@
#include "vt/utils/bits/bits_packer.h"
#include "vt/termination/term_common.h"

#include <fmt/ostream.h>
#include <fmt-vt/ostream.h>

namespace vt { namespace epoch {

Expand Down
2 changes: 1 addition & 1 deletion src/vt/epoch/epoch_type.h
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ struct hash<vt::epoch::EpochType> {

} /* end namespace std */

#include <fmt/format.h>
#include <fmt-vt/format.h>

namespace fmt {

Expand Down
2 changes: 1 addition & 1 deletion src/vt/epoch/epoch_window.cc
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
#include "vt/epoch/epoch_window.h"
#include "vt/epoch/epoch_manip.h"

#include <fmt/ostream.h>
#include <fmt-vt/ostream.h>

namespace vt { namespace epoch {

Expand Down
2 changes: 1 addition & 1 deletion src/vt/runtime/component/diagnostic_value_format.h
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@
#include "vt/runtime/component/diagnostic_enum_format.h"
#include "vt/utils/memory/memory_units.h"

#include <fmt/core.h>
#include <fmt-vt/core.h>

namespace vt { namespace runtime { namespace component { namespace detail {

Expand Down
2 changes: 1 addition & 1 deletion src/vt/runtime/runtime_diagnostics.cc
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@
#include <fort.hpp>
#endif /*vt_check_enabled(libfort)*/

#include <fmt/core.h>
#include <fmt-vt/core.h>

#include <map>
#include <string>
Expand Down
2 changes: 1 addition & 1 deletion src/vt/termination/interval/interval.h
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@

#include <ostream>

#include <fmt/ostream.h>
#include <fmt-vt/ostream.h>

namespace vt { namespace term { namespace interval {

Expand Down
2 changes: 1 addition & 1 deletion src/vt/timing/timing.h
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@
#include <string>

#include <EngFormat-Cpp/eng_format.hpp>
#include <fmt/core.h>
#include <fmt-vt/core.h>

#include "vt/timing/timing_type.h"

Expand Down
2 changes: 1 addition & 1 deletion src/vt/utils/adt/histogram_approx.h
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@
#include <cmath>
#include <algorithm>

#include <fmt/core.h>
#include <fmt-vt/core.h>

namespace vt { namespace util { namespace adt {

Expand Down
2 changes: 1 addition & 1 deletion src/vt/utils/json/json_appender.h
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@

#include <nlohmann/json.hpp>

#include <fmt/core.h>
#include <fmt-vt/core.h>

namespace vt { namespace util { namespace json {

Expand Down
2 changes: 1 addition & 1 deletion src/vt/vrt/collection/balance/node_lb_data.cc
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@
#include <sys/stat.h>
#include <memory>

#include <fmt/core.h>
#include <fmt-vt/core.h>

namespace vt { namespace vrt { namespace collection { namespace balance {

Expand Down
4 changes: 2 additions & 2 deletions src/vt/vrt/collection/manager.impl.h
Original file line number Diff line number Diff line change
Expand Up @@ -89,8 +89,8 @@
#include <sys/stat.h>
#include <unistd.h>

#include <fmt/core.h>
#include <fmt/ostream.h>
#include <fmt-vt/core.h>
#include <fmt-vt/ostream.h>

namespace vt { namespace vrt { namespace collection {

Expand Down
2 changes: 1 addition & 1 deletion tests/perf/ping_pong.cc
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@
#include <vt/objgroup/manager.h>
#include <vt/messaging/active.h>

#include <fmt/core.h>
#include <fmt-vt/core.h>

using namespace vt;
using namespace vt::tests::perf::common;
Expand Down
4 changes: 2 additions & 2 deletions tests/unit/collection/test_collection_common.h
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,8 @@
#include <vt/topos/index/index.h>
#include <vt/context/context.h>

#include <fmt/core.h>
#include <fmt/ostream.h>
#include <fmt-vt/core.h>
#include <fmt-vt/ostream.h>

#include <gtest/gtest.h>

Expand Down
4 changes: 2 additions & 2 deletions tests/unit/collection/test_collection_construct_common.h
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,8 @@
#include "vt/vrt/collection/manager.h"
#include "data_message.h"

#include <fmt/core.h>
#include <fmt/ostream.h>
#include <fmt-vt/core.h>
#include <fmt-vt/ostream.h>

#include <gtest/gtest.h>

Expand Down
2 changes: 1 addition & 1 deletion tests/unit/configs/test_stack_dumping.cc
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
//@HEADER
*/

#include <fmt/core.h>
#include <fmt-vt/core.h>
#include <gtest/gtest.h>

#include "test_parallel_harness.h"
Expand Down