Skip to content

Commit 0a70563

Browse files
authored
V2.6.0 (#165)
1 parent 3b6455a commit 0a70563

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

73 files changed

+6458
-3096
lines changed

CMakeLists.txt

Lines changed: 27 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
cmake_minimum_required (VERSION 3.17)
2+
23
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall")
34
set(CMAKE_CXX_STANDARD 17)
45

6+
57
IF(CODE_COVERAGE)
68
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -g -O0 -Wall -coverage -fprofile-arcs -ftest-coverage")
79
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -g -O0 -Wall -coverage -fprofile-arcs -ftest-coverage")
@@ -12,16 +14,32 @@ project(vdms_application)
1214
add_compile_options(-g -fPIC -std=c++17)
1315

1416
find_package( OpenCV REQUIRED )
15-
find_package(Protobuf REQUIRED)
17+
find_package(Protobuf CONFIG REQUIRED)
1618
find_package( CURL REQUIRED )
1719
find_package(AWSSDK REQUIRED COMPONENTS core s3)
1820

1921
include_directories(${Protobuf_INCLUDE_DIRS})
2022
include_directories(${CMAKE_CURRENT_BINARY_DIR})
2123

22-
execute_process(COMMAND python3 ${CMAKE_CURRENT_SOURCE_DIR}/utils/src/api_schema/createApiString.py ${CMAKE_CURRENT_SOURCE_DIR}/utils/src/api_schema/api_schema.json ${CMAKE_CURRENT_BINARY_DIR}/APISchema.h)
23-
protobuf_generate_cpp(PROTO_SRCS PROTO_HDRS utils/src/protobuf/partitionerMessages.proto utils/src/protobuf/pmgdMessages.proto utils/src/protobuf/queryMessage.proto)
24-
add_library(vdms_protobuf SHARED ${PROTO_SRCS} ${PROTO_HDRS})
24+
execute_process(COMMAND python3
25+
${CMAKE_CURRENT_SOURCE_DIR}/utils/src/api_schema/createApiString.py
26+
${CMAKE_CURRENT_SOURCE_DIR}/utils/src/api_schema/api_schema.json
27+
${CMAKE_CURRENT_BINARY_DIR}/APISchema.h
28+
)
29+
add_library(vdms_protobuf OBJECT
30+
${CMAKE_CURRENT_SOURCE_DIR}/utils/src/protobuf/partitionerMessages.proto
31+
${CMAKE_CURRENT_SOURCE_DIR}/utils/src/protobuf/pmgdMessages.proto
32+
${CMAKE_CURRENT_SOURCE_DIR}/utils/src/protobuf/queryMessage.proto
33+
)
34+
target_link_libraries(vdms_protobuf PUBLIC protobuf::libprotobuf)
35+
set(PROTO_BINARY_DIR ${CMAKE_CURRENT_BINARY_DIR})
36+
target_include_directories(vdms_protobuf PUBLIC "$<BUILD_INTERFACE:${PROTO_BINARY_DIR}>")
37+
protobuf_generate(
38+
LANGUAGE cpp
39+
TARGET vdms_protobuf
40+
IMPORT_DIRS "${CMAKE_CURRENT_SOURCE_DIR}/utils/src/protobuf"
41+
PROTOC_OUT_DIR "${PROTO_BINARY_DIR}"
42+
)
2543

2644
option(CLIENT "Built client library." OFF)
2745
if (CLIENT)
@@ -54,7 +72,9 @@ else()
5472
src/PMGDIterators.cc
5573
src/PMGDQuery.cc
5674
src/PMGDQueryHandler.cc
57-
src/QueryHandler.cc
75+
src/QueryHandlerExample.cc
76+
src/QueryHandlerBase.cc
77+
src/QueryHandlerPMGD.cc
5878
src/QueryMessage.cc
5979
src/RSCommand.cc
6080
src/SearchExpression.cc
@@ -63,10 +83,9 @@ else()
6383
src/VideoCommand.cc
6484
src/AutoDeleteNode.cc
6585
src/ImageLoop.cc
66-
${PROTO_SRCS} ${PROTO_HDRS}
67-
)
86+
src/VideoLoop.cc
87+
)
6888
target_link_libraries(dms vcl pmgd pmgd-util protobuf tbb tiledb vdms-utils pthread -lcurl -lzmq ${AWSSDK_LINK_LIBRARIES})
69-
7089
add_executable(vdms src/vdms.cc)
7190
target_link_libraries(vdms dms vdms_protobuf vcl tiledb faiss flinng jsoncpp ${OpenCV_LIBS} ${AWSSDK_LINK_LIBRARIES})
7291
endif ()

