Community
cancel
Showing results for 
Search instead for 
Did you mean: 
Robert_M_
Beginner
231 Views

rename gmon.out

Jump to solution

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
231 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

2 Replies
232 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

Robert_M_
Beginner
231 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.

Reply