You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

运行RegCM大气模型时遇libmpi_mpifh.so.12加载失败问题求助

Fixing "libmpi_mpifh.so.12: cannot open shared object file" Error When Running RegCM's regcmMPI

Let's break down why this error is popping up and walk through practical fixes to get your RegCM model running smoothly.

Why this happens

The error means your system can’t locate the libmpi_mpifh.so.12 shared library. This file is tied to a specific version of OpenMPI—usually the 3.x series (like 3.1.x). The openmpi-dev and libopenmpi packages you installed are probably a newer or older version that doesn’t include this exact library file.


Step 1: Check if the library exists on your system

First, let’s confirm whether the library is already hiding somewhere on your machine. Run this search command:

find / -name libmpi_mpifh.so.12 2>/dev/null
  • If the command returns a path (e.g., /usr/lib/x86_64-linux-gnu/openmpi/lib/libmpi_mpifh.so.12), skip to Step 3.
  • If no results show up, the library isn’t installed—head to Step 2.

Step 2: Install the correct OpenMPI version

Since libmpi_mpifh.so.12 belongs to OpenMPI 3.x, we’ll install that specific version to match:

  1. First, remove existing OpenMPI packages to avoid conflicts:
    sudo apt-get purge openmpi-dev libopenmpi*
    
  2. Install the 3.x version of OpenMPI:
    sudo apt-get install libopenmpi3 libopenmpi-dev
    

This should install the exact missing library onto your system.


Step 3: Add the library path to your system’s search path

If you found the library in Step 1 but still get the error, it means your system isn’t checking the right directory for it. We’ll add the library’s path to LD_LIBRARY_PATH:

  • Temporary fix (works only for your current terminal session):
    Replace /path/to/mpi/lib with the actual path you found in Step 1, then run:
    export LD_LIBRARY_PATH=/path/to/mpi/lib:$LD_LIBRARY_PATH
    ./regcmMPI
    
  • Permanent fix (applies to all future sessions):
    Open your ~/.bashrc file with a text editor:
    nano ~/.bashrc
    
    Add this line at the end (replace the path with your actual library path):
    export LD_LIBRARY_PATH=/path/to/mpi/lib:$LD_LIBRARY_PATH
    
    Save and exit, then reload the file to apply changes:
    source ~/.bashrc
    

Step 4: Recompile RegCM with the correct MPI (if needed)

If you still hit issues, it’s possible RegCM was compiled with a different MPI version than what’s on your system now. To fix this:

  1. Navigate to your RegCM source directory.
  2. Clean previous build files:
    make clean
    
  3. Reconfigure RegCM to use your current MPI setup. If you installed via apt, run:
    ./configure --with-mpi
    
    If you compiled MPI from source, specify its installation path:
    ./configure --with-mpi=/path/to/your/mpi/installation
    
  4. Recompile and install:
    make
    make install
    

Try these steps in order—most likely Step 2 or 3 will resolve your issue quickly.

内容的提问来源于stack exchange,提问作者Carlos Madrigal

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.05.20 11:44:43