cmake中连接libdl.so,成功编译,但是在提交作业时报错---No such file or directory



  • CMakelist.txt中连接libdl:

    target_link_libraries(helloworld libdl.so)
    

    成功编译:

    [ 50%] Building CXX object CMakeFiles/helloworld.dir/1test.cpp.o
    [100%] Linking CXX executable helloworld
    [100%] Built target helloworld
    
    

    使用bsub提交运行时报错:

    [swEnv@psn010 build]$ bsub -I -q q_sw_expr -N 1 -np 1 -sw3run swrun-5a ./helloworld
    Job <52114473> has been submitted to queue <q_sw_expr>
    waiting for dispatch ...
    dispatching ...
    ./helloworld: error while loading shared libraries: libdl.so.2.1: cannot open shared object file: No such file or directory
    [52114473 ## Sat Dec 26 22:03:17 2020] warning: node [0]: user's mpe task: tid= 0, pid= 9559, exit_code= 127
    Job 52114473 has been finished. exit_code is 127
    

登录后回复