forked from apache/madlib
-
Notifications
You must be signed in to change notification settings - Fork 0
/
ReadMe_Build.txt
202 lines (141 loc) · 7.44 KB
/
ReadMe_Build.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
Please read all sections marked with **. All others are optional and provide
background information.
Building and Installing from Source
===================================
** Run-time Requirements (required read):
-----------------------------------------
- None (except the C++ Standard Library)
** Build-time Requirements (required read):
-------------------------------------------
- CMake >= 2.8.4
- Internet connection to automatically download MADlib's dependencies if needed
(Boost, Eigen). You can avoid this and build MADlib in a networkless mode
by providing tarballs of 3 external dependencies. See configuration options below.
Optional:
- For generating user-level documentation (using `make doc`, see below):
+ doxygen >= 1.8.4, flex >= 2.5.33, and bison >= 2.4 to generate the
user-level API reference in HTML format
+ A recent LaTeX installation for generating the formulas in the user-level
documentation
+ graphviz >= 2.28 to generate graphs for the doxygen documentation
- For generating developer-level documentation (using `make devdoc`, see below):
+ doxygen, flex, and bison as above
+ git >= 1.7 to download/update the local MathJax installation, which is used
for displaying formulas in the developer-level documentation
- For generating a complete installation package (RPM, Package Maker, etc.; see
below):
+ PostgreSQL 9.2, 9.3, 9.4
+ Greenplum 4.2, 4.3
+ All requirements for generating user-level documentation (see above)
** Build-time Debian package dependencies (optional read):
-------------------------------------------
On Debian based platform you can install the required dependencies (aside from
Boost, Eigen and PyXB) by running the following command:
apt-get install cmake g++ m4 python flex bison doxygen graphviz postgresql-server-dev-all texlive-full poppler-utils
** Build instructions (required read):
--------------------------------------
From the MADlib root directory, execute the following commands:
./configure
cd build/
make
To build the user-level documentation using doxygen, run:
make doc
The developer documentation can be built by running `make devdoc` instead.
Optionally, install MADlib with
make install
If you are missing a required library, the `./configure` or `make` step will
notice. Refer to your operating system's manual for instructions to install
the above prerequisites.
Notes:
------
- To speed things up, run `make -j X` instead of `make` where X is the number of
jobs (commands) to run simultaneously. A good choice is the number of
processor cores in your machine.
- MADlib depends on the linear-algebra library Eigen. We always copy it into the
MADlib build directory during the build process.
Building an installation package (RPM, Package Maker, ...)
----------------------------------------------------------
To create a binary installation package, run the following sequence of commands:
./configure
cd build
make doc
make package
To create a complete installation package (for all supported DBMSs, equivalent
to what is offered on the MADlib web site), make sure that the build process is
able to locate the DBMS installations. For complete control, run `./configure`
with arguments `-D<DBMS>_PG_CONFIG=/path/to/pg_config` for all `<DBMS>` in
`POSTGRESQL_9_2`, `POSTGRESQL_9_3`, `POSTGRESQL_9_4`, `GREENPLUM_4_2`,
and `GREENPLUM_4_3`.
Configuration Options:
----------------------
Depending on the environment, `./configure` might have to be called with
additional configuration parameters. The way to specify a parameter `<PARAM>`
is to add a command-line argument `-D<PARAM>=<value>`.
The following provides an overview of the
most important options. Look at `build/CMakeCache.txt` (relative to the MADlib
root directory) for more options, after having run `cmake` the first time.
- `CMAKE_BUILD_TYPE` (default: `RelWithDebInfo`)
`Debug`, `Release`, `RelWithDebInfo`, or `MinSizeRel`
- `CMAKE_PREFIX_PATH` (default: *empty*)
List (separated by `;` without trailing space) of additional search
paths (for each `${PREFIX_PATH}` in `${CMAKE_PREFIX_PATH}`, binaries are
searched for in `${PREFIX_PATH}/bin`, headers are searched for in
`${PREFIX_PATH}/include`, etc.)
For instance, if Boost header files are located under a non-standard
location like `/opt/local/include/boost`, run
`./configure -DCMAKE_PREFIX_PATH=/opt/local`.
- `CMAKE_INSTALL_PREFIX` (default: `/usr/local/madlib`)
Prefix when installing MADlib with `make install`. All files will be
installed within `${CMAKE_INSTALL_PREFIX}`.
- `<DBMS>_PG_CONFIG` (for `<DBMS>` in `POSTGRESQL_9_2`, `POSTGRESQL_9_3`,
`POSTGRESQL_9_4`, `GREENPLUM_4_2`, and `GREENPLUM_4_3`. Default: *empty*)
Path to `pg_config` of the respective DBMS. If none is set, the build
script will check if `$(command -v pg_config)` points to a
PostgreSQL/Greenplum installation.
Note: If no `GREENPLUM<...>_PG_CONFIG` is specified, the build script will
look for `/usr/local/greenplum-db/bin/pg_config`.
- `LIBSTDCXX_COMPAT` (default: *empty*)
If GNU gcc is used to build MADlib and link against the GNU libstdc++, this
option may be used to set the maximum version of libstdc++ acceptable as a
runtime dependency (not supported on Mac OS X). E.g., if MADlib should
require no more than the libstdc++ shipped with gcc 4.1.2, call
`./configure` with `-DLIBSTDCXX_COMPAT=40102`.
The current minimum value supported for option `LIBSTDCXX_COMPAT` is
`40102`, and the latest version of gcc supported when setting this option is
gcc 4.6.x.
Setting this option will enable workarounds in
`src/utils/libstdcxx-compatibility.cpp`.
- `BOOST_TAR_SOURCE` (default: *empty*)
If no recent version of Boost is found (>= 1.47), Boost is downloaded
automatically. Alternatively, the path to the (possibly gzip'ed)
tarball can be specified by calling `./configure` with
`-DBOOST_TAR_SOURCE=/path/to/boost_x.tar.gz`
- `EIGEN_TAR_SOURCE` (default: *empty*)
Eigen is downloaded automatically, unless you call `./configure`
with `-DEIGEN_TAR_SOURCE=/path/to/eigen_x.tar.gz`, in which case
this tarball is used.
- `PYXB_TAR_SOURCE` (default: *empty*)
PyXB is downloaded automatically, unless you call `./configure`
with `-DPYXB_TAR_SOURCE=/path/to/pyxb_x.tar.gz`, in which case
this tarball is used.
- `CREATE_RPM_FOR_UBUNTU` (default: *empty*)
By default, we create a .deb madlib installer on Ubuntu. If this
flag is set to 'True', we will create an RPM instead. Note that
package alien must be installed for this to work.
- `CXX11` (default: *empty*)
Compile with C++11 compatibility. This may be required for building
on newer platforms which don't come with support for pre-2011 C++
standards. For example, MacOSX >= 10.13 (XCode >= 10.x). This option
is also required for Boost >= 1.65 to work, as recent versions of
Boost have also dropped support for older C++ standards.
Debugging
=========
For debugging it is helpful to generate an IDE project (e.g., XCode) with cmake
and then connect to the running database process:
0. Generate XCode project with CMake (in MADlib root directory):
`mkdir -p build/Xcode && cd build/Xcode && cmake -G Xcode ../..`
1. Add an executable in XCode that points to the postgres binary
(e.g., `/usr/local/bin/postgres`)
2. Do a `select pg_backend_pid();` in psql
3. Choose "Run" -> "Attach to Process" -> "Process ID..." in XCode and enter
the process ID obtained in psql