INSTALL.md

Lines changed: 79 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -2,20 +2,20 @@
22
Here is the detailed process of installation of VDMS dependencies.
33

44
## Dependencies
5-
To install VDMS, we must install the necessary dependencies via apt, github, and pip.
5+
To install VDMS, we must install the necessary dependencies via apt, github, and pip (Python 3.9+).
66

7-
### Install Debian Packages
8-
Here we will install the Debian and Python3 packages.
7+
### Install Debian/Ubuntu Packages
8+
Here we will install the Debian/Ubuntu packages.
99
```bash
1010
sudo apt-get update
1111
sudo apt-get install -y --no-install-suggests --no-install-recommends \
1212
apt-transport-https autoconf automake bison build-essential bzip2 ca-certificates \
1313
curl ed flex g++-9 gcc-9 git gnupg-agent javacc libarchive-tools libatlas-base-dev \
1414
libavcodec-dev libavformat-dev libboost-all-dev libbz2-dev libc-ares-dev libcurl4-openssl-dev \
15-
libdc1394-22-dev libgflags-dev libgoogle-glog-dev libgtest-dev libgtk-3-dev libgtk2.0-dev \
16-
libhdf5-dev libjpeg-dev libjpeg62-turbo-dev libjsoncpp-dev libleveldb-dev liblmdb-dev \
15+
libdc1394-22-dev libgflags-dev libgoogle-glog-dev libgtk-3-dev libgtk2.0-dev \
16+
libhdf5-dev libjpeg-dev libjsoncpp-dev libleveldb-dev liblmdb-dev \
1717
liblz4-dev libopenblas-dev libopenmpi-dev libpng-dev librdkafka-dev libsnappy-dev libssl-dev \
18-
libswscale-dev libtbb-dev libtbb2 libtiff-dev libtiff5-dev libtool libzmq3-dev mpich \
18+
libswscale-dev libtbb-dev libtbb2 libtiff-dev libtiff5-dev libtool libzmq3-dev linux-libc-dev mpich \
1919
openjdk-11-jdk-headless pkg-config procps python3-dev python3-pip software-properties-common \
2020
swig unzip uuid-dev
2121
```
@@ -25,81 +25,110 @@ update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-9 1
2525
update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-9 1
2626
```
2727

28+
#### **Install JPEG package**
29+
Please install the JPEG package based on the OS platform being used:
30+
* ***Debian 10+:*** `sudo apt-get install -y libjpeg62-turbo-dev`
31+
* ***Ubuntu 20.04+:*** `sudo apt-get install -y libjpeg8-dev`
32+
<br>
33+
2834
### Install Remaining Dependencies
2935
Here we assume `$VDMS_DEP_DIR` is the directory for installing additional dependencies.
3036
This directory is user-defined but here we use `/dependencies`.
3137
These instructions assume you have full permissions to your system.
32-
If not running as root, add `sudo` where necessary.
38+
***NOTE:*** If running as ***root***, remove `sudo` where applicable.
3339
```bash
3440
VDMS_DEP_DIR=/dependencies # Set to any directory
3541
BUILD_THREADS="-j`nproc`"
3642
mkdir -p $VDMS_DEP_DIR
3743
```
3844

45+
3946
#### Python3 Packages
40-
Here we will install the necessary Python3 packages Numpy and Protobuf 3.20.3.
47+
Here we will install the necessary Python 3.9+ packages Numpy and Protobuf v24.2.
48+
It is expected that you have Python3.9 or higher installed on your system.
49+
All python calls will use Python3.9+; therefore you may find it convenient to set alias for python.
50+
```bash
51+
alias python=/usr/bin/python3
52+
```
53+
***NOTE:*** If multiple versions of Python 3 are present on your system, verify you are using Python3.9 or higher. You can specify the specific verison in above command and also set the following with your specific version: `alias python3=/usr/bin/python3.x`.
54+
4155
You can also install the coverage package if interested in running the Python unit tests.
4256
```bash
43-
PROTOBUF_VERSION="3.20.3"
44-
pip3 install --no-cache-dir "numpy>=1.25.1" "protobuf==${PROTOBUF_VERSION}" "coverage>=7.2.7"
57+
python3 -m pip install --upgrade pip
58+
python3 -m pip install --no-cache-dir "numpy>=1.25.1" "coverage>=7.2.7"
4559
```
4660

4761

48-
#### CMAKE v3.26.4
49-
VDMS requires CMake v3.21+. Here we install CMake v3.26.4.
62+
#### **CMAKE v3.27.2**
63+
VDMS requires CMake v3.21+. Here we install CMake v3.27.2.
5064
```bash
51-
CMAKE_VERSION="v3.26.4"
65+
CMAKE_VERSION="v3.27.2"
5266
git clone --branch ${CMAKE_VERSION} https://github.com/Kitware/CMake.git $VDMS_DEP_DIR/CMake
5367
cd $VDMS_DEP_DIR/CMake
5468
./bootstrap
5569
make ${BUILD_THREADS}
56-
make install
70+
sudo make install
5771
```
5872

59-
### gtest
60-
Unfortunately apt doesn't build gtest so you need to do the following:
61-
```bash
62-
cd /usr/src/gtest/
63-
cmake .
64-
make ${BUILD_THREADS}
65-
mv lib/libgtest* /usr/lib
66-
```
6773

68-
### Faiss v1.7.3
74+
#### **Faiss v1.7.3**
75+
Install the Faiss library for similarity search.
6976
```bash
7077
FAISS_VERSION="v1.7.3"
7178
git clone --branch ${FAISS_VERSION} https://github.com/facebookresearch/faiss.git $VDMS_DEP_DIR/faiss
7279
cd $VDMS_DEP_DIR/faiss
7380
mkdir build && cd build
74-
cmake -DFAISS_ENABLE_GPU=OFF ..
81+
cmake -DFAISS_ENABLE_GPU=OFF -DPython_EXECUTABLE=/usr/bin/python3 ..
7582
make ${BUILD_THREADS}
76-
make install
83+
sudo make install
7784
```
7885

79-
### FLINNG
86+
87+
#### **FLINNG**
88+
Install the Filters to Identify Near-Neighbor Groups (FLINNG) library for similarity search.
8089
```bash
8190
git clone https://github.com/tonyzhang617/FLINNG.git $VDMS_DEP_DIR/FLINNG
8291
cd $VDMS_DEP_DIR/FLINNG
8392
mkdir build && cd build
8493
cmake ..
8594
make ${BUILD_THREADS}
86-
make install
95+
sudo make install
8796
```
8897

89-
### Protobuf 3.20.3
98+
99+
#### **Protobuf v24.2 (4.24.2)**
100+
Install Protobuf (C++ and Python) which requires GoogleTest and Abseil C++ as dependencies.
90101
```bash
91-
PROTOBUF_VERSION="3.20.3"
92-
curl -L -o ${VDMS_DEP_DIR}/${PROTOBUF_VERSION}.tar.gz https://github.com/protocolbuffers/protobuf/archive/refs/tags/v${PROTOBUF_VERSION}.tar.gz
93-
cd ${VDMS_DEP_DIR} && tar -xvf ${PROTOBUF_VERSION}.tar.gz
94-
cd protobuf-${PROTOBUF_VERSION}
95-
./autogen.sh
96-
./configure
102+
PROTOBUF_VERSION="24.2"
103+
git clone -b v${PROTOBUF_VERSION} --recursive https://github.com/protocolbuffers/protobuf.git $VDMS_DEP_DIR/protobuf
104+
105+
cd $VDMS_DEP_DIR/protobuf/third_party/googletest
106+
mkdir build && cd build
107+
cmake -DCMAKE_POSITION_INDEPENDENT_CODE=ON -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=/usr/local \
108+
-DBUILD_GMOCK=ON -DCMAKE_CXX_STANDARD=17 ..
109+
make ${BUILD_THREADS}
110+
sudo make install
111+
sudo ldconfig
112+
113+
cd $VDMS_DEP_DIR/protobuf/third_party/abseil-cpp
114+
mkdir build && cd build
115+
cmake -DCMAKE_POSITION_INDEPENDENT_CODE=ON -DCMAKE_PREFIX_PATH=/usr/local/ -DCMAKE_INSTALL_PREFIX=/usr/local/ \
116+
-DABSL_BUILD_TESTING=ON -DABSL_ENABLE_INSTALL=ON -DABSL_USE_EXTERNAL_GOOGLETEST=ON \
117+
-DABSL_FIND_GOOGLETEST=ON -DCMAKE_CXX_STANDARD=17 ..
118+
make ${BUILD_THREADS}
119+
sudo make install
120+
121+
cd $VDMS_DEP_DIR/protobuf
122+
cmake -DCMAKE_POSITION_INDEPENDENT_CODE=ON -DCMAKE_INSTALL_PREFIX=/usr/local -DCMAKE_CXX_STANDARD=17 \
123+
-Dprotobuf_ABSL_PROVIDER=package -DCMAKE_PREFIX_PATH=/usr/local .
97124
make ${BUILD_THREADS}
98-
make install
99-
ldconfig
125+
sudo make install
126+
127+
python3 -m pip install --no-cache-dir "protobuf==4.${PROTOBUF_VERSION}"
100128
```
101129

102-
### [OpenCV](https://opencv.org/) 4.5.5
130+
131+
#### **[OpenCV](https://opencv.org/) 4.5.5**
103132
Below are instructions for installing ***OpenCV v4.5.5***.
104133
```bash
105134
OPENCV_VERSION="4.5.5"
@@ -108,7 +137,7 @@ cd $VDMS_DEP_DIR/opencv
108137
mkdir build && cd build
109138
cmake -D BUILD_PERF_TESTS=OFF -D BUILD_TESTS=OFF ..
110139
make ${BUILD_THREADS}
111-
make install
140+
sudo make install
112141
```
113142

114143
**Note**: When using videos, and getting the following error: "Unable to stop the stream: Inappropriate ioctl for device", you may need to include more flags when compiling OpenCV. Follow these instructions ([source](https://stackoverflow.com/questions/41200201/opencv-unable-to-stop-the-stream-inappropriate-ioctl-for-device)):
@@ -121,20 +150,21 @@ cmake -D BUILD_PERF_TESTS=OFF -D BUILD_TESTS=OFF -D CMAKE_BUILD_TYPE=RELEASE -D
121150
-D WITH_V4L=ON -D WITH_OPENGL=ON -D WITH_CUBLAS=ON \
122151
-DWITH_QT=OFF -DCUDA_NVCC_FLAGS="-D_FORCE_INLINES" ..
123152
make ${BUILD_THREADS}
124-
make install
153+
sudo make install
125154
```
126155

