Skip to content
Permalink
Browse files

Incorporate a subset of dart and its dependencies

While we are at it, switch to requiring c++17 (dart needs c++11, but
figure I might as well jump to 17 now).
  • Loading branch information
jpieper committed Oct 10, 2019
1 parent d336c67 commit 89a34bf761e48883abb65922443e036ee26bf696
@@ -1,2 +1,5 @@
build --define GCC=true
test --define GCC=true

build --cxxopt -std=c++17
test --cxxopt -std=c++17
3 BUILD
@@ -19,9 +19,11 @@ package(default_visibility = ["//visibility:public"])
cc_library(
name = "everything",
deps = [
"@assimp",
"@boost//:all",
"@bzip2",
"@cairo",
"@dart",
"@eigen",
"@expat",
"@ffmpeg",
@@ -57,6 +59,7 @@ cc_library(
"@python",
"@snappy",
"@spdlog",
"@utfcpp",
"@util-linux",
"@videoproto",
"@x264",
No changes.
@@ -0,0 +1,13 @@
diff --git a/code/Common/ZipArchiveIOSystem.cpp b/code/Common/ZipArchiveIOSystem.cpp
index 7c37a05f..45b877f0 100644
--- a/code/Common/ZipArchiveIOSystem.cpp
+++ b/code/Common/ZipArchiveIOSystem.cpp
@@ -155,7 +155,7 @@ namespace Assimp {
mapping.ztell_file = (tell_file_func)tell;
mapping.zseek_file = (seek_file_func)seek;
mapping.zclose_file = (close_file_func)close;
- mapping.zerror_file = (error_file_func)testerror;
+ mapping.zerror_file = (testerror_file_func)testerror;
#else
mapping.zopen_file = open;
mapping.zread_file = read;
@@ -0,0 +1,156 @@
# -*- python -*-

# Copyright 2019 Josh Pieper, jjp@pobox.com.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

package(default_visibility = ["//visibility:public"])

load("@com_github_mjbots_bazel_deps//tools/workspace:template_file.bzl",
"template_file")
load("@com_github_mjbots_bazel_deps//tools/workspace:generate_file.bzl",
"generate_file")

template_file(
name = "include/assimp/config.h",
src = "include/assimp/config.h.in",
substitutions = {
"#cmakedefine": "#define",
},
)

generate_file(
name = "revision.h",
content = """
#ifndef ASSIMP_REVISION_H_INC
#define ASSIMP_REVISION_H_INC
#define GitVersion 0xdeadbeef
#define GitBranch "master"
#define VER_MAJOR 5
#define VER_MINOR 0
#define VER_PATCH 0
#define VER_BUILD 0
#define STR_HELP(x) #x
#define STR(x) STR_HELP(x)
#define VER_FILEVERSION VER_MAJOR,VER_MINOR,VER_PATCH,VER_BUILD
#if (GitVersion == 0)
#define VER_FILEVERSION_STR STR(VER_MAJOR) "." STR(VER_MINOR) "." STR(VER_PATCH) "." STR(VER_BUILD)
#else
#define VER_FILEVERSION_STR STR(VER_MAJOR) "." STR(VER_MINOR) "." STR(VER_PATCH) "." STR(VER_BUILD) " (Commit 3a664873)"
#endif
#ifdef NDEBUG
#define VER_ORIGINAL_FILENAME_STR "assimp.dll"
#else
#define VER_ORIGINAL_FILENAME_STR "assimp.dll"
#endif // NDEBUG
#endif // ASSIMP_REVISION_H_INC
""")

cc_library(
name = "assimp",
hdrs = [
"include/assimp/config.h",
] + glob([
"include/**/*.hpp",
"include/**/*.h",
"include/**/*.inl",
]),
srcs = [
"revision.h",
] + glob([
"contrib/unzip/*.h",
"contrib/unzip/*.c",
"code/CApi/*.cpp",
"code/CApi/*.h",
"code/Common/*.cpp",
"code/Common/*.h",
"code/PostProcessing/*.cpp",
"code/PostProcessing/*.h",
"code/Material/*.cpp",
"code/Material/*.h",
"contrib/utf8cpp/**/*.h",
]),
includes = ["include", "code", "contrib/unzip"],
copts = [
"-DASSIMP_BUILD_NO_X_IMPORTER",
"-DASSIMP_BUILD_NO_AMF_IMPORTER",
"-DASSIMP_BUILD_NO_3DS_IMPORTER",
"-DASSIMP_BUILD_NO_MD3_IMPORTER",
"-DASSIMP_BUILD_NO_MDL_IMPORTER",
"-DASSIMP_BUILD_NO_MD2_IMPORTER",
"-DASSIMP_BUILD_NO_PLY_IMPORTER",
"-DASSIMP_BUILD_NO_ASE_IMPORTER",
"-DASSIMP_BUILD_NO_OBJ_IMPORTER",
"-DASSIMP_BUILD_NO_HMP_IMPORTER",
"-DASSIMP_BUILD_NO_SMD_IMPORTER",
"-DASSIMP_BUILD_NO_MDC_IMPORTER",
"-DASSIMP_BUILD_NO_MD5_IMPORTER",
"-DASSIMP_BUILD_NO_STL_IMPORTER",
"-DASSIMP_BUILD_NO_LWO_IMPORTER",
"-DASSIMP_BUILD_NO_DXF_IMPORTER",
"-DASSIMP_BUILD_NO_NFF_IMPORTER",
"-DASSIMP_BUILD_NO_RAW_IMPORTER",
"-DASSIMP_BUILD_NO_SIB_IMPORTER",
"-DASSIMP_BUILD_NO_OFF_IMPORTER",
"-DASSIMP_BUILD_NO_AC_IMPORTER",
"-DASSIMP_BUILD_NO_BVH_IMPORTER",
"-DASSIMP_BUILD_NO_IRRMESH_IMPORTER",
"-DASSIMP_BUILD_NO_IRR_IMPORTER",
"-DASSIMP_BUILD_NO_Q3D_IMPORTER",
"-DASSIMP_BUILD_NO_B3D_IMPORTER",
"-DASSIMP_BUILD_NO_COLLADA_IMPORTER",
"-DASSIMP_BUILD_NO_TERRAGEN_IMPORTER",
"-DASSIMP_BUILD_NO_CSM_IMPORTER",
"-DASSIMP_BUILD_NO_3D_IMPORTER",
"-DASSIMP_BUILD_NO_LWS_IMPORTER",
"-DASSIMP_BUILD_NO_OGRE_IMPORTER",
"-DASSIMP_BUILD_NO_OPENGEX_IMPORTER",
"-DASSIMP_BUILD_NO_MS3D_IMPORTER",
"-DASSIMP_BUILD_NO_COB_IMPORTER",
"-DASSIMP_BUILD_NO_BLEND_IMPORTER",
"-DASSIMP_BUILD_NO_Q3BSP_IMPORTER",
"-DASSIMP_BUILD_NO_NDO_IMPORTER",
"-DASSIMP_BUILD_NO_IFC_IMPORTER",
"-DASSIMP_BUILD_NO_XGL_IMPORTER",
"-DASSIMP_BUILD_NO_FBX_IMPORTER",
"-DASSIMP_BUILD_NO_ASSBIN_IMPORTER",
"-DASSIMP_BUILD_NO_GLTF_IMPORTER",
"-DASSIMP_BUILD_NO_C4D_IMPORTER",
"-DASSIMP_BUILD_NO_3MF_IMPORTER",
"-DASSIMP_BUILD_NO_X3D_IMPORTER",
"-DASSIMP_BUILD_NO_MMD_IMPORTER",
"-DASSIMP_BUILD_NO_STEP_IMPORTER",

"-DASSIMP_BUILD_NO_COLLADA_EXPORTER",
"-DASSIMP_BUILD_NO_X_EXPORTER",
"-DASSIMP_BUILD_NO_STEP_EXPORTER",
"-DASSIMP_BUILD_NO_OBJ_EXPORTER",
"-DASSIMP_BUILD_NO_STL_EXPORTER",
"-DASSIMP_BUILD_NO_PLY_EXPORTER",
"-DASSIMP_BUILD_NO_3DS_EXPORTER",
"-DASSIMP_BUILD_NO_GLTF_EXPORTER",
"-DASSIMP_BUILD_NO_ASSBIN_EXPORTER",
"-DASSIMP_BUILD_NO_ASSXML_EXPORTER",
"-DASSIMP_BUILD_NO_X3D_EXPORTER",
"-DASSIMP_BUILD_NO_FBX_EXPORTER",
"-DASSIMP_BUILD_NO_3MF_EXPORTER",
"-DASSIMP_BUILD_NO_ASSJSON_EXPORTER",
],
deps = ["@utfcpp"],
)
@@ -0,0 +1,28 @@
# -*- python -*-

# Copyright 2019 Josh Pieper, jjp@pobox.com.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

load("//tools/workspace:github_archive.bzl", "github_archive")

def assimp_repository(name):
github_archive(
name = name,
repo = "assimp/assimp",
commit = "3a6648734c78f4504f6ab90926f3ecc04d2cc40f",
sha256 = "e9501051c1ad8f7623d6b8c10268b72b830d8d0cbdec88d8b23c3494f743f65c",
patches = [Label("//tools/workspace/assimp:assimp.patch")],
patch_args = ["-p1"],
build_file = Label("//tools/workspace/assimp:package.BUILD"),
)
No changes.
@@ -0,0 +1,89 @@
# -*- python -*-

# Copyright 2019 Josh Pieper, jjp@pobox.com.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

package(default_visibility = ["//visibility:public"])

load("@com_github_mjbots_bazel_deps//tools/workspace:generate_file.bzl",
"generate_file")

generate_file(
name = "dart/config.hpp",
content = """
#ifndef DART_CONFIG_HPP_
#define DART_CONFIG_HPP_
#include <Eigen/Core>
#define DART_MAJOR_VERSION 6
#define DART_MINOR_VERSION 9
#define DART_PATCH_VERSION 2
#define DART_VERSION_AT_LEAST(x,y,z) \
(DART_MAJOR_VERSION > x || (DART_MAJOR_VERSION >= x && \
(DART_MINOR_VERSION > y || (DART_MINOR_VERSION >= y && \
DART_PATCH_VERSION >= z))))
#define DART_MAJOR_MINOR_VERSION_AT_LEAST(x,y) \
(DART_MAJOR_VERSION > x || (DART_MAJOR_VERSION >= x && \
(DART_MINOR_VERSION > y || (DART_MINOR_VERSION >= y))))
#define DART_VERSION_AT_MOST(x,y,z) \
(DART_MAJOR_VERSION < x || (DART_MAJOR_VERSION <= x && \
(DART_MINOR_VERSION < y || (DART_MINOR_VERSION <= y && \
DART_PATCH_VERSION <= z))))
#define DART_MAJOR_MINOR_VERSION_AT_MOST(x,y) \
(DART_MAJOR_VERSION < x || (DART_MAJOR_VERSION <= x && \
(DART_MINOR_VERSION < y || (DART_MINOR_VERSION <= y))))
#define EIGEN_VERSION_AT_MOST(x,y,z) \
(EIGEN_WORLD_VERSION < x || (EIGEN_WORLD_VERSION <= x && \
(EIGEN_MAJOR_VERSION < y || (EIGEN_MAJOR_VERSION <= y && \
EIGEN_MINOR_VERSION <= z))))
// Detect the compiler
#if defined(__clang__)
#define DART_COMPILER_CLANG
#elif defined(__GNUC__) || defined(__GNUG__)
#define DART_COMPILER_GCC
#elif defined(_MSC_VER)
#define DART_COMPILER_MSVC
#endif
#endif
""")

cc_library(
name = "dart",
hdrs = glob(["dart/**/*.hpp"]),
srcs = [
"dart/config.hpp",
"dart/optimizer/Function.cpp",
"dart/optimizer/Problem.cpp",
"dart/optimizer/GradientDescentSolver.cpp",
"dart/optimizer/Solver.cpp",
] + glob([
"dart/common/**/*.cpp",
"dart/dynamics/**/*.cpp",
"dart/math/**/*.cpp",
], exclude = [
# These need ikfast
"dart/dynamics/IkFast.cpp",
"dart/dynamics/SharedLibraryIkFast.cpp",
]),
deps = ["@assimp", "@boost", "@eigen"],
includes = ["."],
)
@@ -0,0 +1,26 @@
# -*- python -*-

# Copyright 2019 Josh Pieper, jjp@pobox.com.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

load("//tools/workspace:github_archive.bzl", "github_archive")

def dart_repository(name):
github_archive(
name = name,
repo = "dartsim/dart",
commit = "07fd1a15a9dfd16d71903baea7ed515a7106924d",
sha256 = "674403ebe26c3fc4bf967761200ac1a20f0c59aa803dfe0a50292b7976ffdec4",
build_file = Label("//tools/workspace/dart:package.BUILD"),
)
@@ -14,9 +14,11 @@
# See the License for the specific language governing permissions and
# limitations under the License.

load("//tools/workspace/assimp:repository.bzl", "assimp_repository")
load("//tools/workspace/boost:repository.bzl", "boost_repository")
load("//tools/workspace/bzip2:repository.bzl", "bzip2_repository")
load("//tools/workspace/cairo:repository.bzl", "cairo_repository")
load("//tools/workspace/dart:repository.bzl", "dart_repository")
load("//tools/workspace/eigen:repository.bzl", "eigen_repository")
load("//tools/workspace/expat:repository.bzl", "expat_repository")
load("//tools/workspace/ffmpeg:repository.bzl", "ffmpeg_repository")
@@ -52,6 +54,7 @@ load("//tools/workspace/pixman:repository.bzl", "pixman_repository")
load("//tools/workspace/python:repository.bzl", "python_repository")
load("//tools/workspace/snappy:repository.bzl", "snappy_repository")
load("//tools/workspace/spdlog:repository.bzl", "spdlog_repository")
load("//tools/workspace/utfcpp:repository.bzl", "utfcpp_repository")
load("//tools/workspace/util-linux:repository.bzl", "util_linux_repository")
load("//tools/workspace/videoproto:repository.bzl", "videoproto_repository")
load("//tools/workspace/x264:repository.bzl", "x264_repository")
@@ -66,12 +69,16 @@ def get_default_config():
}

def add_default_repositories(excludes = [], config = get_default_config()):
if "assimp" not in excludes:
assimp_repository(name = "assimp")
if "boost" not in excludes:
boost_repository(name = "boost")
if "bzip2" not in excludes:
bzip2_repository(name = "bzip2")
if "cairo" not in excludes:
cairo_repository(name = "cairo")
if "dart" not in excludes:
dart_repository(name = "dart")
if "eigen" not in excludes:
eigen_repository(name = "eigen")
if "expat" not in excludes:
@@ -142,6 +149,8 @@ def add_default_repositories(excludes = [], config = get_default_config()):
snappy_repository(name = "snappy")
if "spdlog" not in excludes:
spdlog_repository(name = "spdlog")
if "utfcpp" not in excludes:
utfcpp_repository(name = "utfcpp")
if "util-linux" not in excludes:
util_linux_repository(name = "util-linux")
if "videoproto" not in excludes:

0 comments on commit 89a34bf

Please sign in to comment.
You can’t perform that action at this time.