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

Fix build errors with gcc >= 13 #1793

Merged
merged 1 commit into from
Mar 17, 2024
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
4 changes: 2 additions & 2 deletions .ci/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ cmake .. \
-DCMAKE_BUILD_TYPE=$BUILD_TYPE \
-DDART_VERBOSE=ON \
-DDART_TREAT_WARNINGS_AS_ERRORS=ON \
-DDART_BUILD_EXTRAS=ON \
-DDART_BUILD_EXTRAS=OFF \
-DDART_CODECOV=$CODECOV \
${install_prefix_option}

Expand Down Expand Up @@ -201,5 +201,5 @@ fi
if [ "$BUILD_DARTPY" = "ON" ]; then
echo $PYTHONPATH
cd $BUILD_DIR/python/examples/hello_world
python3 main.py
# python3 main.py
fi
2 changes: 1 addition & 1 deletion .ci/docs_versions.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
DART 6
v6.13.0
v6.13.1
v6.12.2
v6.11.1
v6.10.1
Expand Down
2 changes: 1 addition & 1 deletion .devcontainer/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
FROM dartsim/dart-dev:ubuntu-focal-v6.13
FROM jslee02/dart-dev:ubuntu-jammy-v6.13

13 changes: 13 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# To get started with Dependabot version updates, you'll need to specify which
# package ecosystems to update and where the package manifests are located.
# Please see the documentation for all configuration options:
# https://docs.github.com/github/administering-a-repository/configuration-options-for-dependency-updates

version: 2
updates:

# Maintain dependencies for GitHub Actions
- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "weekly"
4 changes: 2 additions & 2 deletions .github/workflows/api_doc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@ on:
jobs:
deploy:
name: API Documentation
runs-on: ubuntu-18.04
runs-on: ubuntu-latest
env:
DART_DEV_IMAGE: dartsim/dart-dev
DART_DEV_IMAGE: jslee02/dart-dev
DOCKER_TAG: bionic-docs
BUILD_TYPE: Release
COMPILER: gcc
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/ci_macos.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ on:
jobs:
build:
name: ${{ matrix.build_type }}
runs-on: macos-12
runs-on: macos-latest
strategy:
fail-fast: false
matrix:
Expand All @@ -30,7 +30,7 @@ jobs:
uses: actions/checkout@v2
- name: Install Dependencies
env:
INSTALL_OSG_HEAD: OFF # To avoid building OSG, until 3.7 is released.
INSTALL_OSG_HEAD: OFF # To avoid building OSG, until 3.7 is released.
run: .ci/install_osx.sh
- name: Build
run: sudo -E .ci/build.sh
6 changes: 3 additions & 3 deletions .github/workflows/ci_ubuntu.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ jobs:
fail-fast: false
matrix:
# Supported LTS versions
os: [ubuntu-focal, ubuntu-jammy]
os: [ubuntu-focal, ubuntu-jammy, ubuntu-noble]
build_type: [Release]
codecov: [OFF]
check_format: [OFF]
Expand All @@ -35,8 +35,8 @@ jobs:
check_format: ON
build_dartpy: ON
env:
# Hosted on: https://hub.docker.com/repository/docker/dartsim/dart-dev
DART_DEV_IMAGE: dartsim/dart-dev
# Hosted on: https://hub.docker.com/repository/docker/jslee02/dart-dev
DART_DEV_IMAGE: jslee02/dart-dev
DOCKER_TAG: ${{ matrix.os }}-v6.13
COMPILER: gcc
BUILD_TYPE: ${{ matrix.build_type }}
Expand Down
34 changes: 17 additions & 17 deletions .github/workflows/ci_windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,42 +16,42 @@ on:
jobs:
build_2022:
name: ${{ matrix.build_type }}
runs-on: windows-2022
runs-on: windows-latest
strategy:
fail-fast: false
matrix:
toolset: [""]
build_type: [Release]
# build_shared_libs: [ON, OFF] # TODO(JS): Enable once shared lib build is resolved
build_shared_libs: [OFF]
env:
BUILD_TYPE: ${{ matrix.build_type }}
VCPKG_ROOT: "C:/dartsim/vcpkg"
VCPKG_BUILD_TAG: v6.13-2022.07.25-0

steps:
- name: Checkout
uses: actions/checkout@v2
- name: Install Dependencies
shell: cmd
run: |
mkdir -p C:\dartsim
choco install -y wget
wget -q https://github.com/dartsim/vcpkg-build/releases/download/%VCPKG_BUILD_TAG%/vcpkg-dartsim-dependencies.zip
unzip -qq vcpkg-dartsim-dependencies.zip -d C:\dartsim
uses: actions/checkout@v4

- uses: johnwason/vcpkg-action@v6
with:
pkgs: assimp ccd eigen3 fcl fmt spdlog bullet3 coin-or-ipopt flann freeglut glfw3 nlopt ode opengl osg pagmo2 pybind11 tinyxml2 urdfdom
triplet: x64-windows
revision: "2024.02.14"
github-binarycache: true
token: ${{ github.token }}

- name: Install Python dependencies
run: |
python -m pip install --upgrade pip
pip install -U pytest

- name: Build
shell: cmd
run: |
mkdir build
cd build
cmake .. -G "Visual Studio 17 2022" -A x64 -Wno-dev ${{ matrix.toolset }} ^
-DCMAKE_BUILD_TYPE=%BUILD_TYPE% ^
-DCMAKE_TOOLCHAIN_FILE="%VCPKG_ROOT%/scripts/buildsystems/vcpkg.cmake" ^
-DCMAKE_BUILD_TYPE=${{ matrix.build_type }} ^
-DCMAKE_TOOLCHAIN_FILE="${{ github.workspace }}/vcpkg/scripts/buildsystems/vcpkg.cmake" ^
-DDART_MSVC_DEFAULT_OPTIONS=ON ^
-DDART_VERBOSE=ON ^
-DBUILD_SHARED_LIBS=${{ matrix.build_shared_libs }}
cmake --build . --config %BUILD_TYPE% --target ALL_BUILD --parallel
ctest --rerun-failed --output-on-failure -C %BUILD_TYPE%
cmake --build . --config ${{ matrix.build_type }} --target ALL_BUILD --parallel
ctest --rerun-failed --output-on-failure -C ${{ matrix.build_type }}
16 changes: 16 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,21 @@
# DART Changelog

## DART 6

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

* Tested Platforms

* Linux
* Ubuntu 22.04 LTS on amd64 / GCC 11.2 / amd64
* Ubuntu 24.04 LTS on amd64 / GCC 13.2 / amd64
* macOS 12 (Monterey) / AppleClang 14 / amd64
* Windows / MSVC 19.38 / amd64

* Build

* Fixed build with GCC >= 13

### [DART 6.13.1 (2024-01-04)](https://github.com/dartsim/dart/milestone/74?closed=1)

* Tested Platforms
Expand Down
17 changes: 17 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -233,6 +233,19 @@ if(MSVC)

elseif(CMAKE_COMPILER_IS_GNUCXX)

# There is a known bug in GCC 12.1 and above that leads to spurious
# -Wmaybe-uninitialized warnings from gcc/x86_64-linux-gnu/12/include/avxintrin.h and
# -Warray-bounds warnings from gcc/x86_64-linux-gnu/12/include/avx512fintrin.h.
# The bug is tracked here: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105593
# The following workaround can be removed once the bug is fixed.
if(CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 12.1)
add_compile_options(-Wno-array-bounds)
add_compile_options(-Wno-dangling-pointer)
add_compile_options(-Wno-maybe-uninitialized)
add_compile_options(-Wno-stringop-overflow)
add_compile_options(-Wno-uninitialized)
endif()

add_compile_options(-Wall -Wextra -fPIC)
if(DART_TREAT_WARNINGS_AS_ERRORS)
add_compile_options(-Werror)
Expand All @@ -242,6 +255,10 @@ elseif(CMAKE_COMPILER_IS_GNUCXX)
if(GCC_VERSION VERSION_LESS 7.3.0)
message(FATAL_ERROR "The installed g++ version is ${GCC_VERSION}. ${PROJECT_NAME} requires g++ 7.3.0 or greater.")
endif()
if(GCC_VERSION VERSION_GREATER_EQUAL 13.2.0)
# TODO: These warnings should be properly addressed and these compiler options removed
add_compile_options(-Wno-overloaded-virtual -Wno-alloc-size-larger-than -Wno-dangling-pointer)
endif()
set(CMAKE_CXX_FLAGS_RELEASE "-O3 -DNDEBUG")
set(CMAKE_CXX_FLAGS_DEBUG "-g -fno-omit-frame-pointer -fno-inline-functions -fno-inline-functions-called-once -fno-optimize-sibling-calls")
if(DART_FAST_DEBUG)
Expand Down
9 changes: 9 additions & 0 deletions dart/collision/fcl/BackwardCompatibility.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -171,6 +171,15 @@ double length(const dart::collision::fcl::Vector3& t);
/// Returns squared norm of a 3-dim vector
double length2(const dart::collision::fcl::Vector3& t);

[[nodiscard]] inline dart::collision::fcl::Transform3 getTransform3Identity()
{
#if FCL_VERSION_AT_LEAST(0, 6, 0)
return dart::collision::fcl::Transform3::Identity();
#else
return dart::collision::fcl::Transform3();
#endif
}

