zoukankan      html  css  js  c++  java
  • lua加载动态库缺乏相应的系统库

    错误信息:

    使用lua测试lm2动态库时,加载时出现如下错误

    jfyuan@jfy11-B85M-D2V:~/temp/service/soft/code/ginger_resty/cores/lm2/test$ lua lm2_test.lua ./param.txt /home/wlc/SpeechdServer/speechd-centos_6.2-x86_64-0.5.0-20140317150535/modules//lm/res/eng.pred/lm.eng.pred.sh
    lua: error loading module 'aicores.liblm2' from file './aicores/liblm2.so':
    ./aicores/liblm2.so: undefined symbol: pthread_mutexattr_destroy
    stack traceback:
    [C]: ?
    [C]: in function 'require'
    lm2_test.lua:1: in main chunk
    [C]: ?

    而ldd时又看不见需要线程动态库

    jfyuan@jfy11-B85M-D2V:~/temp/service/soft/code/ginger_resty/cores/lm2$ ldd liblm2.so
    linux-vdso.so.1 => (0x00007fff5cddf000)
    libstdc++.so.6 => /usr/lib/x86_64-linux-gnu/libstdc++.so.6 (0x00007fd667978000)
    libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x00007fd667671000)
    libgcc_s.so.1 => /lib/x86_64-linux-gnu/libgcc_s.so.1 (0x00007fd66745b000)
    libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007fd667096000)
    /lib64/ld-linux-x86-64.so.2 (0x00007fd668215000)

    原因可能是lua的require加载模块会对所有导出函数检查依赖库

    解决办法:export LD_PRELOAD=/opt/intel/mkl/lib/intel64/libmkl_core.so:/opt/intel/mkl/lib/intel64/libmkl_sequential.so:/usr/local/lib/libiconv.so.2:/lib/x86_64-linux-gnu/libpthread.so.0

    jfyuan@jfy11-B85M-D2V:~/temp/service/soft/code/ginger_resty/cores/lm2/test$ ldd aicores/liblm2.so
    linux-vdso.so.1 => (0x00007fffe65e6000)
    /opt/intel/mkl/lib/intel64/libmkl_core.so (0x00007f9c43ce4000)
    /opt/intel/mkl/lib/intel64/libmkl_sequential.so (0x00007f9c43645000)
    /usr/local/lib/libiconv.so.2 (0x00007f9c43360000)
    /lib/x86_64-linux-gnu/libpthread.so.0 (0x00007f9c43142000)
    libstdc++.so.6 => /usr/lib/x86_64-linux-gnu/libstdc++.so.6 (0x00007f9c42e14000)
    libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x00007f9c42b0e000)
    libgcc_s.so.1 => /lib/x86_64-linux-gnu/libgcc_s.so.1 (0x00007f9c428f8000)
    libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007f9c42532000)
    libdl.so.2 => /lib/x86_64-linux-gnu/libdl.so.2 (0x00007f9c4232e000)
    /lib64/ld-linux-x86-64.so.2 (0x00007f9c45462000)

  • 相关阅读:
    将Tomcat配置到你的mac电脑上,命令行启动tomcat
    Java反射获取字节码以及判断类型
    mysql那些事
    Hibernate 一对一中的一些问题
    Java long类型和Long类型的那些事
    java中的多线程
    Struts2:java.lang.NoSuchFieldException: resourceEntries at java.lang.Class.getDeclaredField(Class.java:1901)
    生产者-消费者模式
    并行程序设计模式--Master-Worker模式
    Ibatis的类型处理器TypeHandler解析
  • 原文地址:https://www.cnblogs.com/tibetanmastiff/p/5589997.html
Copyright © 2011-2022 走看看