Skip to content

Commit 82cd3f4

Browse files
committed
Add SDK C++ include path to scons extra_inc_dirs
The environment variables (CFLAGS, CXXFLAGS) are now set correctly, and scons recognizes the compiler, but it still can't find <cmath>. The issue: scons runs its own compiler checks and doesn't automatically use the CFLAGS/CXXFLAGS we set in ENV. Solution: Explicitly add the SDK's C++ standard library include path to Cantera's extra_inc_dirs parameter: <SDK>/usr/include/c++/v1 This tells scons exactly where to find standard C++ headers during its configuration checks.
1 parent 9a9e93f commit 82cd3f4

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

packaging/homebrew/mfc.rb

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,8 @@ def install
5050
ENV["SDKROOT"] = sdk_path.to_s
5151

5252
# Run scons, explicitly telling it which compilers to use
53+
# Add SDK C++ include path to extra_inc_dirs so scons can find standard headers
54+
cxx_inc_path = "#{sdk_path}/usr/include/c++/v1"
5355
system venv/"bin/python", "-m", "SCons", "build",
5456
"CC=#{ENV.cc}",
5557
"CXX=#{ENV.cxx}",
@@ -58,7 +60,7 @@ def install
5860
"system_sundials=y",
5961
"system_yamlcpp=y",
6062
"system_fmt=n",
61-
"extra_inc_dirs=#{Formula["sundials"].opt_include}:#{Formula["yaml-cpp"].opt_include}",
63+
"extra_inc_dirs=#{cxx_inc_path}:#{Formula["sundials"].opt_include}:#{Formula["yaml-cpp"].opt_include}",
6264
"extra_lib_dirs=#{Formula["sundials"].opt_lib}:#{Formula["yaml-cpp"].opt_lib}",
6365
"prefix=#{libexec}/cantera",
6466
"python_cmd=#{venv}/bin/python",

0 commit comments

Comments
 (0)