Skip to content

Commit

Permalink
[build] Remove support for CMake < 3.22.1 and Eigen < 3.4.0
Browse files Browse the repository at this point in the history
(cherry picked from commit 7a13a30)
  • Loading branch information
jslee02 committed Mar 22, 2024
1 parent 7bc91d9 commit 6a96ce7
Show file tree
Hide file tree
Showing 18 changed files with 98 additions and 321 deletions.
42 changes: 41 additions & 1 deletion .github/workflows/api_doc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,47 @@ jobs:
- name: Install Dependencies with cache
uses: awalsh128/[email protected]
with:
packages: build-essential libboost-all-dev clang clang-format-12 cmake curl doxygen gcovr git lcov lsb-release pkg-config software-properties-common valgrind libassimp-dev libccd-dev libeigen3-dev libfcl-dev libfmt-dev coinor-libipopt-dev freeglut3-dev libxi-dev libxmu-dev libbullet-dev libtinyxml2-dev liburdfdom-dev liburdfdom-headers-dev libopenscenegraph-dev libnlopt-cxx-dev liboctomap-dev libode-dev libspdlog-dev ocl-icd-opencl-dev libpython3-dev pybind11-dev python3 python3-dev python3-distutils python3-numpy python3-pip python3-setuptools
packages: |
build-essential
libboost-all-dev
clang
clang-format-12
cmake
curl
doxygen
gcovr
git
lcov
lsb-release
pkg-config
software-properties-common
valgrind
libassimp-dev
libeigen3-dev
libfcl-dev
libfmt-dev
coinor-libipopt-dev
freeglut3-dev
libxi-dev
libxmu-dev
libbullet-dev
libtinyxml2-dev
liburdfdom-dev
liburdfdom-headers-dev
libopenscenegraph-dev
libnlopt-cxx-dev
liboctomap-dev
libode-dev
libspdlog-dev
ocl-icd-opencl-dev
libpython3-dev
pybind11-dev
python3
python3-dev
python3-distutils
python3-numpy
python3-pip
python3-setuptools
version: 1.1

- name: Install Python dependencies
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/ci_windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ jobs:
- uses: johnwason/vcpkg-action@v6
with:
# TODO: Add ode and coin-or-ipopt
pkgs: assimp ccd eigen3 fcl fmt spdlog bullet3 freeglut glfw3 nlopt opengl osg pagmo2 tinyxml2 urdfdom
pkgs: assimp eigen3 fcl fmt spdlog bullet3 freeglut glfw3 nlopt opengl osg pagmo2 tinyxml2 urdfdom
triplet: x64-windows
revision: "2024.02.14"
github-binarycache: true
Expand Down
1 change: 0 additions & 1 deletion Brewfile
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ brew 'eigen'
brew 'fcl'
brew 'fmt'
brew 'ipopt'
brew 'libccd'
brew 'nlopt'
brew 'octomap'
brew 'ode'
Expand Down
1 change: 0 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ RUN apt-get update \
&& apt-get -y install --no-install-recommends \
libeigen3-dev \
libassimp-dev \
libccd-dev \
libfcl-dev \
libfmt-dev \
libnlopt-cxx-dev \
Expand Down
11 changes: 2 additions & 9 deletions cmake/DARTFindBullet.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,6 @@ find_package(Bullet COMPONENTS BulletMath BulletCollision MODULE QUIET)

if((BULLET_FOUND OR Bullet_FOUND) AND NOT TARGET Bullet)
add_library(Bullet INTERFACE IMPORTED)
if(CMAKE_VERSION VERSION_LESS 3.11)
set_target_properties(Bullet PROPERTIES
INTERFACE_INCLUDE_DIRECTORIES "${BULLET_INCLUDE_DIRS}"
INTERFACE_LINK_LIBRARIES "${BULLET_LIBRARIES}"
)
else()
target_include_directories(Bullet INTERFACE ${BULLET_INCLUDE_DIRS})
target_link_libraries(Bullet INTERFACE ${BULLET_LIBRARIES})
endif()
target_include_directories(Bullet INTERFACE ${BULLET_INCLUDE_DIRS})
target_link_libraries(Bullet INTERFACE ${BULLET_LIBRARIES})
endif()
20 changes: 2 additions & 18 deletions cmake/DARTFindOpenSceneGraph.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -6,19 +6,10 @@
#
# This file is provided under the "BSD-style" License

if (CMAKE_VERSION VERSION_LESS 3.12)
get_property(old_find_library_use_lib64_paths GLOBAL PROPERTY FIND_LIBRARY_USE_LIB64_PATHS)
set_property(GLOBAL PROPERTY FIND_LIBRARY_USE_LIB64_PATHS TRUE)
endif()

find_package(OpenSceneGraph 3.0 QUIET
COMPONENTS osg osgViewer osgManipulator osgGA osgDB osgShadow osgUtil
)

if (CMAKE_VERSION VERSION_LESS 3.12)
set_property(GLOBAL PROPERTY FIND_LIBRARY_USE_LIB64_PATHS ${old_find_library_use_lib64_paths})
endif()

