Skip to content

Commit

Permalink
Update docs/build_from_source.md (#369)
Browse files Browse the repository at this point in the history
* edit docs/build_from_source.md

* add doc for building source code using Docker

* fix path for program

* build in release mode in Docker
  • Loading branch information
yangzq50 authored Dec 26, 2023
1 parent 9bfd0ec commit c015c01
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 6 deletions.
34 changes: 30 additions & 4 deletions docs/build_from_source.md
Original file line number Diff line number Diff line change
@@ -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.
Expand Down Expand Up @@ -35,16 +61,16 @@ 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
```

### Step4 Start up the Infinity server

```shell
.build/src/infinity
./src/infinity
```


Expand Down Expand Up @@ -84,5 +110,5 @@ ninja -j 12
### Step4 Start up Infinity server

```shell
.build/src/infinity
./src/infinity
```
4 changes: 2 additions & 2 deletions docs/sql_syntax.md
Original file line number Diff line number Diff line change
Expand Up @@ -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);
```

0 comments on commit c015c01

Please sign in to comment.