-
Notifications
You must be signed in to change notification settings - Fork 69
/
Copy pathINSTALL
121 lines (87 loc) · 3.13 KB
/
INSTALL
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
Build Instructions for MySQL Shell
Dependencies
============
Mandatory
- cmake 3.5.1 (note: if you're using a very recent version of cmake and it
doesn't work, try downgrading)
- gcc 10/VisualStudio 2019/clang 10
- MySQL client libraries built from sources
(libmysqlclient, libmysqlxclient)
- zip (gnuwin32 in windows)
- python 3.8+
- libssh 0.9.2
Optional
- gtest and gmock 1.8 (can be automatically downloaded)
- GraalVM 23.0.1
Building From Source
====================
The following instructions build MySQL Shell with a minimal set of features,
additional features can be included by properly configuring the related
dependencies.
Preparation
-----------
MySQL
.....
The MySQL server sources are required to compile with the X protocol client library.
1) Download and unpack MySQL (8.0.11 or newer) source code
2) Configure MySQL server:
mkdir mysql-server/bld
cd mysql-server/bld
cmake .. -DWITH_BOOST=<path to boost> -DWITH_SSL=system
If boost is not available use the next options to let cmake download the
required version:
-DDOWNLOAD_BOOST=1
3) Compile the client libraries:
cmake --build . --target mysqlclient
cmake --build . --target mysqlxclient
Alternatively you can build the entire server:
make
Building the Shell
------------------
1) Download and unpack MySQL Shell source code
2) Configure and Build
Linux/OSX
mkdir mysql-shell/bld
cd mysql-shell/bld
cmake .. \
-DMYSQL_SOURCE_DIR=../../mysql-server\
-DMYSQL_BUILD_DIR=../../mysql-server/bld\
-DHAVE_PYTHON=1\
<other options>
make -j4
Windows
mkdir bld
cd bld
cmake .. -G "Visual Studio 16" \
-DMYSQL_SOURCE_DIR=../../mysql-server\
-DMYSQL_BUILD_DIR=../../mysql-server/bld\
-DHAVE_PYTHON=1\
-DPYTHON_LIBRARY=<path_to_python_library> \
-DPYTHON_INCLUDE_DIR=<python_src>\include;<python_src>\PC
Open the generated solution mysh.sln and build it using Visual Studio.
* Note that in Windows, all dependencies must be built with compatible build
settings, specially regarding Release vs Debug and /MD vs /MT.
Enabling JavaScript Support
---------------------------
JavaScript is enabled by satisfying the native Polyglot API library
(From GraalVM) dependency.
To build The native Polyglot API library follow the instructions at
ext/polyglot/README.txt
To support JavaScript on the MySQL Shell add the following flag to the CMake call:
-DBUNDLED_POLYGLOT_DIR=<Path>
Where Path is the path to the folder containing the native Polyglot API library
and headers
Note that version 23.0.1 is needed and newer versions may not work.
Enabling Python Support
-----------------------
Python is enabled by satisfying the dependency with Python.
To support Python on the MySQL Shell add the following flags to the CMake call:
-DHAVE_PYTHON=1
Additional for windows only:
-DPYTHON_LIBRARY=<path_to_python_library>
-DPYTHON_INCLUDE_DIR=<python_src>\include;<python_src>\PC
Adding Unit Test Support
------------------------
GTest is required to enable Unit Testing. Make them available by adding the
following parameters to the cmake call.
-DWITH_TESTS=1