zoukankan      html  css  js  c++  java
  • The Live Editor is unable to run in the current system configuration

    我在 Kubuntu21.04 安装 Matlab R2018a 后,打开实时编辑器报错。

    从Java吐出的报错中可以看到如下的错误信息:

    /usr/lib/x86_64-linux-gnu/libcairo.so.2: undefined symbol: FT_Get_Var_Design_Coordinates
    

    在stack overflow搜索后发现,错误原因是 /usr/lib/x86_64-linux-gnu/libcairo.so.2 库依赖 FT_Get_Var_Design_Coordinates 符号,而这个符号存在于 libfreetype.so 中。此时搜索系统中存在的 libcairo.so

    $ sudo find / -type f -iname 'libcairo.so*'
    

    可以发现Matlab并没有自带 libcairo.so ,它只能调用系统中的,故搜索系统中存在的 libfreetype.so

    $ sudo find / -type f -iname 'libfreetype.so*'
    

    可以发现 Matlab 自带了 freetype 库,那么分别查看是哪个库缺少了所需的符号:

    $ nm -s -D /usr/lib/x86_64-linux-gnu/libfreetype.so.6.17.4 | grep FT_Get_Var_Design_Coordinates
    000000000001c1d0 T FT_Get_Var_Design_Coordinates
    $ nm -s -D /usr/local/MATLAB/R2018a/bin/glnxa64/libfreetype.so.6.11.1 | grep FT_Get_Var_Design_Coordinates
    

    可以看到系统库具有这个符号而 Matlab 自带库中并不存在这个符号。

    查看 Matlab 中自带的库,可以发现是通过 libfreetype.so.6 软链接到 libfreetype.so.6.11.1 的:

    $ ls /usr/local/MATLAB/R2018a/bin/glnxa64/libfreetype.so* -l
    lrwxrwxrwx 1 root root     42  8月 24 11:10 /usr/local/MATLAB/R2018a/bin/glnxa64/libfreetype.so.6 -> /usr/lib/x86_64-linux-gnu/libfreetype.so.6
    -r--r--r-- 1 root root 651950  2月  6  2018 /usr/local/MATLAB/R2018a/bin/glnxa64/libfreetype.so.6.11.1
    

    那么我们只需要将这个软链接重新链接到系统库上即可:

    $ sudo rm /usr/local/MATLAB/R2018a/bin/glnxa64/libfreetype.so.6
    $ sudo ln -s /usr/lib/x86_64-linux-gnu/libfreetype.so.6 /usr/local/MATLAB/R2018a/bin/glnxa64/libfreetype.so.6
    

    测试此时实时编辑器已经可以正常运行。

    另外使用下面的命令可以检查断开失效的软链接:

    $ find . -xtype l
    

    参考资料

    R, issue “unable to load shared object cairo.so” on Linux CentOS 7

    libcairo undefined symbol: FT_Get_Var_Design_Coordinates error when calling R from compiled MATLAB application on Centos7

    SDUST weilinfox

  • 相关阅读:
    左孩子右兄弟的字典树
    UVA 1401 Remember the Word
    HDOJ 4770 Lights Against Dudely
    UvaLA 3938 "Ray, Pass me the dishes!"
    UVA
    Codeforces 215A A.Sereja and Coat Rack
    Codeforces 215B B.Sereja and Suffixes
    HDU 4788 Hard Disk Drive
    HDU 2095 find your present (2)
    图的连通性问题—学习笔记
  • 原文地址:https://www.cnblogs.com/weilinfox/p/15179587.html
Copyright © 2011-2022 走看看