/// Returns translation component of a transform
dart::collision::fcl::Vector3 getTranslation(
const dart::collision::fcl::Transform3& T);
Expand Down
15 changes: 9 additions & 6 deletions dart/collision/fcl/FCLCollisionDetector.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -989,14 +989,16 @@ FCLCollisionDetector::createFCLCollisionGeometry(
// fclCollGeom.reset(new fcl::Cone(radius, height));
auto fclMesh = new ::fcl::BVHModel<fcl::OBBRSS>();
auto fclCone = fcl::Cone(radius, height);
::fcl::generateBVHModel(*fclMesh, fclCone, fcl::Transform3(), 16, 16);
::fcl::generateBVHModel(
*fclMesh, fclCone, fcl::getTransform3Identity(), 16, 16);
geom = fclMesh;
}
else
{
auto fclMesh = new ::fcl::BVHModel<fcl::OBBRSS>();
auto fclCone = fcl::Cone(radius, height);
::fcl::generateBVHModel(*fclMesh, fclCone, fcl::Transform3(), 16, 16);
::fcl::generateBVHModel(
*fclMesh, fclCone, fcl::getTransform3Identity(), 16, 16);
geom = fclMesh;
}
}
Expand All @@ -1006,7 +1008,7 @@ FCLCollisionDetector::createFCLCollisionGeometry(

const auto pyramid = std::static_pointer_cast<const PyramidShape>(shape);
// Use mesh since FCL doesn't support pyramid shape.
geom = createPyramid<fcl::OBBRSS>(*pyramid, fcl::Transform3());
geom = createPyramid<fcl::OBBRSS>(*pyramid, fcl::getTransform3Identity());
}
else if (PlaneShape::getStaticType() == shapeType)
{
Expand All @@ -1022,9 +1024,10 @@ FCLCollisionDetector::createFCLCollisionGeometry(
else
{
geom = createCube<fcl::OBBRSS>(1000.0, 0.0, 1000.0);
dtwarn << "[FCLCollisionDetector] PlaneShape is not supported by "
<< "FCLCollisionDetector. We create a thin box mesh insted, where "
<< "the size is [1000 0 1000].\n";
dtwarn
<< "[FCLCollisionDetector] PlaneShape is not supported by "
<< "FCLCollisionDetector. We create a thin box mesh instead, where "
<< "the size is [1000 0 1000].\n";
}
}
else if (MeshShape::getStaticType() == shapeType)
Expand Down
10 changes: 5 additions & 5 deletions dart/common/Memory.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -173,11 +173,11 @@ public: \
// Define static creator function that returns std::unique_ptr to the object
#define DART_DEFINE_UNIQUE_OBJECT_CREATOR(class_name) \
duke /*! Create unique instance of this class */ \
_DART_DEFINE_OBJECT_CREATOR( \
class_name, \
DART_UNIQUE_PTR_CREATOR_NAME, \
std::unique_ptr, \
::std::make_unique)
_DART_DEFINE_OBJECT_CREATOR( \
class_name, \
DART_UNIQUE_PTR_CREATOR_NAME, \
std::unique_ptr, \
::std::make_unique)

// Define static creator function that returns std::unique_ptr to the object
// where the constructor is protected
Expand Down
2 changes: 1 addition & 1 deletion dart/constraint/JointCoulombFrictionConstraint.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ double JointCoulombFrictionConstraint::getConstraintForceMixing()
//==============================================================================
void JointCoulombFrictionConstraint::update()
{
// Reset dimention
// Reset dimension
mDim = 0;

std::size_t dof = mJoint->getNumDofs();
Expand Down
2 changes: 1 addition & 1 deletion dart/constraint/JointLimitConstraint.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@ double JointLimitConstraint::getConstraintForceMixing()
//==============================================================================
void JointLimitConstraint::update()
{
// Reset dimention
// Reset dimension
mDim = 0;

const int dof = static_cast<int>(mJoint->getNumDofs());
Expand Down
2 changes: 1 addition & 1 deletion dart/constraint/ServoMotorConstraint.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ double ServoMotorConstraint::getConstraintForceMixing()
//==============================================================================
void ServoMotorConstraint::update()
{
// Reset dimention
// Reset dimension
mDim = 0;

std::size_t dof = mJoint->getNumDofs();
Expand Down
2 changes: 1 addition & 1 deletion dart/dynamics/LineSegmentShape.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -337,7 +337,7 @@ Eigen::Matrix3d LineSegmentShape::computeInertia(double _mass) const
else
{
v.normalize();
Eigen::Vector3d axis = Eigen::Vector3d::UnitZ().cross(v);
axis = Eigen::Vector3d::UnitZ().cross(v);
if (axis.norm() == 0)
{
angle = 0;
Expand Down
Loading