Skip to content

Commit ec7293f

Browse files
committed
fix: fixed updates to build and refactoring
It has been awhile since I built on macos, so the build needed some overall fixes, including upgrading arrow. Oddly, building Arrow 12 seems to be problematic for poetry so upgrading to Arrow 14 helps, though there are likely some build issues to still work through and things to update. The other major thing in this commit is refactoring to accommodate file name changes and a few file moves (mohair.hpp and util.cpp into the root cpp src dir). This is mostly in preparation for integrating back into the mohair repo as well as making the build more flexible and adjusting the architecture to better accommodate when I start integrating with duckdb
1 parent 760330e commit ec7293f

16 files changed

+684
-688
lines changed

.python-version

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
3.11.4
1+
3.12.1

meson.build

+78-55
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,29 @@ project('mohair-faodel'
99
)
1010

1111

12+
# ------------------------------
13+
# Build variables (convenience)
14+
15+
# base directory
16+
cpp_srcdir = 'src' / 'cpp'
17+
18+
# dir for core mohair sources
19+
cpp_querydir = cpp_srcdir / 'query'
20+
21+
# dir for generated protobuf code
22+
cpp_proto_substrait = cpp_srcdir / 'query' / 'substrait'
23+
cpp_proto_mohair = cpp_srcdir / 'query' / 'mohair'
24+
25+
# dir for adapters (execution engines)
26+
cpp_enginedir = cpp_srcdir / 'engines'
27+
28+
# dir for flight services
29+
cpp_servicedir = cpp_srcdir / 'services'
30+
31+
# dir for binary sources (1-1 with binaries)
32+
cpp_tooldir = cpp_srcdir / 'toolbox'
33+
34+
1235
# ------------------------------
1336
# Meson dependencies (modules)
1437

@@ -46,14 +69,21 @@ endif
4669
# Library dependencies
4770

4871
# >> System-dependent dependencies
72+
73+
# Include directory for arrow headers
74+
arrow_incdir = ''
75+
4976
if buildsys_type == 'macosx'
5077
cpp_compiler = meson.get_compiler('cpp')
51-
prefix_local = '/usr' / 'local' / 'arrow-dev' / 'lib'
78+
79+
arrow_prefix = '/usr' / 'local' / 'apache-arrow-14.0.2'
80+
arrow_libdir = arrow_prefix / 'lib'
81+
arrow_incdir = arrow_prefix / 'include'
5282

5383
# |> Arrow
54-
dep_arrow = cpp_compiler.find_library('arrow' , dirs: prefix_local, static: false)
55-
dep_acero = cpp_compiler.find_library('arrow-substrait', dirs: prefix_local, static: false)
56-
dep_flight = cpp_compiler.find_library('arrow-flight' , dirs: prefix_local, static: false)
84+
dep_arrow = cpp_compiler.find_library('arrow' , dirs: arrow_libdir, static: false)
85+
dep_acero = cpp_compiler.find_library('arrow_substrait', dirs: arrow_libdir, static: false)
86+
dep_flight = cpp_compiler.find_library('arrow_flight' , dirs: arrow_libdir, static: false)
5787

5888
elif buildsys_type == 'archlinux'
5989
# |> Arrow
@@ -74,6 +104,8 @@ dep_absllog = dependency('absl_log')
74104
# |> Faodel
75105
dep_ompi = dependency('ompi-cxx', required: get_option('mpi'))
76106
dep_faodel = dependency('faodel' , required: get_option('faodel'))
107+
dep_tiledb = dependency('tiledb' , required: get_option('tiledb'))
108+
dep_duckdb = dependency('duckdb' , required: get_option('duckdb'))
77109

78110

79111
# >> Make configuration data available to source files
@@ -84,9 +116,10 @@ mohair_cfgdata = configuration_data({
84116
,'DUCKDB': dep_duckdb.found()
85117
})
86118

