Skip to content

Commit 6d85023

Browse files
committed
Fix Fypp chemistry boolean interpretation
The issue was that CMake was passing -D chemistry=False (string) to Fypp, but Fypp interprets the string "False" as truthy (non-empty string). This caused Fypp to generate code that tried to use m_thermochem even when MFC_CHEMISTRY=OFF, leading to compilation errors. Solution: Pass 0/1 instead of False/True to Fypp, which correctly interprets as boolean false/true. Also explicitly import join_path in package.py for clarity.
1 parent 959fc79 commit 6d85023

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

CMakeLists.txt

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,9 +45,10 @@ else()
4545
endif()
4646

4747
# Chemistry configuration
48-
set(_chem_str "False")
48+
# Pass 0/1 to Fypp so it interprets correctly as boolean (not string "False"/"True")
49+
set(_chem_str "0")
4950
if (MFC_CHEMISTRY)
50-
set(_chem_str "True")
51+
set(_chem_str "1")
5152
endif()
5253

5354
# Optional: mechanism file name/path for Cantera

packaging/spack/package.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
from spack_repo.builtin.build_systems.cmake import CMakePackage
77

88
from spack.package import *
9+
from spack.util.path import join_path
910

1011

1112
class Mfc(CMakePackage):

0 commit comments

Comments
 (0)