# 使用 Homebrew, apk, apt, dnf, MacPorts, Nix, zypper, winget 安装 gmsh

查看 gmsh 的安装路径、可执行文件、元数据以及面向 AI 代理工作流的安全说明。

## 安装

```sh
sudo av install brew:gmsh
```

其他安装命令:

### macOS

- Homebrew (100%):

```sh
brew install gmsh
```

  证据: local Homebrew formula metadata

- MacPorts (94%):

```sh
sudo port install gmsh
```

  证据: MacPorts ports tree: science/gmsh/Portfile from https://api.github.com/repos/macports/macports-ports/git/trees/master?recursive=1

### Linux

- apk (92%):

```sh
sudo apk add gmsh
```

  证据: Alpine Linux edge package indexes: gmsh from https://dl-cdn.alpinelinux.org/alpine/edge/testing/x86_64/APKINDEX.tar.gz

- Debian apt (92%):

```sh
sudo apt install gmsh
```

  证据: Debian stable package indexes: gmsh from https://deb.debian.org/debian/dists/stable/main/binary-amd64/Packages.xz

- dnf (92%):

```sh
sudo dnf install gmsh
```

  证据: Fedora Rawhide package metadata: gmsh from https://dl.fedoraproject.org/pub/fedora/linux/development/rawhide/Everything/x86_64/os/repodata/07190dc5ae9f35ae73866675fed6d95fe6e8d9fe22c9d7cdf85862cb2ed24a4c-primary.xml.zst

- Nix (92%):

```sh
nix profile install nixpkgs#gmsh
```

  证据: nixpkgs package indexes: pkgs/by-name/gm/gmsh/package.nix from https://api.github.com/repos/NixOS/nixpkgs/git/trees/master?recursive=1

- zypper (92%):

```sh
sudo zypper install gmsh
```

  证据: openSUSE Tumbleweed package metadata: gmsh from https://download.opensuse.org/tumbleweed/repo/oss/repodata/50b07339cb64c8ed4091bdbabddadc1ff5737b090e478818a195b40d8a3292861a879139b4a3987c31109699fde9fbf4a716367ddf4eef77da75f96e3193d6ed-primary.xml.zst

### Windows

- winget (92%):

```sh
winget install --id gmsh.gmsh -e
```

  证据: Windows Package Manager source index: gmsh.gmsh from https://cdn.winget.microsoft.com/cache/source.msix

## 软件包事实

- **软件包键:** brew:gmsh
- **软件包管理器:** Homebrew
- **版本:** 4.15.2
- **来源摘要:** 3D finite element grid generator with CAD engine
- **主页:** <https://gmsh.info/>
- **最后更新:** 2026-06-22T14:03:35-07:00
- **已生成:** 2026-08-03T19:37:03+00:00

## 可执行文件

- gmsh (别名)

## 安装行为

- Bottle: 不可用

## 版本和新鲜度

- 页面生成时间: 2026-08-03
- 管理器版本: 4.15.2
## 项目历史与用法

Gmsh is an automatic three-dimensional finite-element mesh generator with CAD, meshing, solver, and post-processing modules. It is widely packaged because it serves both as a graphical scientific tool and as a scriptable/API-driven mesh generator for simulation workflows.

### 项目历史

Gmsh was created by Christophe Geuzaine and Jean-Francois Remacle, with copyright years in the source README beginning in 1997. The reference manual identifies it as a 3D finite-element mesh generator with built-in pre- and post-processing facilities.

The project was documented in a 2009 International Journal for Numerical Methods in Engineering paper, cited from the official manual. That paper helped establish Gmsh as a named research-software artifact rather than only a utility shipped by its authors.

Gmsh evolved from a standalone meshing program into a modular platform. The manual describes four modules: geometry, mesh, solver, and post-processing, controllable from the GUI, the command line, .geo scripts, and C++, C, Python, Julia, and Fortran APIs.

The 4.x line expanded API and CAD workflows, including OpenCASCADE geometry operations, model attributes, Fortran API support, and ongoing changes to mesh formats and post-processing behavior. The official version history records detailed 4.x releases through 4.15.2 in March 2026.

### 采用历史

The manual states that source code and precompiled binaries are distributed for Windows, macOS, and Linux, with packages also available in Linux and BSD distributions. The batch metadata additionally shows packaging in Homebrew, Alpine, Debian, Fedora, MacPorts, Nix, Ubuntu, winget, and openSUSE.

