Boost logo

Boost :

Subject: [boost] [profile_templates] template profiling on darwin
From: Gordon Woodhull (gordon_at_[hidden])
Date: 2011-05-29 19:48:13


Hey Steven,

Thanks for your help getting the template profiler working on darwin.

I just had to make a couple more obvious config copy/pastes to get this working - my diffs are below.

Also, it appears that the tool is broken for gcc < 4.3 - it looks like some changes were made halfway for template_profiler_test{_enter|_exit} but still some undefined references to template_profiler_test.

I mucked about with this for a few minutes, then gave up and upgraded to gcc 4.5, updated my simlinks, and darwin configuration works ok now. Now I've got LOTS of data to wade through (65K template instantiations for a very small MSM test!)

Thanks again,
Gordon

Index: template-profile.jam
===================================================================
--- template-profile.jam (revision 72066)
+++ template-profile.jam (working copy)
@@ -53,6 +53,22 @@
 
 }
 
+module darwin {
+ import template-profile : init-toolset ;
+ template-profile.init-toolset darwin ;
+
+ actions compile.c++.preprocess {
+ $(CONFIG_COMMAND) $(OPTIONS) $(USER_OPTIONS) -D$(DEFINES) -I"$(INCLUDES)" -E "$(>)" | $(INSTRUMENT-ACTION) >"$(<)"
+ }
+
+ actions compile.c++.template-profile {
+ "$(CONFIG_COMMAND)" $(LANG) -ftemplate-depth-$(TEMPLATE_DEPTH) $(OPTIONS) $(USER_OPTIONS) -D$(DEFINES) -D PROFILE_TEMPLATES -I"$(INCLUDES)" -c "$(>:W)" 2>&1 | "$(FILTER)" $(FILTER-OPTIONS) >"$(<)"
+ }
+}
+
+IMPORT gcc : compile.c++.preprocess : darwin : compile.c++.preprocess ;
+IMPORT gcc : compile.c++.template-profile : darwin : compile.c++.template-profile ;
+
 module msvc {
 
     import template-profile : init-toolset ;
@@ -88,6 +104,8 @@
                 toolset = msvc ;
             case gcc* :
                 toolset = gcc ;
+ case darwin* :
+ toolset = darwin ;
             case * :
                 errors.error unrecognized toolset $(toolset) ;
         }
@@ -124,6 +142,7 @@
 
 generators.register [ class.new warn-generator msvc.compile.c++.template-profile : INSTRUMENTED_TEMPLATE_PREPROCESSED_CPP : RAW_TEMPLATE_PROFILE : <toolset>msvc ] ;
 generators.register [ class.new warn-generator gcc.compile.c++.template-profile : INSTRUMENTED_TEMPLATE_PREPROCESSED_CPP : RAW_TEMPLATE_PROFILE : <toolset>gcc ] ;
+generators.register [ class.new warn-generator darwin.compile.c++.template-profile : INSTRUMENTED_TEMPLATE_PREPROCESSED_CPP : RAW_TEMPLATE_PROFILE : <toolset>darwin ] ;
 
 class final-profile-generator : generator {


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk