Skip to content

Commit

Permalink
Merge branch 'master' into fds_upstream
Browse files Browse the repository at this point in the history
  • Loading branch information
jslee02 authored Oct 17, 2020
2 parents 5c2e209 + 202bad5 commit 3e4ee1f
Show file tree
Hide file tree
Showing 20 changed files with 315 additions and 187 deletions.
41 changes: 15 additions & 26 deletions .appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,9 @@ platform: x64

# specify custom environment variables
environment:
VCPKG_BUILD_TAG: v0.2.0-70f192e
MSVC_DEFAULT_OPTIONS: ON
CMAKE_TOOLCHAIN_FILE: -DCMAKE_TOOLCHAIN_FILE="C:\tools\vcpkg\scripts\buildsystems\vcpkg.cmake"
CMAKE_TOOLCHAIN_FILE: -DCMAKE_TOOLCHAIN_FILE="C:\dartsim\vcpkg\scripts\buildsystems\vcpkg.cmake"
matrix:
- CMAKE_GENERATOR: -G"Visual Studio 16 2019"
CMAKE_TOOLCHAIN: -T"v142"
Expand All @@ -37,27 +38,12 @@ install:
#------------------
# Windows 10
#------------------
# update vcpkg
# - cmd: cd C:\tools\vcpkg
# - cmd: git pull
# - cmd: .\bootstrap-vcpkg.bat

- cmd: if "%platform%"=="Win32" set VCPKG_ARCH=x86-windows
- cmd: if "%platform%"=="x64" set VCPKG_ARCH=x64-windows

# remove outdated versions
# - cmd: vcpkg remove --outdated --recurse

# install required dependencies
- cmd: vcpkg install --recurse --triplet %VCPKG_ARCH% assimp boost-system boost-filesystem ccd eigen3 fcl

# install optional dependencies
# 'dart-utils' needs tinyxml2 and boost algorithm/lexical-cast
# and also boost-math to resolve a circular dependency with lexical-cast
- cmd: vcpkg install --recurse --triplet %VCPKG_ARCH% boost-algorithm boost-lexical-cast boost-math bullet3 freeglut ode opengl tinyxml2
#- vcpkg install --recurse --triplet %VCPKG_ARCH% flann ipopt nlopt osg urdfdom

- cmd: vcpkg integrate install
- cmd: mkdir -p C:\dartsim
- cmd: choco install -y wget
- cmd: wget -q https://github.com/dartsim/vcpkg-build/releases/download/%VCPKG_BUILD_TAG%/vcpkg-dartsim-dependencies.zip
- cmd: unzip -qq vcpkg-dartsim-dependencies.zip -d C:\dartsim
- cmd: cd "%APPVEYOR_BUILD_FOLDER%"

#-------------------------------
Expand All @@ -69,17 +55,13 @@ install:
- sh: sudo apt-get --yes install libnlopt-dev coinor-libipopt-dev libbullet-dev libflann-dev libtinyxml2-dev liburdfdom-dev libxi-dev libxmu-dev freeglut3-dev libopenscenegraph-dev
- sh: sudo apt-get --yes install clang-format-6.0

# preserve contents of selected directories and files across project builds
cache:
- C:\tools\vcpkg\installed -> .appveyor.yml

build_script:
#------------------
# Windows 10
#------------------
- cmd: mkdir build && cd build
- cmd: cmake %CMAKE_GENERATOR% -A x64 -DCMAKE_BUILD_TYPE=%configuration% -DDART_VERBOSE=ON -DDART_MSVC_DEFAULT_OPTIONS="%MSVC_DEFAULT_OPTIONS%" %CMAKE_TOOLCHAIN_FILE% %CMAKE_TOOLCHAIN% ..
# - cmd: cmake --build . --target ALL_BUILD --config %configuration% -- /maxcpucount:4
- cmd: cmake --build . --target ALL_BUILD --config %configuration% --parallel

#-------------------------------
# Ubuntu 16.04 LTS && 18.04 LTS
Expand All @@ -90,5 +72,12 @@ build_script:
- sh: make check-format

test_script:
#- cmd: ctest --build-config %configuration% --parallel 4 --output-on-failure
#------------------
# Windows 10
#------------------
- cmd: ctest --output-on-fauilure

#-------------------------------
# Ubuntu 16.04 LTS && 18.04 LTS
#-------------------------------
- sh: ctest -j4
49 changes: 39 additions & 10 deletions .github/workflows/ccpp.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@ name: C/C++ CI
on:
push:
branches:
- '*'
- '**'
pull_request:
branches:
- '*'
- '**'
schedule:
# Run every day at 02:00
- cron: '0 2 * * 0-6'
Expand Down Expand Up @@ -179,28 +179,57 @@ jobs:
name: Windows [Release]
runs-on: windows-2019
env:
COMPILER: gcc
BUILD_TYPE: Release
RUN_TESTS: OFF
VCPKG_ROOT: 'C:/dartsim/vcpkg'
VCPKG_BUILD_TAG: v0.1.1
VCPKG_BUILD_TAG: v0.2.0-70f192e
steps:
- uses: actions/checkout@v1
- name: Install Dependencies
shell: cmd
run: |
mkdir -p C:/dartsim
mkdir -p C:\dartsim
choco install -y wget
wget https://github.com/dartsim/vcpkg-build/releases/download/%VCPKG_BUILD_TAG%/vcpkg-dartsim-dependencies.zip
unzip vcpkg-dartsim-dependencies.zip -d C:/dartsim
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
- name: Build
shell: cmd
run: |
mkdir build
cd build
cmake .. -G "Visual Studio 16 2019" -A x64 -Wno-dev ^
-DCMAKE_BUILD_TYPE=Release ^
-DCMAKE_BUILD_TYPE=%BUILD_TYPE% ^
-DCMAKE_TOOLCHAIN_FILE="%VCPKG_ROOT%/scripts/buildsystems/vcpkg.cmake" ^
-DDART_MSVC_DEFAULT_OPTIONS=ON ^
-DDART_VERBOSE=ON
cmake --build . --target ALL_BUILD -- /maxcpucount:4
cmake --build . --target ALL_BUILD --parallel
ctest --output-on-fauilure
windows_2019_clang_cl:
name: Windows (clang-cl) [Release]
runs-on: windows-2019
env:
BUILD_TYPE: Release
VCPKG_ROOT: 'C:/dartsim/vcpkg'
VCPKG_BUILD_TAG: v0.2.0-70f192e
steps:
- uses: actions/checkout@v1
- 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
- name: Build
shell: cmd
run: |
mkdir build
cd build
cmake .. -G "Visual Studio 16 2019" -A x64 -Wno-dev ^
-T ClangCl ^
-DCMAKE_BUILD_TYPE=%BUILD_TYPE% ^
-DCMAKE_TOOLCHAIN_FILE="%VCPKG_ROOT%/scripts/buildsystems/vcpkg.cmake" ^
-DDART_MSVC_DEFAULT_OPTIONS=ON ^
-DDART_VERBOSE=ON
cmake --build . --target ALL_BUILD --parallel
ctest --output-on-fauilure
22 changes: 9 additions & 13 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,6 @@ set(DART_PKG_EXTERNAL_DEPS "eigen, ccd, fcl, assimp, boost")
# Build options
#===============================================================================
option(DART_VERBOSE "Whether print detailed information in CMake process" OFF)
option(ENABLE_OPENMP "Build with OpenMP parallaization enabled" ON)
if(MSVC)
set(DART_RUNTIME_LIBRARY "/MD" CACHE STRING "BaseName chosen by the user at CMake configure time")
set_property(CACHE DART_RUNTIME_LIBRARY PROPERTY STRINGS /MD /MT)
Expand Down Expand Up @@ -171,7 +170,7 @@ if(MSVC)

# Visual Studio enables C++14 support by default
set(msvc_required_version 1920)
if(MSVC_VERSION VERSION_LESS ${msvc_required_version})
if(MSVC_VERSION VERSION_LESS ${msvc_required_version} AND ${CMAKE_CXX_COMPILER_ID} STREQUAL "MSVC")
message(FATAL_ERROR "Visual Studio ${MSVC_VERSION} is detected, but "
"${PROJECT_NAME_UPPERCASE} requires ${msvc_required_version} or greater."
)
Expand All @@ -186,17 +185,17 @@ if(MSVC)
set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} ${DART_RUNTIME_LIBRARY}d /Zi /Gy /W1 /EHsc")
set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} ${DART_RUNTIME_LIBRARY} /Zi /GL /Gy /W1 /EHsc")
endif(NOT DART_MSVC_DEFAULT_OPTIONS)
add_definitions(-D_CRT_SECURE_NO_WARNINGS)
add_compile_options(/wd4334)
add_compile_options(/wd4267)
add_definitions(-D_CRT_SECURE_NO_WARNINGS -D_ENABLE_EXTENDED_ALIGNED_STORAGE)
add_compile_options(/wd4005)
add_compile_options(/wd4099)
add_compile_options(/wd4244)
add_compile_options(/wd4250)
add_compile_options(/wd4996)
add_compile_options(/wd4099)
add_compile_options(/wd4267)
add_compile_options(/wd4305)
add_compile_options(/wd4334)
add_compile_options(/wd4838)
add_compile_options(/wd4996)
add_compile_options(/bigobj)
add_compile_definitions(_ENABLE_EXTENDED_ALIGNED_STORAGE)

