MacOS安装gprMax教程

📅 2026/7/4 10:19:41 👁️ 阅读次数 📝 编程学习
MacOS安装gprMax教程

1. gprMax介绍

gprMax是为模拟地面穿透雷达(GPR)而设计的模拟电磁波传播的开源软件。

2. 安装过程

2.1.1 初始化gprMax的Python运行环境

$ conda update conda $ condainstallgit$gitclone https://github.com/gprMax/gprMax.git $cdgprMax $ condaenvcreate-fconda_env.ym

2.2.2 安装gcc

$ brewinstallgcc (过程中可能提示需要使用“xcode-select --install”命令安装Xcode命令行工具,根据提示安装即可。)

2.2.2 安装gprMax

(gprMax)$ python setup.py build(gprMax)$ python setup.pyinstall

3. 常见问题

3.1 #include <_stdio.h> … :

问题描述:

/opt/homebrew/Cellar/gcc/12.2.0/lib/gcc/current/gcc/aarch64-apple-darwin22/12/include-fixed/limits.h:203:75: error: no include pathinwhichto searchforlimits.h203|#include_next <limits.h> /* recurse down to the real one */|^ Infileincluded from /Users/Xuan/miniconda3/envs/gprMax/include/python3.10/Python.h:25: /opt/homebrew/Cellar/gcc/12.2.0/lib/gcc/current/gcc/aarch64-apple-darwin22/12/include-fixed/stdio.h:78:10: fatal error:_stdio.h: No suchfileor directory78|#include <_stdio.h>|^~~~~~~~~~ compilation terminated.

解决方案: 安装Xcode命令行工具。

4. 参考

Getting Started — gprMax User Guide