Skip to content

Commit

Permalink
Merge pull request RobotLocomotion#9 from HarvardAgileRoboticsLab/upd…
Browse files Browse the repository at this point in the history
…ate_from_robot_locomotion

Update from robot locomotion
  • Loading branch information
pvarin authored Dec 7, 2016
2 parents f4057b2 + 10ef071 commit 2bd39c8
Show file tree
Hide file tree
Showing 293 changed files with 12,149 additions and 3,221 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -59,3 +59,4 @@ drake/doc/DoxygenCPP
Pendulum.pmd
drake/doc/_build
bazel-*
xcode
2 changes: 1 addition & 1 deletion .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
url = https://github.com/RobotLocomotion/gurobi.git
[submodule "externals/mosek"]
path = externals/mosek
url = https://github.com/rdeits/mosek-pod.git
url = https://github.com/RobotLocomotion/mosek.git
[submodule "externals/iris"]
path = externals/iris
url = https://github.com/rdeits/iris-distro.git
Expand Down
21 changes: 11 additions & 10 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ drake_setup_options()
# External projects in order of dependencies; 'trivial' ones first
drake_add_external(eigen PUBLIC CMAKE)
drake_add_external(meshconverters PUBLIC CMAKE)
drake_add_external(mosek PUBLIC MATLAB)
drake_add_external(spdlog PUBLIC CMAKE)
drake_add_external(swigmake PUBLIC CMAKE MATLAB PYTHON)
drake_add_external(yalmip PUBLIC CMAKE MATLAB)
Expand All @@ -30,14 +29,9 @@ drake_add_external(yalmip PUBLIC CMAKE MATLAB)
drake_add_external(avl PUBLIC CMAKE FORTRAN)

# bullet
if(WIN32)
set(BULLET_EXTRA_CMAKE_ARGS -DUSE_MSVC_RUNTIME_LIBRARY_DLL=ON)
else()
set(BULLET_EXTRA_CMAKE_ARGS -DBUILD_SHARED_LIBS=ON)
endif()

drake_add_external(bullet PUBLIC CMAKE
CMAKE_ARGS
-DBUILD_SHARED_LIBS=ON
-DBUILD_BULLET2_DEMOS=OFF
-DBUILD_CPU_DEMOS=OFF
-DBUILD_EXTRAS=OFF
Expand All @@ -48,8 +42,7 @@ drake_add_external(bullet PUBLIC CMAKE
-DCMAKE_RELWITHDEBINFO_POSTFIX=
-DINSTALL_LIBS=ON
-DPKGCONFIG_INSTALL_PREFIX=${CMAKE_INSTALL_PREFIX}/lib/pkgconfig
-DUSE_DOUBLE_PRECISION=ON
${BULLET_EXTRA_CMAKE_ARGS})
-DUSE_DOUBLE_PRECISION=ON)

# ccd
drake_add_external(ccd PUBLIC CMAKE
Expand Down Expand Up @@ -77,7 +70,6 @@ drake_add_external(gflags PUBLIC CMAKE
drake_add_external(googletest PUBLIC CMAKE
CMAKE_ARGS
-DBUILD_SHARED_LIBS=ON
-DGTEST_CREATE_SHARED_LIBRARY=1 # Needed for parameterized tests on Windows
-DCMAKE_INSTALL_NAME_DIR=${CMAKE_INSTALL_PREFIX}/lib)

# google_styleguide
Expand Down Expand Up @@ -113,6 +105,13 @@ drake_add_external(ipopt PUBLIC AUTOTOOLS FORTRAN
--with-lapack=BUILD
--with-pic)

# mosek
drake_add_external(mosek PUBLIC CMAKE MATLAB
CMAKE_ARGS
-DBUILD_TESTING=OFF
-DWITH_MATLAB=${Matlab_FOUND}
-DWITH_PYTHON=OFF)

# nlopt
drake_add_external(nlopt PUBLIC CMAKE
CMAKE_ARGS
Expand Down Expand Up @@ -214,6 +213,8 @@ drake_add_external(drake LOCAL PUBLIC CMAKE ALWAYS TEST MATLAB PYTHON
BINARY_DIR ${PROJECT_BINARY_DIR}/drake
CMAKE_ARGS
-DDISABLE_MATLAB:BOOL=${DISABLE_MATLAB}
-DDISABLE_PYTHON:BOOL=${DISABLE_PYTHON}
-DDISABLE_FORTRAN:BOOL=${DISABLE_FORTRAN}
-DWITH_AVL:BOOL=${WITH_AVL}
-DWITH_BOT_CORE_LCMTYPES:BOOL=${WITH_BOT_CORE_LCMTYPES}
-DWITH_BULLET:BOOL=${WITH_BULLET}
Expand Down
19 changes: 13 additions & 6 deletions WORKSPACE
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@

workspace(name = "drake")

load("//tools/third_party/kythe/tools/build_rules/config:pkg_config.bzl", "pkg_config_package")

new_http_archive(
name = "gtest",
url = "https://github.com/google/googletest/archive/release-1.7.0.zip",
Expand All @@ -13,6 +15,12 @@ new_http_archive(
strip_prefix = "googletest-release-1.7.0",
)

git_repository(
name = "gflags",
commit = "a69b2544d613b4bee404988710503720c487119a",
remote = "https://github.com/gflags/gflags.git"
)

new_git_repository(
name = "eigen",
remote = "https://github.com/RobotLocomotion/eigen-mirror.git",
Expand All @@ -27,15 +35,14 @@ new_git_repository(
build_file = "tools/spdlog.BUILD",
)

new_local_repository(
name = "gtk",
path = "/usr",
build_file = "tools/gtk.BUILD",
)

new_git_repository(
name = "lcm",
remote = "https://github.com/lcm-proj/lcm.git",
commit = "a8cda6a64b31739a781b67408c63bec08b15ab32",
build_file = "tools/lcm.BUILD",
)

pkg_config_package(
name = "glib",
modname = "glib-2.0",
)
21 changes: 12 additions & 9 deletions cmake/config.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -170,8 +170,15 @@ macro(drake_setup_fortran)
mark_as_advanced(DISABLE_FORTRAN)

if(NOT DISABLE_FORTRAN)
if(CMAKE_GENERATOR STREQUAL "Ninja")
# The Ninja generator does not support Fortran, so manually find the Fortran
if(CMAKE_GENERATOR STREQUAL "Unix Makefiles")
enable_language(Fortran)

if(CMAKE_Fortran_COMPILER_ID STREQUAL "GNU" AND CMAKE_Fortran_COMPILER_VERSION VERSION_LESS "4.9")
message(FATAL_ERROR "GNU Fortran compiler version must be at least 4.9 \
(detected version ${CMAKE_Fortran_COMPILER_VERSION})")
endif()
else()
# Ninja and Xcode may not support Fortran, so manually find the Fortran
# compiler and set any flags passed in by environment variable
find_program(CMAKE_Fortran_COMPILER
NAMES "$ENV{FC}" gfortran gfortran-6 gfortran-5 gfortran-4
Expand All @@ -183,12 +190,6 @@ macro(drake_setup_fortran)
endif()
set(CMAKE_Fortran_FLAGS "$ENV{FFLAGS}" CACHE STRING
"Flags for Fortran compiler")
else()
enable_language(Fortran)

if(CMAKE_Fortran_COMPILER_ID STREQUAL "GNU" AND CMAKE_Fortran_COMPILER_VERSION VERSION_LESS "4.9")
message(FATAL_ERROR "GCC version must be at least 4.9")
endif()
endif()
endif()
endmacro()
Expand Down Expand Up @@ -249,7 +250,6 @@ macro(drake_setup_platform)
mark_as_advanced(LIB_SUFFIX)

drake_setup_compiler()
drake_setup_fortran()
drake_setup_matlab()
drake_setup_java()
drake_setup_python()
Expand Down Expand Up @@ -281,6 +281,9 @@ macro(drake_setup_superbuild)
FORCE)
endif()
message(STATUS CMAKE_INSTALL_PREFIX=${CMAKE_INSTALL_PREFIX})

# Drake itself does not contain Fortran code.
drake_setup_fortran()
endmacro()

###############################################################################
Expand Down
4 changes: 2 additions & 2 deletions cmake/externals.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -182,8 +182,8 @@ macro(drake_add_cmake_external PROJECT)
CMAKE_Fortran_COMPILER
CMAKE_Fortran_FLAGS)

if(_ext_GENERATOR STREQUAL "Ninja")
# The Ninja generator does not support Fortran.
if(NOT _ext_GENERATOR STREQUAL "Unix Makefiles")
# Ninja and Xcode may not support Fortran.
set(_ext_GENERATOR "Unix Makefiles")
endif()
endif()
Expand Down
2 changes: 1 addition & 1 deletion cmake/options.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,7 @@ macro(drake_setup_options)
drake_optional_external(CCD ON "Convex shape Collision Detection library")

drake_optional_external(DIRECTOR ON
DEPENDS "HAVE_LCM\;HAVE_BOT_CORE_LCMTYPES"
DEPENDS "HAVE_LCM\;HAVE_BOT_CORE_LCMTYPES\;NOT DISABLE_PYTHON"
"VTK-based visualization tool and robot user interface")

drake_optional_external(GOOGLE_STYLEGUIDE ON
Expand Down
2 changes: 1 addition & 1 deletion cmake/packages.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ macro(drake_find_packages)
drake_find_package(gurobi CONFIG)
drake_find_package(lcm CONFIG)
drake_find_package(meshconverters CONFIG)
drake_find_package(mosek PKG_CONFIG)
drake_find_package(mosek CONFIG)
drake_find_package(NLopt CONFIG)
drake_find_package(octomap CONFIG)
drake_find_package(robotlocomotion-lcmtypes CONFIG)
Expand Down
17 changes: 4 additions & 13 deletions cmake/pods.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -191,22 +191,13 @@ endfunction()
# manually.
macro(pods_config_search_paths)
if(NOT DEFINED __pods_setup)
# set where files should be output locally
set(LIBRARY_OUTPUT_PATH ${PROJECT_BINARY_DIR}/lib)
foreach(OUTPUTCONFIG ${CMAKE_CONFIGURATION_TYPES})
string(TOUPPER ${OUTPUTCONFIG} OUTPUTCONFIG)
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY_${OUTPUTCONFIG} ${LIBRARY_OUTPUT_PATH})
endforeach()

# set where files should be installed to
set(LIBRARY_INSTALL_PATH "${DRAKE_LIBRARY_DIR}")

# add build/lib/pkgconfig to the pkg-config search path
set(ENV{PKG_CONFIG_PATH} "${DRAKE_PKGCONFIG_DIR}:$ENV{PKG_CONFIG_PATH}")

# add build/lib to the link path
link_directories(${LIBRARY_OUTPUT_PATH})
link_directories(${LIBRARY_INSTALL_PATH})
# add install/lib/pkgconfig to the pkg-config search path so we find
# .pc files installed by externals (use both the correct library dir, and
# plain 'lib', as some externals may not use the correct library dir)
set(ENV{PKG_CONFIG_PATH} "${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_LIBDIR}/pkgconfig:${CMAKE_INSTALL_PREFIX}/lib/pkgconfig:$ENV{PKG_CONFIG_PATH}")

# abuse RPATH
if(CMAKE_INSTALL_RPATH)
Expand Down
13 changes: 5 additions & 8 deletions drake/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -32,13 +32,6 @@ option(LONG_RUNNING_TESTS "some tests should be run nightly for coverage, but ar

set(CMAKE_POSITION_INDEPENDENT_CODE ON)

if(WITH_PYTHON_3)
set(Python_ADDITIONAL_VERSIONS 3.5)
find_package(PythonInterp 3 MODULE REQUIRED)
else()
find_package(PythonInterp MODULE REQUIRED)
endif()

find_package(BLAS MODULE)
find_package(Doxygen MODULE)
find_package(Perl MODULE)
Expand Down Expand Up @@ -86,6 +79,7 @@ if(CMAKE_CXX_COMPILER_ID MATCHES "Clang")
# https://gcc.gnu.org/bugzilla/show_bug.cgi?id=57709
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Werror=shadow")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Werror=inconsistent-missing-override")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Werror=sign-compare")
else()
# TODO(jwnimmer-tri) Get a similar complement of flags working on clang.
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Werror=extra -Wno-unused-parameter")
Expand Down Expand Up @@ -181,7 +175,10 @@ if(Matlab_FOUND)
add_subdirectory(matlab)
endif()
add_subdirectory(examples)
add_subdirectory(bindings)

if(Matlab_FOUND OR NOT DISABLE_PYTHON)
add_subdirectory(bindings)
endif()

if(BUILD_TESTING)
add_subdirectory(regtests)
Expand Down
Loading

0 comments on commit 2bd39c8

Please sign in to comment.