diff --git a/src/path-planner/states-path-finder.cc b/src/path-planner/states-path-finder.cc
index 1cb04b6c61167bbdea28249767d1cbadb7d64c85..4a807c5396ec7acddddafd4b228ef77f77d8a02d 100644
--- a/src/path-planner/states-path-finder.cc
+++ b/src/path-planner/states-path-finder.cc
@@ -69,8 +69,13 @@ namespace hpp {
       using graph::LockedJoints_t;
       using graph::segments_t;
 
-      static void displayRoadmap(const core::RoadmapPtr_t& roadmap)
+      static void displayRoadmap(const core::RoadmapPtr_t&
+#ifdef HPP_DEBUG
+                                 roadmap
+#endif
+                                 )
       {
+#ifdef HPP_DEBUG
         unsigned i=0;
         for (auto cc : roadmap->connectedComponents()){
           hppDout(info, " CC " << i); ++i;
@@ -78,6 +83,7 @@ namespace hpp {
             hppDout(info, pinocchio::displayConfig(*(n->configuration())));
           }
         }
+#endif
       }
 
       StatesPathFinder::StatesPathFinder(const core::ProblemConstPtr_t& problem,