File tree Expand file tree Collapse file tree 1 file changed +3
-16
lines changed Expand file tree Collapse file tree 1 file changed +3
-16
lines changed Original file line number Diff line number Diff line change @@ -466,26 +466,13 @@ void HipBinBase::printUsage() const {
466
466
467
467
// compiler canRun or not
468
468
bool HipBinBase::canRunCompiler (string exeName, string& cmdOut) {
469
- string compilerName = exeName;
470
- string temp_dir = hipBinUtilPtr_->getTempDir ();
471
- fs::path templateFs = temp_dir;
472
- templateFs /= " canRunXXXXXX" ;
473
- string tmpFileName = hipBinUtilPtr_->mktempFile (templateFs.string ());
474
- compilerName += " --version > " + tmpFileName + " 2>&1" ;
475
469
bool executable = false ;
476
- if (system (const_cast <char *>(compilerName.c_str ()))) {
470
+ SystemCmdOut sysOut = hipBinUtilPtr_->exec ((exeName + " --version" ).c_str ());
471
+ if (sysOut.exitCode != 0 ) {
477
472
executable = false ;
478
473
} else {
479
- string myline;
480
- ifstream fp;
481
- fp.open (tmpFileName);
482
- if (fp.is_open ()) {
483
- while (std::getline (fp, myline)) {
484
- cmdOut += myline;
485
- }
486
- }
487
- fp.close ();
488
474
executable = true ;
475
+ cmdOut += sysOut.out ;
489
476
}
490
477
return executable;
491
478
}
You can’t perform that action at this time.
0 commit comments