macOS Open MPI+Fortran运行ExoPlaSim报错 求环境配置方案
MacOS环境运行ExoPlaSim测试用例编译报错求助
我尝试在自己的MacBook上运行ExoPlaSim软件用例。该软件虽主要面向Linux平台开发,但根据开发者说明可在Mac系统上运行。我运行简单的默认测试用例脚本时出现了一长串报错,我个人推测(如有误请指正)报错的核心原因是Open MPI与Fortran环境适配存在问题。我自身缺乏足够的开发知识排查该问题,因此希望获得相关帮助。
核心报错信息
终端输出末尾的报错信息最具参考价值,指向Fortran/Open MPI相关问题:
ld: library not found for -lm collect2: error: ld returned 1 exit status make: *** [makefile:48: plasim.x] Error 1 ld: library not found for -lm collect2: error: ld returned 1 exit status ld: library not found for -lm collect2: error: ld returned 1 exit status cp: plasim.x: No such file or directory cp: ../bin/most_plasim_t21_l10_p2.x: No such file or directory cp: /Users/[name]/Library/Python/3.9/lib/python/site-packages/exoplasim/plasim/run/most_plasim_t21_l10_p2.x: No such file or directory Mean Molecular Weight set to 28.9703 g/mol rm: /Users/[name]/ExoPlaSim_Testing/mymodel_testrun/plasim_restart: No such file or directory Command '['mpiexec -np 2 most_plasim_t21_l10_p2.x']' returned non-zero exit status 134. Traceback (most recent call last): File "/Users/[name]/Library/Python/3.9/lib/python/site-packages/exoplasim/__init__.py", line 796, in _run subprocess.run([self._exec+self.executable],shell=True,check=True, File "/usr/local/Cellar/python@3.9/3.9.13_1/Frameworks/Python.framework/Versions/3.9/lib/python3.9/subprocess.py", line 528, in run raise CalledProcessError(retcode, process.args, subprocess.CalledProcessError: Command '['mpiexec -np 2 most_plasim_t21_l10_p2.x']' returned non-zero exit status 134. During handling of the above exception, another exception occurred: Traceback (most recent call last): File "/Users/[name]/ExoPlaSim_Testing/testing_exoplasim.py", line 4, in <module> mymodel.run(years=10,crashifbroken=True) File "/Users/[name]/Library/Python/3.9/lib/python/site-packages/exoplasim/__init__.py", line 389, in run self._run(**kwargs) File "/Users/[name]/Library/Python/3.9/lib/python/site-packages/exoplasim/__init__.py", line 876, in _run self._crash() #Bring in the cleaners File "/Users/[name]/Library/Python/3.9/lib/python/site-packages/exoplasim/__init__.py", line 1383, in _crash raise RuntimeError("ExoPlaSim has crashed or begun producing garbage. All working files have been moved to %s_crashed/"%(os.getcwd()+"/"+self.modelname)) RuntimeError: ExoPlaSim has crashed or begun producing garbage. All working files have been moved to /Users/[name]/ExoPlaSim_Testing/mymodel_crashed/
本地运行环境
- 系统版本:Big Sur 11.5
- 编译器:GNU Fortran/GCC 11.3.0
- Open MPI版本:4.1.4,通过brew安装,终端执行
ompi_info命令可正常查询版本,已知该版本支持Fortran
Open MPI官方给出了新版Open MPI在OS X系统上的适配说明,受限于我的开发知识储备无法理解操作指引,也不确定该方案是否能解决我遇到的问题。
测试用例说明
我使用的是ExoPlaSim官方提供的基础测试用例Python脚本,内容如下:
import exoplasim as exo mymodel = exo.Model(workdir="mymodel_testrun",modelname="mymodel",resolution="T21",layers=10,ncpus=8) mymodel.configure() mymodel.exportcfg() mymodel.run(years=100,crashifbroken=True) mymodel.finalize("mymodel_output")
该脚本不存在问题:其他用户可正常运行,也是软件开发者推荐的测试脚本。我仅寻求Mac端相关依赖库的安装、配置解决方案,该问题并非ExoPlaSim软件本身导致。
内容的提问来源于stack exchange,提问作者n_bandit
相关产品推荐
相关产品推荐

