Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# SCM syntax highlighting & preventing 3-way merges
pixi.lock merge=binary linguist-language=YAML linguist-generated=true -diff
33 changes: 17 additions & 16 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,29 +16,30 @@ jobs:
steps:
- uses: actions/checkout@v4

- name: Setup micromamba
uses: mamba-org/setup-micromamba@v1
- name: Setup Pixi
uses: prefix-dev/setup-pixi@v0.8.1
with:
micromamba-version: '1.5.7-0'
environment-file: environment.yml
init-shell: bash
cache-environment: true
post-cleanup: 'all'
cache: true

- name: Compile with meson
shell: micromamba-shell {0}
run: |
meson setup build --buildtype release
meson compile -C build
if [ "${{ matrix.os }}" = "macos-latest" ]; then
export CC=clang
export CXX=clang++
fi
pixi run meson setup build --buildtype release
pixi run meson compile -C build

- name: Test with meson
shell: micromamba-shell {0}
run: |
meson test -C build --verbose
pixi run meson test -C build --verbose

- name: Compile and test without netcdf
shell: micromamba-shell {0}
run: |
meson setup build_nonetcdf --buildtype release --vsenv -Dwith_netcdf=false
meson compile -C build_nonetcdf
meson test -C build_nonetcdf --verbose
if [ "${{ matrix.os }}" = "macos-latest" ]; then
export CC=clang
export CXX=clang++
fi
pixi run meson setup build_nonetcdf --buildtype release -Dwith_netcdf=false
pixi run meson compile -C build_nonetcdf
pixi run meson test -C build_nonetcdf --verbose
28 changes: 9 additions & 19 deletions .github/workflows/ci_windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,32 +16,22 @@ jobs:
steps:
- uses: actions/checkout@v4

- name: Setup micromamba
uses: mamba-org/setup-micromamba@v1
- name: Setup Pixi
uses: prefix-dev/setup-pixi@v0.8.1
with:
micromamba-version: '1.5.7-0'
environment-file: environment.yml
init-shell: powershell
cache-environment: true
post-cleanup: 'all'
cache: true

- name: Compile with meson
shell: pwsh
run: |
micromamba activate flowyenv
meson setup build --buildtype release --vsenv
meson compile -C build
pixi run meson setup build --buildtype release --vsenv
pixi run meson compile -C build

- name: Test with meson
shell: pwsh
run: |
micromamba activate flowyenv
meson test -C build --verbose
pixi run meson test -C build --verbose

- name: Compile and test without netcdf
shell: pwsh
run: |
micromamba activate flowyenv
meson setup build_nonetcdf --buildtype release --vsenv -Dwith_netcdf=false
meson compile -C build_nonetcdf
meson test -C build_nonetcdf --verbose
pixi run meson setup build_nonetcdf --buildtype release --vsenv -Dwith_netcdf=false
pixi run meson compile -C build_nonetcdf
pixi run meson test -C build_nonetcdf --verbose
21 changes: 12 additions & 9 deletions .github/workflows/pre_commit.yml
Original file line number Diff line number Diff line change
@@ -1,18 +1,21 @@
name: pre-commit
name: prek
on:
pull_request:
push:
branches: [main]
jobs:
pre-commit:
prek:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Install Conda environment
uses: mamba-org/setup-micromamba@main
- uses: actions/checkout@v6.0.3
- name: Setup Pixi
uses: prefix-dev/setup-pixi@v0.9.6
with:
environment-file: environment.yml
- name: Run precommit
shell: bash -l {0}
cache: true
- name: Install prek
uses: taiki-e/install-action@prek
- name: Run prek
run: |
pipx run pre-commit run -a
pixi run prek run --all-files --show-diff-on-failure
env:
PREK_COLOR: always
7 changes: 7 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -35,3 +35,10 @@ compile_commands.json
*.out
*.app
/subprojects/pdf_cpplib/
# pixi environments
.pixi/*
!.pixi/config.toml

.project-ctx.toml
GEMINI.md
.gemini/
1 change: 1 addition & 0 deletions environment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,3 +18,4 @@ dependencies:
- libnetcdf
- hdf5
- towncrier
- libhwy
1 change: 1 addition & 0 deletions flowy/include/config.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,7 @@ class InputParams
// ===================================================================================

int npoints{ 30 }; // Number of points for rasterizing the ellipse
int n_runs{ 1 }; // ensemble size (independent runs aggregated for the hazard map)
int n_init{ 0 }; // Number of repetitions of the first lobe (useful for initial spreading)

/*This factor is to choose where the center of the new lobe will be:
Expand Down
26 changes: 14 additions & 12 deletions meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -10,17 +10,19 @@ cpp_args = []

cppc = meson.get_compiler('cpp')

cpp_args += cppc.get_supported_arguments([
'-Wno-unused-local-typedefs', # Ignore unused local typedefs warnings
'-Wno-array-bounds', # Suppress out-of-bounds array access warnings
'-ffast-math', # Enable faster, non-IEEE math calculations
'-fno-finite-math-only', # Allow Inf and NaN
# These are based on recommendations from
# https://youtu.be/_enXuIxuNV4?si=LvtMqPwJ6jYbDY66
'-fno-semantic-interposition', # Assume no interposition for module functions
'-fno-plt', # Avoid PLT for function calls within shared libs
'-Bsymbolic', # Resolve symbols to local definitions
])
if cppc.get_id() != 'msvc' and cppc.get_id() != 'clang-cl'
cpp_args += cppc.get_supported_arguments([
'-Wno-unused-local-typedefs', # Ignore unused local typedefs warnings
'-Wno-array-bounds', # Suppress out-of-bounds array access warnings
'-ffast-math', # Enable faster, non-IEEE math calculations
'-fno-finite-math-only', # Allow Inf and NaN
# These are based on recommendations from
# https://youtu.be/_enXuIxuNV4?si=LvtMqPwJ6jYbDY66
'-fno-semantic-interposition', # Assume no interposition for module functions
'-fno-plt', # Avoid PLT for function calls within shared libs
'-Bsymbolic', # Resolve symbols to local definitions
])
endif

if cpp_args.length() > 0
message('Adding compiler flags', cpp_args)
Expand All @@ -36,7 +38,7 @@ _sources = [
]

# Library dependencies
_deps = []
_deps = [ dependency('openmp'), dependency('libhwy') ]
pdflib_dep = dependency('pdf_cpplib', fallback : ['pdf_cpplib', 'pdflib_dep'])

with_netcdf = get_option('with_netcdf')
Expand Down
Loading
Loading