@@ -217,16 +217,24 @@ bool initPMUEventMap()
217
217
inited = true ;
218
218
const auto mapfile = " mapfile.csv" ;
219
219
const auto mapfilePath = eventFileLocationPrefix + " /" + mapfile;
220
+ const auto mapfilePathAlt = getInstallPathPrefix () + " perfmon/" + mapfile;
220
221
std::ifstream in (mapfilePath);
221
222
std::string line, item;
222
223
223
224
if (!in.is_open ())
224
225
{
225
- cerr << " ERROR: File " << mapfilePath << " can't be open. \n " ;
226
- cerr << " Use -ep <pcm_source_directory>/perfmon option if you cloned PCM source repository recursively with submodules,\n " ;
227
- cerr << " or run 'git clone https://github.com/intel/perfmon' to download the perfmon event repository and use -ep <perfmon_directory> option\n " ;
228
- cerr << " or download the file from https://raw.githubusercontent.com/intel/perfmon/main/" << mapfile << " \n " ;
229
- return false ;
226
+ in.open (mapfilePathAlt);
227
+ if (!in.is_open ())
228
+ {
229
+ cerr << " ERROR: File " << mapfilePath << " or " << mapfilePathAlt << " can't be open. \n " ;
230
+ #ifndef _MSC_VER
231
+ cerr << " run 'make install' in the pcm build directory if you cloned PCM source repository recursively with submodules, or\n " ;
232
+ #endif
233
+ cerr << " use -ep <pcm_source_directory>/perfmon option if you cloned PCM source repository recursively with submodules,\n " ;
234
+ cerr << " or run 'git clone https://github.com/intel/perfmon' to download the perfmon event repository and use -ep <perfmon_directory> option\n " ;
235
+ cerr << " or download the file from https://raw.githubusercontent.com/intel/perfmon/main/" << mapfile << " \n " ;
236
+ return false ;
237
+ }
230
238
}
231
239
int32 FMSPos = -1 ;
232
240
int32 FilenamePos = -1 ;
@@ -300,6 +308,7 @@ bool initPMUEventMap()
300
308
{
301
309
const std::string path1 = eventFileLocationPrefix + evfile.second ;
302
310
const std::string path2 = eventFileLocationPrefix + evfile.second .substr (evfile.second .rfind (' /' ));
311
+ const std::string path3 = getInstallPathPrefix () + " perfmon" + evfile.second ;
303
312
304
313
if (std::ifstream (path1).good ())
305
314
{
@@ -309,9 +318,13 @@ bool initPMUEventMap()
309
318
{
310
319
path = path2;
311
320
}
321
+ else if (std::ifstream (path3).good ())
322
+ {
323
+ path = path3;
324
+ }
312
325
else
313
326
{
314
- std::cerr << " ERROR: Can't open event file at location " << path1 << " or " << path2 << " \n " ;
327
+ std::cerr << " ERROR: Can't open event file at location " << path1 << " or " << path2 << " or " << path3 << " \n " ;
315
328
printError ();
316
329
return false ;
317
330
}
0 commit comments