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

[setup] Restructure Ubuntu dependencies on clang-9 #16622

Merged
merged 1 commit into from
Feb 21, 2022
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
2 changes: 2 additions & 0 deletions setup/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,12 @@ exports_files([
"ubuntu/binary_distribution/packages-bionic.txt",
"ubuntu/binary_distribution/packages-focal.txt",
"ubuntu/source_distribution/packages-bionic.txt",
"ubuntu/source_distribution/packages-bionic-clang.txt",
"ubuntu/source_distribution/packages-bionic-doc-only.txt",
"ubuntu/source_distribution/packages-bionic-maintainer-only.txt",
"ubuntu/source_distribution/packages-bionic-test-only.txt",
"ubuntu/source_distribution/packages-focal.txt",
"ubuntu/source_distribution/packages-focal-clang.txt",
"ubuntu/source_distribution/packages-focal-doc-only.txt",
"ubuntu/source_distribution/packages-focal-maintainer-only.txt",
"ubuntu/source_distribution/packages-focal-test-only.txt",
Expand Down
15 changes: 10 additions & 5 deletions setup/ubuntu/install_prereqs.sh
Original file line number Diff line number Diff line change
Expand Up @@ -31,16 +31,21 @@ while [ "${1:-}" != "" ]; do
--with-kcov)
source_distribution_args+=(--with-kcov)
;;
# Install prerequisites that are only needed to when CC=clang-9, i.e.,
# opts-in to the ability to compile Drake's C++ code using Clang.
--with-clang)
source_distribution_args+=(--with-clang)
;;
# Do NOT install prerequisites that are only needed to when CC=clang-9,
# i.e., opts-out of the ability to compile Drake's C++ code using Clang.
--without-clang)
source_distribution_args+=(--without-clang)
;;
# Install prerequisites that are only needed to run select maintainer
# scripts. Most developers will not need to install these dependencies.
--with-maintainer-only)
source_distribution_args+=(--with-maintainer-only)
;;
# Do NOT install prerequisites that are only needed to build documentation,
# i.e., those prerequisites that are dependencies of bazel run //doc:build.
--without-doc-only)
source_distribution_args+=(--without-doc-only)
;;
# Do NOT install prerequisites that are only needed to build and/or run
# unit tests, i.e., those prerequisites that are not dependencies of
# bazel { build, run } //:install.
Expand Down
18 changes: 18 additions & 0 deletions setup/ubuntu/source_distribution/install_prereqs.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,13 @@ set -euo pipefail
with_doc_only=0
with_kcov=0
with_maintainer_only=0
with_clang=1
with_test_only=1
with_update=1
with_asking=1

# TODO(jwnimmer-tri) Eventually we should default to with_clang=0.

while [ "${1:-}" != "" ]; do
case "$1" in
# Install prerequisites that are only needed to build documentation,
Expand All @@ -29,6 +32,16 @@ while [ "${1:-}" != "" ]; do
--with-kcov)
with_kcov=1
;;
# Install prerequisites that are only needed to when CC=clang-9, i.e.,
# opts-in to the ability to compile Drake's C++ code using Clang.
--with-clang)
with_clang=1
;;
# Do NOT install prerequisites that are only needed to when CC=clang-9,
# i.e., opts-out of the ability to compile Drake's C++ code using Clang.
--without-clang)
with_clang=0
;;
# Install prerequisites that are only needed to run select maintainer
# scripts. Most developers will not need to install these dependencies.
--with-maintainer-only)
Expand Down Expand Up @@ -124,6 +137,11 @@ if [[ "${with_doc_only}" -eq 1 ]]; then
apt-get install ${maybe_yes} --no-install-recommends ${packages}
fi

if [[ "${with_clang}" -eq 1 ]]; then
packages=$(cat "${BASH_SOURCE%/*}/packages-${codename}-clang.txt")
apt-get install ${maybe_yes} --no-install-recommends ${packages}
fi

if [[ "${with_test_only}" -eq 1 ]]; then
packages=$(cat "${BASH_SOURCE%/*}/packages-${codename}-test-only.txt")
# Suppress Python 3.8 warnings when installing python3-pandas on Focal.
Expand Down
2 changes: 2 additions & 0 deletions setup/ubuntu/source_distribution/packages-bionic-clang.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
clang-9
libomp-9-dev
1 change: 0 additions & 1 deletion setup/ubuntu/source_distribution/packages-bionic.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
clang-9
clang-format-9
coinor-libclp-dev
coinor-libcoinutils-dev
Expand Down
2 changes: 2 additions & 0 deletions setup/ubuntu/source_distribution/packages-focal-clang.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
clang-9
libomp-9-dev
1 change: 0 additions & 1 deletion setup/ubuntu/source_distribution/packages-focal.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
clang-9
clang-format-9
coinor-libclp-dev
coinor-libcoinutils-dev
Expand Down