Skip to content

Commit

Permalink
switches Julia to LLVM 6.0.0 and uses BinaryBuilder for CI
Browse files Browse the repository at this point in the history
- changes the support LLVM version to 6.0.0
- adds support for using a pre-built LLVM binary from
  `staticfloat/LLVMBuilder` taking advantage of the
  BinaryBuilder infrastructure.
- adds two Makefile flags:
  - `BINARYBUILDER_TRIPLET` the BinaryBuilder triplet you are building for.
    An example would be `x86_64-linux-gnu`.
  - `USE_BINARYBUILDER_LLVM = 0` set this to 1 if you want to use
    the pre-built binaries for LLVM.
- uses the pre-built binaries on OSX Travis instead of the bottle.
- uses the pre-built binaries on Appveyor instead of a custom cache.
  • Loading branch information
vchuravy committed May 4, 2018
1 parent 7f47f42 commit 702d0d5
Show file tree
Hide file tree
Showing 21 changed files with 57 additions and 23 deletions.
7 changes: 4 additions & 3 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -85,11 +85,12 @@ before_install:
brew tap staticfloat/julia;
brew rm --force $(brew deps --HEAD julia);
brew install -v --only-dependencies --HEAD julia;
brew install -v staticfloat/juliadeps/libgfortran llvm39-julia;
BUILDOPTS="-j3 USECLANG=1 USECCACHE=1 LLVM_CONFIG=$(brew --prefix llvm39-julia)/bin/llvm-config LLVM_SIZE=$(brew --prefix llvm39-julia)/bin/llvm-size";
brew install -v staticfloat/juliadeps/libgfortran;
BUILDOPTS="-j3 USECLANG=1 USECCACHE=1 BINARYBUILDER_TRIPLET=x86_64-apple-darwin14";
BUILDOPTS="$BUILDOPTS USE_BINARYBUILDER_LLVM=1 LLVM_CONFIG=$TRAVIS_BUILD_DIR/usr/tools/llvm-config LLVM_SIZE=$TRAVIS_BUILD_DIR/usr/tools/llvm-size";
BUILDOPTS="$BUILDOPTS VERBOSE=1 USE_BLAS64=0 SUITESPARSE_INC=-I$(brew --prefix suite-sparse-julia)/include FORCE_ASSERTIONS=1";
BUILDOPTS="$BUILDOPTS LIBBLAS=-lopenblas LIBBLASNAME=libopenblas LIBLAPACK=-lopenblas LIBLAPACKNAME=libopenblas";
for lib in LLVM SUITESPARSE ARPACK BLAS LAPACK GMP MPFR PCRE LIBUNWIND; do
for lib in SUITESPARSE ARPACK BLAS LAPACK GMP MPFR PCRE LIBUNWIND; do
BUILDOPTS="$BUILDOPTS USE_SYSTEM_$lib=1";
done;
export LDFLAGS="-L$(brew --prefix openblas-julia)/lib -L$(brew --prefix suite-sparse-julia)/lib";
Expand Down
5 changes: 5 additions & 0 deletions Make.inc
Original file line number Diff line number Diff line change
Expand Up @@ -220,6 +220,11 @@ includedir_rel := $(shell $(JULIAHOME)/contrib/relative_path.sh $(bindir) $(incl
INSTALL_F := $(JULIAHOME)/contrib/install.sh 644
INSTALL_M := $(JULIAHOME)/contrib/install.sh 755
# BinaryBuilder options
# TODO: Autodiscover triplet
USE_BINARYBUILDER_LLVM := 0
BINARYBUILDER_TRIPLET :=
# LLVM Options
LLVMROOT := $(build_prefix)
LLVM_ASSERTIONS := 0
Expand Down
20 changes: 11 additions & 9 deletions contrib/windows/appveyor_build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -45,13 +45,15 @@ if [ "$ARCH" = x86_64 ]; then
echo 'USE_BLAS64 = 1' >> Make.user
echo 'LIBBLAS = -L$(JULIAHOME)/usr/bin -lopenblas64_' >> Make.user
echo 'LIBBLASNAME = libopenblas64_' >> Make.user
echo 'BINARYBUILDER_TRIPLET = x86_64-w64-mingw32' >> Make.user
else
bits=32
archsuffix=86
exc=sjlj
echo "override MARCH = pentium4" >> Make.user
echo 'LIBBLAS = -L$(JULIAHOME)/usr/bin -lopenblas' >> Make.user
echo 'LIBBLASNAME = libopenblas' >> Make.user
echo 'BINARYBUILDER_TRIPLET = i686-w64-mingw32' >> Make.user
fi
echo "override JULIA_CPU_TARGET=generic;native" >> Make.user

Expand Down Expand Up @@ -128,8 +130,7 @@ if [ -z "$USEMSVC" ]; then
rm -f mingw$bits/bin/make.exe
fi
export AR=${CROSS_COMPILE}ar

f=llvm-3.9.1-$ARCH-w64-mingw32-juliadeps-r07.7z
mkdir -p usr/tools
else
echo "override USEMSVC = 1" >> Make.user
echo "override ARCH = $ARCH" >> Make.user
Expand All @@ -143,13 +144,12 @@ else
echo "override LD = $LD -DEBUG" >> Make.user

f=llvm-3.3-$ARCH-msvc12-juliadeps.7z
checksum_download \
"$f" "https://bintray.com/artifact/download/tkelman/generic/$f"
echo "Extracting $f"
$SEVENZIP x -y $f >> get-deps.log
fi

checksum_download \
"$f" "https://bintray.com/artifact/download/tkelman/generic/$f"
echo "Extracting $f"
$SEVENZIP x -y $f >> get-deps.log

if [ -z "`which make 2>/dev/null`" ]; then
if [ -n "`uname | grep CYGWIN`" ]; then
echo "Install the Cygwin package for 'make' and try again."
Expand All @@ -170,7 +170,7 @@ if ! [ -e usr/bin/busybox.exe ]; then
echo "Downloading $f"
$curlflags -o usr/bin/busybox.exe http:https://frippery.org/files/busybox/$f
fi
chmod +x usr/bin/* usr/tools/*
chmod -R +x usr/bin usr/tools

for lib in SUITESPARSE ARPACK BLAS LAPACK \
GMP MPFR PCRE LIBUNWIND; do
Expand Down Expand Up @@ -202,7 +202,9 @@ if [ -n "$USEMSVC" ]; then
-e 's|$dir/$lib|$dir/lib$lib|g' deps/srccache/libuv/compile > linkld
chmod +x linkld
else
echo 'override DEP_LIBS += openlibm' >> Make.user
# Use BinaryBuilder
echo 'USE_BINARYBUILDER_LLVM = 1' >> Make.user
echo 'override DEP_LIBS += llvm openlibm' >> Make.user
make check-whitespace
make VERBOSE=1 -C base version_git.jl.phony
echo 'NO_GIT = 1' >> Make.user
Expand Down
3 changes: 2 additions & 1 deletion deps/Versions.make
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
LLVM_VER = 3.9.1
LLVM_VER = 6.0.0
LLVM_BB_REL = 1
PCRE_VER = 10.30
DSFMT_VER = 2.2.3
LAPACK_VER = 3.5.0
Expand Down
1 change: 0 additions & 1 deletion deps/checksums/cfe-3.9.1.src.tar.xz/md5

This file was deleted.

1 change: 0 additions & 1 deletion deps/checksums/cfe-3.9.1.src.tar.xz/sha512

This file was deleted.

1 change: 1 addition & 0 deletions deps/checksums/cfe-6.0.0.src.tar.xz/md5
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
121b3896cb0c7765d690acc5d9495d24
1 change: 1 addition & 0 deletions deps/checksums/cfe-6.0.0.src.tar.xz/sha512
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
e886dd27448503bbfc7fd4f68eb089c19b2f2be4f0e5b26d3df253833f60b91d70b472a6b530063386e2252075b110ce9f5942800feddf6c34b94a75cf7bd5c6
1 change: 0 additions & 1 deletion deps/checksums/compiler-rt-3.9.1.src.tar.xz/md5

This file was deleted.

1 change: 0 additions & 1 deletion deps/checksums/compiler-rt-3.9.1.src.tar.xz/sha512

This file was deleted.

1 change: 1 addition & 0 deletions deps/checksums/compiler-rt-6.0.0.src.tar.xz/md5
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
ba6368e894b5528e527d86a69d8533c6
1 change: 1 addition & 0 deletions deps/checksums/compiler-rt-6.0.0.src.tar.xz/sha512
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
717bed116ef43ebb2e18daf6fb737472edf57564947f53fe6368d3bbb080f63e986c0d1b94dbd087be998196ad7be54f4361854f8eb5214600b82449ba02c9c1
1 change: 0 additions & 1 deletion deps/checksums/libcxx-3.9.1.src.tar.xz/md5

This file was deleted.

1 change: 0 additions & 1 deletion deps/checksums/libcxx-3.9.1.src.tar.xz/sha512

This file was deleted.

1 change: 0 additions & 1 deletion deps/checksums/lldb-3.9.1.src.tar.xz/md5

This file was deleted.

1 change: 0 additions & 1 deletion deps/checksums/lldb-3.9.1.src.tar.xz/sha512

This file was deleted.

1 change: 0 additions & 1 deletion deps/checksums/llvm-3.9.1.src.tar.xz/md5

This file was deleted.

1 change: 0 additions & 1 deletion deps/checksums/llvm-3.9.1.src.tar.xz/sha512

This file was deleted.

1 change: 1 addition & 0 deletions deps/checksums/llvm-6.0.0.src.tar.xz/md5
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
788a11a35fa62eb008019b37187d09d2
1 change: 1 addition & 0 deletions deps/checksums/llvm-6.0.0.src.tar.xz/sha512
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
a71fdd5ddc46f01327ad891cfcc198febdbe10769c57f14d8a4fb7d514621ee4080e1a641200d3353c16a16731d390270499ec6cd3dc98fadc570f3eb6b52b8c
29 changes: 29 additions & 0 deletions deps/llvm.mk
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
## LLVM ##
include $(SRCDIR)/llvm-ver.make

ifneq ($(USE_BINARYBUILDER_LLVM), 1)
LLVM_GIT_URL_BASE ?= http:https://llvm.org/git
LLVM_GIT_URL_LLVM ?= $(LLVM_GIT_URL_BASE)/llvm.git
LLVM_GIT_URL_CLANG ?= $(LLVM_GIT_URL_BASE)/clang.git
Expand Down Expand Up @@ -567,3 +568,31 @@ ifeq ($(USE_POLLY),1)
([ -d "$(LLVM_SRC_DIR)/tools/polly" ] || exit 0; cd $(LLVM_SRC_DIR)/tools/polly; git pull --ff-only)
endif
endif
else # USE_BINARYBUILDER_LLVM
LLVM_BB_URL_BASE := https://github.com/staticfloat/LLVMBuilder/releases/download
LLVM_BB_URL := $(LLVM_BB_URL_BASE)/v$(LLVM_VER)-$(LLVM_BB_REL)/LLVM.$(BINARYBUILDER_TRIPLET).tar.gz

$(BUILDDIR)/llvm-$(LLVM_VER)-$(LLVM_BB_REL):
mkdir -p $@

$(BUILDDIR)/llvm-$(LLVM_VER)-$(LLVM_BB_REL)/LLVM.$(BINARYBUILDER_TRIPLET).tar.gz: | $(BUILDDIR)/llvm-$(LLVM_VER)-$(LLVM_BB_REL)
$(JLDOWNLOAD) $@ $(LLVM_BB_URL)

$(BUILDDIR)/llvm-$(LLVM_VER)-$(LLVM_BB_REL)/build-compiled: | $(BUILDDIR)/llvm-$(LLVM_VER)-$(LLVM_BB_REL)/LLVM.$(BINARYBUILDER_TRIPLET).tar.gz
echo 1 > $@

$(eval $(call staged-install,llvm,llvm-$$(LLVM_VER)-$$(LLVM_BB_REL),,,,))

#Override provision of stage tarball
$(build_staging)/llvm-$(LLVM_VER)-$(LLVM_BB_REL).tgz: $(BUILDDIR)/llvm-$(LLVM_VER)-$(LLVM_BB_REL)/LLVM.$(BINARYBUILDER_TRIPLET).tar.gz
cp $< $@

clean-llvm:
distclean-llvm:
get-llvm: $(BUILDDIR)/llvm-$(LLVM_VER)-$(LLVM_BB_REL)/LLVM.$(BINARYBUILDER_TRIPLET).tar.gz
extract-llvm:
configure-llvm:
compile-llvm:
fastcheck-llvm:
check-llvm:
endif # USE_BINARYBUILDER_LLVM

0 comments on commit 702d0d5

Please sign in to comment.