Cmake Build Guide For GridDB Python Client

Table of Contents


1 Building the GridDB python client

This section shows how to build the GridDB python client on a single machine.

1.1 Confirming the environment

Confirm that OS is Windows 10 64 bit

1.2 Required software to build GridDB python client

  • cmake: version 3.14.5
  • python: version 3.6.4
  • swig: version 3.0.12
  • GridDB C client: version 4.2.0

In order to build, we also need to install Visual Studio 2017

1.3 Installing required software

1.3.1 Install cmake

1.3.2 Install python

set(PYTHON_RESOURCE C:/Users/username/AppData/Local/Programs/Python/Python36)

1.3.3 Install swig

set(SWIG_RESOURCE E:/swigwin-3.0.12)

1.3.4 Install GridDB C client

  • Please refer to https://github.com/griddb/c\_client to install GridDB C client.
  • 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
set(C_LIB E:/c_client-master/bin/x64/Release)
set(C_HEADER E:/c_client-master/client/c/include)

1.4 Building GridDB python client

Before building Griddb python client, please set link for SOURCE_HEADER (link to folder store cpp headers) in CmakeList.txt

set(SOURCE_HEADER E:/SourceCode/src)

1.4.1 Generate standard build files from cmake

  • Open <PATH_TO_CMAKE>/cmake-3.14.5-win64-x64/bin/cmake-gui.exe
  • Set link for source code in cmake gui: link to folder store CmakeList.txt
  • Set link for the binaries in cmake gui: link to folder which generated files are store (sln file, py file)
  • Run Configure with set Specify the generator for this project is Visual Studio 15 2017, and for Optional toolset to use is x64
  • Run Generate to get standard build files

1.4.2 Build python client

  • Open <PATH_TO_OUTPUT_CMAKE>/griddb_python.sln by Visual Studio 2017
  • Build griddb_python project to get _griddb_python.pyd library and griddb_python.py interface

1.5 Run sample to check for building Python client

  • Put _griddb_python.pyd, gridstore_c.dll libraries and griddb_python.py interface into folder store sample1.py
<PATH_TO>/python.exe sample1.py 239.0.0.1 <port> <cluster> <username> <password>