@@ -36,35 +36,42 @@ class ApacheArrow < Formula
36
36
37
37
depends_on "boost" => :build
38
38
depends_on "cmake" => :build
39
- depends_on "llvm@15" => :build
39
+ depends_on "gflags" => :build
40
+ depends_on "rapidjson" => :build
41
+ depends_on "xsimd" => :build
42
+ depends_on "abseil"
43
+ depends_on "aws-crt-cpp"
40
44
depends_on "aws-sdk-cpp"
41
45
depends_on "brotli"
42
- depends_on "bzip2"
43
- depends_on "glog"
44
46
depends_on "grpc"
47
+ depends_on "llvm"
45
48
depends_on "lz4"
46
- depends_on "mimalloc"
47
49
depends_on "openssl@3"
48
50
depends_on "protobuf"
49
- depends_on "rapidjson"
50
51
depends_on "re2"
51
52
depends_on "snappy"
52
53
depends_on "thrift"
53
54
depends_on "utf8proc"
54
55
depends_on "zstd"
56
+
55
57
uses_from_macos "python" => :build
58
+ uses_from_macos "bzip2"
59
+ uses_from_macos "zlib"
56
60
57
- fails_with gcc : "5"
61
+ # Issue ref: https://github.com/protocolbuffers/protobuf/issues/19447
62
+ fails_with :gcc do
63
+ version "12"
64
+ cause "Protobuf 29+ generated code with visibility and deprecated attributes needs GCC 13+"
65
+ end
58
66
59
67
def install
60
- # This isn't for https://github.com/Homebrew/homebrew-core/issues/76537 .
61
- # This may improve performance.
62
- ENV . runtime_cpu_detection if Hardware ::CPU . intel?
68
+ ENV . llvm_clang if OS . linux?
63
69
64
- # link against system libc++ instead of llvm provided libc++
65
- ENV . remove "HOMEBREW_LIBRARY_PATHS" , Formula [ "llvm" ] . opt_lib
70
+ # We set `ARROW_ORC=OFF` because it fails to build with Protobuf 27.0
66
71
args = %W[
67
72
-DCMAKE_INSTALL_RPATH=#{ rpath }
73
+ -DLLVM_ROOT=#{ Formula [ "llvm" ] . opt_prefix }
74
+ -DARROW_DEPENDENCY_SOURCE=SYSTEM
68
75
-DARROW_ACERO=ON
69
76
-DARROW_COMPUTE=ON
70
77
-DARROW_CSV=ON
@@ -73,43 +80,47 @@ def install
73
80
-DARROW_FLIGHT=ON
74
81
-DARROW_FLIGHT_SQL=ON
75
82
-DARROW_GANDIVA=ON
76
- -DARROW_GCS=ON
77
83
-DARROW_HDFS=ON
78
- -DARROW_INSTALL_NAME_RPATH=OFF
79
84
-DARROW_JSON=ON
80
- -DARROW_MIMALLOC=ON
81
- -DARROW_ORC=ON
85
+ -DARROW_ORC=OFF
82
86
-DARROW_PARQUET=ON
83
87
-DARROW_PROTOBUF_USE_SHARED=ON
84
88
-DARROW_S3=ON
85
- -DARROW_WITH_BROTLI=ON
86
89
-DARROW_WITH_BZ2=ON
90
+ -DARROW_WITH_ZLIB=ON
91
+ -DARROW_WITH_ZSTD=ON
87
92
-DARROW_WITH_LZ4=ON
88
93
-DARROW_WITH_SNAPPY=ON
94
+ -DARROW_WITH_BROTLI=ON
89
95
-DARROW_WITH_UTF8PROC=ON
90
- -DARROW_WITH_ZLIB=ON
91
- -DARROW_WITH_ZSTD=ON
96
+ -DARROW_INSTALL_NAME_RPATH=OFF
92
97
-DPARQUET_BUILD_EXECUTABLES=ON
93
98
]
94
- # Disable runtime SIMD dispatch. It may cause "illegal opcode"
95
- # error on Intel Mac because of one-definition-rule violation.
96
- #
97
- # https://github.com/apache/arrow/issues/36685
98
- args << "-DARROW_RUNTIME_SIMD_LEVEL=NONE" if OS . mac? and Hardware ::CPU . intel?
99
+ args << "-DARROW_MIMALLOC=ON" unless Hardware ::CPU . arm?
100
+ # Reduce overlinking. Can remove on Linux if GCC 11 issue is fixed
101
+ args << "-DCMAKE_SHARED_LINKER_FLAGS=-Wl,#{ OS . mac? ? "-dead_strip_dylibs" : "--as-needed" } "
102
+ # ARROW_SIMD_LEVEL sets the minimum required SIMD. Since this defaults to
103
+ # SSE4.2 on x86_64, we need to reduce level to match oldest supported CPU.
104
+ # Ref: https://arrow.apache.org/docs/cpp/env_vars.html#envvar-ARROW_USER_SIMD_LEVEL
105
+ if build . bottle? && Hardware ::CPU . intel? && ( !OS . mac? || !MacOS . version . requires_sse42? )
106
+ args << "-DARROW_SIMD_LEVEL=NONE"
107
+ end
99
108
100
109
system "cmake" , "-S" , "cpp" , "-B" , "build" , *args , *std_cmake_args
101
110
system "cmake" , "--build" , "build"
102
111
system "cmake" , "--install" , "build"
103
112
end
104
113
105
114
test do
106
- ( testpath /"test.cpp" ) . write <<~EOS
115
+ ENV . method ( DevelopmentTools . default_compiler ) . call if OS . linux?
116
+
117
+ ( testpath /"test.cpp" ) . write <<~CPP
107
118
#include "arrow/api.h"
108
119
int main(void) {
109
120
arrow::int64();
110
121
return 0;
111
122
}
112
- EOS
123
+ CPP
113
124
system ENV . cxx , "test.cpp" , "-std=c++17" , "-I#{ include } " , "-L#{ lib } " , "-larrow" , "-o" , "test"
114
125
system "./test"
115
126
end
0 commit comments