2019-11-01 15:42:04 +08:00
# Install Milvus from Source Code
## Software requirements
- Ubuntu 18.04 or higher
2019-11-19 09:16:58 +08:00
2019-11-19 11:49:05 +08:00
If your operating system is not Ubuntu 18.04 or higher, we recommend you to pull a [docker image of Ubuntu 18.04 ](https://docs.docker.com/install/linux/docker-ce/ubuntu/ ) as your compilation environment.
2019-11-19 09:16:58 +08:00
2019-11-13 15:43:24 +08:00
- CMake 3.12 or higher
##### For GPU version, you will also need:
2019-11-01 15:42:04 +08:00
- CUDA 10.0 or higher
- NVIDIA driver 418 or higher
## Compilation
### Step 1 Install dependencies
```shell
2019-11-13 15:43:24 +08:00
$ cd [Milvus root path]/core
2019-11-01 15:42:04 +08:00
$ ./ubuntu_build_deps.sh
```
### Step 2 Build
```shell
2019-11-13 15:43:24 +08:00
$ cd [Milvus root path]/core
2019-11-01 15:42:04 +08:00
$ ./build.sh -t Debug
or
$ ./build.sh -t Release
2019-11-13 16:18:18 +08:00
```
2019-11-13 15:43:24 +08:00
2019-11-13 16:18:18 +08:00
By default, it will build CPU version. To build GPU version, add `-g` option
2019-11-15 17:44:38 +08:00
```shell
2019-11-13 15:43:24 +08:00
$ ./build.sh -g
2019-11-01 15:42:04 +08:00
```
2019-11-15 17:44:38 +08:00
If you want to know the complete build options, run
```shell
$./build.sh -h
```
2019-11-01 15:42:04 +08:00
When the build is completed, all the stuff that you need in order to run Milvus will be installed under `[Milvus root path]/core/milvus` .
## Launch Milvus server
```shell
$ cd [Milvus root path]/core/milvus
```
Add `lib/` directory to `LD_LIBRARY_PATH`
2019-11-15 17:44:38 +08:00
```shell
2019-11-13 15:43:24 +08:00
$ export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:[Milvus root path]/core/milvus/lib
2019-11-01 15:42:04 +08:00
```
Then start Milvus server:
2019-11-15 17:44:38 +08:00
```shell
2019-11-01 15:42:04 +08:00
$ cd scripts
$ ./start_server.sh
```
To stop Milvus server, run:
```shell
$ ./stop_server.sh
```
2019-11-13 15:43:24 +08:00
## Troubleshooting
1. If you encounter the following error when compiling:
`protocol https not supported or disabled in libcurl` .
First, make sure you have `libcurl4-openssl-dev` installed in your system.
Then try reinstall CMake from source with `--system-curl` option:
2019-11-15 17:44:38 +08:00
```shell
2019-11-13 15:43:24 +08:00
$ ./bootstrap --system-curl
$ make
$ sudo make install
```