From 5f808c6ad7dbc06644647cde8ccff50fb5d907a9 Mon Sep 17 00:00:00 2001 From: Elliot Saba Date: Thu, 23 May 2019 11:40:13 -0700 Subject: [PATCH] Automatically disable `USE_BINARYBUILDER_xxx` when `USE_SYSTEM_xxx` is set (#31725) Also renames `USE_BINARYBUILDER_UNWIND` to `USE_BINARYBUILDER_LIBUNWIND` for consistency, as well as providing a little bit of dependency logic to auto-disable `USE_BINARYBUILDER_SUITESPARSE` if `USE_SYSTEM_BLAS` is set, for example. --- .travis.yml | 2 +- Make.inc | 32 +++++++++++++++++++++++++++++--- deps/unwind.mk | 4 ++-- 3 files changed, 32 insertions(+), 6 deletions(-) diff --git a/.travis.yml b/.travis.yml index e93f329e7dcbf..fc3961a3e02d0 100644 --- a/.travis.yml +++ b/.travis.yml @@ -61,7 +61,7 @@ before_install: ln -s /usr/bin/g++-5 $HOME/bin/x86_64-linux-gnu-g++; gcc --version; BAR="bar -i 30"; - BUILDOPTS="-j5 VERBOSE=1 FORCE_ASSERTIONS=1 LLVM_ASSERTIONS=1 USECCACHE=1 USE_BINARYBUILDER_LIBUV=0 USE_BINARYBUILDER_UNWIND=0 USE_BINARYBUILDER_LLVM=0"; + BUILDOPTS="-j5 VERBOSE=1 FORCE_ASSERTIONS=1 LLVM_ASSERTIONS=1 USECCACHE=1 USE_BINARYBUILDER_LIBUV=0 USE_BINARYBUILDER_LIBUNWIND=0 USE_BINARYBUILDER_LLVM=0"; echo "override ARCH=$ARCH" >> Make.user; sudo sh -c "echo 0 > /proc/sys/net/ipv6/conf/lo/disable_ipv6"; export JULIA_CPU_THREADS=4; diff --git a/Make.inc b/Make.inc index 3084d12c54b32..77a58b266e2ed 100644 --- a/Make.inc +++ b/Make.inc @@ -980,7 +980,7 @@ else endif # BinaryBuilder options. We default to "on" for all the projects listed in BB_PROJECTS, -# but only if contrib/normalize_triplet.py works for our requested triplet +# but only if contrib/normalize_triplet.py works for our requested triplet. ifeq ($(shell python $(JULIAHOME)/contrib/normalize_triplet.py $(or $(XC_HOST),$(XC_HOST),$(BUILD_MACHINE)) >/dev/null 2>/dev/null; echo $$?),0) USE_BINARYBUILDER ?= 1 else @@ -991,8 +991,34 @@ USE_BINARYBUILDER ?= 0 endif # This is the set of projects that BinaryBuilder dependencies are hooked up for. -BB_PROJECTS := OPENBLAS LLVM SUITESPARSE OPENLIBM GMP MBEDTLS LIBSSH2 MPFR CURL LIBGIT2 PCRE LIBUV UNWIND DSFMT OBJCONV -$(foreach proj,$(BB_PROJECTS),$(if $(USE_BINARYBUILDER_$(proj)),,$(eval USE_BINARYBUILDER_$(proj) ?= $(USE_BINARYBUILDER)))) +BB_PROJECTS := OPENBLAS LLVM SUITESPARSE OPENLIBM GMP MBEDTLS LIBSSH2 MPFR CURL LIBGIT2 PCRE LIBUV LIBUNWIND DSFMT OBJCONV +define SET_BB_DEFAULT +# First, check to see if BB is disabled on a global setting +ifeq ($$(USE_BINARYBUILDER),0) +USE_BINARYBUILDER_$(1) ?= 0 +else +# If it's not, check to see if it's disabled by a USE_SYSTEM_xxx flag +ifeq ($$(USE_SYSTEM_$(1)),1) +USE_BINARYBUILDER_$(1) ?= 0 +else +USE_BINARYBUILDER_$(1) ?= 1 +endif +endif +endef +$(foreach proj,$(BB_PROJECTS),$(eval $(call SET_BB_DEFAULT,$(proj)))) + +# Some special restrictions on BB usage: +ifeq ($(USE_SYSTEM_BLAS),1) +# Since the names don't line up (`BLAS` vs. `OPENBLAS`), manually gate: +USE_BINARYBUILDER_OPENBLAS ?= 0 +# Disable BB SuiteSparse if we're using system BLAS +USE_BINARYBUILDER_SUITESPARSE ?= 0 +endif + +ifeq ($(USE_SYSTEM_LIBM),1) +# If we're using system libm, disable BB OpenLibm +USE_BINARYBUILDER_OPENLIBM ?= 0 +endif # Use the Assertions build BINARYBUILDER_LLVM_ASSERTS ?= 0 diff --git a/deps/unwind.mk b/deps/unwind.mk index 055debc07974d..20e3133858450 100644 --- a/deps/unwind.mk +++ b/deps/unwind.mk @@ -1,6 +1,6 @@ ## UNWIND ## -ifneq ($(USE_BINARYBUILDER_UNWIND),1) +ifneq ($(USE_BINARYBUILDER_LIBUNWIND),1) LIBUNWIND_CFLAGS := -U_FORTIFY_SOURCE $(fPIC) LIBUNWIND_CPPFLAGS := @@ -102,7 +102,7 @@ fastcheck-osxunwind: check-osxunwind check-osxunwind: compile-osxunwind install-osxunwind: $(build_prefix)/manifest/osxunwind -else # USE_BINARYBUILDER_UNWIND +else # USE_BINARYBUILDER_LIBUNWIND UNWIND_BB_URL_BASE := https://github.com/JuliaPackaging/Yggdrasil/releases/download/LibUnwind-v$(UNWIND_VER)-$(UNWIND_BB_REL) UNWIND_BB_NAME := LibUnwind.v$(UNWIND_VER)