From c015c016ea75a1fa1116558107a120d7ac1c821c Mon Sep 17 00:00:00 2001 From: yangzq50 <58433399+yangzq50@users.noreply.github.com> Date: Tue, 26 Dec 2023 14:07:09 +0800 Subject: [PATCH] Update docs/build_from_source.md (#369) * edit docs/build_from_source.md * add doc for building source code using Docker * fix path for program * build in release mode in Docker --- docs/build_from_source.md | 34 ++++++++++++++++++++++++++++++---- docs/sql_syntax.md | 4 ++-- 2 files changed, 32 insertions(+), 6 deletions(-) diff --git a/docs/build_from_source.md b/docs/build_from_source.md index 3cb013a265..3c55d0e97d 100644 --- a/docs/build_from_source.md +++ b/docs/build_from_source.md @@ -1,8 +1,34 @@ # Build from Source +- [Build from source on Linux using Docker](#build-from-source-on-linux-using-docker) - [Build from source on Ubuntu 22.04](#build-from-source-on-ubuntu-2204) - [Build from source on Ubuntu 23.10](#build-from-source-on-ubuntu-2310) +## Build from source on Linux using Docker + +This section provides instructions on building Infinity from source on Linux using Docker. + +### Step1 Download the source code + +```shell +git clone https://github.com/infiniflow/infinity.git +``` + +### Step2 Build the source code using Docker + +```shell +cd infinity && mkdir build +TZ=$(readlink -f /etc/localtime | awk -F '/zoneinfo/' '{print $2}') +docker run -d --name infinity_build --network=host -e TZ=$TZ -v $PWD:/infinity infiniflow/infinity_builder:centos7 +docker exec infinity_build bash -c "cd /infinity/build && cmake -G Ninja -DCMAKE_BUILD_TYPE=Release .. && ninja -j 12" +``` + +### Step3 Start up the Infinity server + +```shell +./build/src/infinity +``` + ## Build from source on Ubuntu 22.04 This section provides instructions on building Infinity from source on Ubuntu 22.04. @@ -35,8 +61,8 @@ ln -s /usr/lib/llvm-17/bin/clang-scan-deps /usr/bin/clang-scan-deps ```shell git config --global --add safe.directory infinity cd infinity && mkdir build && cd build -export CC=/usr/bin/clang-18 -export CXX=/usr/bin/clang++-18 +export CC=/usr/bin/clang-17 +export CXX=/usr/bin/clang++-17 cmake -G Ninja .. ninja -j 12 ``` @@ -44,7 +70,7 @@ ninja -j 12 ### Step4 Start up the Infinity server ```shell -.build/src/infinity +./src/infinity ``` @@ -84,5 +110,5 @@ ninja -j 12 ### Step4 Start up Infinity server ```shell -.build/src/infinity +./src/infinity ``` \ No newline at end of file diff --git a/docs/sql_syntax.md b/docs/sql_syntax.md index 8a8911ac5f..b50a883a76 100644 --- a/docs/sql_syntax.md +++ b/docs/sql_syntax.md @@ -70,6 +70,6 @@ DESCRIBE INDEX table_name; #### Example ```sql -SELECT col1 FROM tbl1 ORDER BY KNN(col2, [0.3, 0.3, 0.2, 0.2], 'float', 'l2') LIMIT 2; -SELECT col1 FROM tbl1 ORDER BY KNN(col2, [0.3, 0.3, 0.2, 0.2], 'float', 'ip') DESC LIMIT 2; +SELECT col1 FROM tbl1 SEARCH KNN(col2, [0.3, 0.3, 0.2, 0.2], 'float', 'l2', 2); +SELECT col1 FROM tbl1 SEARCH KNN(col2, [0.3, 0.3, 0.2, 0.2], 'float', 'ip', 2); ```