# stanc3 を Homebrew, MacPorts, Nix でインストール

stanc3 のインストール経路、実行ファイル、メタデータ、AI エージェント向けセキュリティノートを確認します。

## インストール

```sh
sudo av install brew:stanc3
```

追加のインストールコマンド:

### macOS

- Homebrew (100%):

```sh
brew install stanc3
```

  証拠: local Homebrew formula metadata

- MacPorts (94%):

```sh
sudo port install stanc3
```

  証拠: MacPorts ports tree: math/stanc3/Portfile from https://api.github.com/repos/macports/macports-ports/git/trees/master?recursive=1

### Linux

- Nix (92%):

```sh
nix profile install nixpkgs#stanc
```

  証拠: nixpkgs package indexes: pkgs/by-name/st/stanc/package.nix from https://api.github.com/repos/NixOS/nixpkgs/git/trees/master?recursive=1

## パッケージ情報

- **パッケージキー:** brew:stanc3
- **パッケージマネージャ:** Homebrew
- **パッケージマネージャページ:** <https://formulae.brew.sh/formula/stanc3>
- **バージョン:** 2.39.0
- **ソース概要:** Stan transpiler
- **ホームページ:** <https://github.com/stan-dev/stanc3>
- **リポジトリ:** <https://github.com/stan-dev/stanc3>
- **ライセンス:** BSD-3-Clause
- **ソースアーカイブ:** <https://github.com/stan-dev/stanc3.git>
- **最終更新:** 2026-07-13T05:11:31Z
- **生成日時:** 2026-08-04T22:13:35+00:00

## 実行可能ファイル

- stanc (cli)
- stanc (エイリアス)

## ビルド依存関係

- ocaml
- opam

## インストール挙動

- post-install フック: 未定義
- Bottle: 利用可能 対象 arm64_linux, arm64_sequoia, arm64_sonoma, arm64_tahoe, sonoma, x86_64_linux

## バージョンと鮮度

- ページ生成日: 2026-08-04
- マネージャ版: 2.39.0
- マネージャ更新日: 2026-07-13
- ローカルデータ: OK
- 上流リポジトリ: https://github.com/stan-dev/stanc3
- 情報: No cached GitHub release or tag data was available.
## プロジェクトの歴史と使われ方

stanc3 is the OCaml implementation of the Stan compiler, exposed to users as the stanc command.

### プロジェクトの歴史

The official repository describes stanc3 as a new Stan-to-C++ compiler written in OCaml, with a frontend, middle representation, analysis and optimization layer, and Stan Math backend. The Stan User's Guide says the Stan compiler has been implemented in OCaml since Stan 2.22, while the repository README says stanc3 has been the default compiler for Stan since version 2.26.

### 採用の歴史

stanc3 became part of normal Stan usage because Stan interfaces call the stanc compiler when translating models. The official releases page shows signed multi-platform binaries and a JavaScript version, while the package facts show Homebrew, MacPorts, and Nix packaging.

### 使われ方

Users generally encounter stanc through CmdStan and other Stan interfaces, or directly as a CLI with syntax like stanc options model_file. The User's Guide documents options for output files, generated C++ printing, automatic formatting, canonicalization, warnings, optimization levels, OpenCL support, and compiler diagnostics.

### パッケージ好きにとっての重要性

Package nerds care about stanc3 because it is the compiler binary behind a large statistical programming ecosystem. Its OCaml toolchain, generated multi-platform assets, JavaScript build, and integration with CmdStan make it a packaging-sensitive developer tool rather than just an internal library.

### タイムライン

- 2018: Stan developers publicly discussed choosing OCaml for the new compiler implementation.
- Stan 2.22: Stan User's Guide says the compiler has been implemented in OCaml since this version.
- Stan 2.26: stanc3 became the default compiler for Stan, according to the official README.
- 2026: stanc3 v2.39.0 release notes added language features, warning improvements, parser fixes, and optimization bug fixes.

### Related projects

- stanc3 is tightly related to Stan, CmdStan, Stan Math, Stan interfaces, stancjs, and the Stan documentation. Its developer docs also point to OCaml tooling such as dune, opam, ocamlformat, and Merlin.

