GithubHelp home page GithubHelp logo

cross compile problem about srpc HOT 12 CLOSED

ouclbc avatar ouclbc commented on June 11, 2024
cross compile problem

from srpc.

Comments (12)

holmes1412 avatar holmes1412 commented on June 11, 2024

编译srpc需要依赖workflow作为third_party。请问git clone https://github.com/sogou/srpc.git时是否有带上--recursive呢?

如果已经clone完了,可以通过执行命令:git submodule update --init --recursive初始化刚才没有拉下来的third_party,然后再试试~

有什么进展欢迎反馈,谢谢~

from srpc.

ouclbc avatar ouclbc commented on June 11, 2024

我下载的时候带着--recursive

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

from srpc.

holmes1412 avatar holmes1412 commented on June 11, 2024

1、你执行make的路径是在srpc根目录吗?
2、cd workflow看看里边有东西么?

from srpc.

holmes1412 avatar holmes1412 commented on June 11, 2024

我试了一下,如果没有--recursive拉代码的话,确实会有找不到third_party的错误,比如我这里会:

CMake Error at src/CMakeLists.txt:41 (find_package):
  Could not find a package configuration file provided by "Snappy" (requested
  version 1.1.6) with any of the following names:

    SnappyConfig.cmake
    snappy-config.cmake

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

然后你的报错那行是srpc/src的CMakeLists.txt:find_package(Workflow REQUIRED CONFIG HINTS ../workflow)
也就是说如果srpc/workflow/这个目录下如果有workflow-config.cmake.in,就会生成workflow-config.cmake

所以麻烦确认下srpc根目录下的workflow目录里是否有东西?

from srpc.

ouclbc avatar ouclbc commented on June 11, 2024

linux x86下设置交叉编译环境,完整的错误:
mkdir -p build.cmake
cd build.cmake && cmake /home/barton/holly/srpc
CMake Warning at CMakeLists.txt:45 (find_package):
By not providing "FindSnappy.cmake" in CMAKE_MODULE_PATH this project has
asked CMake to find a package configuration file provided by "Snappy", but
CMake did not find one.

Could not find a package configuration file provided by "Snappy" with any
of the following names:

SnappyConfig.cmake
snappy-config.cmake

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

CMake Error at src/CMakeLists.txt:33 (find_package):
Could not find a package configuration file provided by "Workflow" with any
of the following names:

WorkflowConfig.cmake
workflow-config.cmake

Add the installation prefix of "Workflow" to CMAKE_PREFIX_PATH or set
"Workflow_DIR" to a directory containing one of the above files. If
"Workflow" provides a separate development package or SDK, be sure it has
been installed.
在cmakelist.txt里面设置set(CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/third_party/snappy;${CMAKE_SOURCE_DIR}/workflow;${CMAKE_MODULE_PATH}")好像也不行

from srpc.

holmes1412 avatar holmes1412 commented on June 11, 2024

按说src/CMakeLists.txt里的find_package()里已经制定了HINTS的路径才对。
要不你试试set一下Snappy_DIR和Workflow_DIR,看看ok吗?

from srpc.

ouclbc avatar ouclbc commented on June 11, 2024

本地可以编译过,但是交叉编译有问题。set一下Snappy_DIR和Workflow_DIR好像不起作用。

from srpc.

holmes1412 avatar holmes1412 commented on June 11, 2024

我们不懂交叉编译,所以还得请你多帮定位🙏

我看workflow的交叉编译有一个小伙伴提过一个PR:https://github.com/sogou/workflow/pull/655/files 虽然现在你已经编译好workflow了,但不知道这个改动有可以参考的地方吗?比如设置CMAKE_FIND_ROOT_PATH这种。

另外问了下GPT,基本也是建议改这两个:

cmake -DCMAKE_PREFIX_PATH=/path/to/cross/toolchain ..

或者

set(Workflow_DIR "/path/to/cross/toolchain/lib/cmake/Workflow")
find_package(Workflow REQUIRED CONFIG)

要么是否可以先安装workflow、snappy、lz4,然后再编译srpc,从系统里找依赖?

from srpc.

ouclbc avatar ouclbc commented on June 11, 2024

非常感谢你们这边及时的回答,我这边再排查一下cmake的执行流程,看看哪里有问题。

from srpc.

holmes1412 avatar holmes1412 commented on June 11, 2024

好的,有任何进展欢迎反馈,感谢~

from srpc.

ouclbc avatar ouclbc commented on June 11, 2024

我这边在src/CMakelist.txt里面设置绝对路径:set(Workflow_DIR "/home/barton/holly/srpc/workflow")编译通过了,另外请问一下这个srpc怎么切换是brpc还是Thrift 这种有文档说明么?我们想用在嵌入式设备上

from srpc.

holmes1412 avatar holmes1412 commented on June 11, 2024

太好了~

关于收发协议,可以参考这两个文档:
https://github.com/sogou/srpc/blob/master/docs/docs-03-server.md
https://github.com/sogou/srpc/blob/master/docs/docs-04-client.md

比如你在文档里看到SRPCServer/SRPCClient,那就是SRPC协议+protobuf,如果你是用BRPCServer/BRPCClient,那么就是brpc,如此类推。你可以把tutorial编译出来,有各个协议对应的写法和示例可以run~

from srpc.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.