Skip to content

Commit

Permalink
Add libjulia 1.4.2
Browse files Browse the repository at this point in the history
  • Loading branch information
fingolfin committed Oct 4, 2020
1 parent 81fce0a commit 7caa40f
Show file tree
Hide file tree
Showing 7 changed files with 187 additions and 7 deletions.
22 changes: 15 additions & 7 deletions L/libjulia/common.jl
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# `julia build_tarballs.jl --help` to see a usage message.
using BinaryBuilder, Pkg.Types

# Collection of sources required to build GMP
# Collection of sources required to build Julia
function configure(version)
name = "libjulia"

Expand All @@ -21,6 +21,7 @@ function configure(version)
apk add coreutils libuv-dev utf8proc
cd $WORKSPACE/srcdir/julia*
version=$(cat VERSION)
# Apply patches
if [ -d $WORKSPACE/srcdir/patches ]; then
Expand Down Expand Up @@ -73,7 +74,11 @@ function configure(version)
CFLAGS="-I${prefix}/include"
CXXFLAGS="-I${prefix}/include"
else
LLVMLINK="-L${prefix}/lib -lLLVM-9jl"
if [[ "${version}" == 1.4.* ]]; then
LLVMLINK="-L${prefix}/lib -lLLVM-8jl"
else
LLVMLINK="-L${prefix}/lib -lLLVM-9jl"
fi
LLVM_CXXFLAGS="-I${prefix}/include -std=c++14 -fno-exceptions -fno-rtti -D_GNU_SOURCE -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS"
LLVM_LDFLAGS="-L${prefix}/lib"
LDFLAGS="-L${prefix}/lib"
Expand All @@ -92,7 +97,7 @@ function configure(version)
LIBBLASNAME=libopenblas
USE_SYSTEM_LAPACK=1
LIBLAPACKNAME=libopenblas
# USE_SYSTEM_GMP=1
USE_SYSTEM_GMP=1
USE_SYSTEM_MPFR=1
USE_SYSTEM_SUITESPARSE=1
USE_SYSTEM_LIBUV=1
Expand Down Expand Up @@ -181,6 +186,10 @@ function configure(version)
filter!(!Sys.isfreebsd, platforms)
platforms = expand_cxxstring_abis(platforms)

for p in platforms
p["julia_version"] = "$(version.major).$(version.minor)"
end

