Skip to content

Commit 958f67c

Browse files
Added gprof profiling option
1 parent 38cb78b commit 958f67c

File tree

2 files changed

+13
-4
lines changed

2 files changed

+13
-4
lines changed

SU2_CFD/src/meson.build

+11-3
Original file line numberDiff line numberDiff line change
@@ -189,6 +189,11 @@ su2_cfd_src += files(['iteration/CIteration.cpp',
189189

190190
su2_cfd_src += files(['limiters/CLimiterDetails.cpp'])
191191

192+
profiling_args = []
193+
if get_option('enable-gprof')
194+
profiling_args = ['-pg','-no-pie']
195+
endif
196+
192197
if get_option('enable-normal')
193198
su2_cfd_lib = static_library('SU2core',
194199
su2_cfd_src,
@@ -201,7 +206,8 @@ if get_option('enable-normal')
201206
'SU2_CFD.cpp',
202207
install : true,
203208
dependencies : [su2_cfd_dep, su2_deps, common_dep],
204-
cpp_args: ['-fPIC'] + [default_warning_flags, su2_cpp_args])
209+
cpp_args: ['-fPIC'] + [default_warning_flags, su2_cpp_args] + profiling_args,
210+
link_args: profiling_args)
205211
endif
206212

207213
if get_option('enable-autodiff')
@@ -216,7 +222,8 @@ if get_option('enable-autodiff')
216222
'SU2_CFD.cpp',
217223
install : true,
218224
dependencies : [su2_cfd_dep_ad, su2_deps, codi_dep, commonAD_dep],
219-
cpp_args: ['-fPIC'] + [default_warning_flags, su2_cpp_args, codi_rev_args])
225+
cpp_args: ['-fPIC'] + [default_warning_flags, su2_cpp_args, codi_rev_args] + profiling_args,
226+
link_args: profiling_args)
220227
endif
221228

222229
if get_option('enable-directdiff')
@@ -231,6 +238,7 @@ if get_option('enable-directdiff')
231238
'SU2_CFD.cpp',
232239
install : true,
233240
dependencies : [su2_cfd_dep_dd, su2_deps, codi_dep, commonDD_dep],
234-
cpp_args: ['-fPIC'] + [default_warning_flags, su2_cpp_args, codi_for_args])
241+
cpp_args: ['-fPIC'] + [default_warning_flags, su2_cpp_args, codi_for_args] + profiling_args,
242+
link_args: profiling_args)
235243
endif
236244

meson_options.txt

+2-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,8 @@ option('extra-deps', type : 'string', value : '', description: 'comma-separated
2020
option('enable-mpp', type : 'boolean', value : false, description: 'enable Mutation++ support')
2121
option('install-mpp', type : 'boolean', value : false, description: 'install Mutation++ in the directory defined with --prefix')
2222
option('enable-coolprop', type : 'boolean', value : false, description: 'enable CoolProp support')
23-
option('enable-mlpcpp', type : 'boolean', value : false, description: 'enable MLPCpp support')
23+
option('enable-mlpcpp', type : 'boolean', value : false, description: 'enable profiling through gprof')
24+
option('enable-gprof', type : 'boolean', value : false, description: 'enable MLPCpp support')
2425
option('opdi-backend', type : 'combo', choices : ['auto', 'macro', 'ompt'], value : 'auto', description: 'OpDiLib backend choice')
2526
option('codi-tape', type : 'combo', choices : ['JacobianLinear', 'JacobianReuse', 'JacobianMultiUse', 'PrimalLinear', 'PrimalReuse', 'PrimalMultiUse'], value : 'JacobianLinear', description: 'CoDiPack tape choice')
2627
option('opdi-shared-read-opt', type : 'boolean', value : true, description : 'OpDiLib shared reading optimization')

0 commit comments

Comments
 (0)