Skip to content

Commit 03b821c

Browse files
committed
add "QuickStart" for MacOS
1 parent a80a8aa commit 03b821c

1 file changed

Lines changed: 81 additions & 8 deletions

File tree

README.md

Lines changed: 81 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -11,20 +11,26 @@ Building of the library and execution of the sample programs have been checked i
1111
OS: CentOS 7.6(x64) (GCC 4.8.5)
1212
SWIG: 3.0.12
1313
Python: 3.6
14-
GridDB C client: V4.2 CE(Community Edition)
15-
GridDB server: V4.2 CE, CentOS 7.6(x64) (GCC 4.8.5)
14+
GridDB C client: V4.5 CE(Community Edition)
15+
GridDB server: V4.5 CE, CentOS 7.6(x64) (GCC 4.8.5)
1616

1717
OS: Ubuntu 18.04(x64) (gcc 7.3.0)
1818
SWIG: 3.0.12
1919
Python: 3.6
20-
GridDB C client: V4.2 CE (Note: If you build from source code, please use GCC 4.8.5.)
21-
GridDB server: V4.2 CE, Ubuntu 18.04(x64) (Note: If you build from source code, please use GCC 4.8.5.)
20+
GridDB C client: V4.5 CE (Note: If you build from source code, please use GCC 4.8.5.)
21+
GridDB server: V4.5 CE, Ubuntu 18.04(x64) (Note: If you build from source code, please use GCC 4.8.5.)
2222

2323
OS: Windows 10(x64) (VS2017)
2424
SWIG: 3.0.12
2525
Python: 3.6
26-
GridDB C client: V4.2 CE
27-
GridDB server: V4.2 CE, CentOS 7.6(x64) (GCC 4.8.5)
26+
GridDB C client: V4.5 CE
27+
GridDB server: V4.5 CE, CentOS 7.6(x64) (GCC 4.8.5)
28+
29+
OS: MacOS Catalina (x86_64)
30+
SWIG: 3.0.12
31+
Python: 3.6.9
32+
GridDB C client: V4.5 CE
33+
GridDB server: V4.5 CE, Centos 7.6(x64) (GCC 4.8.5)
2834

2935
## QuickStart (CentOS, Ubuntu)
3036
### Preparations
@@ -41,7 +47,7 @@ Install SWIG as below.
4147
Note: If CentOS, you might need to install pcre in advance.
4248
$ sudo yum install pcre2-devel.x86_64
4349

44-
Install [GridDB Server](https://github.com/griddb/griddb_nosql) and [C Client](https://github.com/griddb/c_client). (Note: If you build them from source code, please use GCC 4.8.5.)
50+
Install [GridDB Server](https://github.com/griddb/griddb) and [C Client](https://github.com/griddb/c_client). (Note: If you build them from source code, please use GCC 4.8.5.)
4551

4652
Set CPATH and LIBRARY_PATH.
4753

@@ -103,6 +109,73 @@ Install the MSI package, the package is extracted into C:/Program Files/griddb/P
103109
104110
Note: X.X.X is the software version.
105111
112+
## QuickStart (MacOS)
113+
### Preparations
114+
115+
Install SWIG as below.
116+
117+
$ wget https://prdownloads.sourceforge.net/swig/swig-3.0.12.tar.gz
118+
$ tar xvfz swig-3.0.12.tar.gz
119+
$ cd swig-3.0.12
120+
$ ./configure
121+
$ make
122+
$ sudo make install
123+
124+
Note: If MacOS, you might need to install pcre in advance.
125+
$ sudo brew install pcre
126+
127+
Install [GridDB Server](https://github.com/griddb/griddb) and [C Client](https://github.com/griddb/c_client). (Note: If you build them from source code, please use clang 11.0.0)
128+
129+
Set CPATH and LIBRARY_PATH.
130+
131+
export CPATH=$CPATH:<Python header file directory path>
132+
133+
export LIBRARY_PATH=$LIBRARY_PATH:<C client library file directory path>
134+
135+
Install Pandas and Numpy as below:
136+
137+
$ python -m pip install numpy
138+
$ python -m pip install pandas
139+
140+
Modify **Makefile** to make python_client compatible with MacOS:
141+
- Change python include path and numpy include path on MacOS. For example:
142+
```bash
143+
INCLUDES_PYTHON = $(INCLUDES) \
144+
-I$(HOME)/.pyenv/versions/3.6.9/include/python3.6m \
145+
-I$(HOME)/.pyenv/versions/3.6.9/lib/python3.6/site-packages/numpy/core/include
146+
```
147+
148+
- Remove "-Llibs -lrt" (not support on MacOS) from LDFLAGS on Makefile
149+
- Add "-undefined dynamic_lookup" like
150+
```bash
151+
$(CXX) -shared -undefined dynamic_lookup -o $@ $(OBJS) $(SWIG_PYTHON_OBJS) $(LDFLAGS)
152+
```
153+
### Build and Run
154+
155+
1. Execute the command on project directory.
156+
157+
$ make
158+
159+
2. Set the PYTHONPATH variable for griddb Python module files.
160+
161+
$ export PYTHONPATH=$PYTHONPATH:<installed directory path>
162+
163+
3. Import griddb_python in Python.
164+
165+
### How to run sample
166+
167+
GridDB Server need to be started in advance.
168+
169+
1. Set DYLD_LIBRARY_PATH
170+
171+
export DYLD_LIBRARY_PATH=${DYLD_LIBRARY_PATH}:<C client library file directory path>
172+
173+
2. The command to run sample
174+
175+
$ python3 sample/sample1.py <GridDB notification address> <GridDB notification port>
176+
<GridDB cluster name> <GridDB user> <GridDB password>
177+
-->Person: name=name02 status=False count=2 lob=[65, 66, 67, 68, 69, 70, 71, 72, 73, 74]
178+
106179
## Function
107180
108181
(available)
@@ -124,7 +197,7 @@ Please refer to the following files for more detailed information.
124197
Note:
125198
1. The current API might be changed in the next version. e.g. ContainerInfo
126199
2. When you install C Client with RPM or DEB, you don't need to set LIBRARY_PATH and LD_LIBRARY_PATH.
127-
3. There is [Python Client Package for CentOS and Ubuntu on The Python Package Index (PyPI)](https://pypi.org/project/griddb-python/) .
200+
3. There is [Python Client Package for CentOS, Ubuntu and MacOS on The Python Package Index (PyPI)](https://pypi.org/project/griddb-python/) .
128201
129202
## Community
130203

0 commit comments

Comments
 (0)