# The products that we will ensure are always built
products = [
LibraryProduct("libjulia", :libjulia; dont_dlopen=true),
Expand All @@ -206,21 +215,20 @@ function configure(version)
push!(dependencies, Dependency(PackageSpec(name="OpenBLAS_jll", version=v"0.3.5")))
push!(dependencies, Dependency(PackageSpec(name="libLLVM_jll", version=v"8.0.1")))
push!(dependencies, Dependency(PackageSpec(name="MPFR_jll", version=v"4.0.2")))
# push!(dependencies, Dependency(PackageSpec(name="GMP_jll", version=v"6.1.2")))
push!(dependencies, Dependency(PackageSpec(name="GMP_jll", version=v"6.1.2")))
push!(dependencies, Dependency(PackageSpec(name="LibGit2_jll", version=v"0.28.2")))
elseif version.major == 1 && version.minor == 5
push!(dependencies, Dependency(PackageSpec(name="OpenBLAS_jll", version=v"0.3.9")))
push!(dependencies, Dependency(PackageSpec(name="libLLVM_jll", version=v"9.0.1")))
push!(dependencies, Dependency(PackageSpec(name="MPFR_jll", version=v"4.1.0")))
# push!(dependencies, Dependency(PackageSpec(name="GMP_jll", version=v"6.1.2")))
push!(dependencies, Dependency(PackageSpec(name="GMP_jll", version=v"6.1.2")))
push!(dependencies, Dependency(PackageSpec(name="LibGit2_jll", version=v"0.28.2")))
elseif version.major == 1 && version.minor == 6
push!(dependencies, Dependency(PackageSpec(name="OpenBLAS_jll", version=v"0.3.10")))
push!(dependencies, Dependency(PackageSpec(name="libLLVM_jll", version=v"9.0.1")))
push!(dependencies, Dependency(PackageSpec(name="MPFR_jll", version=v"4.1.0")))
# push!(dependencies, Dependency(PackageSpec(name="GMP_jll", version=v"6.2.0")))
push!(dependencies, Dependency(PackageSpec(name="GMP_jll", version=v"6.2.0")))
push!(dependencies, Dependency(PackageSpec(name="LibGit2_jll", version=v"1.0.1")))
end

return name, version, sources, script, platforms, products, dependencies
end
7 changes: 7 additions & 0 deletions L/libjulia/libjulia@1.4/build_tarballs.jl
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
include("../common.jl")

name, version, sources, script, platforms, products, dependencies = configure(v"1.4.2")

# Build the tarballs, and possibly a `build.jl` as well.
build_tarballs(ARGS, name, version, sources, script, platforms, products, dependencies; preferred_gcc_version=v"7", lock_microarchitecture=false)

40 changes: 40 additions & 0 deletions L/libjulia/libjulia@1.4/bundled/patches/0001-flisp-system.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
From 30c32040d81ba909242b6e5786772efa94e8120f Mon Sep 17 00:00:00 2001
From: Valentin Churavy <v.churavy@gmail.com>
Date: Wed, 23 Sep 2020 16:48:49 -0400
Subject: [PATCH] Allow flips to be built against system UTF8PROC

---
src/flisp/Makefile | 12 ++++++++++--
1 file changed, 10 insertions(+), 2 deletions(-)

diff --git a/src/flisp/Makefile b/src/flisp/Makefile
index 2158e2a5b2..42c4e11ed4 100644
--- a/src/flisp/Makefile
+++ b/src/flisp/Makefile
@@ -32,13 +32,21 @@ OBJS := $(SRCS:%.c=$(BUILDDIR)/%.o)
DOBJS := $(SRCS:%.c=$(BUILDDIR)/%.dbg.obj)
LLT_release := $(LLT_BUILDDIR)/libsupport.a
LLT_debug := $(LLT_BUILDDIR)/libsupport-debug.a
-LIBFILES_release := $(LLT_release) $(LIBUV) $(LIBUTF8PROC)
-LIBFILES_debug := $(LLT_debug) $(LIBUV) $(LIBUTF8PROC)
+LIBFILES_release := $(LLT_release) $(LIBUV)
+LIBFILES_debug := $(LLT_debug) $(LIBUV)
LIBS :=
ifneq ($(OS),WINNT)
LIBS += -lpthread
endif

+ifeq ($(USE_SYSTEM_UTF8PROC),0)
+LIBFILES_release += $(LIBUTF8PROC)
+LIBFILES_debug += $(LIBUTF8PROC)
+else
+LIBS += $(LIBUTF8PROC)
+endif
+
+
FLAGS := -I$(LLTSRCDIR) $(JCFLAGS) $(HFILEDIRS:%=-I%) \
-I$(LIBUV_INC) -I$(UTF8PROC_INC) -I$(build_includedir) $(LIBDIRS:%=-L%) \
-DLIBRARY_EXPORTS -DUTF8PROC_EXPORTS
--
2.28.0

25 changes: 25 additions & 0 deletions L/libjulia/libjulia@1.4/bundled/patches/0002-libuv-system.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
From 85eb6fe1d4dc2d98974c5d3e78b735e887b7b439 Mon Sep 17 00:00:00 2001
From: Valentin Churavy <v.churavy@gmail.com>
Date: Wed, 23 Sep 2020 16:59:34 -0400
Subject: [PATCH] Use universal LIBUV_INC instead of build_includedir

---
base/Makefile | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/base/Makefile b/base/Makefile
index efcf835de7..13bb3ee53d 100644
--- a/base/Makefile
+++ b/base/Makefile
@@ -42,7 +42,7 @@ $(BUILDDIR)/errno_h.jl:
$(BUILDDIR)/file_constants.jl: $(SRCDIR)/../src/file_constants.h
@$(call PRINT_PERL, $(CPP_STDOUT) -DJULIA $< | perl -nle 'print "$$1 0o$$2" if /^(\s*const\s+[A-z_]+\s+=)\s+(0[0-9]*)\s*$$/; print "$$1" if /^\s*(const\s+[A-z_]+\s+=\s+([1-9]|0x)[0-9A-z]*)\s*$$/' > $@)

-$(BUILDDIR)/uv_constants.jl: $(SRCDIR)/../src/uv_constants.h $(build_includedir)/uv/errno.h
+$(BUILDDIR)/uv_constants.jl: $(SRCDIR)/../src/uv_constants.h $(LIBUV_INC)/uv/errno.h
@$(call PRINT_PERL, $(CPP_STDOUT) "-I$(LIBUV_INC)" -DJULIA $< | tail -n 16 > $@)

$(BUILDDIR)/build_h.jl.phony:
--
2.28.0

31 changes: 31 additions & 0 deletions L/libjulia/libjulia@1.4/bundled/patches/0003-flisp.boot.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
From 242ff9a084fe790ac589c55045efc1d5c5f95f4b Mon Sep 17 00:00:00 2001
From: Valentin Churavy <v.churavy@gmail.com>
Date: Wed, 23 Sep 2020 18:28:01 -0400
Subject: [PATCH] stage flisp.boot into host

---
src/flisp/Makefile | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/src/flisp/Makefile b/src/flisp/Makefile
index 42c4e11ed4..50566a0258 100644
--- a/src/flisp/Makefile
+++ b/src/flisp/Makefile
@@ -115,9 +115,13 @@ $(BUILDDIR)/host/Makefile:
@echo 'BUILDING_HOST_TOOLS=1' >> $@
@echo 'include $(SRCDIR)/Makefile' >> $@

-$(BUILDDIR)/host/$(EXENAME): $(BUILDDIR)/host/Makefile
+$(BUILDDIR)/host/$(EXENAME): $(BUILDDIR)/host/Makefile | ${BUILDDIR}/host/flisp.boot
make -C $(BUILDDIR)/host $(EXENAME)

+
+$(BUILDDIR)/host/flisp.boot: $(SRCDIR)/flisp.boot | $(BUILDDIR)/host/Makefile
+ cp $< $@
+
ifneq ($(BUILDDIR),.)
ifneq ($(BUILDDIR),$(SRCDIR))
$(BUILDDIR)/flisp.boot: $(SRCDIR)/flisp.boot | $(BUILDDIR)
--
2.28.0

42 changes: 42 additions & 0 deletions L/libjulia/libjulia@1.4/bundled/patches/0004-musl.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
From f0dd7818f04ea3d68d534f460b69a6c3b4afbfd2 Mon Sep 17 00:00:00 2001
From: Julian Samaroo <jpsamaroo@jpsamaroo.me>
Date: Mon, 18 May 2020 20:58:07 -0500
Subject: [PATCH] Make processor_arm.cpp compile on musl (#34777)

---
src/processor_arm.cpp | 14 ++++++++++----
1 file changed, 10 insertions(+), 4 deletions(-)

diff --git a/src/processor_arm.cpp b/src/processor_arm.cpp
index 7b5fe0003bb5..96ca1789f593 100644
--- a/src/processor_arm.cpp
+++ b/src/processor_arm.cpp
@@ -10,10 +10,16 @@
#include <fstream>
#include <algorithm>

-#if defined(_CPU_AARCH64_) || __GLIBC_PREREQ(2, 16)
+// This nesting is required to allow compilation on musl
+#define USE_DYN_GETAUXVAL
+#if defined(_CPU_AARCH64_)
+# undef USE_DYN_GETAUXVAL
# include <sys/auxv.h>
-#else
-# define DYN_GETAUXVAL
+#elif defined(__GLIBC_PREREQ)
+# if __GLIBC_PREREQ(2, 16)
+# undef USE_DYN_GETAUXVAL
+# include <sys/auxv.h>
+# endif
#endif

namespace ARM {
@@ -498,7 +504,7 @@ static constexpr size_t ncpu_names = sizeof(cpus) / sizeof(cpus[0]);
# define AT_HWCAP2 26
#endif

-#if defined(DYN_GETAUXVAL)
+#if defined(USE_DYN_GETAUXVAL)
static unsigned long getauxval_procfs(unsigned long type)
{
int fd = open("/proc/self/auxv", O_RDONLY);
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
From 956cf8fa2f07f43ffb0a91bd23741e83838f9e7a Mon Sep 17 00:00:00 2001
From: Valentin Churavy <v.churavy@gmail.com>
Date: Thu, 24 Sep 2020 09:41:49 -0400
Subject: [PATCH] use BUILD_EXE for flisp

---
src/Makefile | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/Makefile b/src/Makefile
index 578677b3e1..2852b0ac86 100644
--- a/src/Makefile
+++ b/src/Makefile
@@ -139,8 +139,8 @@ FLISPDIR := $(BUILDDIR)/flisp/host
else
FLISPDIR := $(BUILDDIR)/flisp
endif
-FLISP_EXECUTABLE_debug := $(FLISPDIR)/flisp-debug$(EXE)
-FLISP_EXECUTABLE_release := $(FLISPDIR)/flisp$(EXE)
+FLISP_EXECUTABLE_debug := $(FLISPDIR)/flisp-debug$(BUILD_EXE)
+FLISP_EXECUTABLE_release := $(FLISPDIR)/flisp$(BUILD_EXE)
ifeq ($(OS),WINNT)
FLISP_EXECUTABLE := $(FLISP_EXECUTABLE_release)
else
--
2.28.0

0 comments on commit 7caa40f

Please sign in to comment.