Skip to content

Commit

Permalink
Automatically disable USE_BINARYBUILDER_xxx when USE_SYSTEM_xxx i…
Browse files Browse the repository at this point in the history
…s 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.
  • Loading branch information
staticfloat authored and JeffBezanson committed May 23, 2019
1 parent 587cb82 commit 5f808c6
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 6 deletions.
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
32 changes: 29 additions & 3 deletions Make.inc
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down
4 changes: 2 additions & 2 deletions deps/unwind.mk
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
## UNWIND ##

ifneq ($(USE_BINARYBUILDER_UNWIND),1)
ifneq ($(USE_BINARYBUILDER_LIBUNWIND),1)
LIBUNWIND_CFLAGS := -U_FORTIFY_SOURCE $(fPIC)
LIBUNWIND_CPPFLAGS :=

Expand Down Expand Up @@ -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)
Expand Down

0 comments on commit 5f808c6

Please sign in to comment.