|
| 1 | +#+TITLE: Cmake Build Guide For GridDB Python Client |
| 2 | + |
| 3 | +#+STARTUP: showall |
| 4 | +#+STARTUP: logdone |
| 5 | +#+STARTUP: hidestars |
| 6 | + |
| 7 | +#+OPTIONS: author:nil timestamp:nil creator:nil |
| 8 | +#+OPTIONS: ^:nil _:nil |
| 9 | + |
| 10 | +#+DRAWERS: NOTE |
| 11 | + |
| 12 | +[TABLE-OF-CONTENTS] |
| 13 | + |
| 14 | +#+STYLE: <STYLE type="text/css"> |
| 15 | +#+STYLE: <!- |
| 16 | +#+STYLE: .break { page-break-before: always; } |
| 17 | +#+STYLE: --> |
| 18 | +#+STYLE: </STYLE> |
| 19 | + |
| 20 | +#+HTML: <DIV class="break"></DIV><BR> |
| 21 | + |
| 22 | +* Building the GridDB python client |
| 23 | + |
| 24 | +This section shows how to build the GridDB python client on a single machine. |
| 25 | + |
| 26 | +** Confirming the environment |
| 27 | + |
| 28 | +Confirm that OS is Windows 10 64 bit |
| 29 | + |
| 30 | +** Required software to build GridDB python client |
| 31 | +- cmake: version 3.14.5 |
| 32 | +- python: version 3.6.4 |
| 33 | +- swig: version 3.0.12 |
| 34 | +- GridDB C client: version 4.2.0 |
| 35 | +In order to build, we also need to install Visual Studio 2017 |
| 36 | + |
| 37 | +** Installing required software |
| 38 | +*** Install cmake |
| 39 | +- Download zip package from https://github.com/Kitware/CMake/releases/download/v3.14.5/cmake-3.14.5-win64-x64.zip |
| 40 | +- Extract the zip package and get resource of cmake tool |
| 41 | +*** Install python |
| 42 | +- Download and install python 3.6.4 from https://www.python.org/ftp/python/3.6.4/python-3.6.4-amd64.exe |
| 43 | +- Set path for PYTHON_RESOURCE in *CmakeList.txt* |
| 44 | +#+BEGIN_EXAMPLE |
| 45 | +set(PYTHON_RESOURCE C:/Users/username/AppData/Local/Programs/Python/Python36) |
| 46 | +#+END_EXAMPLE |
| 47 | +*** Install swig |
| 48 | +- Download zip package from https://sourceforge.net/projects/swig/files/swigwin/swigwin-3.0.12/swigwin-3.0.12.zip/download |
| 49 | +- Extract the zip package then set path for SWIG_RESOURCE in *CmakeList.txt* |
| 50 | +#+BEGIN_EXAMPLE |
| 51 | +set(SWIG_RESOURCE E:/swigwin-3.0.12) |
| 52 | +#+END_EXAMPLE |
| 53 | +*** Install GridDB C client |
| 54 | +- Please refer to https://github.com/griddb/c_client to install GridDB C client. |
| 55 | +- After installing GridDB C client, set path for C_LIB (path for gridstore_c.lib) and C_HEADER (path for gridstore.h) in *CmakeList.txt* |
| 56 | +#+BEGIN_EXAMPLE |
| 57 | +set(C_LIB E:/c_client-master/bin/x64/Release) |
| 58 | +set(C_HEADER E:/c_client-master/client/c/include) |
| 59 | +#+END_EXAMPLE |
| 60 | +** Building GridDB python client |
| 61 | +Before building Griddb python client, please set link for SOURCE_HEADER (link to folder store cpp headers) in *CmakeList.txt* |
| 62 | +#+BEGIN_EXAMPLE |
| 63 | +set(SOURCE_HEADER E:/SourceCode/src) |
| 64 | +#+END_EXAMPLE |
| 65 | +*** Generate standard build files from cmake |
| 66 | +- Open <PATH_TO_CMAKE>/cmake-3.14.5-win64-x64/bin/cmake-gui.exe |
| 67 | +- Set link for *source code* in cmake gui: link to folder store *CmakeList.txt* |
| 68 | +- Set link for *the binaries* in cmake gui: link to folder which generated files are store (sln file, py file) |
| 69 | +- Run *Configure* with set *Specify the generator for this project* is *Visual Studio 15 2017*, and for *Optional toolset to use* is *x64* |
| 70 | +- Run *Generate* to get standard build files |
| 71 | +*** Build python client |
| 72 | +- Open <PATH_TO_OUTPUT_CMAKE>/griddb_python.sln by Visual Studio 2017 |
| 73 | +- Build *griddb_python* project to get *_griddb_python.pyd* library and *griddb_python.py* interface |
| 74 | +** Run sample to check for building Python client |
| 75 | +- Put *_griddb_python.pyd*, *gridstore_c.dll* libraries and *griddb_python.py* interface into folder store *sample1.py* |
| 76 | +#+BEGIN_EXAMPLE |
| 77 | +<PATH_TO>/python.exe sample1.py 239.0.0.1 <port> <cluster> <username> <password> |
| 78 | +#+END_EXAMPLE |
| 79 | + |
0 commit comments