elseif(CMAKE_COMPILER_IS_GNUCXX)

Expand All @@ -206,7 +205,6 @@ elseif(CMAKE_COMPILER_IS_GNUCXX)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wextra -fPIC")
execute_process(
COMMAND ${CMAKE_CXX_COMPILER} -dumpfullversion -dumpversion OUTPUT_VARIABLE GCC_VERSION)
set(CXX_COMPILER_VERSION ${GCC_VERSION})
if(GCC_VERSION VERSION_LESS 5.3.1)
message(FATAL_ERROR "The installed g++ version is ${GCC_VERSION}. ${PROJECT_NAME} requires g++ 5.3.1 or greater.")
endif()
Expand Down Expand Up @@ -234,7 +232,6 @@ elseif("${CMAKE_CXX_COMPILER_ID}" MATCHES "Clang")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fPIC")
execute_process(
COMMAND ${CMAKE_CXX_COMPILER} -dumpversion OUTPUT_VARIABLE CLANG_VERSION)
set(CXX_COMPILER_VERSION ${CLANG_VERSION})
if(CLANG_VERSION VERSION_LESS 3.8)
message(FATAL_ERROR "The installed Clang version is ${CLANG_VERSION}. ${PROJECT_NAME} requires clang 3.8 or greater.")
endif()
Expand Down Expand Up @@ -269,10 +266,9 @@ if(DART_VERBOSE)
message(STATUS "[ Build summary ]")
message(STATUS "CMAKE_GENERATOR : ${CMAKE_GENERATOR}")
message(STATUS "Compiler ID : ${CMAKE_CXX_COMPILER_ID}")
message(STATUS "Compiler version : ${CXX_COMPILER_VERSION}")
message(STATUS "Compiler version : ${CMAKE_CXX_COMPILER_VERSION}")
message(STATUS "Build type : ${CMAKE_BUILD_TYPE}")
message(STATUS "BUILD_SHARED_LIBS: ${BUILD_SHARED_LIBS}")
message(STATUS "ENABLE_OPENMP : ${ENABLE_OPENMP}")
message(STATUS "Build gui::osg : ${DART_BUILD_GUI_OSG}")
message(STATUS "Install path : ${CMAKE_INSTALL_PREFIX}")
message(STATUS "CXX_FLAGS : ${CMAKE_CXX_FLAGS}")
Expand Down Expand Up @@ -302,7 +298,7 @@ if(TARGET dart)
# Add a "tests" target to build unit tests.
enable_testing()
if(MSVC)
# add_subdirectory(unittests)
add_subdirectory(unittests)
else()
add_subdirectory(unittests EXCLUDE_FROM_ALL)
endif()
Expand Down
70 changes: 70 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
FROM ubuntu:focal

ENV DEBIAN_FRONTEND=noninteractive

