@@ -58,21 +58,30 @@ def install
5858 # Include both SDK include path and C++ header path for scons' configuration checks
5959 sdk_inc_path = "#{ sdk_path } /usr/include"
6060 cxx_flags_with_includes = "#{ ENV . fetch ( "CXXFLAGS" , nil ) } -I#{ sdk_inc_path } -I#{ cxx_inc_path } "
61- system venv /"bin/python" , "-m" , "SCons" , "build" ,
62- "CC=#{ ENV . cc } " ,
63- "CXX=#{ ENV . cxx } " ,
64- "cc_flags=#{ ENV . fetch ( "CFLAGS" , nil ) } -I#{ sdk_inc_path } " ,
65- "cxx_flags=#{ cxx_flags_with_includes } " ,
66- "python_package=y" ,
67- "f90_interface=n" ,
68- "system_sundials=y" ,
69- "system_yamlcpp=y" ,
70- "system_fmt=n" ,
71- "extra_inc_dirs=#{ cxx_inc_path } :#{ Formula [ "sundials" ] . opt_include } :#{ Formula [ "yaml-cpp" ] . opt_include } " ,
72- "extra_lib_dirs=#{ Formula [ "sundials" ] . opt_lib } :#{ Formula [ "yaml-cpp" ] . opt_lib } " ,
73- "prefix=#{ libexec } /cantera" ,
74- "python_cmd=#{ venv } /bin/python" ,
75- "-j#{ ENV . make_jobs } "
61+
62+ # Run scons build - output config.log if it fails
63+ unless system venv /"bin/python" , "-m" , "SCons" , "build" ,
64+ "CC=#{ ENV . cc } " ,
65+ "CXX=#{ ENV . cxx } " ,
66+ "cc_flags=#{ ENV . fetch ( "CFLAGS" , nil ) } -I#{ sdk_inc_path } " ,
67+ "cxx_flags=#{ cxx_flags_with_includes } " ,
68+ "python_package=y" ,
69+ "f90_interface=n" ,
70+ "system_sundials=y" ,
71+ "system_yamlcpp=y" ,
72+ "system_fmt=n" ,
73+ "extra_inc_dirs=#{ cxx_inc_path } :#{ Formula [ "sundials" ] . opt_include } :#{ Formula [ "yaml-cpp" ] . opt_include } " ,
74+ "extra_lib_dirs=#{ Formula [ "sundials" ] . opt_lib } :#{ Formula [ "yaml-cpp" ] . opt_lib } " ,
75+ "prefix=#{ libexec } /cantera" ,
76+ "python_cmd=#{ venv } /bin/python" ,
77+ "-j#{ ENV . make_jobs } "
78+ # If scons failed, try to output config.log for debugging
79+ if File . exist? ( "config.log" )
80+ ohai "Cantera config.log (for debugging):"
81+ puts File . read ( "config.log" )
82+ end
83+ raise "Cantera scons build failed"
84+ end
7685
7786 # Install Cantera
7887 system venv /"bin/python" , "-m" , "SCons" , "install"
0 commit comments