Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.
29381 토론

Running code compiled with ifort -p not generating profiling output gmon.out

Grgur
초급자
3,068 조회수

Compiling a file with `ifort -p test.f90` and running `./a.out` does not create profiling output gmon.out on macOS 10.15. I've provided an example code below, but it is the case for any file I've tried. Am I missing something?

 

I've tested it with ifort 2021.4.0 and 2021.1.1on macOS 10.15.

 

 

program test_profiling
    implicit none
    real        :: x,y
    x = 0.34
    y = func(x)
    print *,'hello world'
    print *,'x,y = ',x,y
 contains
   real function func(x)
       implicit none
       real,intent(in) :: x
       func = x*2
   end function func
end program test_profiling

 

 

 

 

0 포인트
1 솔루션
Ron_Green
중재자
3,022 조회수

Ah, looks like we forgot to take that -p option out.  A long time ago macOS came with gcc and binutils.  So years ago gprof was available on macOS.  It no longer is.  even if you install gcc and binutils with Homebrew or something, our compiler would not know where to find the libs needed for the profiling.  

 

SO ... I'll ask my Intel colleauges to:

1) remove -p as an option to the driver.

2) remove -help information on -p

3) remove -p from the Developer Guide and Reference for macOS

원본 게시물의 솔루션 보기

0 포인트
6 응답
Ron_Green
중재자
3,023 조회수

Ah, looks like we forgot to take that -p option out.  A long time ago macOS came with gcc and binutils.  So years ago gprof was available on macOS.  It no longer is.  even if you install gcc and binutils with Homebrew or something, our compiler would not know where to find the libs needed for the profiling.  

 

SO ... I'll ask my Intel colleauges to:

1) remove -p as an option to the driver.

2) remove -help information on -p

3) remove -p from the Developer Guide and Reference for macOS

0 포인트
Grgur
초급자
3,012 조회수

Thanks for the feedback, Ron!

 

So there is no profiling option on macOS currently or for the foreseeable future?

0 포인트
Ron_Green
중재자
3,007 조회수

compile with -g and use the 'Instruments' tool that comes with Xcode tools.  It is GUI based so if you only have command line there's hopefully some way to run it in CLI mode.

0 포인트
Ron_Green
중재자
3,015 조회수

as an alternative, you can compile with -g and use Instruments to profile

 

https://coderedirect.com/questions/315993/profiling-c-on-mac-os-x

 

this is for C++ but it should work for Fortran too ( I think.  haven't tried it)

0 포인트
Grgur
초급자
2,997 조회수

Thanks for the hint. I haven't used Instruments before, I'll give it a try.

0 포인트
Barbara_P_Intel
2,750 조회수

The ifort compiler on macOS no longer accepts the "-p" compiler option and the documentation is fixed, too. These fixes are part of oneAPI HPC Toolkit 2023.0.

Thanks for reporting the issue!



0 포인트
응답