# Install build dependencies
RUN apt-get clean \
&& apt-get update \
&& apt-get -y install --no-install-recommends \
build-essential \
cmake \
git \
pkg-config \
software-properties-common \
&& rm -rf /var/lib/apt/lists/*

# Install DART dependencies
RUN apt-get update \
&& apt-get -y install --no-install-recommends \
libeigen3-dev \
libassimp-dev \
libccd-dev \
libfcl-dev \
libboost-all-dev \
libnlopt-cxx-dev \
coinor-libipopt-dev \
libbullet-dev \
liblz4-dev \
libode-dev \
liboctomap-dev \
libflann-dev \
libtinyxml2-dev \
liburdfdom-dev \
libxi-dev \
libxmu-dev \
freeglut3-dev \
libopenscenegraph-dev \
&& rm -rf /var/lib/apt/lists/*

# Install dartpy dependencies
RUN apt-get update \
&& apt-get -y install --no-install-recommends \
libpython3-dev \
pybind11-dev \
python3 \
python3-pip \
python3-pytest \
python3-distutils \
&& rm -rf /var/lib/apt/lists/*

# Compile and install DART and dartpy
COPY . /opt/dart
WORKDIR /opt/dart
RUN cd /opt/dart \
&& mkdir build \
&& cd build \
&& cmake \
-DCMAKE_INSTALL_PREFIX=/usr/ \
-DCMAKE_BUILD_TYPE=Release .. \
-DBUILD_SHARED_LIBS=ON \
-DDART_BUILD_DARTPY=ON \
&& make \
&& make install \
&& make dartpy \
&& make install-dartpy

# Install python dependencies
RUN python3 -m pip install\
numpy

WORKDIR "/"
20 changes: 13 additions & 7 deletions cmake/DARTFindODE.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,18 @@
#
# This file is provided under the "BSD-style" License

find_package(ODE 0.13 QUIET MODULE)
find_package(ODE CONFIG NAMES ODE ode)

if(NOT ODE_FOUND)

find_package(ODE 0.13 QUIET MODULE)

if(ODE_FOUND AND NOT TARGET ODE::ODE)
add_library(ODE::ODE INTERFACE IMPORTED)
set_target_properties(ODE::ODE PROPERTIES
INTERFACE_INCLUDE_DIRECTORIES "${ODE_INCLUDE_DIRS}"
INTERFACE_LINK_LIBRARIES "${ODE_LIBRARIES}"
)
endif()

if(ODE_FOUND AND NOT TARGET ODE::ODE)
add_library(ODE::ODE INTERFACE IMPORTED)
set_target_properties(ODE::ODE PROPERTIES
INTERFACE_INCLUDE_DIRECTORIES "${ODE_INCLUDE_DIRS}"
INTERFACE_LINK_LIBRARIES "${ODE_LIBRARIES}"
)
endif()
12 changes: 11 additions & 1 deletion cmake/DARTFindtinyxml2.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,17 @@
#
# This file is provided under the "BSD-style" License

find_package(tinyxml2 QUIET MODULE)
find_package(tinyxml2 QUIET CONFIG)
if(tinyxml2_FOUND)
set(TINYXML2_FOUND ${tinyxml2_FOUND})
set(TINYXML2_INCLUDE_DIRS ${tinyxml2_INCLUDE_DIRS})
set(TINYXML2_LIBRARIES ${tinyxml2_LIBRARIES})
set(TINYXML2_VERSION ${tinyxml2_VERSION})
endif()

if(NOT tinyxml2_FOUND)
find_package(tinyxml2 QUIET MODULE)
endif()

if((TINYXML2_FOUND OR tinyxml2_FOUND) AND NOT TARGET tinyxml2::tinyxml2)
add_library(tinyxml2::tinyxml2 INTERFACE IMPORTED)
Expand Down
9 changes: 7 additions & 2 deletions cmake/Findassimp.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -26,15 +26,20 @@ find_path(ASSIMP_INCLUDE_DIRS assimp/scene.h

# Libraries
if(MSVC)
set(ASSIMP_LIBRARIES "assimp$<$<CONFIG:Debug>:d>")
find_package(assimp QUIET CONFIG)
if(TARGET assimp::assimp)
set(ASSIMP_LIBRARIES "assimp::assimp")
endif()
else()
find_library(ASSIMP_LIBRARIES
NAMES assimp
HINTS ${PC_ASSIMP_LIBDIR})
endif()

# Version
set(ASSIMP_VERSION ${PC_ASSIMP_VERSION})
if(PC_ASSIMP_VERSION)
set(ASSIMP_VERSION ${PC_ASSIMP_VERSION})
endif()

# Set (NAME)_FOUND if all the variables and the version are satisfied.
include(FindPackageHandleStandardArgs)
Expand Down
9 changes: 7 additions & 2 deletions cmake/Findfcl.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,10 @@ find_path(FCL_INCLUDE_DIRS

# Libraries
if(MSVC)
set(FCL_LIBRARIES "fcl$<$<CONFIG:Debug>:d>")
find_package(fcl QUIET CONFIG)
if(TARGET fcl)
set(FCL_LIBRARIES fcl)
endif()
else()
# Give explicit precedence to ${PC_FCL_LIBDIR}
find_library(FCL_LIBRARIES
Expand All @@ -44,7 +47,9 @@ else()
endif()

# Version
set(FCL_VERSION ${PC_FCL_VERSION})
if(PC_FCL_VERSION)
set(FCL_VERSION ${PC_FCL_VERSION})
endif()

# Set (NAME)_FOUND if all the variables and the version are satisfied.
include(FindPackageHandleStandardArgs)
Expand Down
Loading

0 comments on commit 3e4ee1f

Please sign in to comment.