OmniSciDB  a667adc9c8
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
setup.in.py
Go to the documentation of this file.
1 #!/usr/bin/env python
2 #
3 # This file (setup.in.py) is a template, which cmakes uses to generate setup.py
4 # in build directory where it can be used for installation into python environment.
5 
6 from Cython.Build import cythonize
7 from distutils.core import setup, Extension
8 
9 import os
10 import numpy as np
11 import pyarrow as pa
12 
13 root = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
14 dbe = Extension(
15  "dbe",
16  ["@CMAKE_CURRENT_SOURCE_DIR@/Python/dbe.pyx"],
17  language="c++17",
18  include_dirs=[
19  np.get_include(),
20  pa.get_include(),
21  root,
22  "@CMAKE_SOURCE_DIR@",
23  "@CMAKE_CURRENT_SOURCE_DIR@",
24  "@CMAKE_SOURCE_DIR@/ThirdParty/rapidjson",
25  "@CMAKE_SOURCE_DIR@/Distributed/os",
26  ],
27  library_dirs=pa.get_library_dirs() + ["@CMAKE_CURRENT_BINARY_DIR@", "."],
28  runtime_library_dirs=pa.get_library_dirs() + ["$ORIGIN/../../"],
29  libraries=pa.get_libraries() + ["DBEngine", "boost_system"],
30  extra_compile_args=["-std=c++17", "-DRAPIDJSON_HAS_STDSTRING"],
31 )
32 # Try uncommenting the following line on Linux
33 # if you get weird linker errors or runtime crashes
34 # dbe.define_macros.append(("_GLIBCXX_USE_CXX11_ABI", "0"))
35 
36 # "fat" wheel
37 data_files = []
38 if False: # TODO: implement an option?
39  data_files = [
40  ("lib", ["$<TARGET_FILE:DBEngine>"]),
41  (
42  "bin",
43  ["@CMAKE_BINARY_DIR@/bin/calcite-1.0-SNAPSHOT-jar-with-dependencies.jar"],
44  ),
45  (
46  "QueryEngine",
47  [
48  "@CMAKE_BINARY_DIR@/QueryEngine/RuntimeFunctions.bc",
49  "@CMAKE_BINARY_DIR@/QueryEngine/ExtensionFunctions.ast",
50  ],
51  ),
52  (
53  "include",
54  [
55  "@CMAKE_CURRENT_SOURCE_DIR@/DBEngine.h",
56  "@CMAKE_CURRENT_SOURCE_DIR@/DBEngine.pxd",
57  ],
58  ),
59  ]
60 
61 setup(
62  name="dbe",
63  version="0.1",
64  ext_modules=cythonize(
65  dbe,
66  compiler_directives={
67  "c_string_type": "str",
68  "c_string_encoding": "utf8",
69  "language_level": "3",
70  },
71  include_path=[
72  "@CMAKE_CURRENT_SOURCE_DIR@",
73  "@CMAKE_CURRENT_SOURCE_DIR@/Python",
74  ],
75  ),
76  data_files=data_files,
77 )
Definition: setup.in.py:1