Verified Commit 86d6517d authored by Justin Carpentier's avatar Justin Carpentier
Browse files

core: fix packaging of autodiff and codegen plugins

parent 47ae2f83
......@@ -114,25 +114,13 @@ IF(BUILD_WITH_AUTODIFF_SUPPORT)
# Check first CppADCodeGen
IF(BUILD_WITH_CODEGEN_SUPPORT)
ADD_PROJECT_DEPENDENCY(cppadcg 2.4.1 REQUIRED PKG_CONFIG_REQUIRES "cppadcg >= 2.4.1") # CppADCodeGen 2.4.1 is the first version to check the minimal version of CppAD
IF(CPPADCG_FOUND AND BUILD_WITH_CODEGEN_SUPPORT)
ADD_DEFINITIONS(-DPINOCCHIO_WITH_CPPADCG_SUPPORT)
PKG_CONFIG_APPEND_CFLAGS("-DPINOCCHIO_WITH_CPPADCG_SUPPORT")
ENDIF(CPPADCG_FOUND AND BUILD_WITH_CODEGEN_SUPPORT)
ENDIF(BUILD_WITH_CODEGEN_SUPPORT)
ADD_PROJECT_DEPENDENCY(cppad 20180000.0 REQUIRED PKG_CONFIG_REQUIRES "cppad >= 20180000.0")
ADD_DEFINITIONS(-DPINOCCHIO_WITH_CPPAD_SUPPORT)
PKG_CONFIG_APPEND_CFLAGS("-DPINOCCHIO_WITH_CPPAD_SUPPORT")
IF(NOT ${EIGEN3_VERSION} VERSION_GREATER "3.3.0")
ADD_DEFINITIONS(-DPINOCCHIO_CPPAD_REQUIRES_MATRIX_BASE_PLUGIN)
PKG_CONFIG_APPEND_CFLAGS("-DPINOCCHIO_CPPAD_REQUIRES_MATRIX_BASE_PLUGIN")
ENDIF(NOT ${EIGEN3_VERSION} VERSION_GREATER "3.3.0")
ENDIF(BUILD_WITH_AUTODIFF_SUPPORT)
IF(BUILD_WITH_CASADI_SUPPORT)
ADD_PROJECT_DEPENDENCY(casadi 3.4.5 REQUIRED PKG_CONFIG_REQUIRES "casadi >= 3.4.5")
ADD_DEFINITIONS(-DPINOCCHIO_WITH_CASADI_SUPPORT)
PKG_CONFIG_APPEND_CFLAGS("-DPINOCCHIO_WITH_CASADI_SUPPORT")
ENDIF(BUILD_WITH_CASADI_SUPPORT)
SET(BOOST_REQUIRED_COMPONENTS filesystem serialization system)
......
//
// Copyright (c) 2016-2019 CNRS, INRIA
// Copyright (c) 2016-2020 CNRS, INRIA
//
#ifndef __pinocchio_aba_hxx__
#define __pinocchio_aba_hxx__
#ifdef PINOCCHIO_WITH_CPPAD_SUPPORT
#include "pinocchio/autodiff/cppad.hpp"
#endif
#include "pinocchio/spatial/act-on-set.hpp"
#include "pinocchio/multibody/visitor.hpp"
#include "pinocchio/algorithm/check.hpp"
......
......@@ -5,6 +5,8 @@
#ifndef __pinocchio_autodiff_casadi_hpp__
#define __pinocchio_autodiff_casadi_hpp__
#define PINOCCHIO_WITH_CASADI_SUPPORT
#include "pinocchio/math/fwd.hpp"
#include <casadi/casadi.hpp>
......
......@@ -2,19 +2,18 @@
// Copyright (c) 2018-2020 CNRS INRIA
//
#ifndef __pinocchio_autodiff_ccpad_hpp__
#define __pinocchio_autodiff_ccpad_hpp__
#ifndef __pinocchio_autodiff_cppad_hpp__
#define __pinocchio_autodiff_cppad_hpp__
#include "pinocchio/math/fwd.hpp"
#define PINOCCHIO_WITH_CPPAD_SUPPORT
// Do not include this file directly.
// Copy and use directly the intructions from <cppad/example/cppad_eigen.hpp>
// to avoid redifinition of EIGEN_MATRIXBASE_PLUGIN for Eigen 3.3.0 and later
//#include <cppad/example/cppad_eigen.hpp>
#ifdef PINOCCHIO_CPPAD_REQUIRES_MATRIX_BASE_PLUGIN
#define EIGEN_MATRIXBASE_PLUGIN <cppad/example/eigen_plugin.hpp>
#endif
#define EIGEN_MATRIXBASE_PLUGIN <pinocchio/autodiff/cppad/math/eigen_plugin.hpp>
#include <cppad/cppad.hpp>
#include <Eigen/Dense>
......@@ -178,4 +177,4 @@ namespace pinocchio
#include "pinocchio/autodiff/cppad/utils/static-if.hpp"
#include "pinocchio/autodiff/cppad/math/quaternion.hpp"
#endif // #ifndef __pinocchio_autodiff_ccpad_hpp__
#endif // #ifndef __pinocchio_autodiff_cppad_hpp__
#if !EIGEN_VERSION_AT_LEAST(3,3,3)
typedef Scalar value_type;
#endif
//
// Copyright (c) 2018 CNRS
// Copyright (c) 2018-2020 CNRS INRIA
//
#ifndef __pinocchio_utils_code_generator_base_hpp__
......@@ -10,8 +10,6 @@
#include "pinocchio/multibody/model.hpp"
#include "pinocchio/multibody/data.hpp"
#ifdef PINOCCHIO_WITH_CPPADCG_SUPPORT
namespace pinocchio
{
......@@ -178,6 +176,4 @@ namespace pinocchio
} // namespace pinocchio
#endif // PINOCCHIO_WITH_CPPADCG_SUPPORT
#endif // ifndef __pinocchio_utils_code_generator_base_hpp__
......@@ -5,6 +5,8 @@
#ifndef __pinocchio_codegen_ccpadcg_hpp__
#define __pinocchio_codegen_ccpadcg_hpp__
#define PINOCCHIO_WITH_CPPADCG_SUPPORT
#include "pinocchio/math/fwd.hpp"
#include <cmath>
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment