• NCARG安装配置出现error while loading shared libraries: libg2c.so.0问题额解决办法


    ncl
    ncl: error while loading shared libraries: libg2c.so.0: cannot open shared object file: No such file or directory

    1.yum -y install libg2c.so.0安装之后

    2.which libg2c.so.0 得到其安装的路径 /usr/lib  

    3. 在/etc/bashrc中加入.设置环境变量 export LD_LIBRARY_PATH=/usr/lib/:$LD_LIBRARY_PATH环境变量

    4.到libg2c.so.0 安装的路径 /usr/lib  中

    cp libg2c.so.0 /lib64 中

    [root@localhost lib]# yum search  compat-libf2c
    Loaded plugins: product-id, refresh-packagekit, security, subscription-manager
    This system is not registered to Red Hat Subscription Management. You can use subscription-manager to register.
    ========================== N/S Matched: compat-libf2c ==========================
    compat-libf2c-34.i686 : Fortran 77 compatibility runtime
    compat-libf2c-34.x86_64 : Fortran 77 compatibility runtime

      Name and summary matches only, use "search all" for everything.
    根据系统是32位和64位选择对应的版本

    [root@localhost lib]# yum install compat-libf2c-34.x86_64
    Loaded plugins: product-id, refresh-packagekit, security, subscription-manager
    This system is not registered to Red Hat Subscription Management. You can use subscription-manager to register.
    Setting up Install Process
    Resolving Dependencies
    --> Running transaction check
    ---> Package compat-libf2c-34.x86_64 0:3.4.6-19.el6 will be installed
    --> Finished Dependency Resolution

    Dependencies Resolved

    ================================================================================
     Package                Arch         Version            Repository         Size
    ================================================================================
    Installing:
     compat-libf2c-34       x86_64       3.4.6-19.el6       rhel-source        51 k

    Transaction Summary
    ================================================================================
    Install       1 Package(s)

    Total download size: 51 k
    Installed size: 118 k
    Is this ok [y/N]: y
    Downloading Packages:
    Running rpm_check_debug
    Running Transaction Test
    Transaction Test Succeeded
    Running Transaction
      Installing : compat-libf2c-34-3.4.6-19.el6.x86_64                         1/1
      Verifying  : compat-libf2c-34-3.4.6-19.el6.x86_64                         1/1

    Installed:
      compat-libf2c-34.x86_64 0:3.4.6-19.el6                                        

    Complete!
    [root@localhost lib]# which  compat-libf2c
    /usr/bin/which: no compat-libf2c in (/opt/verdi/VERDI_1.4.1/:/opt/jdk1.7.0_45/bin:/opt/jdk1.7.0_45/jre/bin:/opt/ncarg/bin:/opt/netcdf/bin:/opt/netcdf/lib:/opt/netcdf/include:/opt/netcdf/man:/opt/pgi/linux86/9.0/mpi/mpich/bin:/opt/pgi/linux86/9.0/mpi/mpich/lib:/opt/pgi/linux86/9.0/mpi/mpich/inlcude:/opt/pgi/linux86-64/9.0-1/bin:/opt/verdi/VERDI_1.4.1/:/opt/jdk1.7.0_45/bin:/opt/jdk1.7.0_45/jre/bin:/opt/ncarg/bin:/opt/netcdf/bin:/opt/netcdf/lib:/opt/netcdf/include:/opt/netcdf/man:/opt/pgi/linux86/9.0/mpi/mpich/bin:/opt/pgi/linux86/9.0/mpi/mpich/lib:/opt/pgi/linux86/9.0/mpi/mpich/inlcude:/opt/pgi/linux86-64/9.0-1/bin:/opt/verdi/VERDI_1.4.1/:/opt/jdk1.7.0_45/bin:/opt/jdk1.7.0_45/jre/bin:/opt/ncarg/bin:/opt/netcdf/bin:/opt/netcdf/lib:/opt/netcdf/include:/opt/netcdf/man:/opt/pgi/linux86/9.0/mpi/mpich/bin:/opt/pgi/linux86/9.0/mpi/mpich/lib:/opt/pgi/linux86/9.0/mpi/mpich/inlcude:/opt/pgi/linux86-64/9.0-1/bin:/opt/verdi/VERDI_1.4.1/:/opt/jdk1.7.0_45/bin:/opt/jdk1.7.0_45/jre/bin:/opt/ncarg/bin:/opt/netcdf/bin:/opt/netcdf/lib:/opt/netcdf/include:/opt/netcdf/man:/opt/pgi/linux86/9.0/mpi/mpich/bin:/opt/pgi/linux86/9.0/mpi/mpich/lib:/opt/pgi/linux86/9.0/mpi/mpich/inlcude:/opt/pgi/linux86-64/9.0-1/bin:/usr/lib64/qt-3.3/bin:/usr/local/sbin:/usr/sbin:/sbin:/usr/local/bin:/usr/bin:/bin:/root/bin)
    [root@localhost lib]# source /etc/bashrc
    [root@localhost lib]# ncl
     Copyright (C) 1995-2007 - All Rights Reserved
     University Corporation for Atmospheric Research
     NCAR Command Language Version 5.0.0
     The use of this software is governed by a License Agreement.
     See http://www.ncl.ucar.edu/ for more details.
    ncl 0> exit
    root@localhost lib]# ng4ex gsun01n

    NCAR Graphics NCL Example <gsun01n>


    This example was set up to display the output to an
    X11 window.

      Copying gsun01n.ncl

    Running NCL...
     Copyright (C) 1995-2007 - All Rights Reserved
     University Corporation for Atmospheric Research
     NCAR Command Language Version 5.0.0
     The use of this software is governed by a License Agreement.
     See http://www.ncl.ucar.edu/ for more details.

    Finished running 'ncl < gsun01n'...


    即可解决

     参考文献 PPT

    解决这个问题查询的资料

    先看看运行机器上面有没有这个动态链接库,有的话再看看环境变量对不对,libg2c.so.0 所在路径是不是在你的LD_LIBRARY_PATH里面了,可以到/etc/ld.so.conf文件里面去更改,然后ldconfig

    如果有的话,按2楼操作,一般情况下是动态文件没有,也就是缺少一些文件包,不知道你用的是什么系统,如果是Fedora(CentOS, REDHAT_AS)之类的可以用

    yum -y install libg2c.so.0试试,如果是Ubuntu的话,好像是ape-get之类的。如果还不行的话,就到网上下一个rpm包。不过有时候包的依赖性很难解决。

    安装成功之后,which libg2c.so.0查询安装的路径

    把libg2c.so.0文件复制到根目录下/lib试试,重新登陆试试

    查询安装的软件还是要用rpm命令。 
    rpm -qa 查询所有安装的rpm包,可以配合grep命令。 
    rpm -qi 查询某个具体包的介绍。 
    rpm -ql 列出某个具体包的所有文件。

    路漫漫其修远兮 吾将上下求索
  • 相关阅读:
    C# 收集几条ToString()格式
    C# 使用Quartz简单实例以及备忘
    C# Linq 常用查询操作符
    .Net Core 创建和使用中间件
    .Net Core 学习依赖注入自定义Service
    .Net Core 学习路由和请求参数传递
    .Net Core 学习新建Core MVC 项目
    ExtJS笔记5 Components
    ExtJS笔记4 容器与布局(Layouts and Containers)
    ExtJS笔记3 MVC Architecture
  • 原文地址:https://www.cnblogs.com/hbmlml/p/4238661.html
Copyright © 2020-2023  润新知