Skip to content

Commit

Permalink
Merge pull request RobotLocomotion#14395 from jamiesnape/brew-numpy-1…
Browse files Browse the repository at this point in the history
….19.4-scipy-1.5.4-vtk-8.2.0

Use formulae dependent on Python 3.8 on macOS and rebuild VTK for all platforms
  • Loading branch information
jamiesnape authored Dec 8, 2020
2 parents 0be3ddd + bdd772b commit c0bb0ff
Show file tree
Hide file tree
Showing 13 changed files with 144 additions and 126 deletions.
9 changes: 6 additions & 3 deletions setup/mac/binary_distribution/Brewfile
Original file line number Diff line number Diff line change
Expand Up @@ -15,19 +15,22 @@ brew 'gflags'
brew 'glew'
brew 'glib'
brew 'graphviz'
# brew extract last working version.
brew 'robotlocomotion/director/[email protected]'
brew 'libyaml'
brew 'lz4'
brew 'nlopt'
brew 'numpy'
# brew extract last working version that depends on [email protected].
brew 'robotlocomotion/director/[email protected]'
brew 'openblas'
brew 'pkg-config'
brew '[email protected]'
brew 'scipy'
# brew extract last working version that depends on [email protected].
brew 'robotlocomotion/director/[email protected]'
brew 'suite-sparse'
brew 'tinyxml'
brew 'tinyxml2'
brew 'robotlocomotion/director/[email protected]'
brew 'robotlocomotion/director/[email protected].0'
brew 'xz'
brew 'yaml-cpp'
brew 'zeromq'
Expand Down
16 changes: 15 additions & 1 deletion setup/mac/binary_distribution/install_prereqs.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,21 @@ if ! command -v /usr/local/bin/brew &>/dev/null; then
/usr/bin/ruby -e "$(/usr/bin/curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
fi

/usr/local/bin/brew update
# TODO(jamiesnape): Remove lines uninstalling [email protected], [email protected], and
# [email protected] on or after 2021-02-01.
/usr/local/bin/brew uninstall --force $(cat <<EOF
robotlocomotion/director/[email protected]
robotlocomotion/director/[email protected]
robotlocomotion/director/[email protected]
EOF
)

# Ensure numpy is updated to the most recent version to avoid conflicts with
# robotlocomotion/drake/[email protected]
# TODO(jamiesnape): Remove line upgrading numpy or after 2021-02-01.
/usr/local/bin/brew list numpy &>/dev/null \
&& (brew outdated numpy >/dev/null || /usr/local/bin/brew upgrade numpy)

/usr/local/bin/brew bundle --file="${BASH_SOURCE%/*}/Brewfile" --no-lock