Gmsh's adoption rests on a useful balance: it is light enough to install as a command-line tool, visual enough for interactive geometry and mesh inspection, and programmable enough to sit inside automated simulation pipelines.

Its official documentation and examples make it attractive to finite-element practitioners who need mesh generation without adopting a full commercial preprocessor. The .geo scripting language and multi-language API also make meshes reproducible in source-controlled projects.

### 使用方式

Practitioners use Gmsh to define geometry, generate 1D, 2D, and 3D meshes, assign physical groups, import CAD through OpenCASCADE, inspect mesh quality, and export mesh files for downstream solvers.

Command-line users generate meshes from .geo files in build pipelines or tests. GUI users inspect and tune geometry, mesh sizes, fields, and post-processing views. API users call Gmsh from C++, C, Python, Julia, or Fortran to generate meshes from application code.

Package-manager installs are especially useful for CI and scientific environments where scripts need the gmsh executable or Python module available without a manual GUI installer.

### 为什么软件包爱好者会关心

Gmsh is a high-value package because it turns a hard scientific dependency into a normal system dependency. Build scripts, solver examples, Python notebooks, and finite-element tutorials can all assume an installable gmsh command rather than bundling a meshing engine.

It is also a good example of why scientific packages are often bigger than a CLI: one formula supplies a desktop app, CAD integrations, a shared library, language bindings, examples, and a file-format ecosystem.

### 时间线

- 1997: Gmsh copyright period begins in the source README.
- 2009: Gmsh paper published in International Journal for Numerical Methods in Engineering.
- 2017: Public GitLab project created on gitlab.onelab.info.
- 2022: Gmsh 4.11.0 added Fortran API support and new official macOS ARM builds.
- 2026: Gmsh 4.15.2 released.

### Related projects

- OpenCASCADE supplies CAD-kernel functionality for constructive solid geometry, boolean operations, and STEP import.
- ONELAB is related through the official hosting and solver-oriented workflows documented by Gmsh.
- Finite-element solvers consume the mesh files and physical groups produced by Gmsh.

### 来源

- <https://gitlab.onelab.info/api/v4/projects/gmsh%2Fgmsh>
- <https://gitlab.onelab.info/api/v4/projects/gmsh%2Fgmsh/repository/tags>
- <https://gitlab.onelab.info/gmsh/gmsh>
- <https://gitlab.onelab.info/gmsh/gmsh/-/raw/master/README.txt>
- <https://gmsh.info>
- <https://gmsh.info/doc/texinfo/gmsh.html>


## 安全说明

narrow executable package without higher-risk signals.

- **Geiger 风险:** 绿色 / 低
- narrow executable package without higher-risk signals


## Configuration and credential file locations

These source-backed paths show where this package keeps local settings or durable credentials. Automic Vault can use them as review targets for secret scanning, migration, and command approval.


## Configuration files

- Unix: $GMSH_HOME/<General.OptionsFileName>, $GMSH_HOME/<General.SessionFileName>, ~/<General.OptionsFileName>, ~/<General.SessionFileName>, <model-file>.opt
- Windows: %GMSH_HOME%\<General.OptionsFileName>, %GMSH_HOME%\<General.SessionFileName>, %APPDATA%\<General.OptionsFileName>, %APPDATA%\<General.SessionFileName>, <model-file>.opt
## 其他软件包管理器记录

- Debian apt - gmsh - 4.13.1+ds1-6: normalized package name match | Debian stable package indexes: gmsh from https://deb.debian.org/debian/dists/stable/main/binary-amd64/Packages.xz | Three-dimensional finite element mesh generator | https://gmsh.info
- Debian apt - gmsh-doc - 4.13.1+ds1-6: normalized package name match | Debian stable package indexes: gmsh-doc from https://deb.debian.org/debian/dists/stable/main/binary-amd64/Packages.xz | Three-dimensional finite element mesh generator documentation | https://gmsh.info
- Debian apt - libgmsh-dev - 4.13.1+ds1-6: normalized package name match | Debian stable package indexes: libgmsh-dev from https://deb.debian.org/debian/dists/stable/main/binary-amd64/Packages.xz | Three-dimensional finite element mesh generator development files | https://gmsh.info
- Debian apt - libgmsh-private-headers-dev - 4.13.1+ds1-6: normalized package name match | Debian stable package indexes: libgmsh-private-headers-dev from https://deb.debian.org/debian/dists/stable/main/binary-amd64/Packages.xz | Three-dimensional finite element mesh generator development files | https://gmsh.info
- Debian apt - libgmsh4.13 - 4.13.1+ds1-6: normalized package name match | Debian stable package indexes: libgmsh4.13 from https://deb.debian.org/debian/dists/stable/main/binary-amd64/Packages.xz | Three-dimensional finite element mesh generator shared library | https://gmsh.info
- Debian apt - python3-gmsh - 4.13.1+ds1-6: normalized package name match | Debian stable package indexes: python3-gmsh from https://deb.debian.org/debian/dists/stable/main/binary-amd64/Packages.xz | Three-dimensional finite element mesh generator Python 3 wrapper | https://gmsh.info
- Nix - gmsh: normalized package name match | nixpkgs package indexes: pkgs/by-name/gm/gmsh/package.nix from https://api.github.com/repos/NixOS/nixpkgs/git/trees/master?recursive=1
- Ubuntu apt - gmsh - 4.12.1+ds1-1.1build2: normalized package name match | Ubuntu 24.04 LTS package indexes: gmsh from https://archive.ubuntu.com/ubuntu/dists/noble/universe/binary-amd64/Packages.gz | Three-dimensional finite element mesh generator | https://gmsh.info
- Ubuntu apt - gmsh-doc - 4.12.1+ds1-1.1build2: normalized package name match | Ubuntu 24.04 LTS package indexes: gmsh-doc from https://archive.ubuntu.com/ubuntu/dists/noble/universe/binary-amd64/Packages.gz | Three-dimensional finite element mesh generator documentation | https://gmsh.info
- Ubuntu apt - libgmsh-dev - 4.12.1+ds1-1.1build2: normalized package name match | Ubuntu 24.04 LTS package indexes: libgmsh-dev from https://archive.ubuntu.com/ubuntu/dists/noble/universe/binary-amd64/Packages.gz | Three-dimensional finite element mesh generator development files | https://gmsh.info
- Ubuntu apt - libgmsh-private-headers-dev - 4.12.1+ds1-1.1build2: normalized package name match | Ubuntu 24.04 LTS package indexes: libgmsh-private-headers-dev from https://archive.ubuntu.com/ubuntu/dists/noble/universe/binary-amd64/Packages.gz | Three-dimensional finite element mesh generator development files | https://gmsh.info
- Ubuntu apt - libgmsh4.12t64 - 4.12.1+ds1-1.1build2: normalized package name match | Ubuntu 24.04 LTS package indexes: libgmsh4.12t64 from https://archive.ubuntu.com/ubuntu/dists/noble/universe/binary-amd64/Packages.gz | Three-dimensional finite element mesh generator shared library | https://gmsh.info
- Ubuntu apt - python3-gmsh - 4.12.1+ds1-1.1build2: normalized package name match | Ubuntu 24.04 LTS package indexes: python3-gmsh from https://archive.ubuntu.com/ubuntu/dists/noble/universe/binary-amd64/Packages.gz | Three-dimensional finite element mesh generator Python 3 wrapper | https://gmsh.info
- apk - gmsh - 4.15.0-r0: normalized package name match | Alpine Linux edge package indexes: gmsh from https://dl-cdn.alpinelinux.org/alpine/edge/testing/x86_64/APKINDEX.tar.gz | Automatic 3D finite element mesh generator | https://gmsh.info/
- apk - gmsh-dbg - 4.15.0-r0: normalized package name match | Alpine Linux edge package indexes: gmsh-dbg from https://dl-cdn.alpinelinux.org/alpine/edge/testing/x86_64/APKINDEX.tar.gz | Automatic 3D finite element mesh generator (debug symbols) | https://gmsh.info/
- apk - gmsh-doc - 4.15.0-r0: normalized package name match | Alpine Linux edge package indexes: gmsh-doc from https://dl-cdn.alpinelinux.org/alpine/edge/testing/x86_64/APKINDEX.tar.gz | Automatic 3D finite element mesh generator (documentation) | https://gmsh.info/


## Combined YAML source

View the package source record on GitHub. [combined/gmsh.yml](https://github.com/mxcl/pkgdb/blob/main/combined/gmsh.yml)


## 来源

- pkg.so package database
- Geiger risk classifier
- curated configuration and credential file locations
- curated package history
- pkgdb category and tag curation
- external package-manager database matches
- cross-ecosystem install command graph
