Skip to content

Commit

Permalink
Merge commit 'c0e44293d772d5fdd885083c1c1fa8eaf861255b' as 'stanc3'
Browse files Browse the repository at this point in the history
  • Loading branch information
Yi Zhang committed Feb 28, 2025
2 parents f21d3f5 + c0e4429 commit 46ed01b
Show file tree
Hide file tree
Showing 2,675 changed files with 810,193 additions and 0 deletions.
7 changes: 7 additions & 0 deletions stanc3/.git-blame-ignore-revs
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# usage: git config blame.ignoreRevsFile .git-blame-ignore-revs
# generated with: git log --grep "[fF]ormat.*ocamlformat" --format="format:%H # %s"

2030298f84a95a78953866bf46bc6564f9faee1b # Migrate to Core and format with ocamlformat 0.26.1
845f34e165e16c95596fd48da67bb987bbbe2446 # Format with ocamlformat 0.19.0
9c75bd01015157bae5a133417acf1f7e8af71887 # reformatting using ocamlformat 0.9
b98f92d6a970967bd51158c1b555bf338d4da3b7 # Reformat master with ocamlformat.
8 changes: 8 additions & 0 deletions stanc3/.gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# Set the default behavior, in case people don't have core.autocrlf set.
# This makes sure all text files are automatically converted to lf line endings.
* text eol=lf
*.png binary

