Skip to content

dgb: portable pi constant for MSVC Windows release lane (M_PI undeclared) - #697

Merged
frstrtr merged 1 commit into
masterfrom
ci-steward/dgb-msvc-mpi
Jul 14, 2026
Merged

dgb: portable pi constant for MSVC Windows release lane (M_PI undeclared)#697
frstrtr merged 1 commit into
masterfrom
ci-steward/dgb-msvc-mpi

Conversation

@frstrtr

@frstrtr frstrtr commented Jul 14, 2026

Copy link
Copy Markdown
Owner

What

Replace std::sqrt(M_PI) in dgb/coin/binomial_conf_interval.hpp:ierf() with a namespace-scope constexpr double kPi.

Why

MSVC does not define the non-standard POSIX M_PI macro unless _USE_MATH_DEFINES is set before <cmath>. The dgb release Windows lane (release.yml, self-hosted VM217/MSVC) fails at Build c2pool-dgb with:

binomial_conf_interval.hpp(60): error C2065: 'M_PI': undeclared identifier
binomial_conf_interval.hpp(60): error C2737: 'dy': const object must be initialized

Linux/macOS and build.yml pass because build.yml does not compile dgb's main executable target. Confirmed on release-dispatch run 29307660687 (Linux+macOS green, Windows package red at this exact error).

A constexpr avoids header-order-dependent _USE_MATH_DEFINES fragility. No numeric change on any platform.

Verification

Release-dispatch off this branch to confirm Windows dgb Build/Package non-hollow green (attached next).

Depends on nothing; independent of #696 (release.yml pwsh/em-dash shell heal). Signed 285EFE76. No self-merge.

…e lane)

MSVC does not define the non-standard M_PI macro without _USE_MATH_DEFINES.
binomial_conf_interval.hpp:ierf() used std::sqrt(M_PI) in its Newton step,
which built on Linux/macOS but failed the Windows/MSVC dgb release lane with
C2065 (undeclared identifier). Replace with a namespace-scope constexpr kPi to
avoid header-order-dependent _USE_MATH_DEFINES fragility. No numeric change on
any platform.
@frstrtr
frstrtr merged commit 7115c97 into master Jul 14, 2026
31 of 32 checks passed
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