### ソース

- <https://mc-stan.org/docs/stan-users-guide/using-stanc.html>
- <https://mc-stan.org/stanc3/stanc/index.html>
- <https://raw.githubusercontent.com/stan-dev/stanc3/master/README.md>
- <https://raw.githubusercontent.com/stan-dev/stanc3/master/RELEASE-NOTES.txt>


## セキュリティノート

stanc3 に一致するローカルシークレット処理マニフェストは見つかりませんでした。将来の対応で安定したパッケージ URL を使えるよう、パッケージメタデータはここに公開されています。


## ソースデータベース詳細

- **Source Database:** Homebrew formula API
- **Tap:** homebrew/core
- **Full Name:** stanc3
- **Version Scheme:** 0
- **Revision:** 1
- **Bottle Stable Root URL:** <https://ghcr.io/v2/homebrew/core>
- **Deprecated:** no
- **Disabled:** no
- **Keg Only:** no
- **URL Keys:** stable

## 他のパッケージマネージャ記録

- MacPorts - stanc3: normalized package name match | MacPorts ports tree: math/stanc3/Portfile from https://api.github.com/repos/macports/macports-ports/git/trees/master?recursive=1
- Nix - stanc: installed executable or alias match | nixpkgs package indexes: pkgs/by-name/st/stanc/package.nix from https://api.github.com/repos/NixOS/nixpkgs/git/trees/master?recursive=1


## 関連リンク

- [Source-control packages](https://pkg.so/ja/source-control-tools/) - Belongs to a source-control command family.
- [Terminal utility packages](https://pkg.so/ja/terminal-utilities/) - Matched terminal and command-line workflow metadata.
- [Text processing packages](https://pkg.so/ja/text-processing-tools/) - Matched text, document, or structured-data processing metadata.
- [Developer build packages](https://pkg.so/ja/developer-build-tools/) - Matched build, compiler, generator, or developer workflow metadata.
- [opam](https://pkg.so/ja/brew/opam/) - Build dependency declared by Homebrew.
- [ocaml](https://pkg.so/ja/brew/ocaml/) - Build dependency declared by Homebrew.
- [babel](https://pkg.so/ja/brew/babel/) - Shares pkgdb curated category or tags: cli, compiler, developer-tools, transpiler.
- [pomsky](https://pkg.so/ja/brew/pomsky/) - Shares pkgdb curated category or tags: cli, compiler, developer-tools, transpiler.
- [llvm](https://pkg.so/ja/brew/llvm/) - Shares pkgdb curated category or tags: cli, compiler, developer-tools.
- [llvm@20](https://pkg.so/ja/brew/llvm-20/) - Shares pkgdb curated category or tags: cli, compiler, developer-tools.
- [llvm@21](https://pkg.so/ja/brew/llvm-21/) - Shares pkgdb curated category or tags: cli, compiler, developer-tools.
- [dtc](https://pkg.so/ja/brew/dtc/) - Shares pkgdb curated category or tags: cli, compiler, developer-tools.
- [llvm@18](https://pkg.so/ja/brew/llvm-18/) - Shares pkgdb curated category or tags: cli, compiler, developer-tools.
- [emscripten](https://pkg.so/ja/brew/emscripten/) - Shares pkgdb curated category or tags: cli, compiler, developer-tools.
- [fluent-transpiler](https://pkg.so/ja/npm/fluent-transpiler/) - Local package facts share a topical domain. Shared terms: cli, compiler, developer, developer-tools, transpiler.
- [alive2](https://pkg.so/ja/brew/alive2/) - Local package facts share a topical domain. Shared terms: cli, compiler, developer, developer-tools.
- [bsc](https://pkg.so/ja/brew/bsc/) - Local package facts share a topical domain. Shared terms: cli, compiler, developer, developer-tools.

## Combined YAML source

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


## ソース

- pkg.so package database
- Geiger risk classifier
- package-page enrichment
- curated package history
- package version freshness
- pkgdb category and tag curation
- package relationship graph
- external package-manager database matches
- cross-ecosystem install command graph
