Skip to content

Commit

Permalink
libjulia_jll 1.7 (JuliaPackaging#3214)
Browse files Browse the repository at this point in the history
* libjulia_jll 1.7

* Change most libjulia dependencies into build dependencies
  • Loading branch information
fingolfin authored Jul 3, 2021
1 parent 4faa473 commit ea3eec9
Show file tree
Hide file tree
Showing 3 changed files with 103 additions and 29 deletions.
95 changes: 66 additions & 29 deletions L/libjulia/common.jl
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
# `julia build_tarballs.jl --help` to see a usage message.
using BinaryBuilder, Pkg

include("../../fancy_toys.jl") # for get_addable_spec

# return the platforms supported by libjulia
function libjulia_platforms(julia_version)
platforms = supported_platforms(; experimental=julia_version v"1.7")
Expand All @@ -27,6 +29,7 @@ function build_julia(ARGS, version)
v"1.4.2" => "76a94e06e68fb99822e0876a37c2ed3873e9061e895ab826fd8c9fc7e2f52795",
v"1.5.3" => "be19630383047783d6f314ebe0bf5e3f95f82b0c203606ec636dced405aab1fe",
v"1.6.0" => "c253360d29abb9a3a9e6e01493e0f7bb537d88014fd58ac561b5ba30fcb44cad",
v"1.7.0-beta2" => "7bd9ae5b20f9a03ef97f830285007eaa318a780675ab59b6528cd8ef242aa8cb",
)

sources = [
Expand Down Expand Up @@ -77,10 +80,13 @@ function build_julia(ARGS, version)
override OS=Linux
EOM
# TODO: eventually we should get LLVM_CXXFLAGS from llvm-config from
# a HostDependency, now that we have those
LLVM_CXXFLAGS="-I${prefix}/include -fno-exceptions -fno-rtti -D_GNU_SOURCE -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS"
if [[ "${version}" == 1.[0-5].* ]]; then
LLVM_CXXFLAGS="-I${prefix}/include -std=c++11 -fno-exceptions -fno-rtti -D_GNU_SOURCE -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS"
LLVM_CXXFLAGS="${LLVM_CXXFLAGS} -std=c++11""
else
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_CXXFLAGS="${LLVM_CXXFLAGS} -std=c++14""
fi
LLVM_LDFLAGS="-L${prefix}/lib"
LDFLAGS="-L${prefix}/lib"
Expand All @@ -100,8 +106,13 @@ function build_julia(ARGS, version)
LLVMLINK="-L${prefix}/lib -lLLVM-8jl"
elif [[ "${version}" == 1.5.* ]]; then
LLVMLINK="-L${prefix}/lib -lLLVM-9jl"
else
elif [[ "${version}" == 1.6.* ]]; then
LLVMLINK="-L${prefix}/lib -lLLVM-11jl"
elif [[ "${version}" == 1.7.* ]]; then
LLVMLINK="-L${prefix}/lib -lLLVM-12jl"
else
echo "Error, LLVM version not specified"
exit 1
fi
fi
Expand Down Expand Up @@ -170,7 +181,7 @@ function build_julia(ARGS, version)
USE_SYSTEM_LAPACK=1
LIBLAPACKNAME=libopenblas
EOM
else
elif [[ "${version}" == 1.[0-6].* ]]; then
if [[ "${version}" == 1.[0-4].* ]]; then
# remove broken dylib placeholder to force static linking
rm -f ${prefix}/lib/libosxunwind.dylib
Expand Down Expand Up @@ -229,6 +240,10 @@ function build_julia(ARGS, version)
install_license LICENSE.md
"""

# HACK: JLLs are not allowed to use prerelease versions, so strip that out
# e.g. for 1.7.0-beta2
version = VersionNumber(version.major, version.minor, version.patch)

# These are the platforms we will build for by default, unless further
# platforms are passed in on the command line
platforms = libjulia_platforms(version)
Expand All @@ -251,51 +266,73 @@ function build_julia(ARGS, version)
]

# Dependencies that must be installed before this package can be built/used
dependencies = [

dependencies = BinaryBuilder.AbstractDependency[
Dependency("LibUnwind_jll"),
Dependency("PCRE2_jll", compat="10.31"),
Dependency("OpenLibm_jll"),
Dependency("dSFMT_jll"),
Dependency("LibUV_jll"),
Dependency("utf8proc_jll"),
Dependency("MbedTLS_jll"),
Dependency("LibSSH2_jll"),
Dependency("LibCURL_jll"),
Dependency("Zlib_jll"),
Dependency("p7zip_jll"),
Dependency("MPFR_jll"),
Dependency("GMP_jll"),
Dependency("Objconv_jll"),
BuildDependency("OpenLibm_jll"),
BuildDependency("dSFMT_jll"),
BuildDependency("LibUV_jll"),
BuildDependency("utf8proc_jll"),
BuildDependency("MbedTLS_jll"),
BuildDependency("LibSSH2_jll"),
BuildDependency("LibCURL_jll"),
BuildDependency("Zlib_jll"),
BuildDependency("p7zip_jll"),
BuildDependency("MPFR_jll"),
BuildDependency("GMP_jll"),
BuildDependency("Objconv_jll"),
]
if version < v"1.5.1"
push!(dependencies, Dependency("LibOSXUnwind_jll", compat="0.0.5"))
else
elseif version < v"1.7"
push!(dependencies, Dependency("LibOSXUnwind_jll", compat="0.0.6"))
end

if version < v"1.6"
push!(dependencies, Dependency("SuiteSparse_jll", compat="5.4.0"))
push!(dependencies, BuildDependency("SuiteSparse_jll", compat="5.4.0"))
else
push!(dependencies, Dependency("SuiteSparse_jll"))
push!(dependencies, BuildDependency("SuiteSparse_jll"))
end

if version < v"1.7"
push!(dependencies, BuildDependency("PCRE2_jll", compat="10.31"))
#else
# push!(dependencies, BuildDependency("PCRE2_jll", compat="10.36"))
end

if version.major == 1 && version.minor == 3
push!(dependencies, Dependency("OpenBLAS_jll", compat="0.3.5"))
push!(dependencies, BuildDependency("OpenBLAS_jll", compat="0.3.5"))
# there is no libLLVM_jll 6.0.1, so we use LLVM_jll instead
push!(dependencies, Dependency("LLVM_jll", compat="6.0.1"))
push!(dependencies, Dependency("LibGit2_jll", compat="0.28.2"))
push!(dependencies, BuildDependency("LibGit2_jll", compat="0.28.2"))
elseif version.major == 1 && version.minor == 4
push!(dependencies, Dependency("OpenBLAS_jll", compat="0.3.5"))
push!(dependencies, BuildDependency("OpenBLAS_jll", compat="0.3.5"))
push!(dependencies, Dependency("libLLVM_jll", compat="8.0.1"))
push!(dependencies, Dependency("LibGit2_jll", compat="0.28.2"))
push!(dependencies, BuildDependency("LibGit2_jll", compat="0.28.2"))
elseif version.major == 1 && version.minor == 5
push!(dependencies, Dependency("OpenBLAS_jll", compat="0.3.9"))
push!(dependencies, BuildDependency("OpenBLAS_jll", compat="0.3.9"))
push!(dependencies, Dependency("libLLVM_jll", compat="9.0.1"))
push!(dependencies, Dependency("LibGit2_jll", compat="0.28.2"))
push!(dependencies, BuildDependency("LibGit2_jll", compat="0.28.2"))
elseif version.major == 1 && version.minor == 6
push!(dependencies, Dependency("OpenBLAS_jll", compat="0.3.10"))
push!(dependencies, BuildDependency("OpenBLAS_jll", compat="0.3.10"))
push!(dependencies, Dependency("libLLVM_jll", compat="11.0.0"))
push!(dependencies, Dependency("LibGit2_jll", compat="1.0.1"))
push!(dependencies, BuildDependency("LibGit2_jll", compat="1.0.1"))
elseif version.major == 1 && version.minor == 7
#push!(dependencies, BuildDependency("OpenBLAS_jll", compat="0.3.13"))
#push!(dependencies, Dependency("libLLVM_jll", compat="12.0.0"))
#push!(dependencies, BuildDependency("LibGit2_jll", compat="1.0.1"))

# HACK: we can't install LLVM 12 JLLs for Julia 1.7 from within Julia 1.6. Similar
# for several other standard JLLs.
# So we use get_addable_spec below to "fake it" for now.
# This means the resulting package has fewer dependencies declared, but at least it
# will work and allow people to build JLL binaries ready for Julia 1.7
push!(dependencies, BuildDependency(get_addable_spec("LLVM_full_jll", v"12.0.0+0")))

# starting with Julia 1.7, we need LLVMLibUnwind_jll
push!(dependencies, BuildDependency(get_addable_spec("LLVMLibUnwind_jll", v"11.0.1+1")))
else
error("Unsupported Julia version")
end

julia_compat = version v"1.7" ? "1.6" : "1.0"
Expand Down
2 changes: 2 additions & 0 deletions L/libjulia/libjulia@1.7/build_tarballs.jl
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
include("../common.jl")
build_julia(ARGS, v"1.7.0-beta2")
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
From ab50ac55b912b156c707cff19b068e48d17304c6 Mon Sep 17 00:00:00 2001
From: Max Horn <max@quendi.de>
Date: Fri, 2 Jul 2021 11:50:47 +0200
Subject: [PATCH] Skip running dsymutil for macOS

`dsymutil` segfaults when running on `libjulia-internal.*.dylib`. We don't
have the resources to debug the issue now (although we should look into this
because it can happen elsewhere), but at least we can get the build done.
---
src/Makefile | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/Makefile b/src/Makefile
index 15543ff11b..e80706d30c 100644
--- a/src/Makefile
+++ b/src/Makefile
@@ -300,13 +300,13 @@ $(build_shlibdir)/libjulia-internal.$(JL_MAJOR_MINOR_SHLIB_EXT): $(SRCDIR)/julia
@$(call PRINT_LINK, $(CXXLD) $(call IMPLIB_FLAGS,$@) $(JCXXFLAGS) $(CXXLDFLAGS) $(SHIPFLAGS) $(OBJS) $(RPATH_LIB) -o $@ \
$(JLDFLAGS) $(JLIBLDFLAGS) $(RELEASE_LIBS) $(call SONAME_FLAGS,libjulia-internal.$(JL_MAJOR_SHLIB_EXT)))
@$(INSTALL_NAME_CMD)libjulia-internal.$(SHLIB_EXT) $@
- $(DSYMUTIL) $@
+ #$(DSYMUTIL) $@

$(build_shlibdir)/libjulia-internal-debug.$(JL_MAJOR_MINOR_SHLIB_EXT): $(SRCDIR)/julia.expmap $(DOBJS) $(BUILDDIR)/flisp/libflisp-debug.a $(BUILDDIR)/support/libsupport-debug.a $(LIBUV)
@$(call PRINT_LINK, $(CXXLD) $(call IMPLIB_FLAGS,$@) $(JCXXFLAGS) $(CXXLDFLAGS) $(DEBUGFLAGS) $(DOBJS) $(RPATH_LIB) -o $@ \
$(JLDFLAGS) $(JLIBLDFLAGS) $(DEBUG_LIBS) $(call SONAME_FLAGS,libjulia-internal-debug.$(JL_MAJOR_SHLIB_EXT)))
@$(INSTALL_NAME_CMD)libjulia-internal-debug.$(SHLIB_EXT) $@
- $(DSYMUTIL) $@
+ #$(DSYMUTIL) $@

ifneq ($(OS), WINNT)
$(build_shlibdir)/libjulia-internal.$(JL_MAJOR_SHLIB_EXT) $(build_shlibdir)/libjulia-internal-debug.$(JL_MAJOR_SHLIB_EXT): $(build_shlibdir)/libjulia-internal%.$(JL_MAJOR_SHLIB_EXT): \
--
2.31.0

0 comments on commit ea3eec9

Please sign in to comment.