Browse Source

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: adda3acb2d
tags/v1.3.0
Megvii Engine Team 4 years ago
parent
commit
89e52281e4
1 changed files with 4 additions and 0 deletions
  1. +4
    -0
      CMakeLists.txt

+ 4
- 0
CMakeLists.txt View File

@@ -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)


Loading…
Cancel
Save