Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 9 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ on:

env:
vcpkg_robotology_TAG: v0.4.0
vcpkg_TAG: 222c35e3bcb8f28cd63fc526e591bb4ef6b99e4f
YCM_TAG: v0.11.1
YARP_TAG: 964bb26fa4791d83d72882711ea7509306248106
iDynTree_TAG: v1.1.0
Expand Down Expand Up @@ -61,9 +62,14 @@ jobs:
# Overwrite the VCPKG_INSTALLATION_ROOT env variable defined by GitHub Actions to point to our vcpkg
echo "::set-env name=VCPKG_INSTALLATION_ROOT::C:/robotology/vcpkg"

# Install Catch2
# Install Catch2 and cppad
cd C:/robotology/vcpkg
./vcpkg.exe install --overlay-ports=C:/robotology/robotology-vcpkg-binary-ports catch2:x64-windows
git fetch
git checkout $env:vcpkg_TAG
./bootstrap-vcpkg.bat
./vcpkg.exe install --overlay-ports=C:/robotology/robotology-vcpkg-binary-ports catch2:x64-windows cppad:x64-windows
echo "::set-env name=cppad_DIR::C:/robotology/vcpkg/installed/x64-windows"


- name: Dependencies [macOS]
if: matrix.os == 'macOS-latest'
Expand All @@ -85,7 +91,7 @@ jobs:
with:
path: ${{ github.workspace }}/install/deps
# Including ${{ runner.temp }} is a workaround taken from https://github.com/robotology/whole-body-estimators/pull/62 to fix macos configuration failure on https://github.com/dic-iit/bipedal-locomotion-framework/pull/45
key: source-deps-${{ runner.os }}-${{runner.temp}}-build-type-${{ matrix.build_type }}-vcpkg-robotology-${{ env.vcpkg_robotology_TAG }}-ycm-${{ env.YCM_TAG }}-yarp-${{ env.YARP_TAG }}-iDynTree-${{ env.iDynTree_TAG }}-catch2-${{ env.Catch2_TAG }}-qhull-${{ env.Qhull_TAG }}-casADi-${{ env.CasADi_TAG }}-manif-${{ env.manif_TAG }}
key: source-deps-${{ runner.os }}-${{runner.temp}}-build-type-${{ matrix.build_type }}-vcpkg-${{ env.vcpkg_TAG }}-vcpkg-robotology-${{ env.vcpkg_robotology_TAG }}-ycm-${{ env.YCM_TAG }}-yarp-${{ env.YARP_TAG }}-iDynTree-${{ env.iDynTree_TAG }}-catch2-${{ env.Catch2_TAG }}-qhull-${{ env.Qhull_TAG }}-casADi-${{ env.CasADi_TAG }}-manif-${{ env.manif_TAG }}


- name: Source-based Dependencies [Windows]
Expand Down
48 changes: 47 additions & 1 deletion cmake/Findcppad.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,53 @@ if(NOT WIN32)

# Windows platforms
else()
message(WARNING "Windows is not supported yet.")

find_package(PkgConfig QUIET)
if(PKG_CONFIG_FOUND)

if(cppad_FIND_VERSION)
if(cppad_FIND_VERSION_EXACT)
pkg_check_modules(_PC_cppad QUIET cppad=${cppad_FIND_VERSION})
else()
pkg_check_modules(_PC_cppad QUIET cppad>=${cppad_FIND_VERSION})
endif()
else()
pkg_check_modules(_PC_cppad QUIET cppad)
endif()

if(_PC_cppad_FOUND)
set(cppad_INCLUDE_DIRS ${_PC_cppad_INCLUDE_DIRS} CACHE PATH "cppad include directory")
set(cppad_DEFINITIONS ${_PC_cppad_CFLAGS} CACHE STRING "Additional compiler flags for cppad")

find_library(${_PC_cppad_LIBRARIES}_PATH
NAMES ${_PC_cppad_LIBRARIES}
PATHS ${_PC_cppad_LIBRARY_DIRS})

set(cppad_LIBRARIES ${${_PC_cppad_LIBRARIES}_PATH} CACHE PATH "cppad libraries" FORCE)

else()
set(cppad_DEFINITIONS "")
endif()

endif()

set(cppad_LINK_FLAGS "")

# If pkg-config fails, try to find the package using cppad_DIR
if(NOT _PC_cppad_FOUND)
set(cppad_DIR $ENV{cppad_DIR} CACHE PATH "Path to cppad build directory")

find_path(cppad_INCLUDE_DIRS
NAMES cppad.hpp PATH_SUFFIXES cppad PATHS ${cppad_DIR}/include/cppad)

find_library(cppad_LIBRARIES
NAMES cppad cppad_lib
PATHS ${cppad_DIR}/lib ${cppad_DIR}/lib/cppad)

set(cppad_DEFINITIONS "")
set(cppad_LINK_FLAGS "")
endif()

endif()


Expand Down
2 changes: 1 addition & 1 deletion src/AutoDiff/tests/CppADTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ TEST_CASE("CppAD and Eigen")
Eigen::Map<Eigen::Matrix<double, 3, 3, Eigen::RowMajor>> jacMatrix(jac.data());

// Compute the analytic Jacobian
auto analyticJacobian = [&a, &b](const Eigen::Ref<Eigen::Vector3d>& x) -> Eigen::Matrix3d {
auto analyticJacobian = [&a, &b, &c](const Eigen::Ref<Eigen::Vector3d>& x) -> Eigen::Matrix3d {
Eigen::Vector3d jacobian;
jacobian = a + c * b * (b * x.array()).cos();
return jacobian.asDiagonal();
Expand Down