127-
### Valijson v0.6
128-
This is a headers-only library, no compilation/installation necessary
156+
157+
#### **Valijson v0.6**
158+
This is a headers-only library, no compilation/installation necessary.
129159
```bash
130160
VALIJSON_VERSION="v0.6"
131161
git clone --branch ${VALIJSON_VERSION} https://github.com/tristanpenman/valijson.git $VDMS_DEP_DIR/valijson
132162
cd $VDMS_DEP_DIR/valijson
133-
cp -r include/* /usr/local/include/
163+
sudo cp -r include/* /usr/local/include/
134164
```
135165

136166

137-
### [TileDB](https://tiledb.io/) 2.14.1
167+
#### **[TileDB](https://tiledb.io/) 2.14.1**
138168
The directions below will help you install TileDB v2.14.1 from the source.
139169
You can also follow the directions listed [here](https://docs.tiledb.io/en/latest/installation.html).
140170
```bash
@@ -146,19 +176,22 @@ cd TileDB-${TILEDB_VERSION}
146176
mkdir build && cd build
147177
../bootstrap --prefix=/usr/local/
148178
make ${BUILD_THREADS}
149-
make install-tiledb
179+
sudo make install-tiledb
150180
```
151181

152-
### AWS SDK CPP 1.11.0
182+
183+
#### **AWS SDK CPP 1.11.0**
184+
Use the following instructions to install AWS SDK for C++.
153185
```bash
154186
AWS_SDK_VERSION="1.11.0"
155187
git clone -b ${AWS_SDK_VERSION} --recurse-submodules https://github.com/aws/aws-sdk-cpp ${VDMS_DEP_DIR}/aws-sdk-cpp
156188
mkdir -p ${VDMS_DEP_DIR}/aws-sdk-cpp/build
157189
cd ${VDMS_DEP_DIR}/aws-sdk-cpp/build
158190
cmake .. -DCMAKE_BUILD_TYPE=Debug -DCMAKE_PREFIX_PATH=/usr/local/ -DCMAKE_INSTALL_PREFIX=/usr/local/ -DBUILD_ONLY="s3" -DCUSTOM_MEMORY_MANAGEMENT=OFF
159191
make ${BUILD_THREADS}
160-
make install
192+
sudo make install
161193
```
194+
<br>
162195

163196
## Install VDMS
164197
This version of VDMS treats PMGD as a submodule so both libraries are compiled at one time. After entering the vdms directory, the command `git submodule update --init --recursive` will pull pmgd into the appropriate directory. Furthermore, Cmake is used to compile all directories.

0 commit comments

Comments
 (0)