[Insight-developers] gcc compilation flag conflict when profiling with gprof
Williams, Norman K
norman-k-williams at uiowa.edu
Thu Jul 28 12:17:41 EDT 2011
We're tracking the HDF5 releases, so that bit of silliness is actually in
a third party CMakeLists.txt, I think.The HDF group is very concerned with
performance, since HDF is used on gigantic datasets, so they probably
stuck this in, thinking it would be faster.
We already have to turn off -fopenmp in order for HDF5 to link properly on
OS X, so I think we should remove -pg at the same time. You want to
profile ITK, not HDF5, right?
On 7/25/11 3:54 PM, "gang song" <songgang97 at gmail.com> wrote:
>Hi,
>
>I am trying to profile ITK codes using gprof in Linux, which needs to
>add flag -pg in gcc compilation and linking. However, -pg conflicts
>with -fomit-frame-pointer. Here is what I added in ccmake:
>CMAKE_CXX_FLAGS -pg
>CMAKE_C_FLAGS -pg
>CMAKE_EXE_LINKER_FLAGS -pg
>
>
>[ 44%] Building C object
>Modules/ThirdParty/HDF5/src/itkhdf5/src/CMakeFiles/H5make_libsettings.dir/
>H5make_libsettings.c.o
>gcc: -pg and -fomit-frame-pointer are incompatible
>make[3]: ***
>[Modules/ThirdParty/HDF5/src/itkhdf5/src/CMakeFiles/H5make_libsettings.dir
>/H5make_libsettings.c.o]
>Error 1
>make[2]: ***
>[Modules/ThirdParty/HDF5/src/itkhdf5/src/CMakeFiles/H5make_libsettings.dir
>/all]
>Error 2
>make[1]: ***
>[Modules/Registration/Refactoring/test/CMakeFiles/ITK-RegistrationRefactor
>ingTestDriver.dir/rule]
>Error 2
>make: *** [ITK-RegistrationRefactoringTestDriver] Error 2
>
>-fomit-frame-pointer is used in
>ITK/Modules/ThirdParty/HDF5/src/itkhdf5/CMakeLists.txt, line 361. ITK
>compiles fine if removing it:
>
>IF (CMAKE_COMPILER_IS_GNUCC)
># SET (CMAKE_C_FLAGS "${CMAKE_ANSI_CFLAGS} ${CMAKE_C_FLAGS} -std=c99
>-fomit-frame-pointer -finline-functions -fno-common")
>SET (CMAKE_C_FLAGS "${CMAKE_ANSI_CFLAGS} ${CMAKE_C_FLAGS} -std=c99
>-finline-functions -fno-common")
>ENDIF (CMAKE_COMPILER_IS_GNUCC)
>
>
>Is this a good way to make "-pg" flag working?
>
>
>Thanks
>
>-Gang
>_______________________________________________
>Powered by www.kitware.com
>
>Visit other Kitware open-source projects at
>http://www.kitware.com/opensource/opensource.html
>
>Kitware offers ITK Training Courses, for more information visit:
>http://kitware.com/products/protraining.html
>
>Please keep messages on-topic and check the ITK FAQ at:
>http://www.itk.org/Wiki/ITK_FAQ
>
>Follow this link to subscribe/unsubscribe:
>http://www.itk.org/mailman/listinfo/insight-developers
________________________________
Notice: This UI Health Care e-mail (including attachments) is covered by the Electronic Communications Privacy Act, 18 U.S.C. 2510-2521, is confidential and may be legally privileged. If you are not the intended recipient, you are hereby notified that any retention, dissemination, distribution, or copying of this communication is strictly prohibited. Please reply to the sender that you have received the message in error, then delete it. Thank you.
________________________________
More information about the Insight-developers
mailing list