[GH-ISSUE #211] build error with latest code missing etcd hpp file #92

Closed
opened 2026-10-29 21:09:09 +00:00 by bsakaguchi · 5 comments
Owner

Originally created by @gaowayne on GitHub (Apr 4, 2025).
Original GitHub issue: https://github.com/kvcache-ai/Mooncake/issues/211

hello expert

I follow the readme and build the latest code but I am suffering this build error indicate missing etcd header file.

(base) root@oq1:~/wayne/kvcache/Mooncake/build# make
[  1%] Built target tcp_transport
[  4%] Built target base
[ 12%] Built target rdma_transport
[ 13%] Built target transport
[ 15%] Building CXX object mooncake-transfer-engine/src/CMakeFiles/transfer_engine.dir/transfer_metadata_plugin.cpp.o
/root/wayne/kvcache/Mooncake/mooncake-transfer-engine/src/transfer_metadata_plugin.cpp:36:10: fatal error: etcd/SyncClient.hpp: No such file or directory
   36 | #include <etcd/SyncClient.hpp>
      |          ^~~~~~~~~~~~~~~~~~~~~
compilation terminated.
make[2]: *** [mooncake-transfer-engine/src/CMakeFiles/transfer_engine.dir/build.make:174: mooncake-transfer-engine/src/CMakeFiles/transfer_engine.dir/transfer_metadata_plugin.cpp.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:365: mooncake-transfer-engine/src/CMakeFiles/transfer_engine.dir/all] Error 2
make: *** [Makefile:146: all] Error 2
(base) root@oq1:~/wayne/kvcache/Mooncake/build# 
Originally created by @gaowayne on GitHub (Apr 4, 2025). Original GitHub issue: https://github.com/kvcache-ai/Mooncake/issues/211 hello expert I follow the readme and build the latest code but I am suffering this build error indicate missing etcd header file. ``` (base) root@oq1:~/wayne/kvcache/Mooncake/build# make [ 1%] Built target tcp_transport [ 4%] Built target base [ 12%] Built target rdma_transport [ 13%] Built target transport [ 15%] Building CXX object mooncake-transfer-engine/src/CMakeFiles/transfer_engine.dir/transfer_metadata_plugin.cpp.o /root/wayne/kvcache/Mooncake/mooncake-transfer-engine/src/transfer_metadata_plugin.cpp:36:10: fatal error: etcd/SyncClient.hpp: No such file or directory 36 | #include <etcd/SyncClient.hpp> | ^~~~~~~~~~~~~~~~~~~~~ compilation terminated. make[2]: *** [mooncake-transfer-engine/src/CMakeFiles/transfer_engine.dir/build.make:174: mooncake-transfer-engine/src/CMakeFiles/transfer_engine.dir/transfer_metadata_plugin.cpp.o] Error 1 make[1]: *** [CMakeFiles/Makefile2:365: mooncake-transfer-engine/src/CMakeFiles/transfer_engine.dir/all] Error 2 make: *** [Makefile:146: all] Error 2 (base) root@oq1:~/wayne/kvcache/Mooncake/build# ```
Author
Owner

@stmatengss commented on GitHub (Apr 4, 2025):

Hi, please check that etcd-cpp-apiv3 is installed correctly (bash dependencies.sh). If you don't want to use etcd as metadata service, just disable etcd by setting USE_ETCD as OFF.

<!-- gh-comment-id:2777520586 --> @stmatengss commented on GitHub (Apr 4, 2025): Hi, please check that etcd-cpp-apiv3 is installed correctly (bash dependencies.sh). If you don't want to use etcd as metadata service, just disable etcd by setting USE_ETCD as OFF.
Author
Owner

@gaowayne commented on GitHub (Apr 7, 2025):

bash dependencies.sh

I tried this. it showed cpprest project not found, but the folder is in 3rd party.

(base) root@oq1:~/wayne/kvcache/Mooncake# bash dependencies.sh
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
build-essential is already the newest version (12.10ubuntu1).
cmake is already the newest version (3.28.3-1build7).
libibverbs-dev is already the newest version (50.0-2build2).
libunwind-dev is already the newest version (1.6.2-3build1.1).
libgoogle-glog-dev is already the newest version (0.6.0-2.1build1).
libgtest-dev is already the newest version (1.14.0-1).
libjsoncpp-dev is already the newest version (1.9.5-6build1).
libnuma-dev is already the newest version (2.0.18-1build1).
libpython3-dev is already the newest version (3.12.3-0ubuntu2).
libboost-all-dev is already the newest version (1.83.0.1ubuntu2).
libssl-dev is already the newest version (3.0.13-0ubuntu3.5).
libgrpc-dev is already the newest version (1.51.1-4.1build5).
libgrpc++-dev is already the newest version (1.51.1-4.1build5).
libprotobuf-dev is already the newest version (3.21.12-8.2build1).
protobuf-compiler-grpc is already the newest version (1.51.1-4.1build5).
pybind11-dev is already the newest version (2.11.1-2).
libcurl4-openssl-dev is already the newest version (8.5.0-2ubuntu10.6).
libhiredis-dev is already the newest version (1.2.0-6ubuntu3).
pkg-config is already the newest version (1.8.1-2build1).
patchelf is already the newest version (0.18.0-1.1build1).
The following packages were automatically installed and are no longer required:
  bridge-utils dns-root-data dnsmasq-base python3-compose python3-docker python3-dockerpty python3-docopt python3-dotenv python3-texttable python3-websocket ubuntu-fan
Use 'sudo apt autoremove' to remove them.
0 upgraded, 0 newly installed, 0 to remove and 17 not upgraded.
Requirement already satisfied: build in /root/anaconda3/lib/python3.12/site-packages (1.2.2.post1)
Requirement already satisfied: setuptools in /root/anaconda3/lib/python3.12/site-packages (75.1.0)
Requirement already satisfied: wheel in /root/anaconda3/lib/python3.12/site-packages (0.44.0)
Requirement already satisfied: packaging>=19.1 in /root/anaconda3/lib/python3.12/site-packages (from build) (24.1)
Requirement already satisfied: pyproject_hooks in /root/anaconda3/lib/python3.12/site-packages (from build) (1.2.0)
WARNING: Running pip as the 'root' user can result in broken permissions and conflicting behaviour with the system package manager, possibly rendering your system unusable.It is recommended to use a virtual environment instead: https://pip.pypa.io/warnings/venv. Use the --root-user-action option if you know what you are doing and want to suppress this warning.
*** Download and installing [cpprest sdk] ***
mkdir: cannot create directory ‘/root/wayne/kvcache/Mooncake/thirdparties’: File exists
fatal: destination path 'cpprestsdk' already exists and is not an empty directory.
-- Setting gcc options
-- Added test library httpclient_test
-- Added test library httplistener_test
-- Added test library json_test
-- Added test library pplx_test
-- Added test library streams_test
-- Added test library uri_test
-- Added test library utils_test
-- Configuring done (0.1s)
CMake Warning at Release/src/CMakeLists.txt:42 (add_library):
  Cannot generate a safe runtime search path for target cpprest because files
  in some directories may conflict with libraries in implicit directories:

    runtime library [libz.so.1] in /usr/lib/x86_64-linux-gnu may be hidden by files in:
      /root/anaconda3/lib

  Some of these libraries may not be found correctly.


-- Generating done (0.1s)
-- Build files have been written to: /root/wayne/kvcache/Mooncake/thirdparties/cpprestsdk/build
[  0%] Building CXX object Release/src/CMakeFiles/cpprest.dir/http/common/http_helpers.cpp.o
/root/wayne/kvcache/Mooncake/thirdparties/cpprestsdk/Release/src/http/common/http_helpers.cpp: In function ‘size_t web::http::details::chunked_encoding::add_chunked_delimiters(uint8_t*, size_t, size_t)’:
/root/wayne/kvcache/Mooncake/thirdparties/cpprestsdk/Release/src/http/common/http_helpers.cpp:91:43: error: ‘%8zX’ directive output may be truncated writing between 8 and 16 bytes into a region of size 9 [-Werror=format-truncation=]
   91 |         snprintf(buffer, sizeof(buffer), "%8zX", bytes_read);
      |                                           ^~~~
/root/wayne/kvcache/Mooncake/thirdparties/cpprestsdk/Release/src/http/common/http_helpers.cpp:91:42: note: directive argument in the range [1, 18446744073709551615]
   91 |         snprintf(buffer, sizeof(buffer), "%8zX", bytes_read);
      |                                          ^~~~~~
/root/wayne/kvcache/Mooncake/thirdparties/cpprestsdk/Release/src/http/common/http_helpers.cpp:91:17: note: ‘snprintf’ output between 9 and 17 bytes into a destination of size 9
   91 |         snprintf(buffer, sizeof(buffer), "%8zX", bytes_read);
      |         ~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
cc1plus: all warnings being treated as errors
make[2]: *** [Release/src/CMakeFiles/cpprest.dir/build.make:118: Release/src/CMakeFiles/cpprest.dir/http/common/http_helpers.cpp.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:543: Release/src/CMakeFiles/cpprest.dir/all] Error 2
make: *** [Makefile:146: all] Error 2
*** Download and installing [etcd-cpp-apiv3] ***
fatal: destination path 'etcd-cpp-apiv3' already exists and is not an empty directory.
CMake Deprecation Warning at CMakeLists.txt:1 (cmake_minimum_required):
  Compatibility with CMake < 3.5 will be removed from a future version of
  CMake.

  Update the VERSION argument <min> value or use a ...<max> suffix to tell
  CMake that the project does not need compatibility with older versions.


-- Building etcd-cpp-apiv3 with C++11
-- Found RE2 via CMake.
-- Found GRPC: gRPC::gpr;gRPC::grpc;gRPC::grpc++, /root/anaconda3/bin/grpc_cpp_plugin (found version: "1.62.2")
-- Configuring done (0.1s)
CMake Error: The following variables are used in this project, but they are set to NOTFOUND.
Please set them or make sure they are set and tested correctly in the CMake files:
CPPREST_INCLUDE_DIR
   used as include directory in directory /root/wayne/kvcache/Mooncake/thirdparties/etcd-cpp-apiv3
   used as include directory in directory /root/wayne/kvcache/Mooncake/thirdparties/etcd-cpp-apiv3
   used as include directory in directory /root/wayne/kvcache/Mooncake/thirdparties/etcd-cpp-apiv3
   used as include directory in directory /root/wayne/kvcache/Mooncake/thirdparties/etcd-cpp-apiv3
   used as include directory in directory /root/wayne/kvcache/Mooncake/thirdparties/etcd-cpp-apiv3
   used as include directory in directory /root/wayne/kvcache/Mooncake/thirdparties/etcd-cpp-apiv3
   used as include directory in directory /root/wayne/kvcache/Mooncake/thirdparties/etcd-cpp-apiv3
   used as include directory in directory /root/wayne/kvcache/Mooncake/thirdparties/etcd-cpp-apiv3
   used as include directory in directory /root/wayne/kvcache/Mooncake/thirdparties/etcd-cpp-apiv3
   used as include directory in directory /root/wayne/kvcache/Mooncake/thirdparties/etcd-cpp-apiv3
   used as include directory in directory /root/wayne/kvcache/Mooncake/thirdparties/etcd-cpp-apiv3/src
   used as include directory in directory /root/wayne/kvcache/Mooncake/thirdparties/etcd-cpp-apiv3/src
   used as include directory in directory /root/wayne/kvcache/Mooncake/thirdparties/etcd-cpp-apiv3/src
   used as include directory in directory /root/wayne/kvcache/Mooncake/thirdparties/etcd-cpp-apiv3/src
   used as include directory in directory /root/wayne/kvcache/Mooncake/thirdparties/etcd-cpp-apiv3/src
   used as include directory in directory /root/wayne/kvcache/Mooncake/thirdparties/etcd-cpp-apiv3/src
   used as include directory in directory /root/wayne/kvcache/Mooncake/thirdparties/etcd-cpp-apiv3/src
   used as include directory in directory /root/wayne/kvcache/Mooncake/thirdparties/etcd-cpp-apiv3/src
   used as include directory in directory /root/wayne/kvcache/Mooncake/thirdparties/etcd-cpp-apiv3/src
   used as include directory in directory /root/wayne/kvcache/Mooncake/thirdparties/etcd-cpp-apiv3/src
CPPREST_LIB
    linked by target "etcd-cpp-api" in directory /root/wayne/kvcache/Mooncake/thirdparties/etcd-cpp-apiv3/src

CMake Error in src/CMakeLists.txt:
  Found relative path while evaluating include directories of
  "etcd-cpp-api-core-objects":

    "CPPREST_INCLUDE_DIR-NOTFOUND"



CMake Error in src/CMakeLists.txt:
  Found relative path while evaluating include directories of "etcd-cpp-api":

    "CPPREST_INCLUDE_DIR-NOTFOUND"
<!-- gh-comment-id:2781845438 --> @gaowayne commented on GitHub (Apr 7, 2025): > bash dependencies.sh I tried this. it showed cpprest project not found, but the folder is in 3rd party. ``` (base) root@oq1:~/wayne/kvcache/Mooncake# bash dependencies.sh Reading package lists... Done Building dependency tree... Done Reading state information... Done build-essential is already the newest version (12.10ubuntu1). cmake is already the newest version (3.28.3-1build7). libibverbs-dev is already the newest version (50.0-2build2). libunwind-dev is already the newest version (1.6.2-3build1.1). libgoogle-glog-dev is already the newest version (0.6.0-2.1build1). libgtest-dev is already the newest version (1.14.0-1). libjsoncpp-dev is already the newest version (1.9.5-6build1). libnuma-dev is already the newest version (2.0.18-1build1). libpython3-dev is already the newest version (3.12.3-0ubuntu2). libboost-all-dev is already the newest version (1.83.0.1ubuntu2). libssl-dev is already the newest version (3.0.13-0ubuntu3.5). libgrpc-dev is already the newest version (1.51.1-4.1build5). libgrpc++-dev is already the newest version (1.51.1-4.1build5). libprotobuf-dev is already the newest version (3.21.12-8.2build1). protobuf-compiler-grpc is already the newest version (1.51.1-4.1build5). pybind11-dev is already the newest version (2.11.1-2). libcurl4-openssl-dev is already the newest version (8.5.0-2ubuntu10.6). libhiredis-dev is already the newest version (1.2.0-6ubuntu3). pkg-config is already the newest version (1.8.1-2build1). patchelf is already the newest version (0.18.0-1.1build1). The following packages were automatically installed and are no longer required: bridge-utils dns-root-data dnsmasq-base python3-compose python3-docker python3-dockerpty python3-docopt python3-dotenv python3-texttable python3-websocket ubuntu-fan Use 'sudo apt autoremove' to remove them. 0 upgraded, 0 newly installed, 0 to remove and 17 not upgraded. Requirement already satisfied: build in /root/anaconda3/lib/python3.12/site-packages (1.2.2.post1) Requirement already satisfied: setuptools in /root/anaconda3/lib/python3.12/site-packages (75.1.0) Requirement already satisfied: wheel in /root/anaconda3/lib/python3.12/site-packages (0.44.0) Requirement already satisfied: packaging>=19.1 in /root/anaconda3/lib/python3.12/site-packages (from build) (24.1) Requirement already satisfied: pyproject_hooks in /root/anaconda3/lib/python3.12/site-packages (from build) (1.2.0) WARNING: Running pip as the 'root' user can result in broken permissions and conflicting behaviour with the system package manager, possibly rendering your system unusable.It is recommended to use a virtual environment instead: https://pip.pypa.io/warnings/venv. Use the --root-user-action option if you know what you are doing and want to suppress this warning. *** Download and installing [cpprest sdk] *** mkdir: cannot create directory ‘/root/wayne/kvcache/Mooncake/thirdparties’: File exists fatal: destination path 'cpprestsdk' already exists and is not an empty directory. -- Setting gcc options -- Added test library httpclient_test -- Added test library httplistener_test -- Added test library json_test -- Added test library pplx_test -- Added test library streams_test -- Added test library uri_test -- Added test library utils_test -- Configuring done (0.1s) CMake Warning at Release/src/CMakeLists.txt:42 (add_library): Cannot generate a safe runtime search path for target cpprest because files in some directories may conflict with libraries in implicit directories: runtime library [libz.so.1] in /usr/lib/x86_64-linux-gnu may be hidden by files in: /root/anaconda3/lib Some of these libraries may not be found correctly. -- Generating done (0.1s) -- Build files have been written to: /root/wayne/kvcache/Mooncake/thirdparties/cpprestsdk/build [ 0%] Building CXX object Release/src/CMakeFiles/cpprest.dir/http/common/http_helpers.cpp.o /root/wayne/kvcache/Mooncake/thirdparties/cpprestsdk/Release/src/http/common/http_helpers.cpp: In function ‘size_t web::http::details::chunked_encoding::add_chunked_delimiters(uint8_t*, size_t, size_t)’: /root/wayne/kvcache/Mooncake/thirdparties/cpprestsdk/Release/src/http/common/http_helpers.cpp:91:43: error: ‘%8zX’ directive output may be truncated writing between 8 and 16 bytes into a region of size 9 [-Werror=format-truncation=] 91 | snprintf(buffer, sizeof(buffer), "%8zX", bytes_read); | ^~~~ /root/wayne/kvcache/Mooncake/thirdparties/cpprestsdk/Release/src/http/common/http_helpers.cpp:91:42: note: directive argument in the range [1, 18446744073709551615] 91 | snprintf(buffer, sizeof(buffer), "%8zX", bytes_read); | ^~~~~~ /root/wayne/kvcache/Mooncake/thirdparties/cpprestsdk/Release/src/http/common/http_helpers.cpp:91:17: note: ‘snprintf’ output between 9 and 17 bytes into a destination of size 9 91 | snprintf(buffer, sizeof(buffer), "%8zX", bytes_read); | ~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ cc1plus: all warnings being treated as errors make[2]: *** [Release/src/CMakeFiles/cpprest.dir/build.make:118: Release/src/CMakeFiles/cpprest.dir/http/common/http_helpers.cpp.o] Error 1 make[1]: *** [CMakeFiles/Makefile2:543: Release/src/CMakeFiles/cpprest.dir/all] Error 2 make: *** [Makefile:146: all] Error 2 *** Download and installing [etcd-cpp-apiv3] *** fatal: destination path 'etcd-cpp-apiv3' already exists and is not an empty directory. CMake Deprecation Warning at CMakeLists.txt:1 (cmake_minimum_required): Compatibility with CMake < 3.5 will be removed from a future version of CMake. Update the VERSION argument <min> value or use a ...<max> suffix to tell CMake that the project does not need compatibility with older versions. -- Building etcd-cpp-apiv3 with C++11 -- Found RE2 via CMake. -- Found GRPC: gRPC::gpr;gRPC::grpc;gRPC::grpc++, /root/anaconda3/bin/grpc_cpp_plugin (found version: "1.62.2") -- Configuring done (0.1s) CMake Error: The following variables are used in this project, but they are set to NOTFOUND. Please set them or make sure they are set and tested correctly in the CMake files: CPPREST_INCLUDE_DIR used as include directory in directory /root/wayne/kvcache/Mooncake/thirdparties/etcd-cpp-apiv3 used as include directory in directory /root/wayne/kvcache/Mooncake/thirdparties/etcd-cpp-apiv3 used as include directory in directory /root/wayne/kvcache/Mooncake/thirdparties/etcd-cpp-apiv3 used as include directory in directory /root/wayne/kvcache/Mooncake/thirdparties/etcd-cpp-apiv3 used as include directory in directory /root/wayne/kvcache/Mooncake/thirdparties/etcd-cpp-apiv3 used as include directory in directory /root/wayne/kvcache/Mooncake/thirdparties/etcd-cpp-apiv3 used as include directory in directory /root/wayne/kvcache/Mooncake/thirdparties/etcd-cpp-apiv3 used as include directory in directory /root/wayne/kvcache/Mooncake/thirdparties/etcd-cpp-apiv3 used as include directory in directory /root/wayne/kvcache/Mooncake/thirdparties/etcd-cpp-apiv3 used as include directory in directory /root/wayne/kvcache/Mooncake/thirdparties/etcd-cpp-apiv3 used as include directory in directory /root/wayne/kvcache/Mooncake/thirdparties/etcd-cpp-apiv3/src used as include directory in directory /root/wayne/kvcache/Mooncake/thirdparties/etcd-cpp-apiv3/src used as include directory in directory /root/wayne/kvcache/Mooncake/thirdparties/etcd-cpp-apiv3/src used as include directory in directory /root/wayne/kvcache/Mooncake/thirdparties/etcd-cpp-apiv3/src used as include directory in directory /root/wayne/kvcache/Mooncake/thirdparties/etcd-cpp-apiv3/src used as include directory in directory /root/wayne/kvcache/Mooncake/thirdparties/etcd-cpp-apiv3/src used as include directory in directory /root/wayne/kvcache/Mooncake/thirdparties/etcd-cpp-apiv3/src used as include directory in directory /root/wayne/kvcache/Mooncake/thirdparties/etcd-cpp-apiv3/src used as include directory in directory /root/wayne/kvcache/Mooncake/thirdparties/etcd-cpp-apiv3/src used as include directory in directory /root/wayne/kvcache/Mooncake/thirdparties/etcd-cpp-apiv3/src CPPREST_LIB linked by target "etcd-cpp-api" in directory /root/wayne/kvcache/Mooncake/thirdparties/etcd-cpp-apiv3/src CMake Error in src/CMakeLists.txt: Found relative path while evaluating include directories of "etcd-cpp-api-core-objects": "CPPREST_INCLUDE_DIR-NOTFOUND" CMake Error in src/CMakeLists.txt: Found relative path while evaluating include directories of "etcd-cpp-api": "CPPREST_INCLUDE_DIR-NOTFOUND" ```
Author
Owner

@stmatengss commented on GitHub (Apr 7, 2025):

“/root/wayne/kvcache/Mooncake/thirdparties/cpprestsdk/Release/src/http/common/http_helpers.cpp:91:43: error: ‘%8zX’ directive output may be truncated writing between 8 and 16 bytes into a region of size 9 [-Werror=format-truncation=]
91 | snprintf(buffer, sizeof(buffer), "%8zX", bytes_read);”

I guess it is the compatibility of cpprestsdk and GCC. You can comment out this line of code.

<!-- gh-comment-id:2781929410 --> @stmatengss commented on GitHub (Apr 7, 2025): “/root/wayne/kvcache/Mooncake/thirdparties/cpprestsdk/Release/src/http/common/http_helpers.cpp:91:43: error: ‘%8zX’ directive output may be truncated writing between 8 and 16 bytes into a region of size 9 [-Werror=format-truncation=] 91 | snprintf(buffer, sizeof(buffer), "%8zX", bytes_read);” I guess it is the compatibility of cpprestsdk and GCC. You can comment out this line of code.
Author
Owner

@stmatengss commented on GitHub (Apr 7, 2025):

You can try installing mooncake via pip install.

pip install mooncake_transfer_engine
<!-- gh-comment-id:2781930988 --> @stmatengss commented on GitHub (Apr 7, 2025): You can try installing mooncake via pip install. ``` pip install mooncake_transfer_engine ```
Author
Owner

@alogfans commented on GitHub (Apr 10, 2025):

In the latest version, Mooncake uses the official Go etcd client for v3. The etcd-cpp-api-v3 is only used for backward compatilibity and is not recommended.

<!-- gh-comment-id:2791636723 --> @alogfans commented on GitHub (Apr 10, 2025): In the latest version, Mooncake uses the official Go etcd client for v3. The etcd-cpp-api-v3 is only used for backward compatilibity and is not recommended.
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#92
No description provided.