diff --git a/src/math/fwd.hpp b/src/math/fwd.hpp
index bdd0a157ae94ed2031e645a7149c6388da001728..53cf0c62c2bb529fed03d435169f5b3d1a543cd4 100644
--- a/src/math/fwd.hpp
+++ b/src/math/fwd.hpp
@@ -22,6 +22,23 @@
 #include <math.h>
 #include <boost/math/constants/constants.hpp>
 
+#ifdef PINOCCHIO_WITH_CPPAD_SUPPORT
+namespace boost
+{
+  namespace math
+  {
+    namespace constants
+    {
+      namespace detail
+      {
+        template<typename Scalar>
+        struct constant_pi< CppAD::AD<Scalar> > : constant_pi<Scalar> {};
+      }
+    }
+  }
+}
+#endif
+
 namespace se3
 {
   ///