-
Operating system
-
Ubuntu 18.04 or higher
-
CentOS 7
Note: If your Linux operating system does not meet the requirements, we recommend that you pull a Docker image of Ubuntu 18.04 or CentOS 7 as your compilation environment.
-
GCC 7.0 or higher to support C++ 17
-
CMake 3.12 or higher
-
Git
For GPU-enabled version, you will also need:
-
CUDA 10.x (10.0, 10.1, 10.2)
-
NVIDIA driver 418 or higher
Download the latest Milvus source code and change directory:
$ git clone https://github.com/milvus-io/milvus
$ cd ./milvus/core$ ./ubuntu_build_deps.sh$ ./centos7_build_deps.sh$ ./build.sh -t DebugWhen the build completes, everything that you need to run Milvus is under [Milvus root path]/core/milvus.
$ cd [Milvus root path]/core/milvusAdd lib/ directory to LD_LIBRARY_PATH
$ export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:[Milvus root path]/core/milvus/libThen start Milvus server:
$ cd scripts
$ ./start_server.shTo stop Milvus server, run:
$ ./stop_server.shWith the following Docker images, you should be able to compile Milvus on any Linux platform that runs 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:latestPull GPU-enabled image:
$ docker pull milvusdb/milvus-gpu-build-env:latestStart a CPU-only container:
$ docker run -it -p 19530:19530 -d milvusdb/milvus-cpu-build-env:latestStart a GPU container:
- For nvidia docker 2:
$ docker run --runtime=nvidia -it -p 19530:19530 -d milvusdb/milvus-gpu-build-env:latest- For nvidia container toolkit:
docker run --gpus all -it -p 19530:19530 -d milvusdb/milvus-gpu-build-env:latestTo enter the container:
$ docker exec -it [container_id] bashDownload latest Milvus source code:
$ git clone https://github.com/milvus-io/milvusTo enter its core directory:
$ cd ./milvus/coreIf you are using a CPU-only image:
- run
build.sh:
$ ./build.sh -t Release- Start Milvus server:
$ ./start_server.shIf you are using a GPU-enabled image:
- Add cuda library path to
LD_LIBRARY_PATH:
$ export LD_LIBRARY_PATH=/usr/local/cuda/lib64:$LD_LIBRARY_PATH- Add cuda binary path to
PATH:
$ export PATH=/usr/local/cuda/bin:$PATH- Add a
-gparameter to runbuild.sh:
$ ./build.sh -g -t Release- Start Milvus server:
$ ./start_server.shFollow the steps below to solve this problem:
- Make sure you have
libcurl4-openssl-devinstalled in your system. - Try reinstalling the latest CMake from source with
--system-curloption:
$ ./bootstrap --system-curl
$ make
$ sudo make installIf the --system-curl command doesn't work, you can also reinstall CMake in Ubuntu Software on your local computer.
Try increasing the memory allocated to Docker. If this doesn't work, you can reduce the number of threads in CMake build in [Milvus root path]/core/build.sh.
make -j 8 install || exit 1 # The default number of threads is 8.Note: You might also need to configure CMake build for faiss in [Milvus root path]/core/src/index/thirdparty/faiss.
Follow the steps below to solve this problem:
- Check whether
libmysqlpp.so.3is correctly installed. - If
libmysqlpp.so.3is installed, check whether it is added toLD_LIBRARY_PATH.
Follow the steps below to install a supported version of CMake:
-
Remove the unsupported version of CMake.
-
Get CMake 3.12 or higher. Here we get CMake 3.12.
$ wget https://cmake.org/files/v3.12/cmake-3.12.2-Linux-x86_64.tar.gz
-
Extract the file and install CMake.
$ tar zxvf cmake-3.12.2-Linux-x86_64.tar.gz $ mv cmake-3.12.2-Linux-x86_64 /opt/cmake-3.12.2 $ ln -sf /opt/cmake-3.12.2/bin/* /usr/bin/