提交 89e52281 编写于 作者: M Megvii Engine Team

fix(build/lite): fix lite rc4_encryptor build failed at new ld env

when cuda enable:

error log:
nn-8.0.4-trt-7.2.2.3-libs/TensorRT-7.2.2.3/lib/libnvinfer_static.a(profile.o):
undefined reference to symbol 'dlclose@@GLIBC_2.2.5'
/usr/bin/ld:
/usr/lib/gcc/x86_64-linux-gnu/9/../../../x86_64-linux-gnu/libdl.so:
error adding symbols: DSO missing from command line

ld version:
GNU ld (GNU Binutils for Ubuntu) 2.34, example ubuntu20.04

error reason: at new ld, import flags with active zone

libnvinfer_static.a depend dlclose@@GLIBC_2.2.5, which need -ldl

ld -o rc4_encryptor xxx.o -ldl libnvinfer_static.a, which failed

so we put a -ldl for CUDA_LIBS env, then will change to
ld -o rc4_encryptor xxx.o  libnvinfer_static.a -ldl

GitOrigin-RevId: adda3acb2d5c0952013d59948717060747dd2f8f
上级 992a90bb
......@@ -551,6 +551,10 @@ if(MGE_WITH_CUDA)
endif()
set(MGE_CUDA_LIBS "${MGE_CUDA_LIBS} -lrt")
if(UNIX)
set(MGE_CUDA_LIBS "${MGE_CUDA_LIBS} -ldl")
endif()
endif()
if(MGE_WITH_CAMBRICON)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册