Tencent / Tendis

Tendis is a high-performance distributed storage system fully compatible with the Redis protocol.
http://tendis.cn
Other
2.92k stars 319 forks source link

执行cmake 的时候 报错 #171

Open xiaosayishi opened 2 years ago

xiaosayishi commented 2 years ago

环境:centos7.9 gcc:7.3.0 cmake:3.14.0 gflags-devel gflags
tendis版本:dev-2.2 执行命令:cmake .. -DCMAKE_CXX_FLAGS=-fPIC 显示错误细心如下:

define TENDISPLUS_GIT_SHA1 "53affc54"

define TENDISPLUS_GIT_DIRTY "36"

/usr/local/bin/c++ using rocksdb-5.3.14 jemalloc git patch, we force set jemalloc prof:true error: patch failed: src/prof.c:30 error: src/prof.c: patch does not apply WITH_SNAPPY on, plz ensure you have installed libsnappy on your machine SNAPPY_INCLUDE_DIR=/opt/tendis/tendis2.4/src/thirdparty/include/snappy/ SNAPPY_LIBRARIES=/opt/tendis/tendis2.4/build/lib/libsnappy.a -- JNI library is disabled RelWithDebInfo -O3 -DNDEBUG -- Configuring done CMake Error: install(EXPORT "glog-targets" ...) includes target "glog" which requires target "gflags_nothreads_static" that is not in the export set. -- Generating done -- Build files have been written to: /opt/tendis/tendis2.4/build

当我卸载gflags-devel和gflags的时候执行cmake .. 错误信息如下:

define TENDISPLUS_GIT_SHA1 "53affc54"

define TENDISPLUS_GIT_DIRTY "36"

/usr/local/bin/c++ using rocksdb-5.3.14 jemalloc git patch, we force set jemalloc prof:true error: patch failed: src/prof.c:30 error: src/prof.c: patch does not apply CMake Warning at src/thirdparty/glog/CMakeLists.txt:51 (find_package): By not providing "Findgflags.cmake" in CMAKE_MODULE_PATH this project has asked CMake to find a package configuration file provided by "gflags", but CMake did not find one.

Could not find a package configuration file provided by "gflags" (requested version 2.2.0) with any of the following names:

gflagsConfig.cmake
gflags-config.cmake

Add the installation prefix of "gflags" to CMAKE_PREFIX_PATH or set "gflags_DIR" to a directory containing one of the above files. If "gflags" provides a separate development package or SDK, be sure it has been installed.

WITH_SNAPPY on, plz ensure you have installed libsnappy on your machine SNAPPY_INCLUDE_DIR=/opt/tendis/tendis2.4/src/thirdparty/include/snappy/ SNAPPY_LIBRARIES=/opt/tendis/tendis2.4/build/lib/libsnappy.a -- JNI library is disabled RelWithDebInfo -O3 -DNDEBUG -- Configuring done -- Generating done -- Build files have been written to: /opt/tendis/tendis2.4/build

上面的错误信息要怎么处理,还请各位大师,指点一下,谢谢!

xiaosayishi commented 2 years ago

我编译安装了gflags的2.2.2版本 执行cmake ..时的错误信息如下:

define TENDISPLUS_GIT_SHA1 "53affc54"

define TENDISPLUS_GIT_DIRTY "36"

/usr/local/bin/c++ using rocksdb-5.3.14 jemalloc git patch, we force set jemalloc prof:true error: patch failed: src/prof.c:30 error: src/prof.c: patch does not apply CMake Error at /usr/local/lib/cmake/gflags/gflags-nonamespace-targets.cmake:37 (message): Some (but not all) targets in this export set were already defined.

Targets Defined: gflags_nothreads_static

Targets not yet defined: gflags_shared;gflags_nothreads_shared;gflags_static

Call Stack (most recent call first): /usr/local/lib/cmake/gflags/gflags-config.cmake:17 (include) src/thirdparty/snappy/CMakeLists.txt:133 (find_package)

-- Configuring incomplete, errors occurred! See also "/opt/tendis/tendis2.4/build/CMakeFiles/CMakeOutput.log". See also "/opt/tendis/tendis2.4/build/CMakeFiles/CMakeError.log".

jingjunLi commented 2 years ago

The same as #9 . 可以参考 #9 的做法试一下

xiaosayishi commented 2 years ago

hi,非常感谢您的回复。我试过了#9的做法,当我删除本地的gflags后从新执行cmake ..得到下面的结果: CMake Warning at src/thirdparty/glog/CMakeLists.txt:51 (find_package): By not providing "Findgflags.cmake" in CMAKE_MODULE_PATH this project has asked CMake to find a package configuration file provided by "gflags", but CMake did not find one.

Could not find a package configuration file provided by "gflags" (requested version 2.2.0) with any of the following names:

gflagsConfig.cmake
gflags-config.cmake

Add the installation prefix of "gflags" to CMAKE_PREFIX_PATH or set "gflags_DIR" to a directory containing one of the above files. If "gflags" provides a separate development package or SDK, be sure it has been installed. 然后我将项目里面的链接gflags复制到另外的目录编译了以下,在会回到项目的build目录执行cmake ..显示下面的信息: CMake Error: install(EXPORT "glog-targets" ...) includes target "glog" which requires target "gflags_nothreads_static" that is not in the export set. -- Generating done 最后我又删除了/usr/local/lib/cmake/gflags ,和build目录,从新执行cmake ..显示的信息依然是: CMake Error: install(EXPORT "glog-targets" ...) includes target "glog" which requires target "gflags_nothreads_static" that is not in the export set. -- Generating done 请问还有没有其他方法解决这个问题,非常感谢!