@@ -65,39 +65,55 @@ def install
6565 sundials_lib = Formula [ "sundials" ] . opt_lib
6666 yamlcpp_lib = Formula [ "yaml-cpp" ] . opt_lib
6767
68- unless system venv /"bin/python" , "-m" , "SCons" , "build" ,
69- "CC=#{ ENV . cc } " ,
70- "CXX=#{ ENV . cxx } " ,
71- "cc_flags=#{ ENV . fetch ( "CFLAGS" , nil ) } -I#{ sdk_inc_path } " ,
72- "cxx_flags=#{ cxx_flags_with_includes } " ,
73- "python_package=y" ,
74- "f90_interface=n" ,
75- "system_sundials=y" ,
76- "system_yamlcpp=y" ,
77- "system_fmt=n" ,
78- "extra_inc_dirs=#{ cxx_inc_path } :#{ sundials_inc } :#{ yamlcpp_inc } " ,
79- "extra_lib_dirs=#{ sundials_lib } :#{ yamlcpp_lib } " ,
80- "prefix=#{ libexec } /cantera" ,
81- "python_cmd=#{ venv } /bin/python" ,
82- "-j#{ ENV . make_jobs } "
83- # If scons failed, try to output config.log for debugging
84- ohai "Cantera scons failed. Searching for config.log..."
85- ohai "Current directory: #{ Dir . pwd } "
86- system "ls" , "-la"
87-
88- # Search for config.log in current directory and subdirectories
89- config_logs = Dir . glob ( "**/config.log" )
90- if config_logs . any?
91- config_logs . each do |log_path |
92- ohai "Found config.log at: #{ log_path } "
93- puts File . read ( log_path )
68+ # Debug: Show what we're about to run
69+ opoo "About to run Cantera scons build in: #{ Dir . pwd } "
70+ opoo "SDK path: #{ sdk_path } "
71+ opoo "C++ flags: #{ cxx_flags_with_includes } "
72+
73+ success = system venv /"bin/python" , "-m" , "SCons" , "build" ,
74+ "CC=#{ ENV . cc } " ,
75+ "CXX=#{ ENV . cxx } " ,
76+ "cc_flags=#{ ENV . fetch ( "CFLAGS" , nil ) } -I#{ sdk_inc_path } " ,
77+ "cxx_flags=#{ cxx_flags_with_includes } " ,
78+ "python_package=y" ,
79+ "f90_interface=n" ,
80+ "system_sundials=y" ,
81+ "system_yamlcpp=y" ,
82+ "system_fmt=n" ,
83+ "extra_inc_dirs=#{ cxx_inc_path } :#{ sundials_inc } :#{ yamlcpp_inc } " ,
84+ "extra_lib_dirs=#{ sundials_lib } :#{ yamlcpp_lib } " ,
85+ "prefix=#{ libexec } /cantera" ,
86+ "python_cmd=#{ venv } /bin/python" ,
87+ "-j#{ ENV . make_jobs } "
88+
89+ unless success
90+ opoo "=============================================="
91+ opoo "Cantera scons build FAILED!"
92+ opoo "Current directory: #{ Dir . pwd } "
93+ opoo "=============================================="
94+
95+ # Try to find and display config.log
96+ config_log_candidates = [ "config.log" , "build/config.log" , ".sconf_temp/conftest.out" ]
97+ config_log_candidates . each do |candidate |
98+ next unless File . exist? ( candidate )
99+
100+ opoo "Found #{ candidate } :"
101+ File . open ( candidate , "r" ) do |f |
102+ puts f . read
94103 end
95- else
96- ohai "No config.log found. Listing all files:"
97- system "find" , "." , "-type" , "f" , "-name" , "*.log"
98104 end
99105
100- raise "Cantera scons build failed"
106+ # Also search recursively
107+ Dir . glob ( "**/config.log" ) . each do |path |
108+ opoo "Found config.log at: #{ path } "
109+ puts File . read ( path )
110+ end
111+
112+ # List directory contents
113+ opoo "Directory listing:"
114+ system "ls" , "-laR"
115+
116+ odie "Cantera scons build failed - see config.log output above"
101117 end
102118
103119 # Install Cantera
0 commit comments