87-
mohair_cfgfile = configuration_file(
88-
input : 'mohair-config.hpp.in'
89-
,output: 'mohair-config.hpp'
119+
mohair_cfgfile = configure_file(
120+
input : cpp_srcdir / 'mohair-config.hpp.in'
121+
,output : 'mohair-config.hpp'
122+
,configuration: mohair_cfgdata
90123
)
91124

92125

@@ -103,28 +136,13 @@ elif dep_ompi.found()
103136

104137
endif
105138

139+
if dep_tiledb.found()
140+
dep_service += [dep_tiledb]
141+
endif
106142

107-
# ------------------------------
108-
# Build variables (convenience)
109-
110-
# base directory
111-
cpp_srcdir = 'src' / 'cpp'
112-
113-
# dir for core mohair sources
114-
cpp_coredir = cpp_srcdir / 'mohair'
115-
116-
# dir for generated protobuf code
117-
cpp_proto_substrait = cpp_srcdir / 'mohair' / 'substrait'
118-
cpp_proto_mohair = cpp_srcdir / 'mohair' / 'mohair'
119-
120-
# dir for adapters (execution engines)
121-
cpp_enginedir = cpp_srcdir / 'engines'
122-
123-
# dir for flight services
124-
cpp_servicedir = cpp_srcdir / 'services'
125-
126-
# dir for binary sources (1-1 with binaries)
127-
cpp_tooldir = cpp_srcdir / 'toolbox'
143+
if dep_duckdb.found()
144+
dep_service += [dep_duckdb]
145+
endif
128146

129147

130148
# ------------------------------
@@ -146,17 +164,17 @@ substrait_hdrlist = [
146164

147165
# >> For decomposable queries
148166
query_hdrlist = [
149-
cpp_coredir / 'mohair.hpp'
150-
,cpp_coredir / 'plans.hpp'
151-
,cpp_coredir / 'operators.hpp'
152-
,cpp_coredir / 'messages.hpp'
167+
cpp_srcdir / 'mohair.hpp'
168+
,cpp_querydir / 'plans.hpp'
169+
,cpp_querydir / 'operators.hpp'
170+
,cpp_querydir / 'messages.hpp'
153171
]
154172

155173
# >> For flight services
156174
services_hdrlist = [
157-
cpp_coredir / 'mohair.hpp'
158-
,cpp_coredir / 'plans.hpp'
159-
,cpp_coredir / 'messages.hpp'
175+
cpp_srcdir / 'mohair.hpp'
176+
,cpp_querydir / 'plans.hpp'
177+
,cpp_querydir / 'messages.hpp'
160178
,cpp_enginedir / 'adapter_acero.hpp'
161179
,cpp_enginedir / 'adapter_faodel.hpp'
162180
,cpp_servicedir / 'service_mohair.hpp'
@@ -183,17 +201,17 @@ substrait_srclist = [
183201

184202
# >> For decomposable queries
185203
query_srclist = [
186-
cpp_coredir / 'util.cpp'
187-
,cpp_coredir / 'plans.cpp'
188-
,cpp_coredir / 'operators.cpp'
189-
,cpp_coredir / 'messages.cpp'
204+
cpp_srcdir / 'util.cpp'
205+
,cpp_querydir / 'plans.cpp'
206+
,cpp_querydir / 'operators.cpp'
207+
# ,cpp_querydir / 'messages.cpp'
190208
]
191209

192210
# >> For flight services
193211
services_srclist = [
194-
cpp_coredir / 'util.cpp'
195-
,cpp_coredir / 'plans.cpp'
196-
,cpp_coredir / 'operators.cpp'
212+
cpp_srcdir / 'util.cpp'
213+
,cpp_querydir / 'plans.cpp'
214+
,cpp_querydir / 'operators.cpp'
197215
,cpp_enginedir / 'execution.cpp'
198216
,cpp_servicedir / 'service_mohair.cpp'
199217
]
@@ -214,8 +232,9 @@ mohair_srv_srclist = (substrait_srclist + services_srclist)
214232

215233
lib_mohair = library('mohair'
216234
,lib_mohair_srclist
217-
,dependencies: dep_query
218-
,install : true
235+
,dependencies : dep_query
236+
,include_directories: arrow_incdir
237+
,install : true
219238
)
220239

221240
module_pkgcfg.generate(lib_mohair)
@@ -233,14 +252,15 @@ install_headers(query_hdrlist, subdir: 'mohair')
233252

234253
# |> simple reader for Arrow files
235254
bin_readarrow_srclist = [
236-
cpp_tooldir / 'read-arrow.cpp'
237-
,cpp_coredir / 'util.cpp'
255+
cpp_tooldir / 'read-arrow.cpp'
256+
,cpp_srcdir / 'util.cpp'
238257
]
239258

240259
bin_readarrow = executable('read-arrow'
241260
,bin_readarrow_srclist
242-
,dependencies: dep_arrow
243-
,install : false
261+
,dependencies : dep_arrow
262+
,include_directories: arrow_incdir
263+
,install : false
244264
)
245265

246266
# |> minimal query processor
@@ -251,16 +271,18 @@ bin_mohairquery_srclist = (
251271

252272
bin_mohairquery = executable('mohair'
253273
,bin_mohairquery_srclist
254-
,dependencies: dep_query
255-
,install : false
274+
,dependencies : dep_query
275+
,include_directories: arrow_incdir
276+
,install : false
256277
)
257278

258279
# |> minimal client for mohair services
259280
mohair_srv_srcmain = [ cpp_tooldir / 'mohair-client.cpp' ]
260-
bin_faodelclient = executable('mohair-client'
281+
bin_mohairclient = executable('mohair-client'
261282
,(mohair_srv_srcmain + mohair_srv_srclist)
262-
,dependencies: dep_service
263-
,install : false
283+
,dependencies : dep_service
284+
,include_directories: arrow_incdir
285+
,install : false
264286
)
265287

266288

@@ -279,8 +301,9 @@ if dep_faodel.found()
279301

280302
bin_srv_faodel = executable('faodel-service'
281303
,(faodel_srv_srclist + mohair_srv_srclist)
282-
,dependencies: dep_service
283-
,install : false
304+
,dependencies : dep_service
305+
,include_directories: arrow_incdir
306+
,install : false
284307
)
285308

286309
endif

0 commit comments

Comments
 (0)