[GH-ISSUE #1702] [Bug]: cmake -DUSE_TENT=ON -DTENT_METRICS_ENABLED=ON .. and make -j then error occurs #495

Closed
opened 2026-10-29 21:15:27 +00:00 by bsakaguchi · 4 comments
Owner

Originally created by @easonyang1010 on GitHub (Mar 19, 2026).
Original GitHub issue: https://github.com/kvcache-ai/Mooncake/issues/1702

Originally assigned to: @staryxchen on GitHub.

Bug Report

this is error log, please help me , how to fix it
[ 31%] Building CXX object mooncake-transfer-engine/tent/src/runtime/CMakeFiles/tent_runtime.dir/transport_loader.cpp.o
CMakeFiles/tent_metrics_example.dir/tent_metrics_example.cpp.o: in function asio::error::get_system_category()': /usr/local/include/asio/error.hpp:263: undefined reference to asio::system_category()'
/bin/ld: CMakeFiles/tent_metrics_example.dir/tent_metrics_example.cpp.o: in function __static_initialization_and_destruction_0(int, int) [clone .constprop.0]': /usr/local/include/asio/error.hpp:296: undefined reference to asio::error::get_netdb_category()'
/bin/ld: /usr/local/include/asio/error.hpp:299: undefined reference to asio::error::get_addrinfo_category()' /bin/ld: /usr/local/include/asio/error.hpp:302: undefined reference to asio::error::get_misc_category()'
/bin/ld: CMakeFiles/tent_metrics_example.dir/tent_metrics_example.cpp.o: in function __static_initialization_and_destruction_0(int, int) [clone .constprop.0]': /usr/local/include/asio/experimental/channel_error.hpp:41: undefined reference to asio::experimental::error::get_channel_category()'

Before submitting...

  • Ensure you searched for relevant issues and read the [documentation]
Originally created by @easonyang1010 on GitHub (Mar 19, 2026). Original GitHub issue: https://github.com/kvcache-ai/Mooncake/issues/1702 Originally assigned to: @staryxchen on GitHub. ### Bug Report this is error log, please help me , how to fix it [ 31%] Building CXX object mooncake-transfer-engine/tent/src/runtime/CMakeFiles/tent_runtime.dir/transport_loader.cpp.o CMakeFiles/tent_metrics_example.dir/tent_metrics_example.cpp.o: in function `asio::error::get_system_category()': /usr/local/include/asio/error.hpp:263: undefined reference to `asio::system_category()' /bin/ld: CMakeFiles/tent_metrics_example.dir/tent_metrics_example.cpp.o: in function `__static_initialization_and_destruction_0(int, int) [clone .constprop.0]': /usr/local/include/asio/error.hpp:296: undefined reference to `asio::error::get_netdb_category()' /bin/ld: /usr/local/include/asio/error.hpp:299: undefined reference to `asio::error::get_addrinfo_category()' /bin/ld: /usr/local/include/asio/error.hpp:302: undefined reference to `asio::error::get_misc_category()' /bin/ld: CMakeFiles/tent_metrics_example.dir/tent_metrics_example.cpp.o: in function `__static_initialization_and_destruction_0(int, int) [clone .constprop.0]': /usr/local/include/asio/experimental/channel_error.hpp:41: undefined reference to `asio::experimental::error::get_channel_category()' ### Before submitting... - [ ] Ensure you searched for relevant issues and read the [documentation]
bsakaguchi 2026-10-29 21:15:27 +00:00
  • closed this issue
  • added the
    bug
    label
Author
Owner

@easonyang1010 commented on GitHub (Mar 19, 2026):

cmake -DUSE_TENT=ON ..
make -j
when I use above command, without -DTENT_METRICS_ENABLED=ON, everything is fine

<!-- gh-comment-id:4089835042 --> @easonyang1010 commented on GitHub (Mar 19, 2026): cmake -DUSE_TENT=ON .. make -j when I use above command, without -DTENT_METRICS_ENABLED=ON, everything is fine
Author
Owner

@alogfans commented on GitHub (Mar 20, 2026):

The main reason is the bundled asio in ylt lib is not consistent with OS-installed asio lib. @staryxchen how do you resolve this problem in your developing environment?

<!-- gh-comment-id:4094910536 --> @alogfans commented on GitHub (Mar 20, 2026): The main reason is the bundled asio in ylt lib is not consistent with OS-installed asio lib. @staryxchen how do you resolve this problem in your developing environment?
Author
Owner

@easonyang1010 commented on GitHub (Mar 20, 2026):

@alogfans thanks, by the way, when I use TENT on CUDA, -DUSE_TENT=ON is enough? or I need use -DUSE_TENT=ON -DUSE_CUDA=ON?

<!-- gh-comment-id:4095256907 --> @easonyang1010 commented on GitHub (Mar 20, 2026): @alogfans thanks, by the way, when I use TENT on CUDA, -DUSE_TENT=ON is enough? or I need use -DUSE_TENT=ON -DUSE_CUDA=ON?
Author
Owner

@staryxchen commented on GitHub (Mar 20, 2026):

Hi @easonyang1010, this is a known build issue when compiling with -DUSE_TENT=ON -DTENT_METRICS_ENABLED=ON. The root cause is:

  1. tent_metrics library is missing the yalantinglibs::yalantinglibs link target (only include dirs were added, missing compile definitions and transitive deps)
  2. tent_metrics_example is missing the asio_shared link dependency (required since the project uses ASIO_SEPARATE_COMPILATION mode)

Temporary Workaround

Apply the following changes manually:

mooncake-transfer-engine/tent/src/metrics/CMakeLists.txt — replace the target_link_libraries line and remove the find_path block at the bottom:

target_link_libraries(tent_metrics PUBLIC tent_common tent_interface yalantinglibs::yalantinglibs glog pthread)

mooncake-transfer-engine/tent/include/tent/metrics/tent_metrics.h — add #include <csignal> before ylt headers:

#if TENT_METRICS_ENABLED
#include <csignal>  // Required before ylt headers: coro_io.hpp uses std::signal/SIGPIPE
#include <ylt/metric.hpp>
#include <ylt/coro_http/coro_http_server.hpp>
#endif

mooncake-transfer-engine/tent/tests/CMakeLists.txt — add asio_shared to the link libraries:

target_link_libraries(tent_metrics_example PRIVATE tent_metrics tent_common asio_shared glog ibverbs)

Fix PR

A fix has been submitted: #1712

<!-- gh-comment-id:4095416742 --> @staryxchen commented on GitHub (Mar 20, 2026): Hi @easonyang1010, this is a known build issue when compiling with `-DUSE_TENT=ON -DTENT_METRICS_ENABLED=ON`. The root cause is: 1. `tent_metrics` library is missing the `yalantinglibs::yalantinglibs` link target (only include dirs were added, missing compile definitions and transitive deps) 2. `tent_metrics_example` is missing the `asio_shared` link dependency (required since the project uses `ASIO_SEPARATE_COMPILATION` mode) ### Temporary Workaround Apply the following changes manually: **`mooncake-transfer-engine/tent/src/metrics/CMakeLists.txt`** — replace the `target_link_libraries` line and remove the `find_path` block at the bottom: ```cmake target_link_libraries(tent_metrics PUBLIC tent_common tent_interface yalantinglibs::yalantinglibs glog pthread) ``` **`mooncake-transfer-engine/tent/include/tent/metrics/tent_metrics.h`** — add `#include <csignal>` before ylt headers: ```cpp #if TENT_METRICS_ENABLED #include <csignal> // Required before ylt headers: coro_io.hpp uses std::signal/SIGPIPE #include <ylt/metric.hpp> #include <ylt/coro_http/coro_http_server.hpp> #endif ``` **`mooncake-transfer-engine/tent/tests/CMakeLists.txt`** — add `asio_shared` to the link libraries: ```cmake target_link_libraries(tent_metrics_example PRIVATE tent_metrics tent_common asio_shared glog ibverbs) ``` ### Fix PR A fix has been submitted: #1712
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
kvcache-ai/Mooncake#495
No description provided.