From e90926d955558244b7b6e71cf7d1013f5811a894 Mon Sep 17 00:00:00 2001 From: Elliot Saba Date: Fri, 21 Sep 2018 09:32:53 +0000 Subject: [PATCH 1/2] Update in preparation for new rootfs build --- build_tarballs.jl | 34 +++++++++++++---------- bundled/patches/osx_exports_ldflags.patch | 22 +++++++++++++++ 2 files changed, 41 insertions(+), 15 deletions(-) create mode 100644 bundled/patches/osx_exports_ldflags.patch diff --git a/build_tarballs.jl b/build_tarballs.jl index 6d38782..735c13c 100644 --- a/build_tarballs.jl +++ b/build_tarballs.jl @@ -6,65 +6,69 @@ version = v"0.3.0" sources = [ "https://github.com/xianyi/OpenBLAS/archive/v0.3.0.tar.gz" => "cf51543709abe364d8ecfb5c09a2b533d2b725ea1a66f203509b21a8e9d8f1a1", + "./bundled", ] # Bash recipe for building across all platforms script = raw""" # We always want threading -flags="USE_THREAD=1 GEMM_MULTITHREADING_THRESHOLD=50 NO_AFFINITY=1" +flags=(USE_THREAD=1 GEMM_MULTITHREADING_THRESHOLD=50 NO_AFFINITY=1) # We are cross-compiling -flags="${flags} CROSS=1 HOSTCC=$CC_FOR_BUILD PREFIX=/ CROSS_SUFFIX=${target}-" +flags+=(CROSS=1 "HOSTCC=$CC_FOR_BUILD" PREFIX=/ "CROSS_SUFFIX=${target}-") # We need to use our basic objconv, not a prefixed one: -flags="${flags} OBJCONV=objconv" +flags+=(OBJCONV=objconv) if [[ ${nbits} == 64 ]]; then # If we're building for a 64-bit platform, engage ILP64 LIBPREFIX=libopenblas64_ - flags="${flags} INTERFACE64=1 SYMBOLSUFFIX=64_" + flags+=(INTERFACE64=1 SYMBOLSUFFIX=64_) else LIBPREFIX=libopenblas fi -flags="${flags} LIBPREFIX=${LIBPREFIX}" +flags+=("LIBPREFIX=${LIBPREFIX}") # Set BINARY=32 on 32-bit platforms if [[ ${nbits} == 32 ]]; then - flags="${flags} BINARY=32" + flags+=(BINARY=32) fi # Set BINARY=64 on x86_64 platforms (but not AArch64 or powerpc64le) if [[ ${target} == x86_64-* ]]; then - flags="${flags} BINARY=64" + flags+=(BINARY=64) fi # Use 16 threads unless we're on an i686 arch: if [[ ${target} == i686* ]]; then - flags="${flags} NUM_THREADS=8" + flags+=(NUM_THREADS=8) else - flags="${flags} NUM_THREADS=16" + flags+=(NUM_THREADS=16) fi # On Intel architectures, engage DYNAMIC_ARCH if [[ ${proc_family} == intel ]]; then - flags="${flags} DYNAMIC_ARCH=1" + flags+=(DYNAMIC_ARCH=1) # Otherwise, engage a specific target elif [[ ${target} == aarch64-* ]]; then - flags="${flags} TARGET=ARMV8" + flags+=(TARGET=ARMV8) elif [[ ${target} == arm-* ]]; then - flags="${flags} TARGET=ARMV7" + flags+=(TARGET=ARMV7) elif [[ ${target} == powerpc64le-* ]]; then - flags="${flags} TARGET=POWER8" + flags+=(TARGET=POWER8) fi # Enter the fun zone cd ${WORKSPACE}/srcdir/OpenBLAS-*/ +# Patch so that our LDFLAGS make it all the way through +atomic_patch -p1 "${WORKSPACE}/srcdir/patches/osx_exports_ldflags.patch" + # Build the library -make ${flags} -j${nproc} +make "${flags[@]}" -j${nproc} # Install the library -make ${flags} PREFIX=$prefix install +make "${flags[@]}" "PREFIX=$prefix" install # Force the library to be named the same as in Julia-land. # Move things around, fix symlinks, and update install names/SONAMEs. diff --git a/bundled/patches/osx_exports_ldflags.patch b/bundled/patches/osx_exports_ldflags.patch new file mode 100644 index 0000000..f18f8b2 --- /dev/null +++ b/bundled/patches/osx_exports_ldflags.patch @@ -0,0 +1,22 @@ +commit 6f77af2eef8a6ea2c5e32c66528849c319d4fb6d +Author: Elliot Saba +Date: Fri Sep 21 09:19:51 2018 +0000 + + Add `$(LDFLAGS)` to `$(CC)` and `$(FC)` invocations within `exports/Makefile` + +diff --git a/exports/Makefile b/exports/Makefile +index 29075a9c..3a5f77db 100644 +--- a/exports/Makefile ++++ b/exports/Makefile +@@ -114,9 +114,9 @@ $(LIBDYNNAME) : ../$(LIBNAME).osx.renamed osx.def + endif + ifneq (,$(filter 1 2,$(NOFORTRAN))) + #only build without Fortran +- $(CC) $(CFLAGS) -all_load -headerpad_max_install_names -install_name "$(CURDIR)/../$(LIBDYNNAME)" -dynamiclib -o ../$(LIBDYNNAME) $< -Wl,-exported_symbols_list,osx.def $(FEXTRALIB) ++ $(CC) $(CFLAGS) $(LDFLAGS) -all_load -headerpad_max_install_names -install_name "$(CURDIR)/../$(LIBDYNNAME)" -dynamiclib -o ../$(LIBDYNNAME) $< -Wl,-exported_symbols_list,osx.def $(FEXTRALIB) + else +- $(FC) $(FFLAGS) -all_load -headerpad_max_install_names -install_name "$(CURDIR)/../$(LIBDYNNAME)" -dynamiclib -o ../$(LIBDYNNAME) $< -Wl,-exported_symbols_list,osx.def $(FEXTRALIB) ++ $(FC) $(FFLAGS) $(LDFLAGS) -all_load -headerpad_max_install_names -install_name "$(CURDIR)/../$(LIBDYNNAME)" -dynamiclib -o ../$(LIBDYNNAME) $< -Wl,-exported_symbols_list,osx.def $(FEXTRALIB) + endif + + dllinit.$(SUFFIX) : dllinit.c From 993226fdc9551cf9a99a871d62599bee9033615f Mon Sep 17 00:00:00 2001 From: Elliot Saba Date: Fri, 21 Sep 2018 11:15:33 +0000 Subject: [PATCH 2/2] Expand GCC versions --- build_tarballs.jl | 1 + 1 file changed, 1 insertion(+) diff --git a/build_tarballs.jl b/build_tarballs.jl index 735c13c..930c1f3 100644 --- a/build_tarballs.jl +++ b/build_tarballs.jl @@ -100,6 +100,7 @@ done # These are the platforms we will build for by default, unless further # platforms are passed in on the command line. platforms = supported_platforms() +platforms = expand_gcc_versions(platforms) # The products that we will ensure are always built products(prefix) = [