GithubHelp home page GithubHelp logo

problem about srpc HOT 29 CLOSED

ChengYe9527 avatar ChengYe9527 commented on June 12, 2024
problem

from srpc.

Comments (29)

ChengYe9527 avatar ChengYe9527 commented on June 12, 2024

我应该怎么使用呢

from srpc.

holmes1412 avatar holmes1412 commented on June 12, 2024

你好,我执行这个命令是没有问题的。猜测是getopt这个函数在不同系统里的返回值不一样,导致非参数的解析也进入了default分支。

麻烦确认下是否使用最新的代码,另外可以告知一下具体的系统等信息吗?

from srpc.

ChengYe9527 avatar ChengYe9527 commented on June 12, 2024

是在docker下,ubuntu20.04
从github的srpc页面下载
git clone --recursive https://github.com/sogou/srpc.git
cd srpc
make
也装了protobuf3.6.1的版本,编译没有报错了

from srpc.

ChengYe9527 avatar ChengYe9527 commented on June 12, 2024

是有特定的安装路径吗?

from srpc.

holmes1412 avatar holmes1412 commented on June 12, 2024

和安装路径没有关系,这个小工具只是做简单的参数解析,还不涉及pb呢。我们也没遇到过这个问题,目前只能是怀疑getopt这个返回值在不同平台下有点不一样,需要等我找到类似的系统复现出来才能确定。

from srpc.

ChengYe9527 avatar ChengYe9527 commented on June 12, 2024

tools里面的工具有涉及到protobuf吗?
单tools里面的文档我在ubuntu20.04系统里也是上面的问题

from srpc.

holmes1412 avatar holmes1412 commented on June 12, 2024

不涉及protobuf~

from srpc.

holmes1412 avatar holmes1412 commented on June 12, 2024

需要等我晚点找个环境复现一下。
你可以先把tools/srpc_basic_controller.cc的311、312行注释掉,313行的return false改成return true,然后在tools目录下重新把srpc这个小工具编译出来看看,先感受下构建的用法🙏

from srpc.

ChengYe9527 avatar ChengYe9527 commented on June 12, 2024

好的

from srpc.

ChengYe9527 avatar ChengYe9527 commented on June 12, 2024

我看的只有master是有tools的,其他版本都没有

from srpc.

holmes1412 avatar holmes1412 commented on June 12, 2024

是的,只有master分支有tools目录

from srpc.

Barenboim avatar Barenboim commented on June 12, 2024

我在ubuntu 22.04上,无法复现这个问题。我感觉是getopt有什么行为不一致,或者我们调用方法有什么不太对。

from srpc.

ChengYe9527 avatar ChengYe9527 commented on June 12, 2024

有在macos上安装吗?openssl怎么解决?

from srpc.

Barenboim avatar Barenboim commented on June 12, 2024

mac上也测试过的。openssl我们默认已经安装,毕竟现场编译openssl还是太慢了。

from srpc.

ChengYe9527 avatar ChengYe9527 commented on June 12, 2024

mac上也测过的。openssl我们默认已经安装,最终现场编译openssl还是太慢了。

openssl是什么版本呢?

from srpc.

holmes1412 avatar holmes1412 commented on June 12, 2024

@ChengYe9527 可以直接使用brew install openssl
具体可以参考:sogou/workflow#150
注意macOS有自带的ssl,所以如果使用openssl的话,brew安装之后要按照它的提示建立链接。

from srpc.

ChengYe9527 avatar ChengYe9527 commented on June 12, 2024

截屏2023-03-31 16 18 24

你好,我这边mac编译srpc报错

from srpc.

holmes1412 avatar holmes1412 commented on June 12, 2024

不确定是你原先没有安装protobuf还是系统找默认路径的不统一,建议你可以源码安装一下protobuf。

参考:

git clone -b 3.20.x https://github.com/protocolbuffers/protobuf.git protobuf.3.20
cd protobuf.3.20
sh autogen.sh
./configure
make -j4
make install

from srpc.

ChengYe9527 avatar ChengYe9527 commented on June 12, 2024

我装的 3.6

from srpc.

ChengYe9527 avatar ChengYe9527 commented on June 12, 2024

w

不确定是你最初没有安装protobuf还是系统找到默认路径的不均匀,建议你可以用源码安装一下protobuf。

参考:

git clone -b 3.20.x https://github.com/protocolbuffers/protobuf.git protobuf.3.20
cd protobuf.3.20
sh autogen.sh
./configure
make -j4
make install

我装了protobuf还是报错

from srpc.

holmes1412 avatar holmes1412 commented on June 12, 2024

是源码安装了还报错吗?可以把新的报错信息发给我看一下~

from srpc.

ChengYe9527 avatar ChengYe9527 commented on June 12, 2024

是源码安装了还报错了吗?可以把新的报错信息发给我看一下~

截屏2023-03-31 17 49 34

from srpc.

kedixa avatar kedixa commented on June 12, 2024

@ChengYe9527
你好,你的处理器是Arm的吗,发一下 cat /proc/cpuinfo | head -n 30 的输出

编译一下下面的代码,并把输出发一下

#include <type_traits>
#include <iostream>

bool f() {
    return (char)-1 == (signed char)-1;
}
bool g() {
    return (char)-1 == (unsigned char)-1;
}

int main() {
    std::cout << f() << std::endl;
    std::cout << g() << std::endl;
    return 0;
}

from srpc.

Barenboim avatar Barenboim commented on June 12, 2024

修了:d25cbfd

from srpc.

Barenboim avatar Barenboim commented on June 12, 2024

#298

from srpc.

ChengYe9527 avatar ChengYe9527 commented on June 12, 2024

cat /proc/cpuinfo | head -n 30

cat: /proc/cpuinfo: No such file or directory

代码输出

1
0

Saving session...
...copying shared history...
...saving history...truncating history files...
...completed.

from srpc.

Barenboim avatar Barenboim commented on June 12, 2024

最新代码应该已经修复问题了!感谢。

from srpc.

ChengYe9527 avatar ChengYe9527 commented on June 12, 2024

又在M1的mac上试过吗

是源代码安装了还报错了吗?可以把新的报错信息发给我看一下~

from srpc.

holmes1412 avatar holmes1412 commented on June 12, 2024

@ChengYe9527 是的是一个getopt返回值原先我处理没有很细心的问题,已经修复了。麻烦再试一下,可以用你一开始的ubuntu20.04试试

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.