if ! command -v /usr/local/opt/[email protected]/bin/pip3 &>/dev/null; then
Expand Down
1 change: 0 additions & 1 deletion setup/ubuntu/binary_distribution/packages-bionic.txt
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@ libqt5printsupport5
libqt5widgets5
libquadmath0
libsqlite3-0
libtbb2
libtheora0
libtiff5
libtinyxml2-dev
Expand Down
1 change: 0 additions & 1 deletion setup/ubuntu/binary_distribution/packages-focal.txt
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@ libqt5printsupport5
libqt5widgets5
libquadmath0
libsqlite3-0
libtbb2
libtheora0
libtiff5
libtinyxml2-dev
Expand Down
6 changes: 6 additions & 0 deletions tools/workspace/default.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ load("@drake//tools/workspace/clang_cindex_python3:repository.bzl", "clang_cinde
load("@drake//tools/workspace/com_jidesoft_jide_oss:repository.bzl", "com_jidesoft_jide_oss_repository") # noqa
load("@drake//tools/workspace/commons_io:repository.bzl", "commons_io_repository") # noqa
load("@drake//tools/workspace/csdp:repository.bzl", "csdp_repository")
load("@drake//tools/workspace/double_conversion:repository.bzl", "double_conversion_repository") # noqa
load("@drake//tools/workspace/doxygen:repository.bzl", "doxygen_repository")
load("@drake//tools/workspace/drake_visualizer:repository.bzl", "drake_visualizer_repository") # noqa
load("@drake//tools/workspace/dreal:repository.bzl", "dreal_repository")
Expand Down Expand Up @@ -43,6 +44,7 @@ load("@drake//tools/workspace/libblas:repository.bzl", "libblas_repository")
load("@drake//tools/workspace/libjpeg:repository.bzl", "libjpeg_repository")
load("@drake//tools/workspace/liblapack:repository.bzl", "liblapack_repository") # noqa
load("@drake//tools/workspace/liblz4:repository.bzl", "liblz4_repository")
load("@drake//tools/workspace/liblzma:repository.bzl", "liblzma_repository")
load("@drake//tools/workspace/libpng:repository.bzl", "libpng_repository")
load("@drake//tools/workspace/libtiff:repository.bzl", "libtiff_repository")
load("@drake//tools/workspace/meshcat:repository.bzl", "meshcat_repository")
Expand Down Expand Up @@ -116,6 +118,8 @@ def add_default_repositories(excludes = [], mirrors = DEFAULT_MIRRORS):
commons_io_repository(name = "commons_io", mirrors = mirrors)
if "csdp" not in excludes:
csdp_repository(name = "csdp", mirrors = mirrors)
if "double_conversion" not in excludes:
double_conversion_repository(name = "double_conversion")
if "doxygen" not in excludes:
doxygen_repository(name = "doxygen", mirrors = mirrors)
if "drake_detected_os" not in excludes:
Expand Down Expand Up @@ -178,6 +182,8 @@ def add_default_repositories(excludes = [], mirrors = DEFAULT_MIRRORS):
liblapack_repository(name = "liblapack")
if "liblz4" not in excludes:
liblz4_repository(name = "liblz4")
if "liblzma" not in excludes:
liblzma_repository(name = "liblzma")
if "libpng" not in excludes:
libpng_repository(name = "libpng")
if "libtiff" not in excludes:
Expand Down
8 changes: 8 additions & 0 deletions tools/workspace/double_conversion/BUILD.bazel
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# -*- python -*-

# This file exists to make our directory into a Bazel package, so that our
# neighboring *.bzl file can be loaded elsewhere.

load("//tools/lint:lint.bzl", "add_lint_tests")

add_lint_tests()
15 changes: 15 additions & 0 deletions tools/workspace/double_conversion/package-macos.BUILD.bazel
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# -*- python -*-

licenses(["notice"]) # BSD-3-Clause

cc_library(
name = "double_conversion",
hdrs = glob(["include/double-conversion/*.h"]),
includes = ["include"],
linkopts = [
"-L/usr/local/opt/double-conversion/lib",
"-Wl,-rpath,/usr/local/opt/double-conversion/lib",
"-ldouble-conversion",
],
visibility = ["//visibility:public"],
)
14 changes: 14 additions & 0 deletions tools/workspace/double_conversion/package-ubuntu.BUILD.bazel
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# -*- python -*-

licenses(["notice"]) # BSD-3-Clause

cc_library(
name = "double_conversion",
hdrs = glob(["include/double-conversion/*.h"]),
includes = ["include"],
linkopts = [
"-L/usr/lib/x86_64-linux-gnu",
"-ldouble-conversion",
],
visibility = ["//visibility:public"],
)
40 changes: 40 additions & 0 deletions tools/workspace/double_conversion/repository.bzl
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
# -*- python -*-

load("@drake//tools/workspace:os.bzl", "determine_os")

def _impl(repository_ctx):
os_result = determine_os(repository_ctx)

if os_result.error != None:
fail(os_result.error)

if os_result.is_macos:
repository_ctx.symlink(
"/usr/local/opt/double-conversion/include",
"include",
)
repository_ctx.symlink(
Label(
"@drake//tools/workspace/double_conversion:package-macos.BUILD.bazel", # noqa
),
"BUILD.bazel",
)
elif os_result.is_ubuntu:
repository_ctx.symlink(
"/usr/include/double-conversion",
"include/double-conversion",
)
repository_ctx.symlink(
Label(
"@drake//tools/workspace/double_conversion:package-ubuntu.BUILD.bazel", # noqa
),
"BUILD.bazel",
)
else:
fail("Operating system is NOT supported", attr = os_result)

double_conversion_repository = repository_rule(
local = True,
configure = True,
implementation = _impl,
)
4 changes: 2 additions & 2 deletions tools/workspace/drake_visualizer/repository.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,8 @@ def _impl(repository_ctx):
fail(os_result.error)

if os_result.is_macos:
archive = "dv-0.1.0-406-g4c3e570a-python-3.8.2-qt-5.14.1-vtk-8.2.0-mac-x86_64.tar.gz" # noqa
sha256 = "d09c2bfc80c4e50e178f588c6c2e80b5ce627251ca14c9841dba1f6c0c07fc31" # noqa
archive = "dv-0.1.0-406-g4c3e570a-python-3.8.6-qt-5.15.1-vtk-8.2.0-mac-x86_64.tar.gz" # noqa
sha256 = "292f46d391359d2a2ae71906eb852433dba8e06138dc88b59303a295cf9af1a7" # noqa
elif os_result.ubuntu_release == "18.04":
archive = "dv-0.1.0-406-g4c3e570a-python-3.6.9-qt-5.9.5-vtk-8.2.0-bionic-x86_64-1.tar.gz" # noqa
sha256 = "2c477c2f1186cd151710af9a6f50bd3720034ced3c5ed21d977b0a822ac56237" # noqa
Expand Down
8 changes: 8 additions & 0 deletions tools/workspace/liblzma/BUILD.bazel
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# -*- python -*-

# This file exists to make our directory into a Bazel package, so that our
# neighboring *.bzl file can be loaded elsewhere.

load("//tools/lint:lint.bzl", "add_lint_tests")

add_lint_tests()
20 changes: 20 additions & 0 deletions tools/workspace/liblzma/repository.bzl
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# -*- mode: python -*-

load(
"@drake//tools/workspace:pkg_config.bzl",
"pkg_config_repository",
)

def liblzma_repository(
name,
licenses = ["restricted"], # LGPL-2.1-only
modname = "liblzma",
pkg_config_paths = ["/usr/local/opt/xz/lib/pkgconfig"],
**kwargs):
pkg_config_repository(
name = name,
licenses = licenses,
modname = modname,
pkg_config_paths = pkg_config_paths,
**kwargs
)
Loading

0 comments on commit c0bb0ff

Please sign in to comment.