Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove Boost dependency #1651

Merged
merged 1 commit into from
Jan 15, 2022
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
2 changes: 1 addition & 1 deletion .github/workflows/ci_windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ jobs:
env:
BUILD_TYPE: ${{ matrix.build_type }}
VCPKG_ROOT: "C:/dartsim/vcpkg"
VCPKG_BUILD_TAG: v0.2.0-70f192e
VCPKG_BUILD_TAG: v6.13-c973b49-1
steps:
- name: Checkout
uses: actions/checkout@v2
Expand Down
2 changes: 1 addition & 1 deletion Brewfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@ brew 'cmake'
brew 'pkg-config'

brew 'assimp'
brew 'boost'
brew 'bullet'
brew 'eigen'
brew 'fcl'
brew 'fmt'
brew 'flann'
brew 'ipopt'
brew 'libccd'
Expand Down
8 changes: 7 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,12 @@

### [DART 6.13.0 (TBD)](https://github.com/dartsim/dart/milestone/69?closed=1)

* Dependency

* Added required dependencies: fmt
* Added optional dependencies: spdlog
* Removed required dependencies: Boost

* Build

* Dropped supporting FCL < 0.5: [#1647](https://github.com/dartsim/dart/pull/1647)
Expand All @@ -12,7 +18,7 @@
* Added spdlog support as underlying logging framework: [#1633](https://github.com/dartsim/dart/pull/1633)
* Added custom memory allocators: [#1636](https://github.com/dartsim/dart/pull/1636), [#1637](https://github.com/dartsim/dart/pull/1637), [#1639](https://github.com/dartsim/dart/pull/1639), [#1645](https://github.com/dartsim/dart/pull/1645), [#1646](https://github.com/dartsim/dart/pull/1646)
* Added Stopwatch class to replace Timer: [#1638](https://github.com/dartsim/dart/pull/1638)
* Removed use of boos::filesystem and boost::optional: [#1648](https://github.com/dartsim/dart/pull/1648)
* Removed Boost dependency: [#1648](https://github.com/dartsim/dart/pull/1648), [#1651](https://github.com/dartsim/dart/pull/1651)

* Dynamics

Expand Down
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ string(REGEX REPLACE "^<version>([0-9]+)\\.([0-9]+)\\.([0-9]+)</version>$" "\\3"
set(DART_VERSION "${DART_MAJOR_VERSION}.${DART_MINOR_VERSION}.${DART_PATCH_VERSION}")

set(DART_PKG_DESC "Dynamic Animation and Robotics Toolkit.")
set(DART_PKG_EXTERNAL_DEPS "eigen, ccd, fcl, assimp, boost")
set(DART_PKG_EXTERNAL_DEPS "eigen, ccd, fcl, assimp")

#===============================================================================
# Build options
Expand Down
3 changes: 2 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ RUN apt-get update \
libassimp-dev \
libccd-dev \
libfcl-dev \
libboost-all-dev \
libfmt-dev \
libnlopt-cxx-dev \
coinor-libipopt-dev \
libbullet-dev \
Expand All @@ -34,6 +34,7 @@ RUN apt-get update \
libxmu-dev \
freeglut3-dev \
libopenscenegraph-dev \
libspdlog-dev \
&& rm -rf /var/lib/apt/lists/*

# Install dartpy dependencies
Expand Down
36 changes: 0 additions & 36 deletions cmake/DARTFindBoost.cmake

This file was deleted.

7 changes: 4 additions & 3 deletions cmake/DARTFindDependencies.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,10 @@ if(DART_VERBOSE)
message(STATUS "[ Required dependencies for DART core ]")
endif()

# fmt
dart_find_package(fmt)
dart_check_required_package(fmt "libfmt")

# Eigen
dart_find_package(Eigen3)
dart_check_required_package(EIGEN3 "eigen3")
Expand Down Expand Up @@ -85,9 +89,6 @@ if(ASSIMP_FOUND)
unset(CMAKE_REQUIRED_LIBRARIES)
endif()

# Boost
dart_find_package(Boost)

# octomap
dart_find_package(octomap)
if(MSVC)
Expand Down
9 changes: 9 additions & 0 deletions cmake/DARTFindfmt.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# Copyright (c) 2011-2022, The DART development contributors
# All rights reserved.
#
# The list of contributors can be found at:
# https://github.com/dartsim/dart/blob/master/LICENSE
#
# This file is provided under the "BSD-style" License

find_package(fmt)
10 changes: 4 additions & 6 deletions dart/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,8 @@ set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY "${DART_BINARY_DIR}/lib")
# Targets - {dependency targets}, source directories, [external dependency libs]
#===============================================================================
# dart - common, math, integration, lcpsolver, optimizer, dynamics, collision,
# collision/dart, collision/fcl, constraint, simulation, [eigen3, libccd,
# fcl, assimp, boost]
# collision/dart, collision/fcl, constraint, simulation, [assimp, eigen3,
# fcl, fmt, libccd]
# dart-optimizer-ipopt - {dart}, optimizer/ipopt, [ipopt]
# dart-optimizer-nlopt - {dart}, optimizer/nlopt, [nlopt]
# dart-collision-bullet - {dart}, collision/bullet, [bullet]
Expand Down Expand Up @@ -131,10 +131,8 @@ target_link_libraries(dart
Eigen3::Eigen
ccd
fcl
fmt::fmt
assimp
Boost::boost
Boost::system
Boost::filesystem
)

# spdlog settings
Expand Down Expand Up @@ -207,7 +205,7 @@ endif()
add_component_targets(${PROJECT_NAME} dart dart)
add_component_dependencies(${PROJECT_NAME} dart external-odelcpsolver)
add_component_dependency_packages(${PROJECT_NAME} dart
Eigen3 ccd fcl assimp Boost
assimp Eigen3 ccd fcl fmt
)
if(TARGET octomap)
add_component_dependency_packages(${PROJECT_NAME} dart octomap)
Expand Down
106 changes: 106 additions & 0 deletions dart/common/String.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,106 @@
/*
* Copyright (c) 2011-2022, The DART development contributors
* All rights reserved.
*
* The list of contributors can be found at:
* https://github.com/dartsim/dart/blob/master/LICENSE
*
* This file is provided under the following "BSD-style" License:
* Redistribution and use in source and binary forms, with or
* without modification, are permitted provided that the following
* conditions are met:
* * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* * Redistributions in binary form must reproduce the above
* copyright notice, this list of conditions and the following
* disclaimer in the documentation and/or other materials provided
* with the distribution.
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND
* CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES,
* INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
* USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
* AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
* ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*/

#include "dart/common/String.hpp"

#include <algorithm>

namespace dart::common {

//==============================================================================
std::string toUpper(std::string str)
{
toUpperInPlace(str);
return str;
}

//==============================================================================
void toUpperInPlace(std::string& str)
{
std::transform(str.begin(), str.end(), str.begin(), ::toupper);
}

//==============================================================================
std::string toLower(std::string str)
{
toLowerInPlace(str);
return str;
}

//==============================================================================
void toLowerInPlace(std::string& str)
{
std::transform(str.begin(), str.end(), str.begin(), ::tolower);
}

//==============================================================================
std::string trim(const std::string& str, const std::string& whitespaces)
{
return trimRight(trimLeft(str, whitespaces), whitespaces);
}

//==============================================================================
std::string trimLeft(const std::string& str, const std::string& whitespaces)
{
size_t startpos = str.find_first_not_of(whitespaces);
return (startpos == std::string::npos) ? "" : str.substr(startpos);
}

//==============================================================================
std::string trimRight(const std::string& str, const std::string& whitespaces)
{
size_t endpos = str.find_last_not_of(whitespaces);
return (endpos == std::string::npos) ? "" : str.substr(0, endpos + 1);
}

//==============================================================================
std::vector<std::string> split(
const std::string& str, const std::string& delimiters)
{
std::vector<std::string> tokens;
std::size_t start = str.find_first_not_of(delimiters), end = 0;

while ((end = str.find_first_of(delimiters, start)) != std::string::npos)
{
tokens.push_back(str.substr(start, end - start));
start = str.find_first_not_of(delimiters, end);
}

if (start != std::string::npos)
{
tokens.push_back(str.substr(start));
}

return tokens;
}

} // namespace dart::common
71 changes: 71 additions & 0 deletions dart/common/String.hpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
/*
* Copyright (c) 2011-2022, The DART development contributors
* All rights reserved.
*
* The list of contributors can be found at:
* https://github.com/dartsim/dart/blob/master/LICENSE
*
* This file is provided under the following "BSD-style" License:
* Redistribution and use in source and binary forms, with or
* without modification, are permitted provided that the following
* conditions are met:
* * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* * Redistributions in binary form must reproduce the above
* copyright notice, this list of conditions and the following
* disclaimer in the documentation and/or other materials provided
* with the distribution.
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND
* CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES,
* INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
* USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
* AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
* ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*/

#ifndef DART_COMMON_STRING_HPP_
#define DART_COMMON_STRING_HPP_

#include <string>
#include <vector>

namespace dart::common {

/// Converts string to upper cases
std::string toUpper(std::string str);

/// Converts string to upper cases in place
void toUpperInPlace(std::string& str);

/// Converts string to lower cases
std::string toLower(std::string str);

/// Converts string to lower cases in place
void toLowerInPlace(std::string& str);

/// Trims both sides of string
std::string trim(
const std::string& str, const std::string& whitespaces = " \n\r\t");

/// Trims left side of string
std::string trimLeft(
const std::string& str, const std::string& whitespaces = " \n\r\t");

/// Trims right side of string
std::string trimRight(
const std::string& str, const std::string& whitespaces = " \n\r\t");

/// Splits string given delimiters
std::vector<std::string> split(
const std::string& str, const std::string& delimiters = " \n\r\t");

} // namespace dart::common

#endif // DART_COMMON_STRING_HPP_
Loading