# this sets where github can look for language stats
*.ml linguist-language=OCaml
test/integration/** linguist-vendored
2 changes: 2 additions & 0 deletions stanc3/.github/FUNDING.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
github: stan-dev
custom: https://mc-stan.org/support/
37 changes: 37 additions & 0 deletions stanc3/.github/ISSUE_TEMPLATE/bug-report.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
---
name: Bug report
about: File a bug/issue
title: '[BUG] <title>'
labels: ''
assignees: ''
---
<!-- Thank you for submitting a bug report! -->

### Current Behavior:
<!-- A concise description of what you're experiencing. -->

### Expected Behavior:
<!-- A concise description of what you expected to happen. -->

### Model Code
<!-- If a specific model is causing this issue, it really helps if you can share it -->
<details><summary>Model which exhibits the issue</summary>

```stan
// Please put your code here
```
</details>

### Environment:
<!--
Example:
- OS: Ubuntu 20.04
- stanc: 2.28.0
- cmdstan/rstan/other Stanversions
-->

### Anything else:
<!--
Links? References? Anything that will give us more context about the issue that you are encountering!
-->
8 changes: 8 additions & 0 deletions stanc3/.github/ISSUE_TEMPLATE/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
blank_issues_enabled: false
contact_links:
- name: Question about using Stan, modeling, etc
url: https://discourse.mc-stan.org/
about: |
Ask questions and discuss with other community members here.
If your question involves a specific model, including it will
improve the quality of help the community can provide.
23 changes: 23 additions & 0 deletions stanc3/.github/ISSUE_TEMPLATE/feature-request.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
---
name: Feature request
about: Suggest a new feature for the language or compiler
title: ''
labels: 'feature'
assignees: ''
---

<!-- Please do a quick search of existing issues to make sure that this has not been suggested before.
Thank you for helping us improve Stan!
-->

**Is your feature request related to a problem? Please describe.**
<!-- A description of what the problem is. e.g., "I'm always frustrated when [...]" -->

**Describe the solution you'd like**
<!-- A description of what you're proposing, e.g., "The auto-formatter should allow users to set a line length" -->

**Describe alternatives you've considered**
<!-- A description of any alternative solutions to this problem or features you've considered. -->

**Additional context**
<!-- Add any other context about the feature request here. -->
8 changes: 8 additions & 0 deletions stanc3/.github/ISSUE_TEMPLATE/todo.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
---
name: TODO Item
about: (For existing developers) Open a generic issue related to the build process or something that needs to be worked on.
title: ''
labels: ''
assignees: ''
---

22 changes: 22 additions & 0 deletions stanc3/.github/codecov.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
codecov:
require_ci_to_pass: false
ci:
- jenkins.flatironinstitute.org

coverage:
status:
project:
default:
informational: true
threshold: 100%
target: 0%
patch:
default:
informational: true
threshold: 100%
target: 0%

comment:
layout: "diff, files"
behavior: once
require_changes: true
15 changes: 15 additions & 0 deletions stanc3/.github/pull_request_template.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
#### Submission Checklist

- [ ] Run unit tests
- Documentation
- [ ] If a user-facing facing change was made, the documentation PR is here: <LINK>
- [ ] OR, no user-facing changes were made

## Release notes

Replace this text with a short note on what will change if this pull request is merged. This will be included in the release notes.

## Copyright and Licensing

By submitting this pull request, the copyright holder is agreeing to
license the submitted work under the BSD 3-clause license (https://opensource.org/licenses/BSD-3-Clause)
109 changes: 109 additions & 0 deletions stanc3/.github/workflows/binaries.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,109 @@
name: Build binaries

on:
workflow_dispatch:
inputs:
branch:
description: 'Branch to use for building binaries'
required: true
default: 'master'

jobs:
build:
strategy:
fail-fast: false
matrix:
os:
- macos
- ubuntu
ocaml-compiler:
- 4.14.1

runs-on: ${{ matrix.os }}-latest

steps:
- name: Checkout code
uses: actions/checkout@v3

- name: Download older SDK
if: matrix.os == 'macos'
run: |
wget https://github.com/phracker/MacOSX-SDKs/releases/download/11.3/MacOSX10.11.sdk.tar.xz
tar -xvf MacOSX10.11.sdk.tar.xz
sudo mv MacOSX10.11.sdk /Library/Developer/CommandLineTools/SDKs
echo "MACOSX_DEPLOYMENT_TARGET=10.11" >> $GITHUB_ENV
echo "SDKROOT=/Library/Developer/CommandLineTools/SDKs/MacOSX10.11.sdk/" >> $GITHUB_ENV
- name: Use OCaml ${{ matrix.ocaml-compiler }}
uses: ocaml/setup-ocaml@v2
with:
ocaml-compiler: ${{ matrix.ocaml-compiler }}
cache-prefix: v3

- if: matrix.os == 'macos'
run: opam pin -y dune 3.6.0 --no-action

- run: bash -x scripts/install_build_deps.sh

- name: Build macos
if: matrix.os == 'macos'
run: opam exec -- dune subst; opam exec -- dune build

- name: Build ubuntu
if: matrix.os == 'ubuntu'
run: opam exec -- dune subst; opam exec -- dune build --profile static

- run: mv _build/default/src/stanc/stanc.exe ${{ matrix.os }}-stanc

- name: Upload ${{ matrix.os }} stanc
uses: actions/upload-artifact@v3
with:
name: ${{ matrix.os }}-stanc
path: ${{ matrix.os }}-stanc

build-cross:
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v3

- name: Install cross-compiler
run: sudo apt-get update; sudo apt-get install -y gcc-mingw-w64-x86-64

- name: Use OCaml 4.14.1
uses: ocaml/setup-ocaml@v2
with:
cache-prefix: v1-windows
ocaml-compiler: ocaml-windows64.4.14.1
opam-repositories: |
windows: http://github.com/ocaml-cross/opam-cross-windows.git
default: https://github.com/ocaml/opam-repository.git
- run: bash -x scripts/install_build_deps_windows.sh

- name: Build
run: |
opam exec -- dune subst
opam exec -- dune build -x windows
- run: mv _build/default.windows/src/stanc/stanc.exe windows-stanc

- name: Upload Windows stanc
uses: actions/upload-artifact@v3
with:
name: windows-stanc
path: windows-stanc

- run: bash -x scripts/install_js_deps.sh

- run: opam exec -- dune build --profile release src/stancjs

- run: mv _build/default/src/stancjs/stancjs.bc.js stanc.js

- name: Upload stanc.js
uses: actions/upload-artifact@v3
with:
name: stanc.js
path: stanc.js
42 changes: 42 additions & 0 deletions stanc3/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
# rust
/rust/target
/bindgen_test/target
**/*.rs.bk
Cargo.lock
math_iface/gen/*
*.a

# ocaml
_opam
_build
_coverage/
*.coverage
*.merlin
stanc.install

# js
node_modules/*

# python
*.pyc

# tests
test/*.log

# Visual Studio settings
.vscode/**

# temporary editor files
*~
\#*#
.#*
.*.swp

# Mac OS X hidden files
*.DS_Store

# .hpp files in test folder
test/**/*.hpp

# .omir files in test folder
test/**/*.omir
13 changes: 13 additions & 0 deletions stanc3/.ocamlformat
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
version=0.26.1
# loosely re-creates the now-removed "compact" profile
break-separators=before
break-before-in=auto
break-collection-expressions=wrap
dock-collection-brackets=false
doc-comments=before-except-val
indicate-nested-or-patterns=space
field-space=tight
space-around-lists=false
space-around-records=false
space-around-variants=false
sequence-blank-line=compact
Loading

0 comments on commit 46ed01b

Please sign in to comment.