Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

安装报错 #36

Closed
zcfh opened this issue Oct 13, 2022 · 7 comments
Closed

安装报错 #36

zcfh opened this issue Oct 13, 2022 · 7 comments

Comments

@zcfh
Copy link

zcfh commented Oct 13, 2022

[45/1637] MAKE //thirdparty/nghttp2:nghttp2_build
......
libtool: install: /usr/bin/install -c .libs/libnghttp2.so.14.20.0 /home/name/workspace/yadcc/build64_release/thirdparty/nghttp2/lib/libnghttp2.so.14.20.0
/usr/bin/install: cannot stat '.libs/libnghttp2.so.14.20.0': No such file or directory

ll build64_release/thirdparty/nghttp2/nghttp2-1.41.0/lib/.libs

-rw-rw-r-- 1 wuminghui03 wuminghui03 819848 Oct 13 17:46 libnghttp2.a
lrwxrwxrwx 1 wuminghui03 wuminghui03     16 Oct 13 17:46 libnghttp2.la -> ../libnghttp2.la
-rw-rw-r-- 1 wuminghui03 wuminghui03   1023 Oct 13 17:46 libnghttp2.lai
lrwxrwxrwx 1 wuminghui03 wuminghui03     21 Oct 13 17:46 libnghttp2.so -> libnghttp2.so.14.20.0
lrwxrwxrwx 1 wuminghui03 wuminghui03     21 Oct 13 17:46 libnghttp2.so.14 -> libnghttp2.so.14.20.0
-rw-rw-r-- 1 wuminghui03 wuminghui03  27264 Oct 13 17:46 nghttp2_buf.o

安装报错 .libs/libnghttp2.so.14.20.0 不存在,查看目录 build64_release/thirdparty/nghttp2/nghttp2-1.41.0/lib/.libs , 有指向 libnghttp2.so.14.20.0 但是这个库是不存在的,这个库应该是新构建的才对,但是并未出现这个动态库链接报错。
已经按照 REAMD 更新了submodule, 并且在 build/external/flare 指向过 git lfs install/pull, 是有步骤不对少拉了文件吗
机器 CentOS Linux release 7.4.1708 (Core)。

@zcfh zcfh closed this as completed Oct 13, 2022
@zcfh zcfh reopened this Oct 14, 2022
@0x804d8000
Copy link
Collaborator

应该不是少拉了文件之类的,感觉是nghttp2的构建过程(用的autotools那套应该是)有问题,试试git clean . -xdf看看重新来一次OK不

@zcfh
Copy link
Author

zcfh commented Oct 17, 2022

应该不是少拉了文件之类的,感觉是nghttp2的构建过程(用的autotools那套应该是)有问题,试试git clean . -xdf看看重新来一次OK不

大概知道原因了,通过环境变量指定gcc路径,在一些非blade构建的三方库不生效。
由于机器上默认的gcc版本为4.x,这里搜索了blade的文档,export CC=/home/distcc/gcc-8.3.0/bin/gcc CXX=/home/distcc/gcc-8.3.0/bin/g++ CPP=/home/distcc/gcc-8.3.0/bin/cpp LD=/home/distcc/gcc-8.3.0/bin/g++ ,export了这些变量来指定gcc路径。
上面出现报错,在去掉环境变量 LD=/home/distcc/gcc-8.3.0/bin/g++,就不会出现了。
另外还发现编译fmt的时候,命令中修改CXX为g++,导致环境变量不生效,命令如下。


 **CXX=g++ CC=gcc** cmake -DCMAKE_INSTALL_PREFIX=../ -DCMAKE_INSTALL_LIBDIR=lib -DCMAKE_EXPORT_NO_PACKAGE_REGISTRY=ON -DCMAKE_FIND_PACKAGE_NO_PACKAGE_REGISTRY=ON -DCMAKE_FIND_PACKAGE_NO_SYSTEM_PACKAGE_REGISTRY=ON -DCMAKE_EXPORT_PACKAGE_REGISTRY=OFF -DCMAKE_FIND_USE_PACKAGE_REGISTRY=OFF -DCMAKE_FIND_USE_SYSTEM_PACKAGE_REGISTRY=OFF -DCMAKE_POSITION_INDEPENDENT_CODE=ON -DCMAKE_BUILD_TYPE=Release -DFMT_TEST=OFF ../fmt-7.1.3

手动修改了命令后,fmt不再报错。不过还有其他三方库在报错。
所以应该如何正确指定gcc路径?

@0x804d8000
Copy link
Collaborator

把gcc8的bin目录加到path最前面试试

手动改了CXX是因为有些第三方库会默认找到clang去,所以hack了一把

@zcfh
Copy link
Author

zcfh commented Oct 17, 2022

还是不好使。

一些打印编译指令的还能手动改改。
类似,ctemplate这种的,编译指令都不打印的,完全不知道怎么改。好崩溃。。。

$ make -C build64_release/thirdparty/ctemplate/ctemplate-ctemplate-2.4
make: Entering directory `/home/syslab/wuminghui/yadcc/yadcc/build64_release/thirdparty/ctemplate/ctemplate-ctemplate-2.4'
make  all-am
make[1]: Entering directory `/home/syslab/wuminghui/yadcc/yadcc/build64_release/thirdparty/ctemplate/ctemplate-ctemplate-2.4'
  CXXLD    make_tpl_varnames_h
./.libs/libctemplate_nothreads.so: undefined reference to `ctemplate_htmlparser::htmlparser_new()'
./.libs/libctemplate_nothreads.so: undefined reference to `ctemplate_htmlparser::htmlparser_attr_type(ctemplate_htmlparser::htmlparser_ctx_s*)'
./.libs/libctemplate_nothreads.so: undefined reference to `ctemplate_htmlparser::htmlparser_state(ctemplate_htmlparser::htmlparser_ctx_s*)'
./.libs/libctemplate_nothreads.so: undefined reference to `typeinfo for ctemplate::BaseArena'
./.libs/libctemplate_nothreads.so: undefined reference to `ctemplate::BaseArena::~BaseArena()'
./.libs/libctemplate_nothreads.so: undefined reference to `ctemplate::BaseArena::Reset()'

@zcfh
Copy link
Author

zcfh commented Oct 17, 2022

最终部分编不过的库,手动编完,在软链进build64_release中,现在编译终于通过了,期待明天能跑

@0x804d8000
Copy link
Collaborator

这个不太对……

  1. 检查/home/distcc/gcc-8.3.0/bin/下面有没有cc,很多手动编译的gcc会缺这个,然后跟cmake合作会有问题。不过BUILD里面强行改成了gcc,可能没有cc也能跑。不放心话可以把gcc软链接成cc。
  2. export PATH=/home/distcc/gcc-8.3.0/bin/:$PATH把gcc8加到PATH。这时候命令行执行gcc -v应该是8.x。
  3. 环境变量的CC CXX LD之类的全部unset掉。
  4. build64_release删掉。
  5. 全新编译一次试试。

鹅厂内部用的系统跟CentOS7用户态基本一样,原生的CentOS7应该只要把gcc 8放在PATH头部就没啥特殊要求了(除了blade依赖的,比如python)才对。

@zcfh
Copy link
Author

zcfh commented Oct 18, 2022

问题可能是出在:

  • 一些环境没unset掉
  • ./blade clean ... 和 直接删除build目录的逻辑不同。

之前试过unset CXX等环境变量,同时./blade clean,但是还是有问题。今天创新打开了终端,并且删除了build64_release, 把gcc8的加入到PATH就可以正常编译了,不存在 cc 并不影响。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants