From 2c12fe4484c73b797a58cf5ee5d17abf272873ab Mon Sep 17 00:00:00 2001 From: Elliot Saba Date: Thu, 23 Jun 2016 23:23:16 -0700 Subject: [PATCH 01/10] Prepare Julia v0.4.6 for bottling --- julia.rb | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/julia.rb b/julia.rb index ec330df06..4564fd634 100644 --- a/julia.rb +++ b/julia.rb @@ -17,8 +17,8 @@ class Julia < Formula stable do url 'https://github.com/JuliaLang/julia.git', - :using => GitNoDepthDownloadStrategy, :shallow => false, :tag => "v0.4.5" - version "0.4.5" + :using => GitNoDepthDownloadStrategy, :shallow => false, :tag => "v0.4.6" + version "0.4.6" end head do @@ -29,10 +29,7 @@ class Julia < Formula # Remember to clear "revision" above when prepping for new bottles, if it exists bottle do root_url "https://juliabottles.s3.amazonaws.com" - sha256 "87389deb3c5ba29e01914e407ebe22d6f9447bb6d8c979fb34552d8d7dd6d0d5" => :yosemite - sha256 "1d24744f3119a07c4c596e18de1ea0e2ed0cb73a604f21f03683465955043fc2" => :el_capitan - sha256 "b95bb82db6480502550750f126a7b01d6f6f4e608ba2b461a8ba706a436a5640" => :mavericks - end + end if build.head? depends_on "staticfloat/julia/llvm37-julia" From e0c268f24a8242435a1e8bdadfabdbe430dc2f90 Mon Sep 17 00:00:00 2001 From: Elliot Saba Date: Thu, 23 Jun 2016 23:54:31 -0700 Subject: [PATCH 02/10] Bottle Julia v0.4.6 --- julia.rb | 3 +++ 1 file changed, 3 insertions(+) diff --git a/julia.rb b/julia.rb index 4564fd634..9524e032b 100644 --- a/julia.rb +++ b/julia.rb @@ -29,6 +29,9 @@ class Julia < Formula # Remember to clear "revision" above when prepping for new bottles, if it exists bottle do root_url "https://juliabottles.s3.amazonaws.com" + sha256 "3ce5045fe9c59d745b4eedf545ea881b7449d4014c8324c57966891726f7fa0c" => :yosemite + sha256 "995a0039fa627c1bd3f5f297ed42e2a25b33288acfc24a3675c9f239b295c3d7" => :el_capitan + sha256 "9f665666d413f93cf9ec7c9578744646c386587e9288da4603b6b54effe06bee" => :mavericks end if build.head? From 4fdbebdc34422becb8641a50d15e1a1f0c2ff71c Mon Sep 17 00:00:00 2001 From: Elliot Saba Date: Tue, 16 Aug 2016 09:43:16 -0700 Subject: [PATCH 03/10] Make LLVM patch management a little more manageable --- llvm37-julia.rb | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) diff --git a/llvm37-julia.rb b/llvm37-julia.rb index faac84104..b6886d6fd 100644 --- a/llvm37-julia.rb +++ b/llvm37-julia.rb @@ -20,7 +20,7 @@ def message class Llvm37Julia < Formula desc "The LLVM Compiler Infrastructure" homepage "http://llvm.org/" - revision 1 + revision 2 stable do url "http://llvm.org/releases/3.7.1/llvm-3.7.1.src.tar.xz" @@ -110,7 +110,6 @@ class Llvm37Julia < Formula bottle do root_url 'https://juliabottles.s3.amazonaws.com' cellar :any - revision 4 end keg_only 'Conflicts with llvm37 in homebrew-versions.' @@ -118,14 +117,10 @@ class Llvm37Julia < Formula def patches patch_list = [] - # Backported patches to support julia's use of ORC jit - patch_list << "https://raw.githubusercontent.com/JuliaLang/julia/bc1c18ec2f3452de4b5cb714191478e02bb3847a/deps/llvm-3.7.1.patch" - patch_list << "https://raw.githubusercontent.com/JuliaLang/julia/bcfc9673357df5d4dbeef84bc51099ff743e3757/deps/llvm-3.7.1_2.patch" - # PR 14830 - patch_list << "https://raw.githubusercontent.com/JuliaLang/julia/cf93d6fa9544995f1c402734894e99397167bf50/deps/llvm-3.7.1_3.patch" - patch_list << "https://raw.githubusercontent.com/JuliaLang/julia/59b253031af87f62e7d70a7d8848cdfd4a84288b/deps/patches/llvm-D14260.patch" - patch_list << "https://raw.githubusercontent.com/JuliaLang/julia/7ea3fb509fd02fae657490dd95c3cf5f903acb89/deps/patches/llvm-D21271-instcombine-tbaa-3.7.patch" - + # LLVM 3.7.1 patches + for patch_name in ["llvm-3.7.1", "llvm-3.7.1_2", "llvm3.7.1_3", "llvm-3.8.0_bindir", "llvm-D14260", "llvm-nodllalias", "llvm-D21271-instcombine-tbaa-3.7", "llvm-win64-reloc-dwarf"] + patch_list << "https://raw.githubusercontent.com/JuliaLang/julia/v0.5.0-rc2/deps/patches/#{patch_name}.patch" + end return patch_list end From 6022e75e7488704106106f8705671817b330dd6a Mon Sep 17 00:00:00 2001 From: Elliot Saba Date: Tue, 16 Aug 2016 09:47:45 -0700 Subject: [PATCH 04/10] Accidentally a - --- llvm37-julia.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/llvm37-julia.rb b/llvm37-julia.rb index b6886d6fd..03dabec7f 100644 --- a/llvm37-julia.rb +++ b/llvm37-julia.rb @@ -118,7 +118,7 @@ def patches patch_list = [] # LLVM 3.7.1 patches - for patch_name in ["llvm-3.7.1", "llvm-3.7.1_2", "llvm3.7.1_3", "llvm-3.8.0_bindir", "llvm-D14260", "llvm-nodllalias", "llvm-D21271-instcombine-tbaa-3.7", "llvm-win64-reloc-dwarf"] + for patch_name in ["llvm-3.7.1", "llvm-3.7.1_2", "llvm-3.7.1_3", "llvm-3.8.0_bindir", "llvm-D14260", "llvm-nodllalias", "llvm-D21271-instcombine-tbaa-3.7", "llvm-win64-reloc-dwarf"] patch_list << "https://raw.githubusercontent.com/JuliaLang/julia/v0.5.0-rc2/deps/patches/#{patch_name}.patch" end return patch_list From 301e1f0eb33ab43b16dace947e295a14f5a623c9 Mon Sep 17 00:00:00 2001 From: Elliot Saba Date: Wed, 17 Aug 2016 15:21:25 -0700 Subject: [PATCH 05/10] Remove unnecessary patches --- llvm37-julia.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/llvm37-julia.rb b/llvm37-julia.rb index 03dabec7f..a3030fb81 100644 --- a/llvm37-julia.rb +++ b/llvm37-julia.rb @@ -118,7 +118,7 @@ def patches patch_list = [] # LLVM 3.7.1 patches - for patch_name in ["llvm-3.7.1", "llvm-3.7.1_2", "llvm-3.7.1_3", "llvm-3.8.0_bindir", "llvm-D14260", "llvm-nodllalias", "llvm-D21271-instcombine-tbaa-3.7", "llvm-win64-reloc-dwarf"] + for patch_name in ["llvm-3.7.1", "llvm-3.7.1_2", "llvm-3.7.1_3", "llvm-D14260", "llvm-nodllalias", "llvm-D21271-instcombine-tbaa-3.7"] patch_list << "https://raw.githubusercontent.com/JuliaLang/julia/v0.5.0-rc2/deps/patches/#{patch_name}.patch" end return patch_list From 76a30d40fc03e8b36575fa565fca1c6e09210aef Mon Sep 17 00:00:00 2001 From: Elliot Saba Date: Tue, 23 Aug 2016 17:13:28 -0700 Subject: [PATCH 06/10] Add patch for llvm 3.7.1 on el_capitan and later --- llvm37-julia.rb | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/llvm37-julia.rb b/llvm37-julia.rb index a3030fb81..28aa2d788 100644 --- a/llvm37-julia.rb +++ b/llvm37-julia.rb @@ -233,6 +233,12 @@ def install ln_s libcxxabi_buildpath/"include/cxxabi.h", libcxx_buildpath/"include" end + if MacOS.version >= :el_capitan + inreplace "#{libcxx_buildpath}/include/string", + "basic_string<_CharT, _Traits, _Allocator>::basic_string(const allocator_type& __a)", + "basic_string<_CharT, _Traits, _Allocator>::basic_string(const allocator_type& __a) noexcept(is_nothrow_copy_constructible::value)" + end + # Putting libcxx in projects only ensures that headers are installed. # Manually "make install" to actually install the shared libs. libcxx_make_args = [ From d3da0f27f19a8194b11a59b72cffbeec81d72606 Mon Sep 17 00:00:00 2001 From: Elliot Saba Date: Wed, 24 Aug 2016 01:02:32 -0700 Subject: [PATCH 07/10] Retry for el_capitan --- llvm37-julia.rb | 24 ++++++++++++++++++------ 1 file changed, 18 insertions(+), 6 deletions(-) diff --git a/llvm37-julia.rb b/llvm37-julia.rb index 28aa2d788..bc8526932 100644 --- a/llvm37-julia.rb +++ b/llvm37-julia.rb @@ -110,6 +110,8 @@ class Llvm37Julia < Formula bottle do root_url 'https://juliabottles.s3.amazonaws.com' cellar :any + rebuild 4 + sha256 "2d5901f5340f4524ef17750df31b638fae4a208e3d9c5103bb91b16ed4c51536" => :yosemite end keg_only 'Conflicts with llvm37 in homebrew-versions.' @@ -121,6 +123,10 @@ def patches for patch_name in ["llvm-3.7.1", "llvm-3.7.1_2", "llvm-3.7.1_3", "llvm-D14260", "llvm-nodllalias", "llvm-D21271-instcombine-tbaa-3.7"] patch_list << "https://raw.githubusercontent.com/JuliaLang/julia/v0.5.0-rc2/deps/patches/#{patch_name}.patch" end + + # Add Homebrew's llvm37 patch + patch_list << "https://gist.githubusercontent.com/staticfloat/a430de88fefffcf79d1a75d7b8362aab/raw/142ac6885a438eb5555ed38f1359193ebf588b7a/homebrew-llvm37.patch" + return patch_list end @@ -134,6 +140,7 @@ def patches option "without-shared", "Don't build LLVM as a shared library" option "with-assertions", "Slows down LLVM, but provides more debug information" + depends_on "gnu-sed" => :build depends_on "gmp" depends_on "libffi" => :recommended depends_on :python => :optional @@ -145,7 +152,7 @@ def patches # version suffix def ver - "3.7.1" + "3.7" end # LLVM installs its own standard library which confuses stdlib checking. @@ -156,6 +163,8 @@ def ver fails_with :llvm def install + # One of llvm makefiles relies on gnu sed behavior to generate CMake modules correctly + ENV.prepend_path "PATH", "#{Formula["gnu-sed"].opt_libexec}/gnubin" # Apple's libstdc++ is too old to build LLVM ENV.libcxx if ENV.compiler == :clang @@ -181,11 +190,11 @@ def install install_prefix = lib/"llvm-#{ver}" - args = [ - "--prefix=#{install_prefix}", - "--enable-optimized", - "--disable-bindings", - "--with-gmp=#{Formula["gmp"].opt_prefix}", + args = %W[ + --prefix=#{install_prefix} + --enable-optimized + --disable-bindings + --with-gmp=#{Formula["gmp"].opt_prefix} ] if build.with? "all-targets" @@ -286,6 +295,9 @@ def caveats; <<-EOS.undent end test do + # test for sed errors since some llvm makefiles assume that sed + # understands '\n' which is true for gnu sed and not for bsd sed. + assert_no_match /PATH\)n/, (lib/"llvm-3.7/share/llvm/cmake/LLVMConfig.cmake").read system "#{bin}/llvm-config-#{ver}", "--version" end end From 2c3042b880496f2747fdd47b1ecdf6e8145b3ed8 Mon Sep 17 00:00:00 2001 From: Elliot Saba Date: Wed, 24 Aug 2016 08:17:16 -0700 Subject: [PATCH 08/10] No more bottles --- llvm37-julia.rb | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/llvm37-julia.rb b/llvm37-julia.rb index bc8526932..fc44077f0 100644 --- a/llvm37-julia.rb +++ b/llvm37-julia.rb @@ -20,7 +20,7 @@ def message class Llvm37Julia < Formula desc "The LLVM Compiler Infrastructure" homepage "http://llvm.org/" - revision 2 + revision 3 stable do url "http://llvm.org/releases/3.7.1/llvm-3.7.1.src.tar.xz" @@ -110,8 +110,6 @@ class Llvm37Julia < Formula bottle do root_url 'https://juliabottles.s3.amazonaws.com' cellar :any - rebuild 4 - sha256 "2d5901f5340f4524ef17750df31b638fae4a208e3d9c5103bb91b16ed4c51536" => :yosemite end keg_only 'Conflicts with llvm37 in homebrew-versions.' From 1e9ce86c99c3b552303341c1363367bc7a09a6ca Mon Sep 17 00:00:00 2001 From: Elliot Saba Date: Thu, 25 Aug 2016 00:35:41 -0700 Subject: [PATCH 09/10] Finally, FINALLY, bottle llvm37-julia with all new patches --- llvm37-julia.rb | 3 +++ 1 file changed, 3 insertions(+) diff --git a/llvm37-julia.rb b/llvm37-julia.rb index fc44077f0..e7d8c308b 100644 --- a/llvm37-julia.rb +++ b/llvm37-julia.rb @@ -110,6 +110,9 @@ class Llvm37Julia < Formula bottle do root_url 'https://juliabottles.s3.amazonaws.com' cellar :any + sha256 "64a396ee4133f9e5b911e88e2b4ba0d370a40894c2d65beb7bbf6016bee6fcd4" => :mavericks + sha256 "73661c5c2b221c71f50f26e1a520be9559f2fe088b3f8d3457ae4ad241cafba6" => :el_capitan + sha256 "cf4011885f555dbb9b3bf799dce19d35f3608d0c420b050bc0cb5dc1436298b2" => :yosemite end keg_only 'Conflicts with llvm37 in homebrew-versions.' From 04c5fd6130c627b4bb6c8a795b4b1158aae00227 Mon Sep 17 00:00:00 2001 From: Elliot Saba Date: Thu, 25 Aug 2016 01:11:37 -0700 Subject: [PATCH 10/10] Add `-DUSEORC_JIT` to get julia HEAD building again! --- julia.rb | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/julia.rb b/julia.rb index 9524e032b..9e03bfcc3 100644 --- a/julia.rb +++ b/julia.rb @@ -87,9 +87,10 @@ def install build_opts << "FC=#{ENV['FC']}" end - # Tell julia about our llc, since it's been named nonstandardly + # Tell julia about our llvm-config, since it's been named nonstandardly if build.head? - build_opts << "LLVM_CONFIG=llvm-config-3.7.1" + build_opts << "LLVM_CONFIG=llvm-config-3.7" + ENV["CPPFLAGS"] += " -DUSE_ORCJIT " else build_opts << "LLVM_CONFIG=llvm-config-3.3" end