Setup SPTAG on Ubuntu
In this section, will describe how to setup SPTAG on Ubuntu machine.
- Update ubuntu and build env
sudo apt-get update && sudo apt-get install build-essential
- Install cmake
- Download cmake. You can find the cmake releases here.
# e.g. download cmake version 3.14.7
wget https://github.com/Kitware/CMake/releases/download/v3.14.7/cmake-3.14.7-Linux-x86_64.sh -P opt/
- Follow these instructions:
chmod +x opt/cmake-3.<your_version>.sh(chmod makes the script executable)sudo bash opt/cmake-3.<your_version>.sh- The script installs to a target directory so in order to get the
cmakecommand, make a symbolic link from the target directory where cmake was extracted to:sudo ln -s <target_directory>/cmake-3.<your_version>/bin/* /usr/local/bin cmake --versionNote: If you encounter this error: The program 'cmake' is currently not installed, Please try the command from step 3 again with a full path (e.g.sudo ln -s /home/<your name>/SPTAG/opt/cmake-3.<your_version>-Linux-x86_64/bin/* /usr/local/bin)
- Install boost
- Download boost 1.67 version:
wget https://netix.dl.sourceforge.net/project/boost/boost/1.67.0/boost_1_67_0.tar.gz
(There are some version mis-matching issues and reported on github issue)
- Extract and install
tar -xzvf boost*
cd boost_1_67_0
./bootstrap.sh --prefix=/usr/local
./b2
sudo ./b2 install
sudo apt-get install swig
- Generate a Release folder in the code directory which will contain all the build targets:
mkdir build
cd build && cmake .. && make
- Add SPTAG module to python path
# so python can find the SPTAG module
ENV PYTHONPATH=/app/Release