Skip to content

Modernize build and dependencies#6

Open
stanbot8 wants to merge 8 commits intomasterfrom
dev/stanbot8
Open

Modernize build and dependencies#6
stanbot8 wants to merge 8 commits intomasterfrom
dev/stanbot8

Conversation

@stanbot8
Copy link
Owner

@stanbot8 stanbot8 commented Feb 20, 2026

Summary

Replace deprecated sonarcloud-github-c-cpp action

The sonarcloud-github-c-cpp action used in CI was deprecated and removed. Replaced with the current sonarcloud-github-action and updated the build wrapper download step to use the latest API.

Add missing C++ standard library includes

Added explicit #include <cmath> to log_range_param.h and range_param.h. These headers relied on transitive includes which can break with different compilers or standard library versions.

Replace cpptoml with tomlplusplus

cpptoml is an unmaintained library (last updated 2018). Replaced it with tomlplusplus v3.4.0, an actively maintained, header-only TOML v1.0 parser. Updated all config parsing code in param.cc, param_group.cc, simulation.cc, and the cpptoml.h compatibility wrapper.

cpptoml is kept in third_party/ with a deprecation #pragma message so downstream code that includes it still compiles. The old src/core/util/cpptoml.h utility header is now a forwarding shim to the new src/core/util/toml_config.h, which contains the BDM_ASSIGN_CONFIG_VALUE macros rewritten for tomlplusplus.

A TomlConfig typedef (using TomlConfig = toml::table) is added in param_group.h so that downstream code never references the concrete TOML library type directly. All AssignFromConfig signatures use const TomlConfig& instead of the old const std::shared_ptr<cpptoml::table>&.

Replace NULL with nullptr

Replaced 3 uses of the C macro NULL with C++ nullptr in command_line_options.cc, mapped_data_array.h, and benchmark/main.cc.

Update nlohmann/json from 3.9.1 to 3.12.0

Bumps the bundled single-header JSON library to stay current. The 3.9.1 release is from 2021; 3.12.0 includes accumulated bug fixes and maintenance improvements.

Full changelog: https://github.com/nlohmann/json/releases/tag/v3.12.0

Fix DiffusionGrid::GetConcentration error label

The out-of-bounds error in GetConcentration incorrectly identified itself as ChangeConcentrationBy.

Skip FTCS solver for zero-diffusion grids

When the diffusion coefficient is 0 but decay is nonzero, EulerGrid::DiffuseWith* now applies decay as a simple element-wise multiply instead of running the full FTCS stencil. The Laplacian term vanishes with D=0, so the stencil computation is wasted work. Also fixes two pre-existing cpplint warnings in diffusion_grid.h.

@stanbot8 stanbot8 closed this Feb 20, 2026
@stanbot8 stanbot8 reopened this Feb 20, 2026
@stanbot8 stanbot8 force-pushed the dev/stanbot8 branch 6 times, most recently from 258639d to e99ede2 Compare February 24, 2026 19:11
@stanbot8 stanbot8 changed the title Modernize build and dependencies Modernize build, dependencies, and simulation bounds Feb 26, 2026
@stanbot8 stanbot8 force-pushed the dev/stanbot8 branch 3 times, most recently from 4ad5842 to 609a5fb Compare March 4, 2026 07:44
@stanbot8 stanbot8 changed the title Modernize build, dependencies, and simulation bounds Modernize build and dependencies Mar 4, 2026
@stanbot8 stanbot8 force-pushed the dev/stanbot8 branch 5 times, most recently from 8dacd10 to 7d1133f Compare March 4, 2026 13:38
stanbot8 added 8 commits March 4, 2026 14:28
Switch from SonarSource/sonarcloud-github-c-cpp@v2 to
SonarSource/sonarqube-scan-action@v7 which replaces the
deprecated build wrapper and scanner integration.
Migrate all TOML parsing from cpptoml to tomlplusplus. Introduce a
TomlConfig typedef to insulate downstream code from the concrete
library. Keep cpptoml in third_party/ with a deprecation pragma so
existing includes still compile. Move BDM_ASSIGN_CONFIG_VALUE macros
to a new toml_config.h and turn the old cpptoml.h utility header
into a forwarding shim with a deprecation warning.
When the diffusion coefficient is 0 but decay is nonzero, apply
decay as a simple element-wise multiply instead of running the
full FTCS stencil. The Laplacian term vanishes with D=0, so the
stencil computation is wasted work.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant