From a47b73335a495e14d8b846c54d218775e9ea02c3 Mon Sep 17 00:00:00 2001 From: Adam Beckmeyer Date: Mon, 3 Aug 2020 11:14:03 -0400 Subject: [PATCH] julia: update to 1.5.0. This update uses as many system shlibs as possible, including llvm10, which seems to pass the included test suite more or less as well as using the in-tree, patched llvm9. If any issues arise, it may be necessary to drop the llvm10 dependency and set USE_SYSTEM_LLVM=0 for a rebuild. The linear algebra libraries are still vendored, because julia likes to use an ILP64 ABI for BLAS while the Void openblas uses an LP64 ABI. Closes #24097. Co-authored-by: Adam Beckmeyer Co-authored-by: Andrew J. Hesford --- srcpkgs/julia/patches/36697.diff | 104 +++++++++++++++++++++++++++++++ srcpkgs/julia/template | 81 +++++++++++++----------- 2 files changed, 150 insertions(+), 35 deletions(-) create mode 100644 srcpkgs/julia/patches/36697.diff diff --git a/srcpkgs/julia/patches/36697.diff b/srcpkgs/julia/patches/36697.diff new file mode 100644 index 0000000000..f0c84d548e --- /dev/null +++ b/srcpkgs/julia/patches/36697.diff @@ -0,0 +1,104 @@ +This patch was taken from +to workaround julia 1.5.0 not building correctly with musl libc. + +diff --git Make.inc Make.inc +index e91461514463..21a0299318b5 100644 +--- Make.inc ++++ Make.inc +@@ -940,17 +940,17 @@ LIBUNWIND:= + else + ifeq ($(USE_SYSTEM_LIBUNWIND), 1) + ifneq ($(OS),Darwin) +-LIBUNWIND:=-lunwind-generic -lunwind ++LIBUNWIND:=-lunwind + # Only for linux since we want to use not yet released libunwind features + JCFLAGS+=-DSYSTEM_LIBUNWIND + JCPPFLAGS+=-DSYSTEM_LIBUNWIND + endif + else + ifeq ($(OS),Darwin) +-LIBUNWIND:=$(build_libdir)/libosxunwind.a ++LIBUNWIND:=-losxunwind + JCPPFLAGS+=-DLIBOSXUNWIND + else +-LIBUNWIND:=$(build_libdir)/libunwind-generic.a $(build_libdir)/libunwind.a ++LIBUNWIND:=-lunwind + endif + endif + endif +@@ -1206,12 +1206,12 @@ OSLIBS += -lelf -lkvm -lrt -lpthread + OSLIBS += -lgcc_s + + OSLIBS += -Wl,--export-dynamic -Wl,--version-script=$(JULIAHOME)/src/julia.expmap \ +- $(NO_WHOLE_ARCHIVE) $(LIBUNWIND) ++ $(NO_WHOLE_ARCHIVE) + endif + + ifeq ($(OS), Darwin) + SHLIB_EXT := dylib +-OSLIBS += -framework CoreFoundation $(LIBUNWIND) ++OSLIBS += -framework CoreFoundation + WHOLE_ARCHIVE := -Xlinker -all_load + NO_WHOLE_ARCHIVE := + JLDFLAGS := +diff --git Makefile Makefile +index 96f58b9aec4e..23d1bd5208f7 100644 +--- Makefile ++++ Makefile +@@ -181,6 +181,11 @@ endif + ifeq ($(USE_LLVM_SHLIB),1) + JL_PRIVATE_LIBS-$(USE_SYSTEM_LLVM) += libLLVM libLLVM-9jl + endif ++ifeq ($(OS),Darwin) ++JL_PRIVATE_LIBS-$(USE_SYSTEM_LIBUNWIND) += libosxunwind ++else ++JL_PRIVATE_LIBS-$(USE_SYSTEM_LIBUNWIND) += libunwind ++endif + + ifeq ($(USE_SYSTEM_LIBM),0) + JL_PRIVATE_LIBS-$(USE_SYSTEM_OPENLIBM) += libopenlibm +diff --git deps/Makefile deps/Makefile +index e6a975ba1873..90e231f30e85 100644 +--- deps/Makefile ++++ deps/Makefile +@@ -157,7 +157,11 @@ ifneq ($(OS), WINNT) + DEP_LIBS += libwhich + endif + +-DEP_LIBS_STAGED := $(filter-out suitesparse-wrapper osxunwind,$(DEP_LIBS)) # unlist targets that have not been converted to use the staged-install ++# unlist targets that have not been converted to use the staged-install ++DEP_LIBS_STAGED := $(filter-out suitesparse-wrapper,$(DEP_LIBS)) ++ifneq ($(USE_BINARYBUILDER_LIBUNWIND),1) ++DEP_LIBS_STAGED := $(filter-out osxunwind,$(DEP_LIBS)) ++endif + + + ## Common build target prefixes +diff --git deps/unwind.mk deps/unwind.mk +index f44917c28981..08d8990a720e 100644 +--- deps/unwind.mk ++++ deps/unwind.mk +@@ -109,7 +109,7 @@ UNWIND_BB_NAME := LibUnwind.v$(UNWIND_VER) + + $(eval $(call bb-install,unwind,UNWIND,false)) + +-OSXUNWIND_BB_URL_BASE := https://github.com/JuliaPackaging/Yggdrasil/releases/download/LibOSXUnwind-$(OSXUNWIND_VER)-$(OSXUNWIND_BB_REL) ++OSXUNWIND_BB_URL_BASE := https://github.com/JuliaBinaryWrappers/LibOSXUnwind_jll.jl/releases/download/LibOSXUnwind-v$(OSXUNWIND_VER)+$(OSXUNWIND_BB_REL) + OSXUNWIND_BB_NAME := LibOSXUnwind.v$(OSXUNWIND_VER) + + $(eval $(call bb-install,osxunwind,OSXUNWIND,false)) +diff --git src/Makefile src/Makefile +index 3153c0178d0a..7d8db3740209 100644 +--- src/Makefile ++++ src/Makefile +@@ -120,7 +120,7 @@ CLANG_LDFLAGS += -Wl,-undefined,dynamic_lookup + endif + + +-COMMON_LIBS := -L$(build_shlibdir) -L$(build_libdir) $(LIBUV) $(LIBUTF8PROC) $(NO_WHOLE_ARCHIVE) $(LLVMLINK) $(OSLIBS) $(LIBUNWIND) ++COMMON_LIBS := -L$(build_shlibdir) -L$(build_libdir) $(LIBUV) $(LIBUTF8PROC) $(NO_WHOLE_ARCHIVE) $(LIBUNWIND) $(LLVMLINK) $(OSLIBS) + DEBUG_LIBS := $(WHOLE_ARCHIVE) $(BUILDDIR)/flisp/libflisp-debug.a $(WHOLE_ARCHIVE) $(BUILDDIR)/support/libsupport-debug.a $(COMMON_LIBS) + RELEASE_LIBS := $(WHOLE_ARCHIVE) $(BUILDDIR)/flisp/libflisp.a $(WHOLE_ARCHIVE) $(BUILDDIR)/support/libsupport.a $(COMMON_LIBS) + + + diff --git a/srcpkgs/julia/template b/srcpkgs/julia/template index 80f6d001a7..3616027006 100644 --- a/srcpkgs/julia/template +++ b/srcpkgs/julia/template @@ -1,65 +1,69 @@ # Template file for 'julia' pkgname=julia -version=1.4.2 +version=1.5.0 revision=1 -archs="i686* x86_64*" +archs="i686* x86_64* armv7l* aarch64*" build_style=gnu-makefile make_build_args="prefix=/usr sysconfdir=/etc datarootdir=/usr/share - USE_LLVM_SHLIB=1 USE_BINARYBUILDER=0 - USE_SYSTEM_LIBUV=0 USE_SYSTEM_LIBUNWIND=0 USE_SYSTEM_PATCHELF=1 USE_SYSTEM_LIBM=0 - USE_SYSTEM_DSFMT=0 USE_SYSTEM_LLVM=0 USE_SYSTEM_PCRE=1 USE_SYSTEM_BLAS=0 - USE_SYSTEM_GMP=1 USE_SYSTEM_LIBGIT2=0 USE_SYSTEM_MBEDTLS=1 USE_SYSTEM_LIBSSH2=1 - USE_SYSTEM_CURL=1 USE_SYSTEM_MPFR=1 USE_SYSTEM_SUITESPARSE=0 USE_SYSTEM_UTF8PROC=0 - USE_SYSTEM_ZLIB=1 USE_SYSTEM_P7ZIP=1 USE_SYSTEM_LAPACK=0" + USE_BINARYBUILDER=0 USE_SYSTEM_LIBM=0 USE_SYSTEM_DSFMT=0 USE_SYSTEM_LIBUV=0 + USE_SYSTEM_SUITESPARSE=0 USE_SYSTEM_BLAS=0 USE_SYSTEM_LAPACK=0 USE_SYSTEM_LLVM=1 + USE_SYSTEM_LIBUNWIND=1 USE_SYSTEM_PCRE=1 USE_SYSTEM_GMP=1 USE_SYSTEM_PATCHELF=1 + USE_SYSTEM_MPFR=1 USE_SYSTEM_MBEDTLS=1 USE_SYSTEM_LIBSSH2=1 USE_SYSTEM_CURL=1 + USE_SYSTEM_ZLIB=1 USE_SYSTEM_P7ZIP=1 USE_SYSTEM_LIBGIT2=1 USE_SYSTEM_UTF8PROC=1 + UTF8PROC_INC='${XBPS_CROSS_BASE}/usr/include/libutf8proc'" make_install_args="$make_build_args" make_check_args="$make_build_args" make_check_target=testall conf_files="/etc/julia/startup.jl" -hostmakedepends="perl cmake python gcc-fortran patchelf which tar xz" -makedepends="pcre2-devel gmp-devel mpfr-devel libcurl-devel - libssh2-devel mbedtls-devel libatomic-devel zlib-devel p7zip" -depends="pcre2 gmp mpfr libcurl libssh2 mbedtls libatomic zlib p7zip" +hostmakedepends="pkg-config perl cmake python gcc-fortran patchelf which tar xz" +makedepends="p7zip pcre2-devel mpfr-devel libgit2-devel libcurl-devel + libssh2-devel mbedtls-devel libatomic-devel zlib-devel libunwind-devel + libutf8proc-devel llvm10" +# Julia provides vendored symlinks in /usr/lib/julia pointing to these libraries, +# but none of the julia executables link to them so these are not auto-detected +depends="libgit2 libcurl mpfr mbedtls libpcre2 libssh2 libquadmath p7zip" short_desc="High-level, high-performance dynamic programming language" maintainer="Adam Beckmeyer " license="MIT" homepage="https://julialang.org" distfiles="https://github.com/JuliaLang/julia/releases/download/v${version}/julia-${version}-full.tar.gz" -checksum=948c70801d5cce81eeb7f764b51b4bfbb2dc0b1b9effc2cb9fc8f8cf6c90a334 -nocross=yes -# Falsely detects dependency on libllvm -skiprdeps="/usr/lib/libjulia.so.1.4 /usr/lib/julia/libllvmcalltest.so" - -case "$XBPS_TARGET_MACHINE" in -*-musl) - broken="fails to compile internal LLVM" - ;; -i686-musl) - makedepends+=" libexecinfo-devel" - depends+=" libexecinfo" - LDFLAGS="-lexecinfo -lc" - ;; -x86_64-musl) - makedepends+=" libexecinfo-devel" - depends+=" libexecinfo" - LDFLAGS="-lexecinfo" - ;; -esac +checksum=4a6ffadc8dd04ca0b7fdef6ae203d0af38185e57b78f7c0b972c4707354a6d1b +nocross="build system is a mess" +# Targets for the vendored symlinks mentioned above +shlib_requires="libgit2.so.1.0 libcurl.so.4 libmpfr.so.6 libgmp.so.10 + libmbedcrypto.so.3 libmbedtls.so.12 libmbedx509.so.0 libpcre2-8.so.0 + libssh2.so.1 libquadmath.so.0" case "$XBPS_TARGET_MACHINE" in i686*) export M="pentium4" export CFLAGS="-march=pentium4" export CXXFLAGS="-march=pentium4" - export LDFLAGS+=" -Wl,--no-keep-memory" - make_build_args+=" MARCH=pentium4" - make_build_args+=" OPENBLAS_USE_THREAD=0" + export LDFLAGS="-Wl,--no-keep-memory" + + make_build_args+=" MARCH=pentium4 OPENBLAS_USE_THREAD=0" ;; x86_64*) export M="x86-64" export CFLAGS="-march=x86-64" export CXXFLAGS="-march=x86-64" + make_build_args+=" MARCH=x86-64" ;; +armv7l*) + export M="armv7-a" + export CFLAGS="-march=armv7-a" + export CXXFLAGS="-march=armv7-a" + + make_build_args+=" MARCH=armv7-a" + ;; +aarch64*) + export M="armv8-a" + export CFLAGS="-march=armv8-a" + export CXXFLAGS="-march=armv8-a" + + make_build_args+=" MARCH=armv8-a" + ;; esac post_extract() { @@ -68,6 +72,13 @@ post_extract() { post_install() { vlicense LICENSE.md + + # julia needlessly copies system libraries into a vendor directory + local _lib + for _lib in libgcc_s.so.1 libgfortran.so.5 libquadmath.so.0; do + rm -f "${DESTDIR}/usr/lib/julia/${_lib}" + ln -s "/usr/lib/${_lib}" "${DESTDIR}/usr/lib/julia" + done } julia-devel_package() {