README.md 2.1 KB
Newer Older
G
groot 已提交
1 2
### Compilation
#### Step 1: install necessery tools
G
groot 已提交
3

G
groot 已提交
4
    centos7 : 
X
MS-154  
xj.lin 已提交
5
        yum install gfortran qt4 flex bison mysql-devel mysql
G
groot 已提交
6 7
        
    ubuntu16.04 : 
X
MS-154  
xj.lin 已提交
8
        sudo apt-get install gfortran qt4-qmake flex bison libmysqlclient-dev mysql-client
Z
update  
zhiru 已提交
9 10
        
    cd scripts && sudo ./requirements.sh     
Z
zhiru 已提交
11 12 13 14 15 16

If `libmysqlclient_r.so` does not exist after installing MySQL Development Files, you need to create a symbolic link:

```
sudo ln -s /path/to/libmysqlclient.so /path/to/libmysqlclient_r.so
```
G
groot 已提交
17

Z
zhiru 已提交
18
#### Step 2: build(output to cmake_build folder)
Z
zhiru 已提交
19

G
groot 已提交
20
cmake_build/src/milvus_server is the server
G
groot 已提交
21

G
groot 已提交
22
cmake_build/src/libmilvus_engine.a is the static library
G
groot 已提交
23

X
MS-154  
xj.lin 已提交
24 25 26
    git submodule init
    git submodule update

G
groot 已提交
27 28 29
    cd [sourcecode path]/cpp
    ./build.sh -t Debug
    ./build.sh -t Release
30
    ./build.sh -l -t Release # Build license version(only available for Release)
Z
zhiru 已提交
31 32 33 34 35 36 37 38 39 40 41 42 43 44

If you encounter the following error when building:
`protocol https not supported or disabled in libcurl`

1. Install libcurl4-openssl-dev

2. Install cmake 3.14: 

   ```
   ./bootstrap --system-curl 
   make 
   sudo make install
   ```

G
groot 已提交
45
#### To build unittest:
Z
zhiru 已提交
46

G
groot 已提交
47 48 49
    ./build.sh -u
    or
    ./build.sh --unittest
Z
zhiru 已提交
50

G
groot 已提交
51 52 53 54 55
#### To run code coverage

    apt-get install lcov
    ./build.sh -u -c

J
jinhai 已提交
56
### Launch server
G
groot 已提交
57
Set config in cpp/conf/server_config.yaml
G
groot 已提交
58

X
MS-154  
xj.lin 已提交
59
Add milvus/lib to LD_LIBRARY_PATH
Z
zhiru 已提交
60 61

```
X
MS-154  
xj.lin 已提交
62
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/path/to/milvus/lib
Z
zhiru 已提交
63 64
```

J
jinhai 已提交
65
Then launch server with config:
G
groot 已提交
66 67 68
    cd [build output path]
    start_server.sh
    stop_server.sh
J
jinhai 已提交
69

J
jinhai 已提交
70
### Launch test_client(only for debug)
G
groot 已提交
71 72
If you want to test remote api, you can build test_client.
test_client use same config file with server:
Z
zhiru 已提交
73

G
groot 已提交
74 75 76
    cd [build output path]/test_client
    test_client -c [sourcecode path]/cpp/conf/server_config.yaml

J
jinhai 已提交
77 78 79 80 81 82 83 84 85 86
### License Generate
Use get_sys_info to get system info file.

    ./get_sys_info                  # system.info will be generated

Use license_generator to generate license file.

    ./license_generator -s system.info -l system.license -b 2019-05-15 -e 2019-08-14                 

Copy the license file to path assigned by license_path in server config file.