howz97 opened a new issue, #2568:
URL: https://github.com/apache/brpc/issues/2568

   **Describe the bug (描述bug)**
   CentOS7 编译失败
   
   **To Reproduce (复现方法)**
   根据文档在CentOS7执行:
   ```shell
   sudo yum install epel-release
   sudo yum install git gcc-c++ make openssl-devel gflags-devel protobuf-devel 
protobuf-compiler leveldb-devel
   $ sh config_brpc.sh --headers="/usr/include" --libs="/usr/lib64 /usr/bin"
   $ make
   ```
   得到结果
   ```shell
   > Generating src/idl_options.pb.cc
   /usr/bin/protoc --cpp_out=./src --proto_path=./src 
--proto_path=/usr/include/ src/idl_options.proto
   g++ -c -I./src -I/usr/include/ -std=c++0x -DBRPC_WITH_GLOG=0 
-DGFLAGS_NS=gflags -D__const__=__unused__ -g -DBTHREAD_USE_FAST_PTHREAD_MUTEX 
-D_GNU_SOURCE -DUSE_SYMBOLIZE -DNO_TCMALLOC -D__STDC_FORMAT_MACROS 
-D__STDC_LIMIT_MACROS -D__STDC_CONSTANT_MACROS -DNDEBUG 
-DBRPC_REVISION=\"1.8.0\|master\|37814d2\|2024-03-13T13:31:41+08:00\" -O2 -pipe 
-Wall -W -fPIC -fstrict-aliasing -Wno-invalid-offsetof -Wno-unused-parameter 
-fno-omit-frame-pointer src/mcpack2pb/generator.cpp -o src/mcpack2pb/generator.o
   > Generating src/brpc/rtmp.pb.h
   /usr/bin/protoc --cpp_out=./src --proto_path=./src 
--proto_path=/usr/include/ src/brpc/rtmp.proto
   > Generating src/brpc/get_favicon.pb.h
   /usr/bin/protoc --cpp_out=./src --proto_path=./src 
--proto_path=/usr/include/ src/brpc/get_favicon.proto
   > Generating src/brpc/get_js.pb.h
   /usr/bin/protoc --cpp_out=./src --proto_path=./src 
--proto_path=/usr/include/ src/brpc/get_js.proto
   > Generating src/brpc/span.pb.h
   /usr/bin/protoc --cpp_out=./src --proto_path=./src 
--proto_path=/usr/include/ src/brpc/span.proto
   > Generating src/brpc/streaming_rpc_meta.pb.h
   /usr/bin/protoc --cpp_out=./src --proto_path=./src 
--proto_path=/usr/include/ src/brpc/streaming_rpc_meta.proto
   > Generating src/brpc/builtin_service.pb.h
   /usr/bin/protoc --cpp_out=./src --proto_path=./src 
--proto_path=/usr/include/ src/brpc/builtin_service.proto
   > Generating src/brpc/grpc_health_check.pb.h
   /usr/bin/protoc --cpp_out=./src --proto_path=./src 
--proto_path=/usr/include/ src/brpc/grpc_health_check.proto
   brpc/grpc_health_check.proto:39:51: Expected ")".
   make: *** [src/brpc/grpc_health_check.pb.h] Error 1
   ```
   **Expected behavior (期望行为)**
   
   编译通过
   **Versions (各种版本)**
   OS: CentOS7
   Compiler: gcc (GCC) 4.8.5 20150623 (Red Hat 4.8.5-44)
   brpc: 
https://github.com/apache/brpc/commit/37814d2da8f4a08da642eca28f139c293321d519
   protobuf:
   
   **Additional context/screenshots (更多上下文/截图)**
   
   尝试用cmake 进行编译:
   ```shell
   mkdir build && cd build 
   cmake ..
   ```
   仍然编译失败:
   ```shell
   -- The C compiler identification is GNU 4.8.5
   -- The CXX compiler identification is GNU 4.8.5
   -- Check for working C compiler: /usr/bin/cc
   -- Check for working C compiler: /usr/bin/cc -- works
   -- Detecting C compiler ABI info
   -- Detecting C compiler ABI info - done
   -- Check for working CXX compiler: /usr/bin/c++
   -- Check for working CXX compiler: /usr/bin/c++ -- works
   -- Detecting CXX compiler ABI info
   -- Detecting CXX compiler ABI info - done
   -- Found gflags: /usr/lib64/libgflags.so
   -- Looking for include file pthread.h
   -- Looking for include file pthread.h - found
   -- Looking for pthread_create
   -- Looking for pthread_create - not found
   -- Looking for pthread_create in pthreads
   -- Looking for pthread_create in pthreads - not found
   -- Looking for pthread_create in pthread
   -- Looking for pthread_create in pthread - found
   -- Found Threads: TRUE
   -- Found PROTOBUF: /usr/lib64/libprotobuf.so
   CMake Error at CMakeLists.txt:157 (if):
     if given arguments:
   
       "Protobuf_VERSION" "GREATER_EQUAL" "4.22"
   
     Unknown arguments specified
   
   
   -- Configuring incomplete, errors occurred!
   See also "/home/centos/brpc/build/CMakeFiles/CMakeOutput.log".
   See also "/home/centos/brpc/build/CMakeFiles/CMakeError.log".
   ```


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscr...@brpc.apache.org.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@brpc.apache.org
For additional commands, e-mail: dev-h...@brpc.apache.org

Reply via email to