Skip to content

Commit f46fa52

Browse files
committed
merged main
2 parents 69e85cd + 358065a commit f46fa52

30 files changed

+2543
-1223
lines changed

.github/workflows/basic_build.yml

Lines changed: 161 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -346,3 +346,164 @@ jobs:
346346
with:
347347
files: release-dist/**
348348
generate_release_notes: true
349+
350+
bindc:
351+
name: Build (${{ matrix.os }} / ${{ matrix.toolchain.ccompiler }} / ${{matrix.toolchain.fcompiler}})
352+
runs-on: ${{ matrix.os }}
353+
strategy:
354+
fail-fast: false
355+
matrix:
356+
os: [ubuntu-22.04, macos-latest, windows-latest]
357+
toolchain:
358+
- ccompiler: gcc
359+
cversion: "11"
360+
fcompiler: gcc
361+
fversion: "11"
362+
include:
363+
- os: ubuntu-22.04
364+
toolchain:
365+
ccompiler: gcc
366+
cversion: "13"
367+
fcompiler: gcc
368+
fversion: "13"
369+
- os: ubuntu-22.04
370+
toolchain:
371+
ccompiler: intel
372+
cversion: "2023.1"
373+
fcompiler: intel
374+
fversion: "2023.1"
375+
- os: ubuntu-22.04
376+
toolchain:
377+
ccompiler: intel-classic
378+
cversion: "2021.9"
379+
fcompiler: intel-classic
380+
fversion: "2021.9"
381+
- os: windows-latest
382+
toolchain:
383+
ccompiler: msvc
384+
cversion: latest
385+
fcompiler: intel
386+
fversion: "2025.2"
387+
- os: windows-latest
388+
toolchain:
389+
ccompiler: intel
390+
cversion: "2025.2"
391+
fcompiler: intel
392+
fversion: "2025.2"
393+
defaults:
394+
run:
395+
shell: bash
396+
steps:
397+
- name: Check out CEA
398+
uses: actions/checkout@v6
399+
400+
- name: Check out GFE
401+
if: ${{ runner.os != 'Windows' }}
402+
uses: actions/checkout@v6
403+
with:
404+
repository: Goddard-Fortran-Ecosystem/GFE
405+
path: extern/gfe
406+
submodules: true
407+
408+
- name: Set up Fortran compiler
409+
if: ${{ runner.os != 'Windows' || matrix.toolchain.fcompiler != 'gcc' }}
410+
uses: fortran-lang/setup-fortran@v1
411+
with:
412+
compiler: ${{ matrix.toolchain.fcompiler }}
413+
version: ${{ matrix.toolchain.fversion }}
414+
415+
- name: Set up Fortran compiler (Windows, gfortran)
416+
if: ${{ runner.os == 'Windows' && matrix.toolchain.fcompiler == 'gcc' }}
417+
run: |
418+
# Use pre-installed MinGW on Windows runners to avoid Chocolatey issues
419+
# GitHub Actions windows-latest runners include MinGW in C:\ProgramData\chocolatey\lib\mingw\tools\install\mingw64\bin
420+
$mingwPath = "C:\ProgramData\chocolatey\lib\mingw\tools\install\mingw64\bin"
421+
if (Test-Path $mingwPath) {
422+
echo "$mingwPath" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
423+
echo "FC=$mingwPath\gfortran.exe" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
424+
} else {
425+
# Fallback: search for gfortran in common locations
426+
$gfortran = Get-Command gfortran -ErrorAction SilentlyContinue
427+
if ($gfortran) {
428+
echo "FC=$($gfortran.Source)" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
429+
} else {
430+
Write-Error "gfortran not found on Windows runner"
431+
exit 1
432+
}
433+
}
434+
shell: pwsh
435+
436+
- name: Set up C Compiler
437+
if: ${{matrix.toolchain.ccompiler == 'msvc'}}
438+
uses: ilammy/msvc-dev-cmd@v1
439+
440+
- name: Install build tools
441+
run: |
442+
python -m pip install --upgrade pip
443+
python -m pip install ninja setuptools numpy cython
444+
445+
- name: Record toolchain info
446+
run: |
447+
git --version
448+
cmake --version
449+
ninja --version
450+
if command -v gfortran &> /dev/null; then gfortran --version; fi
451+
if [ -n "${FC}" ]; then "${FC}" --version; fi
452+
453+
- name: Configure and Build GFE
454+
if: ${{ runner.os != 'Windows' }}
455+
run: |
456+
cmake -S extern/gfe -B build/extern/gfe -GNinja \
457+
-DCMAKE_INSTALL_PREFIX=build/install \
458+
-DCMAKE_BUILD_TYPE=Release \
459+
-DSKIP_MPI=YES \
460+
-DSKIP_OPENMP=YES \
461+
-DSKIP_FHAMCREST=YES \
462+
-DSKIP_ESMF=YES \
463+
-DSKIP_ROBUST=YES
464+
cmake --build build/extern/gfe --target install
465+
466+
- name: Configure (linux)
467+
if: ${{runner.os != 'Windows' || matrix.toolchain.ccompiler != 'msvc'}}
468+
run: |
469+
cmake -S . -B build -G Ninja \
470+
-DCMAKE_PREFIX_PATH=build/install \
471+
-DCMAKE_BUILD_TYPE=Debug \
472+
-DCEA_BUILD_TESTING=ON \
473+
-DCEA_ENABLE_BIND_C=ON \
474+
-DCEA_ENABLE_BIND_CXX=OFF \
475+
-DCEA_ENABLE_BIND_PYTHON=OFF \
476+
-DCEA_ENABLE_BIND_MATLAB=OFF \
477+
-DCEA_ENABLE_BIND_EXCEL=OFF \
478+
-DCMAKE_Fortran_FLAGS="-ffree-line-length-none"
479+
480+
- name: Configure (msvc)
481+
if: ${{runner.os == 'Windows' && matrix.toolchain.ccompiler == 'msvc'}}
482+
run: |
483+
cmake -S . -B build -G Ninja \
484+
-DCMAKE_BUILD_TYPE=Release \
485+
-DCEA_BUILD_TESTING=ON \
486+
-DCEA_ENABLE_BIND_C=ON \
487+
-DCEA_ENABLE_BIND_CXX=OFF \
488+
-DCEA_ENABLE_BIND_PYTHON=OFF \
489+
-DCEA_ENABLE_BIND_MATLAB=OFF \
490+
-DCEA_ENABLE_BIND_EXCEL=OFF \
491+
-DCMAKE_C_COMPILER=cl \
492+
-DCMAKE_WINDOWS_EXPORT_ALL_SYMBOLS=ON
493+
494+
- name: Build
495+
run: |
496+
cmake --build build
497+
498+
- name: Run smoke test (Unix)
499+
if: runner.os != 'Windows'
500+
run: |
501+
./build/source/cea -h
502+
503+
- name: Run smoke test (Windows)
504+
if: runner.os == 'Windows'
505+
run: |
506+
./build/source/cea.exe -h
507+
508+
- name: Run ctest
509+
run: ctest --test-dir build --output-on-failure

.github/workflows/publish_wheels.yml

Lines changed: 37 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,20 @@ on:
55
push:
66
tags:
77
- "v*"
8+
workflow_dispatch:
9+
inputs:
10+
repository:
11+
description: "Package index target"
12+
required: true
13+
default: testpypi
14+
type: choice
15+
options:
16+
- testpypi
17+
- pypi
18+
19+
permissions:
20+
contents: read
21+
id-token: write
822

923
jobs:
1024
build-wheels:
@@ -81,16 +95,37 @@ jobs:
8195
name: Publish to PyPI
8296
needs: build-wheels
8397
runs-on: ubuntu-22.04
84-
if: startsWith(github.ref, 'refs/tags/v')
98+
if: startsWith(github.ref, 'refs/tags/v') || github.event_name == 'workflow_dispatch'
99+
permissions:
100+
contents: read
101+
id-token: write
85102
steps:
86103
- name: Download artifacts
87104
uses: actions/download-artifact@v4
88105
with:
89106
path: dist
90107
merge-multiple: true
91108

109+
- name: Verify OIDC token availability
110+
shell: bash
111+
run: |
112+
if [ -z "${ACTIONS_ID_TOKEN_REQUEST_TOKEN:-}" ] || [ -z "${ACTIONS_ID_TOKEN_REQUEST_URL:-}" ]; then
113+
echo "OIDC token env vars are unavailable for this run."
114+
echo "ACTIONS_ID_TOKEN_REQUEST_TOKEN set: $([ -n "${ACTIONS_ID_TOKEN_REQUEST_TOKEN:-}" ] && echo yes || echo no)"
115+
echo "ACTIONS_ID_TOKEN_REQUEST_URL set: $([ -n "${ACTIONS_ID_TOKEN_REQUEST_URL:-}" ] && echo yes || echo no)"
116+
echo "Ensure workflow/job has 'id-token: write' and repository/org policy permits OIDC."
117+
exit 1
118+
fi
119+
92120
- name: Publish to PyPI
121+
if: startsWith(github.ref, 'refs/tags/v') || (github.event_name == 'workflow_dispatch' && github.event.inputs.repository == 'pypi')
122+
uses: pypa/gh-action-pypi-publish@release/v1
123+
with:
124+
packages-dir: dist
125+
126+
- name: Publish to TestPyPI
127+
if: github.event_name == 'workflow_dispatch' && github.event.inputs.repository == 'testpypi'
93128
uses: pypa/gh-action-pypi-publish@release/v1
94129
with:
130+
repository-url: https://test.pypi.org/legacy/
95131
packages-dir: dist
96-
password: ${{ secrets.PYPI_API_TOKEN }}

.gitignore

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,10 @@ docs/doctrees/
55
docs/doxygen/
66
docs/html/
77
docs/source/_build/
8+
*.aux
9+
*.log
10+
*.toc
11+
*.out
812
extern/gfe
913
extern/install
1014
*.swp
@@ -15,21 +19,22 @@ extern/install
1519
*.csv
1620
*.xlsx
1721
*.pdf
18-
*.tex
19-
*.log
20-
*.aux
21-
*.toc
2222
*.bat
2323
*.lib
24+
*.dylib
25+
*.so
26+
*.dll
27+
*.pyc
28+
*.pyo
29+
*.pyd
30+
*.egg-info/
2431
!sampleThe/*.inp
2532
!test/main_interface/*.inp
2633
!test/main_interface/reference_output/*.out
2734
__pycache__/
2835
*.py[cod]
2936
*$py.class
30-
source/bind/excel/*.dylib
31-
source/bind/excel/*.so
32-
source/bind/excel/*.dll
3337
source/bind/excel/~$*.xlsm
3438
source/bind/excel/*.lib
3539
source/bind/python/samples
40+
source/bind/python/cea/samples/*.tex

CHANGELOG.md

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,28 @@ All notable user-visible changes to this project are documented here.
1010

1111
### Added
1212

13-
## [3.0.1] – Unreleased
13+
## [3.0.3] - 2026-02-20
14+
15+
### Changed
16+
- Hardened PyPI publishing CI with OIDC preflight checks and manual `workflow_dispatch` target selection (`testpypi`/`pypi`); installation docs now lead with `python -m pip install cea` and mention GitHub Releases binary assets.
17+
18+
### Fixed
19+
20+
### Added
21+
22+
## [3.0.2] – 2026-02-20
23+
24+
### Added
25+
- Initial Microsoft Visual C++ (MSVC) support in the C bindings/build pipeline (`#29`).
26+
27+
### Changed
28+
- `RocketSolver_solve` now treats `pi_p` as optional for better API compatibility and easier caller usage (`#36`).
29+
30+
### Fixed
31+
- Corrected detonation-wave upstream enthalpy calculations and upstream molecular weight handling in the legacy interface (`#33`).
32+
- Resolved failing transport-property test cases to restore expected regression behavior (`#37`).
33+
34+
## [3.0.1] – 2026-02-11
1435

1536
### Added
1637
- Python bindings and examples/tests for the CEA interface (`Feat/icx python binding`, #23).

CMakeLists.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,9 +53,9 @@ endif()
5353
# Testing
5454
option(CEA_BUILD_TESTING "Build test harness for CEA" ${PROJECT_IS_TOP_LEVEL})
5555
if(CEA_BUILD_TESTING)
56-
find_package(PFUNIT REQUIRED)
57-
include(CTest)
56+
find_package(PFUNIT)
5857
endif()
58+
include(CTest)
5959

6060
set(CMAKE_POSITION_INDEPENDENT_CODE ON)
6161

README.md

Lines changed: 19 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,23 @@ the CEA code base to adopt modern software engineering practices and improve
3131
CEA's ability to interface with other software packages and analysis environments
3232
via well-defined programming APIs in multiple languages.
3333

34-
## Build and Install
34+
## Install (Recommended)
35+
36+
For most users, install the published Python package directly:
37+
38+
python -m pip install cea
39+
40+
This is the fastest path to start using the Python API (`import cea`) without
41+
building from source.
42+
43+
If you need the legacy CLI executable (`cea`) or C/Fortran build artifacts, use
44+
the source build path below.
45+
46+
Prebuilt release assets are also available on the GitHub Releases page,
47+
including platform executables and shared libraries (`.so`, `.dll`, `.lib`,
48+
`.dll.a`).
49+
50+
## Build and Install from Source
3551

3652
The CEA software package is compiled and installed using CMake v3.19+. The core
3753
software has no external dependencies, and is known to build successfully on a
@@ -85,10 +101,10 @@ If you are not using presets, set `-DCEA_ENABLE_BIND_PYTHON=OFF` and also disabl
85101
the MATLAB wrapper (it forces Python on). For Fortran-only, also set
86102
`-DCEA_ENABLE_BIND_C=OFF`.
87103

88-
### Python Binding
104+
### Python Binding from a Source Checkout
89105

90106
The new Python binding provides direct access to compiled CEA routines.
91-
The basic installation process is as follows:
107+
If you are developing locally or want to build from a checkout, use:
92108

93109
cd <cea_source_dir>
94110
pip install .

docs/source/installation.rst

Lines changed: 22 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,26 @@ Install
22
*******
33
CEA can be installed on Windows, MacOS, and Linux systems.
44

5+
Recommended: Install from PyPI
6+
------------------------------
7+
8+
For most users, the recommended installation path is the published Python
9+
package:
10+
11+
::
12+
13+
python -m pip install cea
14+
15+
This installs the Python API (``import cea``) without requiring a local source
16+
build.
17+
18+
If you need the command-line executable (``cea``), C/Fortran artifacts, or
19+
custom compiler/toolchain control, follow the source build instructions below.
20+
21+
Prebuilt release assets are also available on the GitHub Releases page,
22+
including platform executables and shared libraries (``.so``, ``.dll``,
23+
``.lib``, ``.dll.a``).
24+
525
Prerequisites
626
-------------
727

@@ -19,8 +39,8 @@ Clone the repository::
1939
git clone https://github.com/nasa/cea
2040
cd cea
2141

22-
Build and Install
23-
-----------------
42+
Build and Install from Source
43+
-----------------------------
2444

2545
The CEA software package is compiled and installed using CMake. The basic
2646
installation process is as follows:

0 commit comments

Comments
 (0)