Skip to content

Commit a648a59

Browse files
committed
Fix Cantera build: Pass compiler and SDK paths to scons
The error was: "Checking for C++ header file cmath... no" "The C++ compiler is not correctly configured (incomplete include paths)" When running scons via venv's Python, it doesn't inherit Homebrew's compiler environment. Solution: explicitly pass compiler and SDK paths: - CC=#{ENV.cc} - CXX=#{ENV.cxx} - CFLAGS=-isysroot#{MacOS.sdk_path} - CXXFLAGS=-isysroot#{MacOS.sdk_path} This ensures scons can find standard C++ headers like cmath.
1 parent 8efd560 commit a648a59

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

packaging/homebrew/mfc.rb

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,12 +40,17 @@ def install
4040

4141
# Configure Cantera build
4242
# Run scons with the venv's Python so it can find installed packages
43+
# Pass compiler and SDK paths explicitly since Homebrew's env is isolated
4344
system venv/"bin/python", "-m", "SCons", "build",
4445
"python_package=y",
4546
"f90_interface=n",
4647
"system_sundials=y",
4748
"system_yamlcpp=y",
4849
"system_fmt=n",
50+
"CC=#{ENV.cc}",
51+
"CXX=#{ENV.cxx}",
52+
"CFLAGS=-isysroot#{MacOS.sdk_path}",
53+
"CXXFLAGS=-isysroot#{MacOS.sdk_path}",
4954
"extra_inc_dirs=#{Formula["sundials"].opt_include}:#{Formula["yaml-cpp"].opt_include}",
5055
"extra_lib_dirs=#{Formula["sundials"].opt_lib}:#{Formula["yaml-cpp"].opt_lib}",
5156
"prefix=#{libexec}/cantera",

0 commit comments

Comments
 (0)