File tree Expand file tree Collapse file tree 1 file changed +22
-3
lines changed Expand file tree Collapse file tree 1 file changed +22
-3
lines changed Original file line number Diff line number Diff line change @@ -230,13 +230,32 @@ impl Configure {
230
230
let out = fs:: File :: create ( out_dir. join ( "out.log" ) ) . expect ( "Cannot create log file" ) ;
231
231
let err = fs:: File :: create ( out_dir. join ( "err.log" ) ) . expect ( "Cannot create log file" ) ;
232
232
233
- // This will automatically run in parallel without `-j` flag
234
- Command :: new ( "make" )
233
+ // Run `make` as an subprocess
234
+ //
235
+ // - This will automatically run in parallel without `-j` flag
236
+ // - The `make` of OpenBLAS outputs 30k lines,
237
+ // which will be redirected into `out.log` and `err.log`.
238
+ match Command :: new ( "make" )
235
239
. current_dir ( out_dir)
236
240
. stdout ( unsafe { Stdio :: from_raw_fd ( out. into_raw_fd ( ) ) } ) // this works only for unix
237
241
. stderr ( unsafe { Stdio :: from_raw_fd ( err. into_raw_fd ( ) ) } )
238
242
. args ( & self . make_args ( ) )
239
- . check_call ( ) ?;
243
+ . status ( )
244
+ {
245
+ Ok ( status) => {
246
+ if !status. success ( ) {
247
+ let err =
248
+ fs:: read_to_string ( out_dir. join ( "err.log" ) ) . expect ( "Cannot read log file" ) ;
249
+ bail ! ( "`make` returns non-zero status {}:\n {}" , status, err) ;
250
+ }
251
+ }
252
+ Err ( error) => {
253
+ bail ! (
254
+ "Cannot start subprocess ({}). Maybe `make` does not exist." ,
255
+ error
256
+ ) ;
257
+ }
258
+ }
240
259
241
260
let make_conf = MakeConf :: new ( out_dir. join ( "Makefile.conf" ) ) ?;
242
261
You can’t perform that action at this time.
0 commit comments