Intel® C++ Compiler
Community support and assistance for creating C++ code that runs on platforms based on Intel® processors.

rename gmon.out

Robert_M_
Beginner
801 Views

Hi folks,

it seems like the ICC does not use the environment variable GMON_OUT_PREFIX. Is tehre another way to change the filename of the gmon.out file?!

thank you.

0 Kudos
1 Solution
Shenghong_G_Intel
801 Views

Hello Robert,

Looks like it works for me, which version of compiler you are using? did you build with "-p" option (or -pg)?

$ icc -v
icc version 14.0.2 (gcc version 4.8.0 compatibility)
$ icc foo.c -p
$ export GMON_OUT_PREFIX=gprof.out
$ ./a.out
$ ls gprof.out*
gprof.out.86655
$ ./a.out
$ ls gprof.out*
gprof.out.86655  gprof.out.86657
$ export GMON_OUT_PREFIX=test.out
$ ./a.out
$ ls gprof.out* test.out*
gprof.out.86655  gprof.out.86657  test.out.86667
$

Thanks,

Shenghong

 

View solution in original post

0 Kudos
2 Replies
Shenghong_G_Intel
802 Views

Hello Robert,

Looks like it works for me, which version of compiler you are using? did you build with "-p" option (or -pg)?

$ icc -v
icc version 14.0.2 (gcc version 4.8.0 compatibility)
$ icc foo.c -p
$ export GMON_OUT_PREFIX=gprof.out
$ ./a.out
$ ls gprof.out*
gprof.out.86655
$ ./a.out
$ ls gprof.out*
gprof.out.86655  gprof.out.86657
$ export GMON_OUT_PREFIX=test.out
$ ./a.out
$ ls gprof.out* test.out*
gprof.out.86655  gprof.out.86657  test.out.86667
$

Thanks,

Shenghong

 

0 Kudos
Robert_M_
Beginner
801 Views

Oh, this was my fault. I misunderstood this Variable being evaluated at compile time, not at runtime.

It works for me as well, thank you.

0 Kudos
Reply