# It seems that OPENSCENEGRAPH_FOUND will inadvertently get set to true when
# OpenThreads is found, even if OpenSceneGraph is not installed. This is quite
# possibly a bug in OSG's cmake configuration file. For now, it seems that
Expand Down Expand Up @@ -56,13 +47,6 @@ endif()
# where the system that DART is built and where the system that consumes DART.
if((OPENSCENEGRAPH_FOUND OR OpenSceneGraph_FOUND) AND NOT TARGET osg::osg)
add_library(osg::osg INTERFACE IMPORTED)
if(CMAKE_VERSION VERSION_LESS 3.11)
set_target_properties(osg::osg PROPERTIES
INTERFACE_INCLUDE_DIRECTORIES "${OPENSCENEGRAPH_INCLUDE_DIRS}"
INTERFACE_LINK_LIBRARIES "${OPENSCENEGRAPH_LIBRARIES}"
)
else()
target_include_directories(osg::osg INTERFACE ${OPENSCENEGRAPH_INCLUDE_DIRS})
target_link_libraries(osg::osg INTERFACE ${OPENSCENEGRAPH_LIBRARIES})
endif()
target_include_directories(osg::osg INTERFACE ${OPENSCENEGRAPH_INCLUDE_DIRS})
target_link_libraries(osg::osg INTERFACE ${OPENSCENEGRAPH_LIBRARIES})
endif()
3 changes: 0 additions & 3 deletions dart/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -160,9 +160,6 @@ endif()

# C++ standard settings
target_compile_features(dart PUBLIC cxx_std_17)
if(CMAKE_COMPILER_IS_GNUCXX AND CMAKE_CXX_COMPILER_VERSION VERSION_LESS 8.0)
target_link_libraries(dart PUBLIC "stdc++fs")
endif()

# Build DART with all available SIMD instructions
if(DART_ENABLE_SIMD)
Expand Down
20 changes: 2 additions & 18 deletions dart/common/Memory.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,8 @@
#include <dart/config.hpp>

#include <dart/common/Deprecated.hpp>
#include <dart/common/detail/AlignedAllocator.hpp>

#include <Eigen/Core>

#include <map>
#include <memory>
Expand All @@ -53,21 +54,6 @@ template <typename T, typename... Args>
DART_DEPRECATED(6.9)
std::unique_ptr<T> make_unique(Args&&... args);

#if EIGEN_VERSION_AT_LEAST(3, 2, 1) && EIGEN_VERSION_AT_MOST(3, 2, 8)

template <typename _Tp>
using aligned_vector
= std::vector<_Tp, dart::common::detail::aligned_allocator_cpp11<_Tp>>;

template <typename _Key, typename _Tp, typename _Compare = std::less<_Key>>
using aligned_map = std::map<
_Key,
_Tp,
_Compare,
dart::common::detail::aligned_allocator_cpp11<std::pair<const _Key, _Tp>>>;

#else

template <typename _Tp>
using aligned_vector = std::vector<_Tp, Eigen::aligned_allocator<_Tp>>;

Expand All @@ -78,8 +64,6 @@ using aligned_map = std::map<
_Compare,
Eigen::aligned_allocator<std::pair<const _Key, _Tp>>>;

#endif

} // namespace common
} // namespace dart

Expand Down
106 changes: 0 additions & 106 deletions dart/common/detail/AlignedAllocator.hpp

This file was deleted.

13 changes: 1 addition & 12 deletions dart/common/detail/Memory-impl.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -36,15 +36,10 @@
#include <dart/config.hpp>

#include <Eigen/Core>
#include <Eigen/StdVector>

#include <memory>

#if EIGEN_VERSION_AT_LEAST(3, 2, 1) && EIGEN_VERSION_AT_MOST(3, 2, 8)
#include <dart/common/detail/AlignedAllocator.hpp>
#else
#include <Eigen/StdVector>
#endif

namespace dart {
namespace common {

Expand All @@ -54,14 +49,8 @@ std::shared_ptr<_Tp> make_aligned_shared(_Args&&... __args)
{
using _Tp_nc = typename std::remove_const<_Tp>::type;

#if EIGEN_VERSION_AT_LEAST(3, 2, 1) && EIGEN_VERSION_AT_MOST(3, 2, 8)
return std::allocate_shared<_Tp>(
detail::aligned_allocator_cpp11<_Tp_nc>(),
std::forward<_Args>(__args)...);
#else
return std::allocate_shared<_Tp>(
Eigen::aligned_allocator<_Tp_nc>(), std::forward<_Args>(__args)...);
#endif // EIGEN_VERSION_AT_LEAST(3,2,1) && EIGEN_VERSION_AT_MOST(3,2,8)
}

//==============================================================================
Expand Down
2 changes: 2 additions & 0 deletions dart/common/detail/SharedLibraryManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,8 @@

#include <fstream>

#include <cassert>

namespace dart {
namespace common {
namespace detail {
Expand Down
Loading

0 comments on commit 6a96ce7

Please sign in to comment.