-
Ubuntu 18.04 or higher
If your operating system is not Ubuntu 18.04 or higher, we recommend you to pull a docker image of Ubuntu 18.04 as your compilation environment.
-
GCC 7.0 or higher to support C++17
-
CMake 3.12 or higher
- CUDA 10.0 or higher
- NVIDIA driver 418 or higher
$ cd [Milvus root path]/core
$ ./ubuntu_build_deps.sh
$ cd [Milvus root path]/core
$ ./build.sh -t Debug
or
$ ./build.sh -t Release
By default, it will build CPU-only version. To build GPU version, add -g
option
$ ./build.sh -g
If you want to know the complete build options, run
$./build.sh -h
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
.
$ cd [Milvus root path]/core/milvus
Add lib/
directory to LD_LIBRARY_PATH
$ export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:[Milvus root path]/core/milvus/lib
Then start Milvus server:
$ cd scripts
$ ./start_server.sh
To stop Milvus server, run:
$ ./stop_server.sh
With the following Docker images, you should be able to compile Milvus on any Linux platform that run Docker. To build a GPU supported Milvus, you need to install NVIDIA Docker first.
Pull CPU-only image:
$ docker pull milvusdb/milvus-cpu-build-env:latest
Pull GPU-enabled image:
$ docker pull milvusdb/milvus-gpu-build-env:latest
Start a CPU-only container:
$ docker run -it -p 19530:19530 -d milvusdb/milvus-cpu-build-env:latest
Start a GPU container:
$ docker run --runtime=nvidia -it -p 19530:19530 -d milvusdb/milvus-gpu-build-env:latest
To enter the container:
$ docker exec -it [container_id] bash
Download latest Milvus source code:
$ cd /home
$ git clone https://github.com/milvus-io/milvus
To enter its core directory:
$ cd ./milvus/core
If you are using a CPU-only image, compile it like this:
$ ./build.sh -t Release
If you are using a GPU-enabled image, you need to add a -g
parameter:
$ ./build.sh -g -t Release
Then start Milvus server:
$ ./start_server.sh
-
If you encounter the following error when compiling:
protocol https not supported or disabled in libcurl
. First, make sure you havelibcurl4-openssl-dev
installed in your system. Then try reinstalling the latest CMake from source with--system-curl
option:$ ./bootstrap --system-curl $ make $ sudo make install
If the --system-curl
command doesn't work, you can also reinstall CMake in Ubuntu Software on your local computer.
-
If you encounter the following error when compiling in a Docker image:
internal compiler error
. Try increasing the memory allocated to docker first. -
If you encounter the following error during compilation:
.../bin/milvus_server: error while loading shared libraries: libmysqlpp.so.3: cannot open shared object file: No such file or directory
Try the following solutions:
- Check whether
libmysqlpp.so.3
is correctly installed; - If
libmysqlpp.so.3
is installed, check whether it is added toLD_LIBRARY_PATH
.
- Check whether