First Commit

This commit is contained in:
proitlab committed 2026-07-01 13:38:05 +07:00
1 parent 267107ff05
commit 37fe4eee3a
53 files changed
+15098 -2

No files matched your search

+52
View File
@@ -0,0 +1,52 @@
# Edge RK3588 production counter — copy to .env on device
# cp .env.example .env && nano .env
OUTPUT_DIR=/opt/bytetrack-counter-cpp
DB_PATH=/opt/bytetrack-counter-cpp/bytetrack_counter.db
STATE_FILE=/tmp/bytetrack_current_batch.json
# Direct LAN camera RTSP (low latency)
SOURCE=rtsp://frigate:zenai@192.168.192.16:8554/camera_stream_640
#SOURCE=rtsp://192.168.192.53:8554/my_stream
OPENCV_FFMPEG_CAPTURE_OPTIONS=rtsp_transport;tcp|fflags;nobuffer|flags;low_delay
# RKNN model — export'd from YOLO with imgsz=320
MODEL_PATH=/opt/models/zenai_apc_cicalengka_20260609.rknn
IMGSZ=320
HALF=false
CONF=0.3
# RKNN NPU core mask: 1=core0, 2=core1, 3=core0+core1, 7=all three
CORE_MASK=7
# YOLO decoder params (must match model export)
NUM_CLASSES=2
SCORE_SIGMOID=false
CAMERA_NAME=CC1
OBJECT_LABEL=ayam-potong
CLASS_AYAM=ayam
CLASS_TALENAN=talenan
# Line crossing: rtl (default) | ltr | both
CROSS_DIRECTION=ltr
LINE_X=
LINE_X_FRAC=0.5
DAILY_CUTOFF_TIME=17:00
BATCH_TIMEOUT_SECONDS=300
IGNORE_BATCH_LABEL_TIMEOUT_SECONDS=30
MIN_OBJECT_PER_BATCH=60
MIN_DURATION_PER_BATCH=60
EXPORT_CSV=true
RECORD_VIDEO=false
LIVE_STREAM_ENABLED=true
LIVE_STREAM_FRAME_PATH=/dev/shm/bytetrack-counter/live_frame.jpg
LIVE_STREAM_QUALITY=75
LIVE_STREAM_EVERY_N=2
LOG_LEVEL=info
DASHBOARD_PORT=5001
+50
View File
@@ -0,0 +1,50 @@
# Edge RK3588 production counter — copy to .env on device
# cp .env.example .env && nano .env
OUTPUT_DIR=/opt/bytetrack-counter-go
DB_PATH=/opt/bytetrack-counter-go/bytetrack_counter.db
STATE_FILE=/tmp/bytetrack_current_batch.json
# Direct LAN camera RTSP (low latency)
SOURCE=rtsp://frigate:zenai@127.0.0.1:8554/camera_stream_640
#SOURCE=rtsp://192.168.192.53:8554/my_stream
OPENCV_FFMPEG_CAPTURE_OPTIONS=rtsp_transport;tcp|fflags;nobuffer|flags;low_delay
# RKNN model — export'd from YOLO with imgsz=320
MODEL_PATH=/opt/models/zenai_apc_cicalengka_20260609.rknn
IMGSZ=320
HALF=false
CONF=0.3
# RKNN NPU core mask: 1=core0, 2=core1, 3=core0+core1, 7=all three
CORE_MASK=7
# YOLO decoder params (must match model export)
NUM_CLASSES=2
SCORE_SIGMOID=false
CAMERA_NAME=CC1
OBJECT_LABEL=ayam-potong
CLASS_AYAM=ayam
CLASS_TALENAN=talenan
# Line crossing: rtl (default) | ltr | both
CROSS_DIRECTION=ltr
LINE_X=
LINE_X_FRAC=0.5
DAILY_CUTOFF_TIME=17:00
BATCH_TIMEOUT_SECONDS=300
IGNORE_BATCH_LABEL_TIMEOUT_SECONDS=30
MIN_OBJECT_PER_BATCH=60
MIN_DURATION_PER_BATCH=60
EXPORT_CSV=true
RECORD_VIDEO=false
LIVE_STREAM_ENABLED=true
LIVE_STREAM_FRAME_PATH=/dev/shm/bytetrack-counter/live_frame.jpg
LIVE_STREAM_QUALITY=75
LIVE_STREAM_EVERY_N=2
LOG_LEVEL=info
+35
View File
@@ -0,0 +1,35 @@
# AGENTS.md — ByteTrack Counter C++
## RKNN Dynamic Shape Requirement
The RKNN model (`zenai_apc_cicalengka_20260609.rknn`) is exported with **dynamic input shapes** (`model inference type: dynamic_shape`). The C API **requires** calling `rknn_set_input_shapes()` before `rknn_inputs_set()`. Without it, `librknnrt.so` crashes with:
```
std::out_of_range: vector::_M_range_check: __n (which is 18446744073709551615) >= this->size() (which is 1)
```
This is called in the constructor of `RKNNYOLO` at `src/rknn_yolo.cpp:60`, right after querying input attributes:
```cpp
in_attr.dims[0] = 1;
in_attr.dims[1] = imgsz_;
in_attr.dims[2] = imgsz_;
in_attr.dims[3] = 3;
in_attr.n_dims = 4;
ret = rknn_set_input_shapes(rknn_ctx_, io_num.n_input, &in_attr);
```
## Build
```bash
cd /opt/bytetrack-counter-cpp/build
cmake .. -DHAS_RKNN=ON
make -j$(nproc)
```
## Service
```bash
systemctl restart bytetrack-counter
journalctl -u bytetrack-counter -f
```
+37
View File
@@ -0,0 +1,37 @@
# ByteTrack Counter C++ — Build Instructions
## Install Dependencies
```bash
apt install -y build-essential cmake libopencv-dev libeigen3-dev libsqlite3-dev
```
| Package | Provides |
|---------|---------|
| `build-essential` | g++, make, libc-dev |
| `cmake` | CMake |
| `libopencv-dev` | OpenCV (core, imgproc, videoio, highgui, imgcodecs) |
| `libeigen3-dev` | Eigen3 linear algebra |
| `libsqlite3-dev` | SQLite3 |
For RKNN NPU support, also install `librknnrt` from your board's SDK.
## Compile
```bash
mkdir -p build && cd build
# Without NPU
cmake .. && make -j$(nproc)
# With RKNN NPU support
cmake .. -DHAS_RKNN=ON && make -j$(nproc)
```
The binary will be generated at `build/bytetrack-counter`.
## Install
```bash
cmake --install . --prefix /opt/bytetrack-counter-cpp/build/install
```
+55
View File
@@ -0,0 +1,55 @@
cmake_minimum_required(VERSION 3.16)
project(bytetrack-counter LANGUAGES CXX)
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_CXX_EXTENSIONS OFF)
find_package(OpenCV REQUIRED COMPONENTS core imgproc videoio highgui imgcodecs)
set(Eigen3_DIR /usr/share/eigen3/cmake)
find_package(Eigen3 REQUIRED NO_MODULE)
find_package(SQLite3 REQUIRED)
option(HAS_RKNN "Build with RKNN NPU support" OFF)
if(HAS_RKNN)
add_definitions(-DHAS_RKNN)
include_directories(/usr/local/include/rknn)
endif()
set(SOURCES
src/main.cpp
src/kalman_filter.cpp
src/bytetrack.cpp
src/batch_store.cpp
src/csv_logger.cpp
src/rknn_yolo.cpp
src/config.cpp
src/drawing.cpp
)
add_executable(bytetrack-counter ${SOURCES})
target_include_directories(bytetrack-counter PRIVATE
${OpenCV_INCLUDE_DIRS}
${EIGEN3_INCLUDE_DIR}
${SQLite3_INCLUDE_DIRS}
src
)
target_link_libraries(bytetrack-counter
${OpenCV_LIBS}
${SQLite3_LIBRARIES}
pthread
)
if(HAS_RKNN)
find_library(RKNN_LIB rknnrt PATHS /usr/lib /usr/local/lib)
if(RKNN_LIB)
target_link_libraries(bytetrack-counter ${RKNN_LIB})
else()
message(WARNING "librknnrt not found — RKNN support disabled")
endif()
endif()
install(TARGETS bytetrack-counter DESTINATION /opt/bytetrack-counter-cpp/bin)
-2
View File
@@ -1,2 +0,0 @@
# bytetrack-counter-cpp
+1
View File
@@ -0,0 +1 @@
batch,frame,timestamp,chicken_id
1 batch frame timestamp chicken_id
+379
View File
@@ -0,0 +1,379 @@
"""
Production batch persistence for edge Jetson counter.
Mirrors frigate-counter SQLite schema + current_batch.json contract.
"""
import json
import sqlite3
import threading
import time
from datetime import datetime, timedelta
from pathlib import Path
class BatchStore:
def __init__(
self,
db_path,
state_file,
camera_name,
object_label='ayam-potong',
cutoff_time='20:00',
batch_timeout=300.0,
ignore_batch_label_timeout=30.0,
min_object_per_batch=60,
min_duration_per_batch=60,
carry_ids=50,
logger=print,
):
self.db_path = db_path
self.state_file = Path(state_file)
self.camera_name = camera_name
self.object_label = object_label
self.cutoff_time_str = cutoff_time
datetime.strptime(cutoff_time, '%H:%M')
self.batch_timeout = float(batch_timeout)
self.ignore_batch_label_timeout = float(ignore_batch_label_timeout)
self.min_object_per_batch = int(min_object_per_batch)
self.min_duration_per_batch = int(min_duration_per_batch)
self.carry_ids = int(carry_ids)
self.log = logger
self.state_lock = threading.Lock()
self.batch_timer = None
self.ignore_batch_label = False
self.ignore_batch_label_timer = None
self.previous_state = None
self.shutdown_event = threading.Event()
Path(db_path).parent.mkdir(parents=True, exist_ok=True)
self.state_file.parent.mkdir(parents=True, exist_ok=True)
self.db = sqlite3.connect(db_path, check_same_thread=False)
self._init_db()
self.current_state = self._load_state()
self.previous_state = self.current_state
def _init_db(self):
cur = self.db.cursor()
cur.execute(
"""
CREATE TABLE IF NOT EXISTS batches (
id INTEGER PRIMARY KEY AUTOINCREMENT,
counting_date TEXT NOT NULL,
batch_number INTEGER NOT NULL,
camera_name TEXT NOT NULL,
object_label TEXT NOT NULL,
count INTEGER NOT NULL,
start_time TEXT NOT NULL,
end_time TEXT NOT NULL,
created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
UNIQUE(counting_date, batch_number, camera_name, object_label)
)
"""
)
cur.execute(
"""
CREATE TABLE IF NOT EXISTS daily_summaries (
id INTEGER PRIMARY KEY AUTOINCREMENT,
counting_date TEXT NOT NULL,
camera_name TEXT NOT NULL,
object_label TEXT NOT NULL,
total_count INTEGER NOT NULL DEFAULT 0,
total_batches INTEGER NOT NULL DEFAULT 0,
updated_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
UNIQUE(counting_date, camera_name, object_label)
)
"""
)
self.db.commit()
def get_counting_date(self, dt=None):
if dt is None:
dt = datetime.now()
cutoff = datetime.strptime(self.cutoff_time_str, '%H:%M').time()
if dt.time() < cutoff:
return dt.date().isoformat()
return (dt.date() + timedelta(days=1)).isoformat()
def _load_state(self):
if not self.state_file.exists():
return None
try:
with open(self.state_file, 'r', encoding='utf-8') as f:
state = json.load(f)
current_date = self.get_counting_date()
if state.get('counting_date') != current_date:
self.log(
f"State file belongs to previous counting day ({state.get('counting_date')}). "
'Finalizing before fresh start.'
)
self._insert_batch(
state['counting_date'],
state['batch_number'],
state['count'],
state['start_time'],
datetime.now().isoformat(),
)
self.state_file.unlink(missing_ok=True)
return None
self.log(
f"Resumed batch #{state['batch_number']} from {state['start_time']} "
f"with count={state['count']}"
)
self._reset_batch_timer()
return state
except Exception as exc:
self.log(f'Failed to load state file: {exc}')
return None
def save_state(self):
if self.current_state is None:
self.state_file.unlink(missing_ok=True)
return
with open(self.state_file, 'w', encoding='utf-8') as f:
json.dump(self.current_state, f, indent=2, ensure_ascii=False)
def get_next_batch_number(self, counting_date):
cur = self.db.cursor()
cur.execute(
"""
SELECT COALESCE(MAX(batch_number), 0)
FROM batches
WHERE counting_date = ? AND camera_name = ? AND object_label = ?
""",
(counting_date, self.camera_name, self.object_label),
)
return cur.fetchone()[0] + 1
def start_new_batch(self, counting_date):
batch_number = self.get_next_batch_number(counting_date)
now = datetime.now().isoformat()
counted_ids = []
if self.previous_state is not None:
try:
counted_ids = self.previous_state['counted_event_ids'][-self.carry_ids:]
except (KeyError, TypeError):
counted_ids = []
self.current_state = {
'counting_date': counting_date,
'batch_number': batch_number,
'count': 0,
'start_time': now,
'last_detection_time': now,
'counted_event_ids': counted_ids,
}
self.save_state()
self.log(f'Started batch #{batch_number} for {counting_date} ({self.object_label})')
def _reset_batch_timer(self):
if self.batch_timer:
self.batch_timer.cancel()
self.batch_timer = threading.Timer(self.batch_timeout, self._on_batch_timeout)
self.batch_timer.daemon = True
self.batch_timer.start()
def _on_batch_timeout(self):
self.log(f'Batch inactivity timeout ({self.batch_timeout}s) reached')
self.end_batch(closed_by='timeout')
def _ignore_batch_label(self):
if not self.ignore_batch_label_timer:
self.ignore_batch_label = True
self.ignore_batch_label_timer = threading.Timer(
self.ignore_batch_label_timeout, self._on_ignore_batch_label_timeout
)
self.ignore_batch_label_timer.daemon = True
self.ignore_batch_label_timer.start()
self.log(
f'Ignore batch label for {self.ignore_batch_label_timeout}s'
)
def _on_ignore_batch_label_timeout(self):
self.ignore_batch_label_timer = None
self.ignore_batch_label = False
self.log('Ignore batch label cooldown finished')
def record_ayam_crossing(self, track_id):
"""Line-cross equivalent of production ayam-potong MQTT event."""
with self.state_lock:
counting_date = self.get_counting_date()
started_new = False
if self.current_state is None:
self.start_new_batch(counting_date)
started_new = True
elif self.current_state['counting_date'] != counting_date:
self._end_batch_locked(closed_by='cutoff')
self.start_new_batch(counting_date)
started_new = True
event_key = str(track_id)
if event_key not in self.current_state['counted_event_ids']:
self.current_state['count'] += 1
self.current_state['counted_event_ids'].append(event_key)
self.log(
f'Counted ayam (track {track_id}) | batch #{self.current_state["batch_number"]} '
f'total: {self.current_state["count"]}'
)
self.current_state['last_detection_time'] = datetime.now().isoformat()
self.save_state()
self._reset_batch_timer()
return self.current_state['count'], started_new
def record_talenan_crossing(self, track_id):
"""Line-cross equivalent of production telenan MQTT batch close."""
if self.ignore_batch_label:
return False
with self.state_lock:
self._ignore_batch_label()
self._end_batch_locked(closed_by='talenan')
self.log(f'Batch closed by talenan (track {track_id})')
if self.batch_timer:
self.batch_timer.cancel()
self.batch_timer = None
return True
def end_batch(self, closed_by='manual'):
with self.state_lock:
self._end_batch_locked(closed_by=closed_by)
def _end_batch_locked(self, closed_by='manual'):
if self.current_state is None:
return False
self.previous_state = self.current_state
state = self.current_state
start_time_obj = datetime.fromisoformat(state['start_time'])
end_time_obj = datetime.now()
duration_seconds = (end_time_obj - start_time_obj).total_seconds()
if (state['count'] < self.min_object_per_batch
or duration_seconds < self.min_duration_per_batch):
self.current_state = None
self.save_state()
if self.batch_timer:
self.batch_timer.cancel()
self.batch_timer = None
self.log(
f'Batch #{state["batch_number"]} discarded '
f'(count={state["count"]}, duration={duration_seconds:.0f}s)'
)
return False
end_time = end_time_obj.isoformat()
try:
self._insert_batch(
state['counting_date'],
state['batch_number'],
state['count'],
state['start_time'],
end_time,
)
cps = state['count'] / duration_seconds if duration_seconds > 0 else 0
self.log(
f'Batch #{state["batch_number"]} ended | count={state["count"]} | '
f'duration={duration_seconds:.0f}s | cps={cps:.3f} | closed_by={closed_by}'
)
except Exception as exc:
self.log(f'Failed to persist batch: {exc}')
return False
self.current_state = None
self.save_state()
if self.batch_timer:
self.batch_timer.cancel()
self.batch_timer = None
return True
def _insert_batch(self, counting_date, batch_number, count, start_time, end_time):
cur = self.db.cursor()
cur.execute(
"""
INSERT INTO batches
(counting_date, batch_number, camera_name, object_label, count, start_time, end_time)
VALUES (?, ?, ?, ?, ?, ?, ?)
""",
(counting_date, batch_number, self.camera_name, self.object_label, count, start_time, end_time),
)
cur.execute(
"""
INSERT INTO daily_summaries
(counting_date, camera_name, object_label, total_count, total_batches)
VALUES (?, ?, ?, ?, 1)
ON CONFLICT(counting_date, camera_name, object_label)
DO UPDATE SET
total_count = total_count + excluded.total_count,
total_batches = total_batches + excluded.total_batches,
updated_at = CURRENT_TIMESTAMP
""",
(counting_date, self.camera_name, self.object_label, count),
)
self.db.commit()
cur.execute(
"""
SELECT total_count, total_batches
FROM daily_summaries
WHERE counting_date = ? AND camera_name = ? AND object_label = ?
""",
(counting_date, self.camera_name, self.object_label),
)
row = cur.fetchone()
if row:
self.log(
f'Daily totals for {counting_date}: {row[0]} objects across {row[1]} batch(es)'
)
def cutoff_watcher_loop(self):
while not self.shutdown_event.is_set():
time.sleep(60)
with self.state_lock:
if self.current_state is None:
continue
if self.current_state['counting_date'] != self.get_counting_date():
self.log('Daily cutoff reached – finalizing batch')
self._end_batch_locked(closed_by='cutoff')
def start_cutoff_watcher(self):
t = threading.Thread(target=self.cutoff_watcher_loop, daemon=True)
t.start()
return t
@property
def current_batch_number(self):
if self.current_state is None:
return 0
return self.current_state['batch_number']
@property
def current_batch_count(self):
if self.current_state is None:
return 0
return self.current_state['count']
def get_closed_total_for_day(self, counting_date=None):
if counting_date is None:
counting_date = self.get_counting_date()
cur = self.db.cursor()
cur.execute(
"""
SELECT COALESCE(total_count, 0)
FROM daily_summaries
WHERE counting_date = ? AND camera_name = ? AND object_label = ?
""",
(counting_date, self.camera_name, self.object_label),
)
row = cur.fetchone()
return row[0] if row else 0
def display_total(self):
return self.get_closed_total_for_day() + self.current_batch_count
def shutdown(self):
self.shutdown_event.set()
self.end_batch(closed_by='shutdown')
if self.batch_timer:
self.batch_timer.cancel()
self.db.close()
+366
View File
@@ -0,0 +1,366 @@
# This is the CMakeCache file.
# For build in directory: /opt/bytetrack-counter-cpp/build
# It was generated by CMake: /usr/bin/cmake
# You can edit this file to change values found and used by cmake.
# If you do not want to change any of the values, simply exit the editor.
# If you do want to change a value, simply edit, save, and exit the editor.
# The syntax for the file is as follows:
# KEY:TYPE=VALUE
# KEY is the name of a variable in the cache.
# TYPE is a hint to GUIs for the type of VALUE, DO NOT EDIT TYPE!.
# VALUE is the current value for the KEY.
########################
# EXTERNAL cache entries
########################
//Path to a program.
CMAKE_ADDR2LINE:FILEPATH=/usr/bin/addr2line
//Path to a program.
CMAKE_AR:FILEPATH=/usr/bin/ar
//Choose the type of build, options are: None Debug Release RelWithDebInfo
// MinSizeRel ...
CMAKE_BUILD_TYPE:STRING=
//Enable/Disable color output during build.
CMAKE_COLOR_MAKEFILE:BOOL=ON
//CXX compiler
CMAKE_CXX_COMPILER:FILEPATH=/usr/bin/c++
//A wrapper around 'ar' adding the appropriate '--plugin' option
// for the GCC compiler
CMAKE_CXX_COMPILER_AR:FILEPATH=/usr/bin/gcc-ar-13
//A wrapper around 'ranlib' adding the appropriate '--plugin' option
// for the GCC compiler
CMAKE_CXX_COMPILER_RANLIB:FILEPATH=/usr/bin/gcc-ranlib-13
//Flags used by the CXX compiler during all build types.
CMAKE_CXX_FLAGS:STRING=
//Flags used by the CXX compiler during DEBUG builds.
CMAKE_CXX_FLAGS_DEBUG:STRING=-g
//Flags used by the CXX compiler during MINSIZEREL builds.
CMAKE_CXX_FLAGS_MINSIZEREL:STRING=-Os -DNDEBUG
//Flags used by the CXX compiler during RELEASE builds.
CMAKE_CXX_FLAGS_RELEASE:STRING=-O3 -DNDEBUG
//Flags used by the CXX compiler during RELWITHDEBINFO builds.
CMAKE_CXX_FLAGS_RELWITHDEBINFO:STRING=-O2 -g -DNDEBUG
//Path to a program.
CMAKE_DLLTOOL:FILEPATH=CMAKE_DLLTOOL-NOTFOUND
//Flags used by the linker during all build types.
CMAKE_EXE_LINKER_FLAGS:STRING=
//Flags used by the linker during DEBUG builds.
CMAKE_EXE_LINKER_FLAGS_DEBUG:STRING=
//Flags used by the linker during MINSIZEREL builds.
CMAKE_EXE_LINKER_FLAGS_MINSIZEREL:STRING=
//Flags used by the linker during RELEASE builds.
CMAKE_EXE_LINKER_FLAGS_RELEASE:STRING=
//Flags used by the linker during RELWITHDEBINFO builds.
CMAKE_EXE_LINKER_FLAGS_RELWITHDEBINFO:STRING=
//Enable/Disable output of compile commands during generation.
CMAKE_EXPORT_COMPILE_COMMANDS:BOOL=
//Value Computed by CMake.
CMAKE_FIND_PACKAGE_REDIRECTS_DIR:STATIC=/opt/bytetrack-counter-cpp/build/CMakeFiles/pkgRedirects
//Install path prefix, prepended onto install directories.
CMAKE_INSTALL_PREFIX:PATH=/usr/local
//Path to a program.
CMAKE_LINKER:FILEPATH=/usr/bin/ld
//Path to a program.
CMAKE_MAKE_PROGRAM:FILEPATH=/usr/bin/gmake
//Flags used by the linker during the creation of modules during
// all build types.
CMAKE_MODULE_LINKER_FLAGS:STRING=
//Flags used by the linker during the creation of modules during
// DEBUG builds.
CMAKE_MODULE_LINKER_FLAGS_DEBUG:STRING=
//Flags used by the linker during the creation of modules during
// MINSIZEREL builds.
CMAKE_MODULE_LINKER_FLAGS_MINSIZEREL:STRING=
//Flags used by the linker during the creation of modules during
// RELEASE builds.
CMAKE_MODULE_LINKER_FLAGS_RELEASE:STRING=
//Flags used by the linker during the creation of modules during
// RELWITHDEBINFO builds.
CMAKE_MODULE_LINKER_FLAGS_RELWITHDEBINFO:STRING=
//No help, variable specified on the command line.
CMAKE_MODULE_PATH:UNINITIALIZED=/usr/share/cmake-3.28/Modules
//Path to a program.
CMAKE_NM:FILEPATH=/usr/bin/nm
//Path to a program.
CMAKE_OBJCOPY:FILEPATH=/usr/bin/objcopy
//Path to a program.
CMAKE_OBJDUMP:FILEPATH=/usr/bin/objdump
//Value Computed by CMake
CMAKE_PROJECT_DESCRIPTION:STATIC=
//Value Computed by CMake
CMAKE_PROJECT_HOMEPAGE_URL:STATIC=
//Value Computed by CMake
CMAKE_PROJECT_NAME:STATIC=bytetrack-counter
//Path to a program.
CMAKE_RANLIB:FILEPATH=/usr/bin/ranlib
//Path to a program.
CMAKE_READELF:FILEPATH=/usr/bin/readelf
//Flags used by the linker during the creation of shared libraries
// during all build types.
CMAKE_SHARED_LINKER_FLAGS:STRING=
//Flags used by the linker during the creation of shared libraries
// during DEBUG builds.
CMAKE_SHARED_LINKER_FLAGS_DEBUG:STRING=
//Flags used by the linker during the creation of shared libraries
// during MINSIZEREL builds.
CMAKE_SHARED_LINKER_FLAGS_MINSIZEREL:STRING=
//Flags used by the linker during the creation of shared libraries
// during RELEASE builds.
CMAKE_SHARED_LINKER_FLAGS_RELEASE:STRING=
//Flags used by the linker during the creation of shared libraries
// during RELWITHDEBINFO builds.
CMAKE_SHARED_LINKER_FLAGS_RELWITHDEBINFO:STRING=
//If set, runtime paths are not added when installing shared libraries,
// but are added when building.
CMAKE_SKIP_INSTALL_RPATH:BOOL=NO
//If set, runtime paths are not added when using shared libraries.
CMAKE_SKIP_RPATH:BOOL=NO
//Flags used by the linker during the creation of static libraries
// during all build types.
CMAKE_STATIC_LINKER_FLAGS:STRING=
//Flags used by the linker during the creation of static libraries
// during DEBUG builds.
CMAKE_STATIC_LINKER_FLAGS_DEBUG:STRING=
//Flags used by the linker during the creation of static libraries
// during MINSIZEREL builds.
CMAKE_STATIC_LINKER_FLAGS_MINSIZEREL:STRING=
//Flags used by the linker during the creation of static libraries
// during RELEASE builds.
CMAKE_STATIC_LINKER_FLAGS_RELEASE:STRING=
//Flags used by the linker during the creation of static libraries
// during RELWITHDEBINFO builds.
CMAKE_STATIC_LINKER_FLAGS_RELWITHDEBINFO:STRING=
//Path to a program.
CMAKE_STRIP:FILEPATH=/usr/bin/strip
//Path to a program.
CMAKE_TAPI:FILEPATH=CMAKE_TAPI-NOTFOUND
//If this value is on, makefiles will be generated without the
// .SILENT directive, and all commands will be echoed to the console
// during the make. This is useful for debugging only. With Visual
// Studio IDE projects all commands are done without /nologo.
CMAKE_VERBOSE_MAKEFILE:BOOL=FALSE
//The directory containing a CMake configuration file for Eigen3.
Eigen3_DIR:PATH=/usr/share/eigen3/cmake
//Build with RKNN NPU support
HAS_RKNN:BOOL=ON
//The directory containing a CMake configuration file for OpenCV.
OpenCV_DIR:PATH=/usr/lib/aarch64-linux-gnu/cmake/opencv4
//Path to a library.
RKNN_LIB:FILEPATH=/usr/lib/librknnrt.so
//Path to a file.
SQLite3_INCLUDE_DIR:PATH=/usr/include
//Path to a library.
SQLite3_LIBRARY:FILEPATH=/usr/lib/aarch64-linux-gnu/libsqlite3.so
//Value Computed by CMake
bytetrack-counter_BINARY_DIR:STATIC=/opt/bytetrack-counter-cpp/build
//Value Computed by CMake
bytetrack-counter_IS_TOP_LEVEL:STATIC=ON
//Value Computed by CMake
bytetrack-counter_SOURCE_DIR:STATIC=/opt/bytetrack-counter-cpp
########################
# INTERNAL cache entries
########################
//ADVANCED property for variable: CMAKE_ADDR2LINE
CMAKE_ADDR2LINE-ADVANCED:INTERNAL=1
//ADVANCED property for variable: CMAKE_AR
CMAKE_AR-ADVANCED:INTERNAL=1
//This is the directory where this CMakeCache.txt was created
CMAKE_CACHEFILE_DIR:INTERNAL=/opt/bytetrack-counter-cpp/build
//Major version of cmake used to create the current loaded cache
CMAKE_CACHE_MAJOR_VERSION:INTERNAL=3
//Minor version of cmake used to create the current loaded cache
CMAKE_CACHE_MINOR_VERSION:INTERNAL=28
//Patch version of cmake used to create the current loaded cache
CMAKE_CACHE_PATCH_VERSION:INTERNAL=3
//ADVANCED property for variable: CMAKE_COLOR_MAKEFILE
CMAKE_COLOR_MAKEFILE-ADVANCED:INTERNAL=1
//Path to CMake executable.
CMAKE_COMMAND:INTERNAL=/usr/bin/cmake
//Path to cpack program executable.
CMAKE_CPACK_COMMAND:INTERNAL=/usr/bin/cpack
//Path to ctest program executable.
CMAKE_CTEST_COMMAND:INTERNAL=/usr/bin/ctest
//ADVANCED property for variable: CMAKE_CXX_COMPILER
CMAKE_CXX_COMPILER-ADVANCED:INTERNAL=1
//ADVANCED property for variable: CMAKE_CXX_COMPILER_AR
CMAKE_CXX_COMPILER_AR-ADVANCED:INTERNAL=1
//ADVANCED property for variable: CMAKE_CXX_COMPILER_RANLIB
CMAKE_CXX_COMPILER_RANLIB-ADVANCED:INTERNAL=1
//ADVANCED property for variable: CMAKE_CXX_FLAGS
CMAKE_CXX_FLAGS-ADVANCED:INTERNAL=1
//ADVANCED property for variable: CMAKE_CXX_FLAGS_DEBUG
CMAKE_CXX_FLAGS_DEBUG-ADVANCED:INTERNAL=1
//ADVANCED property for variable: CMAKE_CXX_FLAGS_MINSIZEREL
CMAKE_CXX_FLAGS_MINSIZEREL-ADVANCED:INTERNAL=1
//ADVANCED property for variable: CMAKE_CXX_FLAGS_RELEASE
CMAKE_CXX_FLAGS_RELEASE-ADVANCED:INTERNAL=1
//ADVANCED property for variable: CMAKE_CXX_FLAGS_RELWITHDEBINFO
CMAKE_CXX_FLAGS_RELWITHDEBINFO-ADVANCED:INTERNAL=1
//ADVANCED property for variable: CMAKE_DLLTOOL
CMAKE_DLLTOOL-ADVANCED:INTERNAL=1
//Executable file format
CMAKE_EXECUTABLE_FORMAT:INTERNAL=ELF
//ADVANCED property for variable: CMAKE_EXE_LINKER_FLAGS
CMAKE_EXE_LINKER_FLAGS-ADVANCED:INTERNAL=1
//ADVANCED property for variable: CMAKE_EXE_LINKER_FLAGS_DEBUG
CMAKE_EXE_LINKER_FLAGS_DEBUG-ADVANCED:INTERNAL=1
//ADVANCED property for variable: CMAKE_EXE_LINKER_FLAGS_MINSIZEREL
CMAKE_EXE_LINKER_FLAGS_MINSIZEREL-ADVANCED:INTERNAL=1
//ADVANCED property for variable: CMAKE_EXE_LINKER_FLAGS_RELEASE
CMAKE_EXE_LINKER_FLAGS_RELEASE-ADVANCED:INTERNAL=1
//ADVANCED property for variable: CMAKE_EXE_LINKER_FLAGS_RELWITHDEBINFO
CMAKE_EXE_LINKER_FLAGS_RELWITHDEBINFO-ADVANCED:INTERNAL=1
//ADVANCED property for variable: CMAKE_EXPORT_COMPILE_COMMANDS
CMAKE_EXPORT_COMPILE_COMMANDS-ADVANCED:INTERNAL=1
//Name of external makefile project generator.
CMAKE_EXTRA_GENERATOR:INTERNAL=
//Name of generator.
CMAKE_GENERATOR:INTERNAL=Unix Makefiles
//Generator instance identifier.
CMAKE_GENERATOR_INSTANCE:INTERNAL=
//Name of generator platform.
CMAKE_GENERATOR_PLATFORM:INTERNAL=
//Name of generator toolset.
CMAKE_GENERATOR_TOOLSET:INTERNAL=
//Source directory with the top level CMakeLists.txt file for this
// project
CMAKE_HOME_DIRECTORY:INTERNAL=/opt/bytetrack-counter-cpp
//Install .so files without execute permission.
CMAKE_INSTALL_SO_NO_EXE:INTERNAL=1
//ADVANCED property for variable: CMAKE_LINKER
CMAKE_LINKER-ADVANCED:INTERNAL=1
//ADVANCED property for variable: CMAKE_MAKE_PROGRAM
CMAKE_MAKE_PROGRAM-ADVANCED:INTERNAL=1
//ADVANCED property for variable: CMAKE_MODULE_LINKER_FLAGS
CMAKE_MODULE_LINKER_FLAGS-ADVANCED:INTERNAL=1
//ADVANCED property for variable: CMAKE_MODULE_LINKER_FLAGS_DEBUG
CMAKE_MODULE_LINKER_FLAGS_DEBUG-ADVANCED:INTERNAL=1
//ADVANCED property for variable: CMAKE_MODULE_LINKER_FLAGS_MINSIZEREL
CMAKE_MODULE_LINKER_FLAGS_MINSIZEREL-ADVANCED:INTERNAL=1
//ADVANCED property for variable: CMAKE_MODULE_LINKER_FLAGS_RELEASE
CMAKE_MODULE_LINKER_FLAGS_RELEASE-ADVANCED:INTERNAL=1
//ADVANCED property for variable: CMAKE_MODULE_LINKER_FLAGS_RELWITHDEBINFO
CMAKE_MODULE_LINKER_FLAGS_RELWITHDEBINFO-ADVANCED:INTERNAL=1
//ADVANCED property for variable: CMAKE_NM
CMAKE_NM-ADVANCED:INTERNAL=1
//number of local generators
CMAKE_NUMBER_OF_MAKEFILES:INTERNAL=1
//ADVANCED property for variable: CMAKE_OBJCOPY
CMAKE_OBJCOPY-ADVANCED:INTERNAL=1
//ADVANCED property for variable: CMAKE_OBJDUMP
CMAKE_OBJDUMP-ADVANCED:INTERNAL=1
//Platform information initialized
CMAKE_PLATFORM_INFO_INITIALIZED:INTERNAL=1
//ADVANCED property for variable: CMAKE_RANLIB
CMAKE_RANLIB-ADVANCED:INTERNAL=1
//ADVANCED property for variable: CMAKE_READELF
CMAKE_READELF-ADVANCED:INTERNAL=1
//Path to CMake installation.
CMAKE_ROOT:INTERNAL=/usr/share/cmake-3.28
//ADVANCED property for variable: CMAKE_SHARED_LINKER_FLAGS
CMAKE_SHARED_LINKER_FLAGS-ADVANCED:INTERNAL=1
//ADVANCED property for variable: CMAKE_SHARED_LINKER_FLAGS_DEBUG
CMAKE_SHARED_LINKER_FLAGS_DEBUG-ADVANCED:INTERNAL=1
//ADVANCED property for variable: CMAKE_SHARED_LINKER_FLAGS_MINSIZEREL
CMAKE_SHARED_LINKER_FLAGS_MINSIZEREL-ADVANCED:INTERNAL=1
//ADVANCED property for variable: CMAKE_SHARED_LINKER_FLAGS_RELEASE
CMAKE_SHARED_LINKER_FLAGS_RELEASE-ADVANCED:INTERNAL=1
//ADVANCED property for variable: CMAKE_SHARED_LINKER_FLAGS_RELWITHDEBINFO
CMAKE_SHARED_LINKER_FLAGS_RELWITHDEBINFO-ADVANCED:INTERNAL=1
//ADVANCED property for variable: CMAKE_SKIP_INSTALL_RPATH
CMAKE_SKIP_INSTALL_RPATH-ADVANCED:INTERNAL=1
//ADVANCED property for variable: CMAKE_SKIP_RPATH
CMAKE_SKIP_RPATH-ADVANCED:INTERNAL=1
//ADVANCED property for variable: CMAKE_STATIC_LINKER_FLAGS
CMAKE_STATIC_LINKER_FLAGS-ADVANCED:INTERNAL=1
//ADVANCED property for variable: CMAKE_STATIC_LINKER_FLAGS_DEBUG
CMAKE_STATIC_LINKER_FLAGS_DEBUG-ADVANCED:INTERNAL=1
//ADVANCED property for variable: CMAKE_STATIC_LINKER_FLAGS_MINSIZEREL
CMAKE_STATIC_LINKER_FLAGS_MINSIZEREL-ADVANCED:INTERNAL=1
//ADVANCED property for variable: CMAKE_STATIC_LINKER_FLAGS_RELEASE
CMAKE_STATIC_LINKER_FLAGS_RELEASE-ADVANCED:INTERNAL=1
//ADVANCED property for variable: CMAKE_STATIC_LINKER_FLAGS_RELWITHDEBINFO
CMAKE_STATIC_LINKER_FLAGS_RELWITHDEBINFO-ADVANCED:INTERNAL=1
//ADVANCED property for variable: CMAKE_STRIP
CMAKE_STRIP-ADVANCED:INTERNAL=1
//ADVANCED property for variable: CMAKE_TAPI
CMAKE_TAPI-ADVANCED:INTERNAL=1
//uname command
CMAKE_UNAME:INTERNAL=/usr/bin/uname
//ADVANCED property for variable: CMAKE_VERBOSE_MAKEFILE
CMAKE_VERBOSE_MAKEFILE-ADVANCED:INTERNAL=1
//Details about finding OpenCV
FIND_PACKAGE_MESSAGE_DETAILS_OpenCV:INTERNAL=[/usr][cfound components: core imgproc videoio highgui imgcodecs ][v4.6.0()]
//Details about finding SQLite3
FIND_PACKAGE_MESSAGE_DETAILS_SQLite3:INTERNAL=[/usr/include][/usr/lib/aarch64-linux-gnu/libsqlite3.so][v3.45.1()]
//ADVANCED property for variable: SQLite3_INCLUDE_DIR
SQLite3_INCLUDE_DIR-ADVANCED:INTERNAL=1
//ADVANCED property for variable: SQLite3_LIBRARY
SQLite3_LIBRARY-ADVANCED:INTERNAL=1
//linker supports push/pop state
_CMAKE_LINKER_PUSHPOP_STATE_SUPPORTED:INTERNAL=TRUE
@@ -0,0 +1,85 @@
set(CMAKE_CXX_COMPILER "/usr/bin/c++")
set(CMAKE_CXX_COMPILER_ARG1 "")
set(CMAKE_CXX_COMPILER_ID "GNU")
set(CMAKE_CXX_COMPILER_VERSION "13.3.0")
set(CMAKE_CXX_COMPILER_VERSION_INTERNAL "")
set(CMAKE_CXX_COMPILER_WRAPPER "")
set(CMAKE_CXX_STANDARD_COMPUTED_DEFAULT "17")
set(CMAKE_CXX_EXTENSIONS_COMPUTED_DEFAULT "ON")
set(CMAKE_CXX_COMPILE_FEATURES "cxx_std_98;cxx_template_template_parameters;cxx_std_11;cxx_alias_templates;cxx_alignas;cxx_alignof;cxx_attributes;cxx_auto_type;cxx_constexpr;cxx_decltype;cxx_decltype_incomplete_return_types;cxx_default_function_template_args;cxx_defaulted_functions;cxx_defaulted_move_initializers;cxx_delegating_constructors;cxx_deleted_functions;cxx_enum_forward_declarations;cxx_explicit_conversions;cxx_extended_friend_declarations;cxx_extern_templates;cxx_final;cxx_func_identifier;cxx_generalized_initializers;cxx_inheriting_constructors;cxx_inline_namespaces;cxx_lambdas;cxx_local_type_template_args;cxx_long_long_type;cxx_noexcept;cxx_nonstatic_member_init;cxx_nullptr;cxx_override;cxx_range_for;cxx_raw_string_literals;cxx_reference_qualified_functions;cxx_right_angle_brackets;cxx_rvalue_references;cxx_sizeof_member;cxx_static_assert;cxx_strong_enums;cxx_thread_local;cxx_trailing_return_types;cxx_unicode_literals;cxx_uniform_initialization;cxx_unrestricted_unions;cxx_user_literals;cxx_variadic_macros;cxx_variadic_templates;cxx_std_14;cxx_aggregate_default_initializers;cxx_attribute_deprecated;cxx_binary_literals;cxx_contextual_conversions;cxx_decltype_auto;cxx_digit_separators;cxx_generic_lambdas;cxx_lambda_init_captures;cxx_relaxed_constexpr;cxx_return_type_deduction;cxx_variable_templates;cxx_std_17;cxx_std_20;cxx_std_23")
set(CMAKE_CXX98_COMPILE_FEATURES "cxx_std_98;cxx_template_template_parameters")
set(CMAKE_CXX11_COMPILE_FEATURES "cxx_std_11;cxx_alias_templates;cxx_alignas;cxx_alignof;cxx_attributes;cxx_auto_type;cxx_constexpr;cxx_decltype;cxx_decltype_incomplete_return_types;cxx_default_function_template_args;cxx_defaulted_functions;cxx_defaulted_move_initializers;cxx_delegating_constructors;cxx_deleted_functions;cxx_enum_forward_declarations;cxx_explicit_conversions;cxx_extended_friend_declarations;cxx_extern_templates;cxx_final;cxx_func_identifier;cxx_generalized_initializers;cxx_inheriting_constructors;cxx_inline_namespaces;cxx_lambdas;cxx_local_type_template_args;cxx_long_long_type;cxx_noexcept;cxx_nonstatic_member_init;cxx_nullptr;cxx_override;cxx_range_for;cxx_raw_string_literals;cxx_reference_qualified_functions;cxx_right_angle_brackets;cxx_rvalue_references;cxx_sizeof_member;cxx_static_assert;cxx_strong_enums;cxx_thread_local;cxx_trailing_return_types;cxx_unicode_literals;cxx_uniform_initialization;cxx_unrestricted_unions;cxx_user_literals;cxx_variadic_macros;cxx_variadic_templates")
set(CMAKE_CXX14_COMPILE_FEATURES "cxx_std_14;cxx_aggregate_default_initializers;cxx_attribute_deprecated;cxx_binary_literals;cxx_contextual_conversions;cxx_decltype_auto;cxx_digit_separators;cxx_generic_lambdas;cxx_lambda_init_captures;cxx_relaxed_constexpr;cxx_return_type_deduction;cxx_variable_templates")
set(CMAKE_CXX17_COMPILE_FEATURES "cxx_std_17")
set(CMAKE_CXX20_COMPILE_FEATURES "cxx_std_20")
set(CMAKE_CXX23_COMPILE_FEATURES "cxx_std_23")
set(CMAKE_CXX_PLATFORM_ID "Linux")
set(CMAKE_CXX_SIMULATE_ID "")
set(CMAKE_CXX_COMPILER_FRONTEND_VARIANT "GNU")
set(CMAKE_CXX_SIMULATE_VERSION "")
set(CMAKE_AR "/usr/bin/ar")
set(CMAKE_CXX_COMPILER_AR "/usr/bin/gcc-ar-13")
set(CMAKE_RANLIB "/usr/bin/ranlib")
set(CMAKE_CXX_COMPILER_RANLIB "/usr/bin/gcc-ranlib-13")
set(CMAKE_LINKER "/usr/bin/ld")
set(CMAKE_MT "")
set(CMAKE_TAPI "CMAKE_TAPI-NOTFOUND")
set(CMAKE_COMPILER_IS_GNUCXX 1)
set(CMAKE_CXX_COMPILER_LOADED 1)
set(CMAKE_CXX_COMPILER_WORKS TRUE)
set(CMAKE_CXX_ABI_COMPILED TRUE)
set(CMAKE_CXX_COMPILER_ENV_VAR "CXX")
set(CMAKE_CXX_COMPILER_ID_RUN 1)
set(CMAKE_CXX_SOURCE_FILE_EXTENSIONS C;M;c++;cc;cpp;cxx;m;mm;mpp;CPP;ixx;cppm;ccm;cxxm;c++m)
set(CMAKE_CXX_IGNORE_EXTENSIONS inl;h;hpp;HPP;H;o;O;obj;OBJ;def;DEF;rc;RC)
foreach (lang C OBJC OBJCXX)
if (CMAKE_${lang}_COMPILER_ID_RUN)
foreach(extension IN LISTS CMAKE_${lang}_SOURCE_FILE_EXTENSIONS)
list(REMOVE_ITEM CMAKE_CXX_SOURCE_FILE_EXTENSIONS ${extension})
endforeach()
endif()
endforeach()
set(CMAKE_CXX_LINKER_PREFERENCE 30)
set(CMAKE_CXX_LINKER_PREFERENCE_PROPAGATES 1)
set(CMAKE_CXX_LINKER_DEPFILE_SUPPORTED TRUE)
# Save compiler ABI information.
set(CMAKE_CXX_SIZEOF_DATA_PTR "8")
set(CMAKE_CXX_COMPILER_ABI "ELF")
set(CMAKE_CXX_BYTE_ORDER "LITTLE_ENDIAN")
set(CMAKE_CXX_LIBRARY_ARCHITECTURE "aarch64-linux-gnu")
if(CMAKE_CXX_SIZEOF_DATA_PTR)
set(CMAKE_SIZEOF_VOID_P "${CMAKE_CXX_SIZEOF_DATA_PTR}")
endif()
if(CMAKE_CXX_COMPILER_ABI)
set(CMAKE_INTERNAL_PLATFORM_ABI "${CMAKE_CXX_COMPILER_ABI}")
endif()
if(CMAKE_CXX_LIBRARY_ARCHITECTURE)
set(CMAKE_LIBRARY_ARCHITECTURE "aarch64-linux-gnu")
endif()
set(CMAKE_CXX_CL_SHOWINCLUDES_PREFIX "")
if(CMAKE_CXX_CL_SHOWINCLUDES_PREFIX)
set(CMAKE_CL_SHOWINCLUDES_PREFIX "${CMAKE_CXX_CL_SHOWINCLUDES_PREFIX}")
endif()
set(CMAKE_CXX_IMPLICIT_INCLUDE_DIRECTORIES "/usr/include/c++/13;/usr/include/aarch64-linux-gnu/c++/13;/usr/include/c++/13/backward;/usr/lib/gcc/aarch64-linux-gnu/13/include;/usr/local/include;/usr/include/aarch64-linux-gnu;/usr/include")
set(CMAKE_CXX_IMPLICIT_LINK_LIBRARIES "stdc++;m;gcc_s;gcc;c;gcc_s;gcc")
set(CMAKE_CXX_IMPLICIT_LINK_DIRECTORIES "/usr/lib/gcc/aarch64-linux-gnu/13;/usr/lib/aarch64-linux-gnu;/usr/lib;/lib/aarch64-linux-gnu;/lib")
set(CMAKE_CXX_IMPLICIT_LINK_FRAMEWORK_DIRECTORIES "")
Binary file not shown.
+15
View File
@@ -0,0 +1,15 @@
set(CMAKE_HOST_SYSTEM "Linux-6.1.115-vendor-rk35xx")
set(CMAKE_HOST_SYSTEM_NAME "Linux")
set(CMAKE_HOST_SYSTEM_VERSION "6.1.115-vendor-rk35xx")
set(CMAKE_HOST_SYSTEM_PROCESSOR "aarch64")
set(CMAKE_SYSTEM "Linux-6.1.115-vendor-rk35xx")
set(CMAKE_SYSTEM_NAME "Linux")
set(CMAKE_SYSTEM_VERSION "6.1.115-vendor-rk35xx")
set(CMAKE_SYSTEM_PROCESSOR "aarch64")
set(CMAKE_CROSSCOMPILING "FALSE")
set(CMAKE_SYSTEM_LOADED 1)
@@ -0,0 +1,869 @@
/* This source file must have a .cpp extension so that all C++ compilers
recognize the extension without flags. Borland does not know .cxx for
example. */
#ifndef __cplusplus
# error "A C compiler has been selected for C++."
#endif
#if !defined(__has_include)
/* If the compiler does not have __has_include, pretend the answer is
always no. */
# define __has_include(x) 0
#endif
/* Version number components: V=Version, R=Revision, P=Patch
Version date components: YYYY=Year, MM=Month, DD=Day */
#if defined(__COMO__)
# define COMPILER_ID "Comeau"
/* __COMO_VERSION__ = VRR */
# define COMPILER_VERSION_MAJOR DEC(__COMO_VERSION__ / 100)
# define COMPILER_VERSION_MINOR DEC(__COMO_VERSION__ % 100)
#elif defined(__INTEL_COMPILER) || defined(__ICC)
# define COMPILER_ID "Intel"
# if defined(_MSC_VER)
# define SIMULATE_ID "MSVC"
# endif
# if defined(__GNUC__)
# define SIMULATE_ID "GNU"
# endif
/* __INTEL_COMPILER = VRP prior to 2021, and then VVVV for 2021 and later,
except that a few beta releases use the old format with V=2021. */
# if __INTEL_COMPILER < 2021 || __INTEL_COMPILER == 202110 || __INTEL_COMPILER == 202111
# define COMPILER_VERSION_MAJOR DEC(__INTEL_COMPILER/100)
# define COMPILER_VERSION_MINOR DEC(__INTEL_COMPILER/10 % 10)
# if defined(__INTEL_COMPILER_UPDATE)
# define COMPILER_VERSION_PATCH DEC(__INTEL_COMPILER_UPDATE)
# else
# define COMPILER_VERSION_PATCH DEC(__INTEL_COMPILER % 10)
# endif
# else
# define COMPILER_VERSION_MAJOR DEC(__INTEL_COMPILER)
# define COMPILER_VERSION_MINOR DEC(__INTEL_COMPILER_UPDATE)
/* The third version component from --version is an update index,
but no macro is provided for it. */
# define COMPILER_VERSION_PATCH DEC(0)
# endif
# if defined(__INTEL_COMPILER_BUILD_DATE)
/* __INTEL_COMPILER_BUILD_DATE = YYYYMMDD */
# define COMPILER_VERSION_TWEAK DEC(__INTEL_COMPILER_BUILD_DATE)
# endif
# if defined(_MSC_VER)
/* _MSC_VER = VVRR */
# define SIMULATE_VERSION_MAJOR DEC(_MSC_VER / 100)
# define SIMULATE_VERSION_MINOR DEC(_MSC_VER % 100)
# endif
# if defined(__GNUC__)
# define SIMULATE_VERSION_MAJOR DEC(__GNUC__)
# elif defined(__GNUG__)
# define SIMULATE_VERSION_MAJOR DEC(__GNUG__)
# endif
# if defined(__GNUC_MINOR__)
# define SIMULATE_VERSION_MINOR DEC(__GNUC_MINOR__)
# endif
# if defined(__GNUC_PATCHLEVEL__)
# define SIMULATE_VERSION_PATCH DEC(__GNUC_PATCHLEVEL__)
# endif
#elif (defined(__clang__) && defined(__INTEL_CLANG_COMPILER)) || defined(__INTEL_LLVM_COMPILER)
# define COMPILER_ID "IntelLLVM"
#if defined(_MSC_VER)
# define SIMULATE_ID "MSVC"
#endif
#if defined(__GNUC__)
# define SIMULATE_ID "GNU"
#endif
/* __INTEL_LLVM_COMPILER = VVVVRP prior to 2021.2.0, VVVVRRPP for 2021.2.0 and
* later. Look for 6 digit vs. 8 digit version number to decide encoding.
* VVVV is no smaller than the current year when a version is released.
*/
#if __INTEL_LLVM_COMPILER < 1000000L
# define COMPILER_VERSION_MAJOR DEC(__INTEL_LLVM_COMPILER/100)
# define COMPILER_VERSION_MINOR DEC(__INTEL_LLVM_COMPILER/10 % 10)
# define COMPILER_VERSION_PATCH DEC(__INTEL_LLVM_COMPILER % 10)
#else
# define COMPILER_VERSION_MAJOR DEC(__INTEL_LLVM_COMPILER/10000)
# define COMPILER_VERSION_MINOR DEC(__INTEL_LLVM_COMPILER/100 % 100)
# define COMPILER_VERSION_PATCH DEC(__INTEL_LLVM_COMPILER % 100)
#endif
#if defined(_MSC_VER)
/* _MSC_VER = VVRR */
# define SIMULATE_VERSION_MAJOR DEC(_MSC_VER / 100)
# define SIMULATE_VERSION_MINOR DEC(_MSC_VER % 100)
#endif
#if defined(__GNUC__)
# define SIMULATE_VERSION_MAJOR DEC(__GNUC__)
#elif defined(__GNUG__)
# define SIMULATE_VERSION_MAJOR DEC(__GNUG__)
#endif
#if defined(__GNUC_MINOR__)
# define SIMULATE_VERSION_MINOR DEC(__GNUC_MINOR__)
#endif
#if defined(__GNUC_PATCHLEVEL__)
# define SIMULATE_VERSION_PATCH DEC(__GNUC_PATCHLEVEL__)
#endif
#elif defined(__PATHCC__)
# define COMPILER_ID "PathScale"
# define COMPILER_VERSION_MAJOR DEC(__PATHCC__)
# define COMPILER_VERSION_MINOR DEC(__PATHCC_MINOR__)
# if defined(__PATHCC_PATCHLEVEL__)
# define COMPILER_VERSION_PATCH DEC(__PATHCC_PATCHLEVEL__)
# endif
#elif defined(__BORLANDC__) && defined(__CODEGEARC_VERSION__)
# define COMPILER_ID "Embarcadero"
# define COMPILER_VERSION_MAJOR HEX(__CODEGEARC_VERSION__>>24 & 0x00FF)
# define COMPILER_VERSION_MINOR HEX(__CODEGEARC_VERSION__>>16 & 0x00FF)
# define COMPILER_VERSION_PATCH DEC(__CODEGEARC_VERSION__ & 0xFFFF)
#elif defined(__BORLANDC__)
# define COMPILER_ID "Borland"
/* __BORLANDC__ = 0xVRR */
# define COMPILER_VERSION_MAJOR HEX(__BORLANDC__>>8)
# define COMPILER_VERSION_MINOR HEX(__BORLANDC__ & 0xFF)
#elif defined(__WATCOMC__) && __WATCOMC__ < 1200
# define COMPILER_ID "Watcom"
/* __WATCOMC__ = VVRR */
# define COMPILER_VERSION_MAJOR DEC(__WATCOMC__ / 100)
# define COMPILER_VERSION_MINOR DEC((__WATCOMC__ / 10) % 10)
# if (__WATCOMC__ % 10) > 0
# define COMPILER_VERSION_PATCH DEC(__WATCOMC__ % 10)
# endif
#elif defined(__WATCOMC__)
# define COMPILER_ID "OpenWatcom"
/* __WATCOMC__ = VVRP + 1100 */
# define COMPILER_VERSION_MAJOR DEC((__WATCOMC__ - 1100) / 100)
# define COMPILER_VERSION_MINOR DEC((__WATCOMC__ / 10) % 10)
# if (__WATCOMC__ % 10) > 0
# define COMPILER_VERSION_PATCH DEC(__WATCOMC__ % 10)
# endif
#elif defined(__SUNPRO_CC)
# define COMPILER_ID "SunPro"
# if __SUNPRO_CC >= 0x5100
/* __SUNPRO_CC = 0xVRRP */
# define COMPILER_VERSION_MAJOR HEX(__SUNPRO_CC>>12)
# define COMPILER_VERSION_MINOR HEX(__SUNPRO_CC>>4 & 0xFF)
# define COMPILER_VERSION_PATCH HEX(__SUNPRO_CC & 0xF)
# else
/* __SUNPRO_CC = 0xVRP */
# define COMPILER_VERSION_MAJOR HEX(__SUNPRO_CC>>8)
# define COMPILER_VERSION_MINOR HEX(__SUNPRO_CC>>4 & 0xF)
# define COMPILER_VERSION_PATCH HEX(__SUNPRO_CC & 0xF)
# endif
#elif defined(__HP_aCC)
# define COMPILER_ID "HP"
/* __HP_aCC = VVRRPP */
# define COMPILER_VERSION_MAJOR DEC(__HP_aCC/10000)
# define COMPILER_VERSION_MINOR DEC(__HP_aCC/100 % 100)
# define COMPILER_VERSION_PATCH DEC(__HP_aCC % 100)
#elif defined(__DECCXX)
# define COMPILER_ID "Compaq"
/* __DECCXX_VER = VVRRTPPPP */
# define COMPILER_VERSION_MAJOR DEC(__DECCXX_VER/10000000)
# define COMPILER_VERSION_MINOR DEC(__DECCXX_VER/100000 % 100)
# define COMPILER_VERSION_PATCH DEC(__DECCXX_VER % 10000)
#elif defined(__IBMCPP__) && defined(__COMPILER_VER__)
# define COMPILER_ID "zOS"
/* __IBMCPP__ = VRP */
# define COMPILER_VERSION_MAJOR DEC(__IBMCPP__/100)
# define COMPILER_VERSION_MINOR DEC(__IBMCPP__/10 % 10)
# define COMPILER_VERSION_PATCH DEC(__IBMCPP__ % 10)
#elif defined(__open_xl__) && defined(__clang__)
# define COMPILER_ID "IBMClang"
# define COMPILER_VERSION_MAJOR DEC(__open_xl_version__)
# define COMPILER_VERSION_MINOR DEC(__open_xl_release__)
# define COMPILER_VERSION_PATCH DEC(__open_xl_modification__)
# define COMPILER_VERSION_TWEAK DEC(__open_xl_ptf_fix_level__)
#elif defined(__ibmxl__) && defined(__clang__)
# define COMPILER_ID "XLClang"
# define COMPILER_VERSION_MAJOR DEC(__ibmxl_version__)
# define COMPILER_VERSION_MINOR DEC(__ibmxl_release__)
# define COMPILER_VERSION_PATCH DEC(__ibmxl_modification__)
# define COMPILER_VERSION_TWEAK DEC(__ibmxl_ptf_fix_level__)
#elif defined(__IBMCPP__) && !defined(__COMPILER_VER__) && __IBMCPP__ >= 800
# define COMPILER_ID "XL"
/* __IBMCPP__ = VRP */
# define COMPILER_VERSION_MAJOR DEC(__IBMCPP__/100)
# define COMPILER_VERSION_MINOR DEC(__IBMCPP__/10 % 10)
# define COMPILER_VERSION_PATCH DEC(__IBMCPP__ % 10)
#elif defined(__IBMCPP__) && !defined(__COMPILER_VER__) && __IBMCPP__ < 800
# define COMPILER_ID "VisualAge"
/* __IBMCPP__ = VRP */
# define COMPILER_VERSION_MAJOR DEC(__IBMCPP__/100)
# define COMPILER_VERSION_MINOR DEC(__IBMCPP__/10 % 10)
# define COMPILER_VERSION_PATCH DEC(__IBMCPP__ % 10)
#elif defined(__NVCOMPILER)
# define COMPILER_ID "NVHPC"
# define COMPILER_VERSION_MAJOR DEC(__NVCOMPILER_MAJOR__)
# define COMPILER_VERSION_MINOR DEC(__NVCOMPILER_MINOR__)
# if defined(__NVCOMPILER_PATCHLEVEL__)
# define COMPILER_VERSION_PATCH DEC(__NVCOMPILER_PATCHLEVEL__)
# endif
#elif defined(__PGI)
# define COMPILER_ID "PGI"
# define COMPILER_VERSION_MAJOR DEC(__PGIC__)
# define COMPILER_VERSION_MINOR DEC(__PGIC_MINOR__)
# if defined(__PGIC_PATCHLEVEL__)
# define COMPILER_VERSION_PATCH DEC(__PGIC_PATCHLEVEL__)
# endif
#elif defined(__clang__) && defined(__cray__)
# define COMPILER_ID "CrayClang"
# define COMPILER_VERSION_MAJOR DEC(__cray_major__)
# define COMPILER_VERSION_MINOR DEC(__cray_minor__)
# define COMPILER_VERSION_PATCH DEC(__cray_patchlevel__)
# define COMPILER_VERSION_INTERNAL_STR __clang_version__
#elif defined(_CRAYC)
# define COMPILER_ID "Cray"
# define COMPILER_VERSION_MAJOR DEC(_RELEASE_MAJOR)
# define COMPILER_VERSION_MINOR DEC(_RELEASE_MINOR)
#elif defined(__TI_COMPILER_VERSION__)
# define COMPILER_ID "TI"
/* __TI_COMPILER_VERSION__ = VVVRRRPPP */
# define COMPILER_VERSION_MAJOR DEC(__TI_COMPILER_VERSION__/1000000)
# define COMPILER_VERSION_MINOR DEC(__TI_COMPILER_VERSION__/1000 % 1000)
# define COMPILER_VERSION_PATCH DEC(__TI_COMPILER_VERSION__ % 1000)
#elif defined(__CLANG_FUJITSU)
# define COMPILER_ID "FujitsuClang"
# define COMPILER_VERSION_MAJOR DEC(__FCC_major__)
# define COMPILER_VERSION_MINOR DEC(__FCC_minor__)
# define COMPILER_VERSION_PATCH DEC(__FCC_patchlevel__)
# define COMPILER_VERSION_INTERNAL_STR __clang_version__
#elif defined(__FUJITSU)
# define COMPILER_ID "Fujitsu"
# if defined(__FCC_version__)
# define COMPILER_VERSION __FCC_version__
# elif defined(__FCC_major__)
# define COMPILER_VERSION_MAJOR DEC(__FCC_major__)
# define COMPILER_VERSION_MINOR DEC(__FCC_minor__)
# define COMPILER_VERSION_PATCH DEC(__FCC_patchlevel__)
# endif
# if defined(__fcc_version)
# define COMPILER_VERSION_INTERNAL DEC(__fcc_version)
# elif defined(__FCC_VERSION)
# define COMPILER_VERSION_INTERNAL DEC(__FCC_VERSION)
# endif
#elif defined(__ghs__)
# define COMPILER_ID "GHS"
/* __GHS_VERSION_NUMBER = VVVVRP */
# ifdef __GHS_VERSION_NUMBER
# define COMPILER_VERSION_MAJOR DEC(__GHS_VERSION_NUMBER / 100)
# define COMPILER_VERSION_MINOR DEC(__GHS_VERSION_NUMBER / 10 % 10)
# define COMPILER_VERSION_PATCH DEC(__GHS_VERSION_NUMBER % 10)
# endif
#elif defined(__TASKING__)
# define COMPILER_ID "Tasking"
# define COMPILER_VERSION_MAJOR DEC(__VERSION__/1000)
# define COMPILER_VERSION_MINOR DEC(__VERSION__ % 100)
# define COMPILER_VERSION_INTERNAL DEC(__VERSION__)
#elif defined(__ORANGEC__)
# define COMPILER_ID "OrangeC"
# define COMPILER_VERSION_MAJOR DEC(__ORANGEC_MAJOR__)
# define COMPILER_VERSION_MINOR DEC(__ORANGEC_MINOR__)
# define COMPILER_VERSION_PATCH DEC(__ORANGEC_PATCHLEVEL__)
#elif defined(__SCO_VERSION__)
# define COMPILER_ID "SCO"
#elif defined(__ARMCC_VERSION) && !defined(__clang__)
# define COMPILER_ID "ARMCC"
#if __ARMCC_VERSION >= 1000000
/* __ARMCC_VERSION = VRRPPPP */
# define COMPILER_VERSION_MAJOR DEC(__ARMCC_VERSION/1000000)
# define COMPILER_VERSION_MINOR DEC(__ARMCC_VERSION/10000 % 100)
# define COMPILER_VERSION_PATCH DEC(__ARMCC_VERSION % 10000)
#else
/* __ARMCC_VERSION = VRPPPP */
# define COMPILER_VERSION_MAJOR DEC(__ARMCC_VERSION/100000)
# define COMPILER_VERSION_MINOR DEC(__ARMCC_VERSION/10000 % 10)
# define COMPILER_VERSION_PATCH DEC(__ARMCC_VERSION % 10000)
#endif
#elif defined(__clang__) && defined(__apple_build_version__)
# define COMPILER_ID "AppleClang"
# if defined(_MSC_VER)
# define SIMULATE_ID "MSVC"
# endif
# define COMPILER_VERSION_MAJOR DEC(__clang_major__)
# define COMPILER_VERSION_MINOR DEC(__clang_minor__)
# define COMPILER_VERSION_PATCH DEC(__clang_patchlevel__)
# if defined(_MSC_VER)
/* _MSC_VER = VVRR */
# define SIMULATE_VERSION_MAJOR DEC(_MSC_VER / 100)
# define SIMULATE_VERSION_MINOR DEC(_MSC_VER % 100)
# endif
# define COMPILER_VERSION_TWEAK DEC(__apple_build_version__)
#elif defined(__clang__) && defined(__ARMCOMPILER_VERSION)
# define COMPILER_ID "ARMClang"
# define COMPILER_VERSION_MAJOR DEC(__ARMCOMPILER_VERSION/1000000)
# define COMPILER_VERSION_MINOR DEC(__ARMCOMPILER_VERSION/10000 % 100)
# define COMPILER_VERSION_PATCH DEC(__ARMCOMPILER_VERSION/100 % 100)
# define COMPILER_VERSION_INTERNAL DEC(__ARMCOMPILER_VERSION)
#elif defined(__clang__)
# define COMPILER_ID "Clang"
# if defined(_MSC_VER)
# define SIMULATE_ID "MSVC"
# endif
# define COMPILER_VERSION_MAJOR DEC(__clang_major__)
# define COMPILER_VERSION_MINOR DEC(__clang_minor__)
# define COMPILER_VERSION_PATCH DEC(__clang_patchlevel__)
# if defined(_MSC_VER)
/* _MSC_VER = VVRR */
# define SIMULATE_VERSION_MAJOR DEC(_MSC_VER / 100)
# define SIMULATE_VERSION_MINOR DEC(_MSC_VER % 100)
# endif
#elif defined(__LCC__) && (defined(__GNUC__) || defined(__GNUG__) || defined(__MCST__))
# define COMPILER_ID "LCC"
# define COMPILER_VERSION_MAJOR DEC(__LCC__ / 100)
# define COMPILER_VERSION_MINOR DEC(__LCC__ % 100)
# if defined(__LCC_MINOR__)
# define COMPILER_VERSION_PATCH DEC(__LCC_MINOR__)
# endif
# if defined(__GNUC__) && defined(__GNUC_MINOR__)
# define SIMULATE_ID "GNU"
# define SIMULATE_VERSION_MAJOR DEC(__GNUC__)
# define SIMULATE_VERSION_MINOR DEC(__GNUC_MINOR__)
# if defined(__GNUC_PATCHLEVEL__)
# define SIMULATE_VERSION_PATCH DEC(__GNUC_PATCHLEVEL__)
# endif
# endif
#elif defined(__GNUC__) || defined(__GNUG__)
# define COMPILER_ID "GNU"
# if defined(__GNUC__)
# define COMPILER_VERSION_MAJOR DEC(__GNUC__)
# else
# define COMPILER_VERSION_MAJOR DEC(__GNUG__)
# endif
# if defined(__GNUC_MINOR__)
# define COMPILER_VERSION_MINOR DEC(__GNUC_MINOR__)
# endif
# if defined(__GNUC_PATCHLEVEL__)
# define COMPILER_VERSION_PATCH DEC(__GNUC_PATCHLEVEL__)
# endif
#elif defined(_MSC_VER)
# define COMPILER_ID "MSVC"
/* _MSC_VER = VVRR */
# define COMPILER_VERSION_MAJOR DEC(_MSC_VER / 100)
# define COMPILER_VERSION_MINOR DEC(_MSC_VER % 100)
# if defined(_MSC_FULL_VER)
# if _MSC_VER >= 1400
/* _MSC_FULL_VER = VVRRPPPPP */
# define COMPILER_VERSION_PATCH DEC(_MSC_FULL_VER % 100000)
# else
/* _MSC_FULL_VER = VVRRPPPP */
# define COMPILER_VERSION_PATCH DEC(_MSC_FULL_VER % 10000)
# endif
# endif
# if defined(_MSC_BUILD)
# define COMPILER_VERSION_TWEAK DEC(_MSC_BUILD)
# endif
#elif defined(_ADI_COMPILER)
# define COMPILER_ID "ADSP"
#if defined(__VERSIONNUM__)
/* __VERSIONNUM__ = 0xVVRRPPTT */
# define COMPILER_VERSION_MAJOR DEC(__VERSIONNUM__ >> 24 & 0xFF)
# define COMPILER_VERSION_MINOR DEC(__VERSIONNUM__ >> 16 & 0xFF)
# define COMPILER_VERSION_PATCH DEC(__VERSIONNUM__ >> 8 & 0xFF)
# define COMPILER_VERSION_TWEAK DEC(__VERSIONNUM__ & 0xFF)
#endif
#elif defined(__IAR_SYSTEMS_ICC__) || defined(__IAR_SYSTEMS_ICC)
# define COMPILER_ID "IAR"
# if defined(__VER__) && defined(__ICCARM__)
# define COMPILER_VERSION_MAJOR DEC((__VER__) / 1000000)
# define COMPILER_VERSION_MINOR DEC(((__VER__) / 1000) % 1000)
# define COMPILER_VERSION_PATCH DEC((__VER__) % 1000)
# define COMPILER_VERSION_INTERNAL DEC(__IAR_SYSTEMS_ICC__)
# elif defined(__VER__) && (defined(__ICCAVR__) || defined(__ICCRX__) || defined(__ICCRH850__) || defined(__ICCRL78__) || defined(__ICC430__) || defined(__ICCRISCV__) || defined(__ICCV850__) || defined(__ICC8051__) || defined(__ICCSTM8__))
# define COMPILER_VERSION_MAJOR DEC((__VER__) / 100)
# define COMPILER_VERSION_MINOR DEC((__VER__) - (((__VER__) / 100)*100))
# define COMPILER_VERSION_PATCH DEC(__SUBVERSION__)
# define COMPILER_VERSION_INTERNAL DEC(__IAR_SYSTEMS_ICC__)
# endif
/* These compilers are either not known or too old to define an
identification macro. Try to identify the platform and guess that
it is the native compiler. */
#elif defined(__hpux) || defined(__hpua)
# define COMPILER_ID "HP"
#else /* unknown compiler */
# define COMPILER_ID ""
#endif
/* Construct the string literal in pieces to prevent the source from
getting matched. Store it in a pointer rather than an array
because some compilers will just produce instructions to fill the
array rather than assigning a pointer to a static array. */
char const* info_compiler = "INFO" ":" "compiler[" COMPILER_ID "]";
#ifdef SIMULATE_ID
char const* info_simulate = "INFO" ":" "simulate[" SIMULATE_ID "]";
#endif
#ifdef __QNXNTO__
char const* qnxnto = "INFO" ":" "qnxnto[]";
#endif
#if defined(__CRAYXT_COMPUTE_LINUX_TARGET)
char const *info_cray = "INFO" ":" "compiler_wrapper[CrayPrgEnv]";
#endif
#define STRINGIFY_HELPER(X) #X
#define STRINGIFY(X) STRINGIFY_HELPER(X)
/* Identify known platforms by name. */
#if defined(__linux) || defined(__linux__) || defined(linux)
# define PLATFORM_ID "Linux"
#elif defined(__MSYS__)
# define PLATFORM_ID "MSYS"
#elif defined(__CYGWIN__)
# define PLATFORM_ID "Cygwin"
#elif defined(__MINGW32__)
# define PLATFORM_ID "MinGW"
#elif defined(__APPLE__)
# define PLATFORM_ID "Darwin"
#elif defined(_WIN32) || defined(__WIN32__) || defined(WIN32)
# define PLATFORM_ID "Windows"
#elif defined(__FreeBSD__) || defined(__FreeBSD)
# define PLATFORM_ID "FreeBSD"
#elif defined(__NetBSD__) || defined(__NetBSD)
# define PLATFORM_ID "NetBSD"
#elif defined(__OpenBSD__) || defined(__OPENBSD)
# define PLATFORM_ID "OpenBSD"
#elif defined(__sun) || defined(sun)
# define PLATFORM_ID "SunOS"
#elif defined(_AIX) || defined(__AIX) || defined(__AIX__) || defined(__aix) || defined(__aix__)
# define PLATFORM_ID "AIX"
#elif defined(__hpux) || defined(__hpux__)
# define PLATFORM_ID "HP-UX"
#elif defined(__HAIKU__)
# define PLATFORM_ID "Haiku"
#elif defined(__BeOS) || defined(__BEOS__) || defined(_BEOS)
# define PLATFORM_ID "BeOS"
#elif defined(__QNX__) || defined(__QNXNTO__)
# define PLATFORM_ID "QNX"
#elif defined(__tru64) || defined(_tru64) || defined(__TRU64__)
# define PLATFORM_ID "Tru64"
#elif defined(__riscos) || defined(__riscos__)
# define PLATFORM_ID "RISCos"
#elif defined(__sinix) || defined(__sinix__) || defined(__SINIX__)
# define PLATFORM_ID "SINIX"
#elif defined(__UNIX_SV__)
# define PLATFORM_ID "UNIX_SV"
#elif defined(__bsdos__)
# define PLATFORM_ID "BSDOS"
#elif defined(_MPRAS) || defined(MPRAS)
# define PLATFORM_ID "MP-RAS"
#elif defined(__osf) || defined(__osf__)
# define PLATFORM_ID "OSF1"
#elif defined(_SCO_SV) || defined(SCO_SV) || defined(sco_sv)
# define PLATFORM_ID "SCO_SV"
#elif defined(__ultrix) || defined(__ultrix__) || defined(_ULTRIX)
# define PLATFORM_ID "ULTRIX"
#elif defined(__XENIX__) || defined(_XENIX) || defined(XENIX)
# define PLATFORM_ID "Xenix"
#elif defined(__WATCOMC__)
# if defined(__LINUX__)
# define PLATFORM_ID "Linux"
# elif defined(__DOS__)
# define PLATFORM_ID "DOS"
# elif defined(__OS2__)
# define PLATFORM_ID "OS2"
# elif defined(__WINDOWS__)
# define PLATFORM_ID "Windows3x"
# elif defined(__VXWORKS__)
# define PLATFORM_ID "VxWorks"
# else /* unknown platform */
# define PLATFORM_ID
# endif
#elif defined(__INTEGRITY)
# if defined(INT_178B)
# define PLATFORM_ID "Integrity178"
# else /* regular Integrity */
# define PLATFORM_ID "Integrity"
# endif
# elif defined(_ADI_COMPILER)
# define PLATFORM_ID "ADSP"
#else /* unknown platform */
# define PLATFORM_ID
#endif
/* For windows compilers MSVC and Intel we can determine
the architecture of the compiler being used. This is because
the compilers do not have flags that can change the architecture,
but rather depend on which compiler is being used
*/
#if defined(_WIN32) && defined(_MSC_VER)
# if defined(_M_IA64)
# define ARCHITECTURE_ID "IA64"
# elif defined(_M_ARM64EC)
# define ARCHITECTURE_ID "ARM64EC"
# elif defined(_M_X64) || defined(_M_AMD64)
# define ARCHITECTURE_ID "x64"
# elif defined(_M_IX86)
# define ARCHITECTURE_ID "X86"
# elif defined(_M_ARM64)
# define ARCHITECTURE_ID "ARM64"
# elif defined(_M_ARM)
# if _M_ARM == 4
# define ARCHITECTURE_ID "ARMV4I"
# elif _M_ARM == 5
# define ARCHITECTURE_ID "ARMV5I"
# else
# define ARCHITECTURE_ID "ARMV" STRINGIFY(_M_ARM)
# endif
# elif defined(_M_MIPS)
# define ARCHITECTURE_ID "MIPS"
# elif defined(_M_SH)
# define ARCHITECTURE_ID "SHx"
# else /* unknown architecture */
# define ARCHITECTURE_ID ""
# endif
#elif defined(__WATCOMC__)
# if defined(_M_I86)
# define ARCHITECTURE_ID "I86"
# elif defined(_M_IX86)
# define ARCHITECTURE_ID "X86"
# else /* unknown architecture */
# define ARCHITECTURE_ID ""
# endif
#elif defined(__IAR_SYSTEMS_ICC__) || defined(__IAR_SYSTEMS_ICC)
# if defined(__ICCARM__)
# define ARCHITECTURE_ID "ARM"
# elif defined(__ICCRX__)
# define ARCHITECTURE_ID "RX"
# elif defined(__ICCRH850__)
# define ARCHITECTURE_ID "RH850"
# elif defined(__ICCRL78__)
# define ARCHITECTURE_ID "RL78"
# elif defined(__ICCRISCV__)
# define ARCHITECTURE_ID "RISCV"
# elif defined(__ICCAVR__)
# define ARCHITECTURE_ID "AVR"
# elif defined(__ICC430__)
# define ARCHITECTURE_ID "MSP430"
# elif defined(__ICCV850__)
# define ARCHITECTURE_ID "V850"
# elif defined(__ICC8051__)
# define ARCHITECTURE_ID "8051"
# elif defined(__ICCSTM8__)
# define ARCHITECTURE_ID "STM8"
# else /* unknown architecture */
# define ARCHITECTURE_ID ""
# endif
#elif defined(__ghs__)
# if defined(__PPC64__)
# define ARCHITECTURE_ID "PPC64"
# elif defined(__ppc__)
# define ARCHITECTURE_ID "PPC"
# elif defined(__ARM__)
# define ARCHITECTURE_ID "ARM"
# elif defined(__x86_64__)
# define ARCHITECTURE_ID "x64"
# elif defined(__i386__)
# define ARCHITECTURE_ID "X86"
# else /* unknown architecture */
# define ARCHITECTURE_ID ""
# endif
#elif defined(__TI_COMPILER_VERSION__)
# if defined(__TI_ARM__)
# define ARCHITECTURE_ID "ARM"
# elif defined(__MSP430__)
# define ARCHITECTURE_ID "MSP430"
# elif defined(__TMS320C28XX__)
# define ARCHITECTURE_ID "TMS320C28x"
# elif defined(__TMS320C6X__) || defined(_TMS320C6X)
# define ARCHITECTURE_ID "TMS320C6x"
# else /* unknown architecture */
# define ARCHITECTURE_ID ""
# endif
# elif defined(__ADSPSHARC__)
# define ARCHITECTURE_ID "SHARC"
# elif defined(__ADSPBLACKFIN__)
# define ARCHITECTURE_ID "Blackfin"
#elif defined(__TASKING__)
# if defined(__CTC__) || defined(__CPTC__)
# define ARCHITECTURE_ID "TriCore"
# elif defined(__CMCS__)
# define ARCHITECTURE_ID "MCS"
# elif defined(__CARM__)
# define ARCHITECTURE_ID "ARM"
# elif defined(__CARC__)
# define ARCHITECTURE_ID "ARC"
# elif defined(__C51__)
# define ARCHITECTURE_ID "8051"
# elif defined(__CPCP__)
# define ARCHITECTURE_ID "PCP"
# else
# define ARCHITECTURE_ID ""
# endif
#else
# define ARCHITECTURE_ID
#endif
/* Convert integer to decimal digit literals. */
#define DEC(n) \
('0' + (((n) / 10000000)%10)), \
('0' + (((n) / 1000000)%10)), \
('0' + (((n) / 100000)%10)), \
('0' + (((n) / 10000)%10)), \
('0' + (((n) / 1000)%10)), \
('0' + (((n) / 100)%10)), \
('0' + (((n) / 10)%10)), \
('0' + ((n) % 10))
/* Convert integer to hex digit literals. */
#define HEX(n) \
('0' + ((n)>>28 & 0xF)), \
('0' + ((n)>>24 & 0xF)), \
('0' + ((n)>>20 & 0xF)), \
('0' + ((n)>>16 & 0xF)), \
('0' + ((n)>>12 & 0xF)), \
('0' + ((n)>>8 & 0xF)), \
('0' + ((n)>>4 & 0xF)), \
('0' + ((n) & 0xF))
/* Construct a string literal encoding the version number. */
#ifdef COMPILER_VERSION
char const* info_version = "INFO" ":" "compiler_version[" COMPILER_VERSION "]";
/* Construct a string literal encoding the version number components. */
#elif defined(COMPILER_VERSION_MAJOR)
char const info_version[] = {
'I', 'N', 'F', 'O', ':',
'c','o','m','p','i','l','e','r','_','v','e','r','s','i','o','n','[',
COMPILER_VERSION_MAJOR,
# ifdef COMPILER_VERSION_MINOR
'.', COMPILER_VERSION_MINOR,
# ifdef COMPILER_VERSION_PATCH
'.', COMPILER_VERSION_PATCH,
# ifdef COMPILER_VERSION_TWEAK
'.', COMPILER_VERSION_TWEAK,
# endif
# endif
# endif
']','\0'};
#endif
/* Construct a string literal encoding the internal version number. */
#ifdef COMPILER_VERSION_INTERNAL
char const info_version_internal[] = {
'I', 'N', 'F', 'O', ':',
'c','o','m','p','i','l','e','r','_','v','e','r','s','i','o','n','_',
'i','n','t','e','r','n','a','l','[',
COMPILER_VERSION_INTERNAL,']','\0'};
#elif defined(COMPILER_VERSION_INTERNAL_STR)
char const* info_version_internal = "INFO" ":" "compiler_version_internal[" COMPILER_VERSION_INTERNAL_STR "]";
#endif
/* Construct a string literal encoding the version number components. */
#ifdef SIMULATE_VERSION_MAJOR
char const info_simulate_version[] = {
'I', 'N', 'F', 'O', ':',
's','i','m','u','l','a','t','e','_','v','e','r','s','i','o','n','[',
SIMULATE_VERSION_MAJOR,
# ifdef SIMULATE_VERSION_MINOR
'.', SIMULATE_VERSION_MINOR,
# ifdef SIMULATE_VERSION_PATCH
'.', SIMULATE_VERSION_PATCH,
# ifdef SIMULATE_VERSION_TWEAK
'.', SIMULATE_VERSION_TWEAK,
# endif
# endif
# endif
']','\0'};
#endif
/* Construct the string literal in pieces to prevent the source from
getting matched. Store it in a pointer rather than an array
because some compilers will just produce instructions to fill the
array rather than assigning a pointer to a static array. */
char const* info_platform = "INFO" ":" "platform[" PLATFORM_ID "]";
char const* info_arch = "INFO" ":" "arch[" ARCHITECTURE_ID "]";
#if defined(__INTEL_COMPILER) && defined(_MSVC_LANG) && _MSVC_LANG < 201403L
# if defined(__INTEL_CXX11_MODE__)
# if defined(__cpp_aggregate_nsdmi)
# define CXX_STD 201402L
# else
# define CXX_STD 201103L
# endif
# else
# define CXX_STD 199711L
# endif
#elif defined(_MSC_VER) && defined(_MSVC_LANG)
# define CXX_STD _MSVC_LANG
#else
# define CXX_STD __cplusplus
#endif
const char* info_language_standard_default = "INFO" ":" "standard_default["
#if CXX_STD > 202002L
"23"
#elif CXX_STD > 201703L
"20"
#elif CXX_STD >= 201703L
"17"
#elif CXX_STD >= 201402L
"14"
#elif CXX_STD >= 201103L
"11"
#else
"98"
#endif
"]";
const char* info_language_extensions_default = "INFO" ":" "extensions_default["
#if (defined(__clang__) || defined(__GNUC__) || defined(__xlC__) || \
defined(__TI_COMPILER_VERSION__)) && \
!defined(__STRICT_ANSI__)
"ON"
#else
"OFF"
#endif
"]";
/*--------------------------------------------------------------------------*/
int main(int argc, char* argv[])
{
int require = 0;
require += info_compiler[argc];
require += info_platform[argc];
require += info_arch[argc];
#ifdef COMPILER_VERSION_MAJOR
require += info_version[argc];
#endif
#ifdef COMPILER_VERSION_INTERNAL
require += info_version_internal[argc];
#endif
#ifdef SIMULATE_ID
require += info_simulate[argc];
#endif
#ifdef SIMULATE_VERSION_MAJOR
require += info_simulate_version[argc];
#endif
#if defined(__CRAYXT_COMPUTE_LINUX_TARGET)
require += info_cray[argc];
#endif
require += info_language_standard_default[argc];
require += info_language_extensions_default[argc];
(void)argv;
return require;
}
+278
View File
@@ -0,0 +1,278 @@
---
events:
-
kind: "message-v1"
backtrace:
- "/usr/share/cmake-3.28/Modules/CMakeDetermineSystem.cmake:233 (message)"
- "CMakeLists.txt:2 (project)"
message: |
The system is: Linux - 6.1.115-vendor-rk35xx - aarch64
-
kind: "message-v1"
backtrace:
- "/usr/share/cmake-3.28/Modules/CMakeDetermineCompilerId.cmake:17 (message)"
- "/usr/share/cmake-3.28/Modules/CMakeDetermineCompilerId.cmake:64 (__determine_compiler_id_test)"
- "/usr/share/cmake-3.28/Modules/CMakeDetermineCXXCompiler.cmake:126 (CMAKE_DETERMINE_COMPILER_ID)"
- "CMakeLists.txt:2 (project)"
message: |
Compiling the CXX compiler identification source file "CMakeCXXCompilerId.cpp" succeeded.
Compiler: /usr/bin/c++
Build flags:
Id flags:
The output was:
0
Compilation of the CXX compiler identification source "CMakeCXXCompilerId.cpp" produced "a.out"
The CXX compiler identification is GNU, found in:
/opt/bytetrack-counter-cpp/build/CMakeFiles/3.28.3/CompilerIdCXX/a.out
-
kind: "try_compile-v1"
backtrace:
- "/usr/share/cmake-3.28/Modules/CMakeDetermineCompilerABI.cmake:57 (try_compile)"
- "/usr/share/cmake-3.28/Modules/CMakeTestCXXCompiler.cmake:26 (CMAKE_DETERMINE_COMPILER_ABI)"
- "CMakeLists.txt:2 (project)"
checks:
- "Detecting CXX compiler ABI info"
directories:
source: "/opt/bytetrack-counter-cpp/build/CMakeFiles/CMakeScratch/TryCompile-fLP7hx"
binary: "/opt/bytetrack-counter-cpp/build/CMakeFiles/CMakeScratch/TryCompile-fLP7hx"
cmakeVariables:
CMAKE_CXX_FLAGS: ""
CMAKE_CXX_FLAGS_DEBUG: "-g"
CMAKE_EXE_LINKER_FLAGS: ""
buildResult:
variable: "CMAKE_CXX_ABI_COMPILED"
cached: true
stdout: |
Change Dir: '/opt/bytetrack-counter-cpp/build/CMakeFiles/CMakeScratch/TryCompile-fLP7hx'
Run Build Command(s): /usr/bin/cmake -E env VERBOSE=1 /usr/bin/gmake -f Makefile cmTC_4ab7f/fast
/usr/bin/gmake -f CMakeFiles/cmTC_4ab7f.dir/build.make CMakeFiles/cmTC_4ab7f.dir/build
gmake[1]: Entering directory '/opt/bytetrack-counter-cpp/build/CMakeFiles/CMakeScratch/TryCompile-fLP7hx'
Building CXX object CMakeFiles/cmTC_4ab7f.dir/CMakeCXXCompilerABI.cpp.o
/usr/bin/c++ -v -o CMakeFiles/cmTC_4ab7f.dir/CMakeCXXCompilerABI.cpp.o -c /usr/share/cmake-3.28/Modules/CMakeCXXCompilerABI.cpp
Using built-in specs.
COLLECT_GCC=/usr/bin/c++
OFFLOAD_TARGET_NAMES=nvptx-none
OFFLOAD_TARGET_DEFAULT=1
Target: aarch64-linux-gnu
Configured with: ../src/configure -v --with-pkgversion='Ubuntu 13.3.0-6ubuntu2~24.04.1' --with-bugurl=file:///usr/share/doc/gcc-13/README.Bugs --enable-languages=c,ada,c++,go,d,fortran,objc,obj-c++,m2 --prefix=/usr --with-gcc-major-version-only --program-suffix=-13 --program-prefix=aarch64-linux-gnu- --enable-shared --enable-linker-build-id --libexecdir=/usr/libexec --without-included-gettext --enable-threads=posix --libdir=/usr/lib --enable-nls --enable-bootstrap --enable-clocale=gnu --enable-libstdcxx-debug --enable-libstdcxx-time=yes --with-default-libstdcxx-abi=new --enable-libstdcxx-backtrace --enable-gnu-unique-object --disable-libquadmath --disable-libquadmath-support --enable-plugin --enable-default-pie --with-system-zlib --enable-libphobos-checking=release --with-target-system-zlib=auto --enable-objc-gc=auto --enable-multiarch --enable-fix-cortex-a53-843419 --disable-werror --enable-offload-targets=nvptx-none=/build/gcc-13-f9pAEi/gcc-13-13.3.0/debian/tmp-nvptx/usr --enable-offload-defaulted --without-cuda-driver --enable-checking=release --build=aarch64-linux-gnu --host=aarch64-linux-gnu --target=aarch64-linux-gnu --with-build-config=bootstrap-lto-lean --enable-link-serialization=4
Thread model: posix
Supported LTO compression algorithms: zlib zstd
gcc version 13.3.0 (Ubuntu 13.3.0-6ubuntu2~24.04.1)
COLLECT_GCC_OPTIONS='-v' '-o' 'CMakeFiles/cmTC_4ab7f.dir/CMakeCXXCompilerABI.cpp.o' '-c' '-shared-libgcc' '-mlittle-endian' '-mabi=lp64' '-dumpdir' 'CMakeFiles/cmTC_4ab7f.dir/'
/usr/libexec/gcc/aarch64-linux-gnu/13/cc1plus -quiet -v -imultiarch aarch64-linux-gnu -D_GNU_SOURCE /usr/share/cmake-3.28/Modules/CMakeCXXCompilerABI.cpp -quiet -dumpdir CMakeFiles/cmTC_4ab7f.dir/ -dumpbase CMakeCXXCompilerABI.cpp.cpp -dumpbase-ext .cpp -mlittle-endian -mabi=lp64 -version -fasynchronous-unwind-tables -fstack-protector-strong -Wformat -Wformat-security -fstack-clash-protection -o /tmp/ccmrn412.s
GNU C++17 (Ubuntu 13.3.0-6ubuntu2~24.04.1) version 13.3.0 (aarch64-linux-gnu)
compiled by GNU C version 13.3.0, GMP version 6.3.0, MPFR version 4.2.1, MPC version 1.3.1, isl version isl-0.26-GMP
GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072
ignoring duplicate directory "/usr/include/aarch64-linux-gnu/c++/13"
ignoring nonexistent directory "/usr/local/include/aarch64-linux-gnu"
ignoring nonexistent directory "/usr/lib/gcc/aarch64-linux-gnu/13/include-fixed/aarch64-linux-gnu"
ignoring nonexistent directory "/usr/lib/gcc/aarch64-linux-gnu/13/include-fixed"
ignoring nonexistent directory "/usr/lib/gcc/aarch64-linux-gnu/13/../../../../aarch64-linux-gnu/include"
#include "..." search starts here:
#include <...> search starts here:
/usr/include/c++/13
/usr/include/aarch64-linux-gnu/c++/13
/usr/include/c++/13/backward
/usr/lib/gcc/aarch64-linux-gnu/13/include
/usr/local/include
/usr/include/aarch64-linux-gnu
/usr/include
End of search list.
Compiler executable checksum: 3007a9bdd78900ddf3753164e1e631d0
COLLECT_GCC_OPTIONS='-v' '-o' 'CMakeFiles/cmTC_4ab7f.dir/CMakeCXXCompilerABI.cpp.o' '-c' '-shared-libgcc' '-mlittle-endian' '-mabi=lp64' '-dumpdir' 'CMakeFiles/cmTC_4ab7f.dir/'
as -v -EL -mabi=lp64 -o CMakeFiles/cmTC_4ab7f.dir/CMakeCXXCompilerABI.cpp.o /tmp/ccmrn412.s
GNU assembler version 2.42 (aarch64-linux-gnu) using BFD version (GNU Binutils for Ubuntu) 2.42
COMPILER_PATH=/usr/libexec/gcc/aarch64-linux-gnu/13/:/usr/libexec/gcc/aarch64-linux-gnu/13/:/usr/libexec/gcc/aarch64-linux-gnu/:/usr/lib/gcc/aarch64-linux-gnu/13/:/usr/lib/gcc/aarch64-linux-gnu/
LIBRARY_PATH=/usr/lib/gcc/aarch64-linux-gnu/13/:/usr/lib/gcc/aarch64-linux-gnu/13/../../../aarch64-linux-gnu/:/usr/lib/gcc/aarch64-linux-gnu/13/../../../../lib/:/lib/aarch64-linux-gnu/:/lib/../lib/:/usr/lib/aarch64-linux-gnu/:/usr/lib/../lib/:/usr/lib/gcc/aarch64-linux-gnu/13/../../../:/lib/:/usr/lib/
COLLECT_GCC_OPTIONS='-v' '-o' 'CMakeFiles/cmTC_4ab7f.dir/CMakeCXXCompilerABI.cpp.o' '-c' '-shared-libgcc' '-mlittle-endian' '-mabi=lp64' '-dumpdir' 'CMakeFiles/cmTC_4ab7f.dir/CMakeCXXCompilerABI.cpp.'
Linking CXX executable cmTC_4ab7f
/usr/bin/cmake -E cmake_link_script CMakeFiles/cmTC_4ab7f.dir/link.txt --verbose=1
/usr/bin/c++ -v CMakeFiles/cmTC_4ab7f.dir/CMakeCXXCompilerABI.cpp.o -o cmTC_4ab7f
Using built-in specs.
COLLECT_GCC=/usr/bin/c++
COLLECT_LTO_WRAPPER=/usr/libexec/gcc/aarch64-linux-gnu/13/lto-wrapper
OFFLOAD_TARGET_NAMES=nvptx-none
OFFLOAD_TARGET_DEFAULT=1
Target: aarch64-linux-gnu
Configured with: ../src/configure -v --with-pkgversion='Ubuntu 13.3.0-6ubuntu2~24.04.1' --with-bugurl=file:///usr/share/doc/gcc-13/README.Bugs --enable-languages=c,ada,c++,go,d,fortran,objc,obj-c++,m2 --prefix=/usr --with-gcc-major-version-only --program-suffix=-13 --program-prefix=aarch64-linux-gnu- --enable-shared --enable-linker-build-id --libexecdir=/usr/libexec --without-included-gettext --enable-threads=posix --libdir=/usr/lib --enable-nls --enable-bootstrap --enable-clocale=gnu --enable-libstdcxx-debug --enable-libstdcxx-time=yes --with-default-libstdcxx-abi=new --enable-libstdcxx-backtrace --enable-gnu-unique-object --disable-libquadmath --disable-libquadmath-support --enable-plugin --enable-default-pie --with-system-zlib --enable-libphobos-checking=release --with-target-system-zlib=auto --enable-objc-gc=auto --enable-multiarch --enable-fix-cortex-a53-843419 --disable-werror --enable-offload-targets=nvptx-none=/build/gcc-13-f9pAEi/gcc-13-13.3.0/debian/tmp-nvptx/usr --enable-offload-defaulted --without-cuda-driver --enable-checking=release --build=aarch64-linux-gnu --host=aarch64-linux-gnu --target=aarch64-linux-gnu --with-build-config=bootstrap-lto-lean --enable-link-serialization=4
Thread model: posix
Supported LTO compression algorithms: zlib zstd
gcc version 13.3.0 (Ubuntu 13.3.0-6ubuntu2~24.04.1)
COMPILER_PATH=/usr/libexec/gcc/aarch64-linux-gnu/13/:/usr/libexec/gcc/aarch64-linux-gnu/13/:/usr/libexec/gcc/aarch64-linux-gnu/:/usr/lib/gcc/aarch64-linux-gnu/13/:/usr/lib/gcc/aarch64-linux-gnu/
LIBRARY_PATH=/usr/lib/gcc/aarch64-linux-gnu/13/:/usr/lib/gcc/aarch64-linux-gnu/13/../../../aarch64-linux-gnu/:/usr/lib/gcc/aarch64-linux-gnu/13/../../../../lib/:/lib/aarch64-linux-gnu/:/lib/../lib/:/usr/lib/aarch64-linux-gnu/:/usr/lib/../lib/:/usr/lib/gcc/aarch64-linux-gnu/13/../../../:/lib/:/usr/lib/
COLLECT_GCC_OPTIONS='-v' '-o' 'cmTC_4ab7f' '-shared-libgcc' '-mlittle-endian' '-mabi=lp64' '-dumpdir' 'cmTC_4ab7f.'
/usr/libexec/gcc/aarch64-linux-gnu/13/collect2 -plugin /usr/libexec/gcc/aarch64-linux-gnu/13/liblto_plugin.so -plugin-opt=/usr/libexec/gcc/aarch64-linux-gnu/13/lto-wrapper -plugin-opt=-fresolution=/tmp/cciBFqhE.res -plugin-opt=-pass-through=-lgcc_s -plugin-opt=-pass-through=-lgcc -plugin-opt=-pass-through=-lc -plugin-opt=-pass-through=-lgcc_s -plugin-opt=-pass-through=-lgcc --build-id --eh-frame-hdr --hash-style=gnu --as-needed -dynamic-linker /lib/ld-linux-aarch64.so.1 -X -EL -maarch64linux --fix-cortex-a53-843419 -pie -z now -z relro -o cmTC_4ab7f /usr/lib/gcc/aarch64-linux-gnu/13/../../../aarch64-linux-gnu/Scrt1.o /usr/lib/gcc/aarch64-linux-gnu/13/../../../aarch64-linux-gnu/crti.o /usr/lib/gcc/aarch64-linux-gnu/13/crtbeginS.o -L/usr/lib/gcc/aarch64-linux-gnu/13 -L/usr/lib/gcc/aarch64-linux-gnu/13/../../../aarch64-linux-gnu -L/usr/lib/gcc/aarch64-linux-gnu/13/../../../../lib -L/lib/aarch64-linux-gnu -L/lib/../lib -L/usr/lib/aarch64-linux-gnu -L/usr/lib/../lib -L/usr/lib/gcc/aarch64-linux-gnu/13/../../.. CMakeFiles/cmTC_4ab7f.dir/CMakeCXXCompilerABI.cpp.o -lstdc++ -lm -lgcc_s -lgcc -lc -lgcc_s -lgcc /usr/lib/gcc/aarch64-linux-gnu/13/crtendS.o /usr/lib/gcc/aarch64-linux-gnu/13/../../../aarch64-linux-gnu/crtn.o
COLLECT_GCC_OPTIONS='-v' '-o' 'cmTC_4ab7f' '-shared-libgcc' '-mlittle-endian' '-mabi=lp64' '-dumpdir' 'cmTC_4ab7f.'
gmake[1]: Leaving directory '/opt/bytetrack-counter-cpp/build/CMakeFiles/CMakeScratch/TryCompile-fLP7hx'
exitCode: 0
-
kind: "message-v1"
backtrace:
- "/usr/share/cmake-3.28/Modules/CMakeDetermineCompilerABI.cmake:127 (message)"
- "/usr/share/cmake-3.28/Modules/CMakeTestCXXCompiler.cmake:26 (CMAKE_DETERMINE_COMPILER_ABI)"
- "CMakeLists.txt:2 (project)"
message: |
Parsed CXX implicit include dir info: rv=done
found start of include info
found start of implicit include info
add: [/usr/include/c++/13]
add: [/usr/include/aarch64-linux-gnu/c++/13]
add: [/usr/include/c++/13/backward]
add: [/usr/lib/gcc/aarch64-linux-gnu/13/include]
add: [/usr/local/include]
add: [/usr/include/aarch64-linux-gnu]
add: [/usr/include]
end of search list found
collapse include dir [/usr/include/c++/13] ==> [/usr/include/c++/13]
collapse include dir [/usr/include/aarch64-linux-gnu/c++/13] ==> [/usr/include/aarch64-linux-gnu/c++/13]
collapse include dir [/usr/include/c++/13/backward] ==> [/usr/include/c++/13/backward]
collapse include dir [/usr/lib/gcc/aarch64-linux-gnu/13/include] ==> [/usr/lib/gcc/aarch64-linux-gnu/13/include]
collapse include dir [/usr/local/include] ==> [/usr/local/include]
collapse include dir [/usr/include/aarch64-linux-gnu] ==> [/usr/include/aarch64-linux-gnu]
collapse include dir [/usr/include] ==> [/usr/include]
implicit include dirs: [/usr/include/c++/13;/usr/include/aarch64-linux-gnu/c++/13;/usr/include/c++/13/backward;/usr/lib/gcc/aarch64-linux-gnu/13/include;/usr/local/include;/usr/include/aarch64-linux-gnu;/usr/include]
-
kind: "message-v1"
backtrace:
- "/usr/share/cmake-3.28/Modules/CMakeDetermineCompilerABI.cmake:159 (message)"
- "/usr/share/cmake-3.28/Modules/CMakeTestCXXCompiler.cmake:26 (CMAKE_DETERMINE_COMPILER_ABI)"
- "CMakeLists.txt:2 (project)"
message: |
Parsed CXX implicit link information:
link line regex: [^( *|.*[/\\])(ld|CMAKE_LINK_STARTFILE-NOTFOUND|([^/\\]+-)?ld|collect2)[^/\\]*( |$)]
ignore line: [Change Dir: '/opt/bytetrack-counter-cpp/build/CMakeFiles/CMakeScratch/TryCompile-fLP7hx']
ignore line: []
ignore line: [Run Build Command(s): /usr/bin/cmake -E env VERBOSE=1 /usr/bin/gmake -f Makefile cmTC_4ab7f/fast]
ignore line: [/usr/bin/gmake -f CMakeFiles/cmTC_4ab7f.dir/build.make CMakeFiles/cmTC_4ab7f.dir/build]
ignore line: [gmake[1]: Entering directory '/opt/bytetrack-counter-cpp/build/CMakeFiles/CMakeScratch/TryCompile-fLP7hx']
ignore line: [Building CXX object CMakeFiles/cmTC_4ab7f.dir/CMakeCXXCompilerABI.cpp.o]
ignore line: [/usr/bin/c++ -v -o CMakeFiles/cmTC_4ab7f.dir/CMakeCXXCompilerABI.cpp.o -c /usr/share/cmake-3.28/Modules/CMakeCXXCompilerABI.cpp]
ignore line: [Using built-in specs.]
ignore line: [COLLECT_GCC=/usr/bin/c++]
ignore line: [OFFLOAD_TARGET_NAMES=nvptx-none]
ignore line: [OFFLOAD_TARGET_DEFAULT=1]
ignore line: [Target: aarch64-linux-gnu]
ignore line: [Configured with: ../src/configure -v --with-pkgversion='Ubuntu 13.3.0-6ubuntu2~24.04.1' --with-bugurl=file:///usr/share/doc/gcc-13/README.Bugs --enable-languages=c ada c++ go d fortran objc obj-c++ m2 --prefix=/usr --with-gcc-major-version-only --program-suffix=-13 --program-prefix=aarch64-linux-gnu- --enable-shared --enable-linker-build-id --libexecdir=/usr/libexec --without-included-gettext --enable-threads=posix --libdir=/usr/lib --enable-nls --enable-bootstrap --enable-clocale=gnu --enable-libstdcxx-debug --enable-libstdcxx-time=yes --with-default-libstdcxx-abi=new --enable-libstdcxx-backtrace --enable-gnu-unique-object --disable-libquadmath --disable-libquadmath-support --enable-plugin --enable-default-pie --with-system-zlib --enable-libphobos-checking=release --with-target-system-zlib=auto --enable-objc-gc=auto --enable-multiarch --enable-fix-cortex-a53-843419 --disable-werror --enable-offload-targets=nvptx-none=/build/gcc-13-f9pAEi/gcc-13-13.3.0/debian/tmp-nvptx/usr --enable-offload-defaulted --without-cuda-driver --enable-checking=release --build=aarch64-linux-gnu --host=aarch64-linux-gnu --target=aarch64-linux-gnu --with-build-config=bootstrap-lto-lean --enable-link-serialization=4]
ignore line: [Thread model: posix]
ignore line: [Supported LTO compression algorithms: zlib zstd]
ignore line: [gcc version 13.3.0 (Ubuntu 13.3.0-6ubuntu2~24.04.1) ]
ignore line: [COLLECT_GCC_OPTIONS='-v' '-o' 'CMakeFiles/cmTC_4ab7f.dir/CMakeCXXCompilerABI.cpp.o' '-c' '-shared-libgcc' '-mlittle-endian' '-mabi=lp64' '-dumpdir' 'CMakeFiles/cmTC_4ab7f.dir/']
ignore line: [ /usr/libexec/gcc/aarch64-linux-gnu/13/cc1plus -quiet -v -imultiarch aarch64-linux-gnu -D_GNU_SOURCE /usr/share/cmake-3.28/Modules/CMakeCXXCompilerABI.cpp -quiet -dumpdir CMakeFiles/cmTC_4ab7f.dir/ -dumpbase CMakeCXXCompilerABI.cpp.cpp -dumpbase-ext .cpp -mlittle-endian -mabi=lp64 -version -fasynchronous-unwind-tables -fstack-protector-strong -Wformat -Wformat-security -fstack-clash-protection -o /tmp/ccmrn412.s]
ignore line: [GNU C++17 (Ubuntu 13.3.0-6ubuntu2~24.04.1) version 13.3.0 (aarch64-linux-gnu)]
ignore line: [ compiled by GNU C version 13.3.0 GMP version 6.3.0 MPFR version 4.2.1 MPC version 1.3.1 isl version isl-0.26-GMP]
ignore line: []
ignore line: [GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072]
ignore line: [ignoring duplicate directory "/usr/include/aarch64-linux-gnu/c++/13"]
ignore line: [ignoring nonexistent directory "/usr/local/include/aarch64-linux-gnu"]
ignore line: [ignoring nonexistent directory "/usr/lib/gcc/aarch64-linux-gnu/13/include-fixed/aarch64-linux-gnu"]
ignore line: [ignoring nonexistent directory "/usr/lib/gcc/aarch64-linux-gnu/13/include-fixed"]
ignore line: [ignoring nonexistent directory "/usr/lib/gcc/aarch64-linux-gnu/13/../../../../aarch64-linux-gnu/include"]
ignore line: [#include "..." search starts here:]
ignore line: [#include <...> search starts here:]
ignore line: [ /usr/include/c++/13]
ignore line: [ /usr/include/aarch64-linux-gnu/c++/13]
ignore line: [ /usr/include/c++/13/backward]
ignore line: [ /usr/lib/gcc/aarch64-linux-gnu/13/include]
ignore line: [ /usr/local/include]
ignore line: [ /usr/include/aarch64-linux-gnu]
ignore line: [ /usr/include]
ignore line: [End of search list.]
ignore line: [Compiler executable checksum: 3007a9bdd78900ddf3753164e1e631d0]
ignore line: [COLLECT_GCC_OPTIONS='-v' '-o' 'CMakeFiles/cmTC_4ab7f.dir/CMakeCXXCompilerABI.cpp.o' '-c' '-shared-libgcc' '-mlittle-endian' '-mabi=lp64' '-dumpdir' 'CMakeFiles/cmTC_4ab7f.dir/']
ignore line: [ as -v -EL -mabi=lp64 -o CMakeFiles/cmTC_4ab7f.dir/CMakeCXXCompilerABI.cpp.o /tmp/ccmrn412.s]
ignore line: [GNU assembler version 2.42 (aarch64-linux-gnu) using BFD version (GNU Binutils for Ubuntu) 2.42]
ignore line: [COMPILER_PATH=/usr/libexec/gcc/aarch64-linux-gnu/13/:/usr/libexec/gcc/aarch64-linux-gnu/13/:/usr/libexec/gcc/aarch64-linux-gnu/:/usr/lib/gcc/aarch64-linux-gnu/13/:/usr/lib/gcc/aarch64-linux-gnu/]
ignore line: [LIBRARY_PATH=/usr/lib/gcc/aarch64-linux-gnu/13/:/usr/lib/gcc/aarch64-linux-gnu/13/../../../aarch64-linux-gnu/:/usr/lib/gcc/aarch64-linux-gnu/13/../../../../lib/:/lib/aarch64-linux-gnu/:/lib/../lib/:/usr/lib/aarch64-linux-gnu/:/usr/lib/../lib/:/usr/lib/gcc/aarch64-linux-gnu/13/../../../:/lib/:/usr/lib/]
ignore line: [COLLECT_GCC_OPTIONS='-v' '-o' 'CMakeFiles/cmTC_4ab7f.dir/CMakeCXXCompilerABI.cpp.o' '-c' '-shared-libgcc' '-mlittle-endian' '-mabi=lp64' '-dumpdir' 'CMakeFiles/cmTC_4ab7f.dir/CMakeCXXCompilerABI.cpp.']
ignore line: [Linking CXX executable cmTC_4ab7f]
ignore line: [/usr/bin/cmake -E cmake_link_script CMakeFiles/cmTC_4ab7f.dir/link.txt --verbose=1]
ignore line: [/usr/bin/c++ -v CMakeFiles/cmTC_4ab7f.dir/CMakeCXXCompilerABI.cpp.o -o cmTC_4ab7f ]
ignore line: [Using built-in specs.]
ignore line: [COLLECT_GCC=/usr/bin/c++]
ignore line: [COLLECT_LTO_WRAPPER=/usr/libexec/gcc/aarch64-linux-gnu/13/lto-wrapper]
ignore line: [OFFLOAD_TARGET_NAMES=nvptx-none]
ignore line: [OFFLOAD_TARGET_DEFAULT=1]
ignore line: [Target: aarch64-linux-gnu]
ignore line: [Configured with: ../src/configure -v --with-pkgversion='Ubuntu 13.3.0-6ubuntu2~24.04.1' --with-bugurl=file:///usr/share/doc/gcc-13/README.Bugs --enable-languages=c ada c++ go d fortran objc obj-c++ m2 --prefix=/usr --with-gcc-major-version-only --program-suffix=-13 --program-prefix=aarch64-linux-gnu- --enable-shared --enable-linker-build-id --libexecdir=/usr/libexec --without-included-gettext --enable-threads=posix --libdir=/usr/lib --enable-nls --enable-bootstrap --enable-clocale=gnu --enable-libstdcxx-debug --enable-libstdcxx-time=yes --with-default-libstdcxx-abi=new --enable-libstdcxx-backtrace --enable-gnu-unique-object --disable-libquadmath --disable-libquadmath-support --enable-plugin --enable-default-pie --with-system-zlib --enable-libphobos-checking=release --with-target-system-zlib=auto --enable-objc-gc=auto --enable-multiarch --enable-fix-cortex-a53-843419 --disable-werror --enable-offload-targets=nvptx-none=/build/gcc-13-f9pAEi/gcc-13-13.3.0/debian/tmp-nvptx/usr --enable-offload-defaulted --without-cuda-driver --enable-checking=release --build=aarch64-linux-gnu --host=aarch64-linux-gnu --target=aarch64-linux-gnu --with-build-config=bootstrap-lto-lean --enable-link-serialization=4]
ignore line: [Thread model: posix]
ignore line: [Supported LTO compression algorithms: zlib zstd]
ignore line: [gcc version 13.3.0 (Ubuntu 13.3.0-6ubuntu2~24.04.1) ]
ignore line: [COMPILER_PATH=/usr/libexec/gcc/aarch64-linux-gnu/13/:/usr/libexec/gcc/aarch64-linux-gnu/13/:/usr/libexec/gcc/aarch64-linux-gnu/:/usr/lib/gcc/aarch64-linux-gnu/13/:/usr/lib/gcc/aarch64-linux-gnu/]
ignore line: [LIBRARY_PATH=/usr/lib/gcc/aarch64-linux-gnu/13/:/usr/lib/gcc/aarch64-linux-gnu/13/../../../aarch64-linux-gnu/:/usr/lib/gcc/aarch64-linux-gnu/13/../../../../lib/:/lib/aarch64-linux-gnu/:/lib/../lib/:/usr/lib/aarch64-linux-gnu/:/usr/lib/../lib/:/usr/lib/gcc/aarch64-linux-gnu/13/../../../:/lib/:/usr/lib/]
ignore line: [COLLECT_GCC_OPTIONS='-v' '-o' 'cmTC_4ab7f' '-shared-libgcc' '-mlittle-endian' '-mabi=lp64' '-dumpdir' 'cmTC_4ab7f.']
link line: [ /usr/libexec/gcc/aarch64-linux-gnu/13/collect2 -plugin /usr/libexec/gcc/aarch64-linux-gnu/13/liblto_plugin.so -plugin-opt=/usr/libexec/gcc/aarch64-linux-gnu/13/lto-wrapper -plugin-opt=-fresolution=/tmp/cciBFqhE.res -plugin-opt=-pass-through=-lgcc_s -plugin-opt=-pass-through=-lgcc -plugin-opt=-pass-through=-lc -plugin-opt=-pass-through=-lgcc_s -plugin-opt=-pass-through=-lgcc --build-id --eh-frame-hdr --hash-style=gnu --as-needed -dynamic-linker /lib/ld-linux-aarch64.so.1 -X -EL -maarch64linux --fix-cortex-a53-843419 -pie -z now -z relro -o cmTC_4ab7f /usr/lib/gcc/aarch64-linux-gnu/13/../../../aarch64-linux-gnu/Scrt1.o /usr/lib/gcc/aarch64-linux-gnu/13/../../../aarch64-linux-gnu/crti.o /usr/lib/gcc/aarch64-linux-gnu/13/crtbeginS.o -L/usr/lib/gcc/aarch64-linux-gnu/13 -L/usr/lib/gcc/aarch64-linux-gnu/13/../../../aarch64-linux-gnu -L/usr/lib/gcc/aarch64-linux-gnu/13/../../../../lib -L/lib/aarch64-linux-gnu -L/lib/../lib -L/usr/lib/aarch64-linux-gnu -L/usr/lib/../lib -L/usr/lib/gcc/aarch64-linux-gnu/13/../../.. CMakeFiles/cmTC_4ab7f.dir/CMakeCXXCompilerABI.cpp.o -lstdc++ -lm -lgcc_s -lgcc -lc -lgcc_s -lgcc /usr/lib/gcc/aarch64-linux-gnu/13/crtendS.o /usr/lib/gcc/aarch64-linux-gnu/13/../../../aarch64-linux-gnu/crtn.o]
arg [/usr/libexec/gcc/aarch64-linux-gnu/13/collect2] ==> ignore
arg [-plugin] ==> ignore
arg [/usr/libexec/gcc/aarch64-linux-gnu/13/liblto_plugin.so] ==> ignore
arg [-plugin-opt=/usr/libexec/gcc/aarch64-linux-gnu/13/lto-wrapper] ==> ignore
arg [-plugin-opt=-fresolution=/tmp/cciBFqhE.res] ==> ignore
arg [-plugin-opt=-pass-through=-lgcc_s] ==> ignore
arg [-plugin-opt=-pass-through=-lgcc] ==> ignore
arg [-plugin-opt=-pass-through=-lc] ==> ignore
arg [-plugin-opt=-pass-through=-lgcc_s] ==> ignore
arg [-plugin-opt=-pass-through=-lgcc] ==> ignore
arg [--build-id] ==> ignore
arg [--eh-frame-hdr] ==> ignore
arg [--hash-style=gnu] ==> ignore
arg [--as-needed] ==> ignore
arg [-dynamic-linker] ==> ignore
arg [/lib/ld-linux-aarch64.so.1] ==> ignore
arg [-X] ==> ignore
arg [-EL] ==> ignore
arg [-maarch64linux] ==> ignore
arg [--fix-cortex-a53-843419] ==> ignore
arg [-pie] ==> ignore
arg [-znow] ==> ignore
arg [-zrelro] ==> ignore
arg [-o] ==> ignore
arg [cmTC_4ab7f] ==> ignore
arg [/usr/lib/gcc/aarch64-linux-gnu/13/../../../aarch64-linux-gnu/Scrt1.o] ==> obj [/usr/lib/gcc/aarch64-linux-gnu/13/../../../aarch64-linux-gnu/Scrt1.o]
arg [/usr/lib/gcc/aarch64-linux-gnu/13/../../../aarch64-linux-gnu/crti.o] ==> obj [/usr/lib/gcc/aarch64-linux-gnu/13/../../../aarch64-linux-gnu/crti.o]
arg [/usr/lib/gcc/aarch64-linux-gnu/13/crtbeginS.o] ==> obj [/usr/lib/gcc/aarch64-linux-gnu/13/crtbeginS.o]
arg [-L/usr/lib/gcc/aarch64-linux-gnu/13] ==> dir [/usr/lib/gcc/aarch64-linux-gnu/13]
arg [-L/usr/lib/gcc/aarch64-linux-gnu/13/../../../aarch64-linux-gnu] ==> dir [/usr/lib/gcc/aarch64-linux-gnu/13/../../../aarch64-linux-gnu]
arg [-L/usr/lib/gcc/aarch64-linux-gnu/13/../../../../lib] ==> dir [/usr/lib/gcc/aarch64-linux-gnu/13/../../../../lib]
arg [-L/lib/aarch64-linux-gnu] ==> dir [/lib/aarch64-linux-gnu]
arg [-L/lib/../lib] ==> dir [/lib/../lib]
arg [-L/usr/lib/aarch64-linux-gnu] ==> dir [/usr/lib/aarch64-linux-gnu]
arg [-L/usr/lib/../lib] ==> dir [/usr/lib/../lib]
arg [-L/usr/lib/gcc/aarch64-linux-gnu/13/../../..] ==> dir [/usr/lib/gcc/aarch64-linux-gnu/13/../../..]
arg [CMakeFiles/cmTC_4ab7f.dir/CMakeCXXCompilerABI.cpp.o] ==> ignore
arg [-lstdc++] ==> lib [stdc++]
arg [-lm] ==> lib [m]
arg [-lgcc_s] ==> lib [gcc_s]
arg [-lgcc] ==> lib [gcc]
arg [-lc] ==> lib [c]
arg [-lgcc_s] ==> lib [gcc_s]
arg [-lgcc] ==> lib [gcc]
arg [/usr/lib/gcc/aarch64-linux-gnu/13/crtendS.o] ==> obj [/usr/lib/gcc/aarch64-linux-gnu/13/crtendS.o]
arg [/usr/lib/gcc/aarch64-linux-gnu/13/../../../aarch64-linux-gnu/crtn.o] ==> obj [/usr/lib/gcc/aarch64-linux-gnu/13/../../../aarch64-linux-gnu/crtn.o]
collapse obj [/usr/lib/gcc/aarch64-linux-gnu/13/../../../aarch64-linux-gnu/Scrt1.o] ==> [/usr/lib/aarch64-linux-gnu/Scrt1.o]
collapse obj [/usr/lib/gcc/aarch64-linux-gnu/13/../../../aarch64-linux-gnu/crti.o] ==> [/usr/lib/aarch64-linux-gnu/crti.o]
collapse obj [/usr/lib/gcc/aarch64-linux-gnu/13/../../../aarch64-linux-gnu/crtn.o] ==> [/usr/lib/aarch64-linux-gnu/crtn.o]
collapse library dir [/usr/lib/gcc/aarch64-linux-gnu/13] ==> [/usr/lib/gcc/aarch64-linux-gnu/13]
collapse library dir [/usr/lib/gcc/aarch64-linux-gnu/13/../../../aarch64-linux-gnu] ==> [/usr/lib/aarch64-linux-gnu]
collapse library dir [/usr/lib/gcc/aarch64-linux-gnu/13/../../../../lib] ==> [/usr/lib]
collapse library dir [/lib/aarch64-linux-gnu] ==> [/lib/aarch64-linux-gnu]
collapse library dir [/lib/../lib] ==> [/lib]
collapse library dir [/usr/lib/aarch64-linux-gnu] ==> [/usr/lib/aarch64-linux-gnu]
collapse library dir [/usr/lib/../lib] ==> [/usr/lib]
collapse library dir [/usr/lib/gcc/aarch64-linux-gnu/13/../../..] ==> [/usr/lib]
implicit libs: [stdc++;m;gcc_s;gcc;c;gcc_s;gcc]
implicit objs: [/usr/lib/aarch64-linux-gnu/Scrt1.o;/usr/lib/aarch64-linux-gnu/crti.o;/usr/lib/gcc/aarch64-linux-gnu/13/crtbeginS.o;/usr/lib/gcc/aarch64-linux-gnu/13/crtendS.o;/usr/lib/aarch64-linux-gnu/crtn.o]
implicit dirs: [/usr/lib/gcc/aarch64-linux-gnu/13;/usr/lib/aarch64-linux-gnu;/usr/lib;/lib/aarch64-linux-gnu;/lib]
implicit fwks: []
...
@@ -0,0 +1,16 @@
# CMAKE generated file: DO NOT EDIT!
# Generated by "Unix Makefiles" Generator, CMake Version 3.28
# Relative path conversion top directories.
set(CMAKE_RELATIVE_PATH_TOP_SOURCE "/opt/bytetrack-counter-cpp")
set(CMAKE_RELATIVE_PATH_TOP_BINARY "/opt/bytetrack-counter-cpp/build")
# Force unix paths in dependencies.
set(CMAKE_FORCE_UNIX_PATHS 1)
# The C and CXX include file regular expressions for this directory.
set(CMAKE_C_INCLUDE_REGEX_SCAN "^.*$")
set(CMAKE_C_INCLUDE_REGEX_COMPLAIN "^$")
set(CMAKE_CXX_INCLUDE_REGEX_SCAN ${CMAKE_C_INCLUDE_REGEX_SCAN})
set(CMAKE_CXX_INCLUDE_REGEX_COMPLAIN ${CMAKE_C_INCLUDE_REGEX_COMPLAIN})
+54
View File
@@ -0,0 +1,54 @@
# CMAKE generated file: DO NOT EDIT!
# Generated by "Unix Makefiles" Generator, CMake Version 3.28
# The generator used is:
set(CMAKE_DEPENDS_GENERATOR "Unix Makefiles")
# The top level Makefile was generated from the following files:
set(CMAKE_MAKEFILE_DEPENDS
"CMakeCache.txt"
"/opt/bytetrack-counter-cpp/CMakeLists.txt"
"CMakeFiles/3.28.3/CMakeCXXCompiler.cmake"
"CMakeFiles/3.28.3/CMakeSystem.cmake"
"/usr/lib/aarch64-linux-gnu/cmake/opencv4/OpenCVConfig-version.cmake"
"/usr/lib/aarch64-linux-gnu/cmake/opencv4/OpenCVConfig.cmake"
"/usr/lib/aarch64-linux-gnu/cmake/opencv4/OpenCVModules-release.cmake"
"/usr/lib/aarch64-linux-gnu/cmake/opencv4/OpenCVModules.cmake"
"/usr/share/cmake-3.28/Modules/CMakeCXXInformation.cmake"
"/usr/share/cmake-3.28/Modules/CMakeCommonLanguageInclude.cmake"
"/usr/share/cmake-3.28/Modules/CMakeGenericSystem.cmake"
"/usr/share/cmake-3.28/Modules/CMakeInitializeConfigs.cmake"
"/usr/share/cmake-3.28/Modules/CMakeLanguageInformation.cmake"
"/usr/share/cmake-3.28/Modules/CMakeSystemSpecificInformation.cmake"
"/usr/share/cmake-3.28/Modules/CMakeSystemSpecificInitialize.cmake"
"/usr/share/cmake-3.28/Modules/Compiler/CMakeCommonCompilerMacros.cmake"
"/usr/share/cmake-3.28/Modules/Compiler/GNU-CXX.cmake"
"/usr/share/cmake-3.28/Modules/Compiler/GNU.cmake"
"/usr/share/cmake-3.28/Modules/FindPackageHandleStandardArgs.cmake"
"/usr/share/cmake-3.28/Modules/FindPackageMessage.cmake"
"/usr/share/cmake-3.28/Modules/FindSQLite3.cmake"
"/usr/share/cmake-3.28/Modules/Platform/Linux-GNU-CXX.cmake"
"/usr/share/cmake-3.28/Modules/Platform/Linux-GNU.cmake"
"/usr/share/cmake-3.28/Modules/Platform/Linux-Initialize.cmake"
"/usr/share/cmake-3.28/Modules/Platform/Linux.cmake"
"/usr/share/cmake-3.28/Modules/Platform/UnixPaths.cmake"
"/usr/share/eigen3/cmake/Eigen3Config.cmake"
"/usr/share/eigen3/cmake/Eigen3ConfigVersion.cmake"
"/usr/share/eigen3/cmake/Eigen3Targets.cmake"
)
# The corresponding makefile is:
set(CMAKE_MAKEFILE_OUTPUTS
"Makefile"
"CMakeFiles/cmake.check_cache"
)
# Byproducts of CMake generate step:
set(CMAKE_MAKEFILE_PRODUCTS
"CMakeFiles/CMakeDirectoryInformation.cmake"
)
# Dependency information for all targets:
set(CMAKE_DEPEND_INFO_FILES
"CMakeFiles/bytetrack-counter.dir/DependInfo.cmake"
)
+112
View File
@@ -0,0 +1,112 @@
# CMAKE generated file: DO NOT EDIT!
# Generated by "Unix Makefiles" Generator, CMake Version 3.28
# Default target executed when no arguments are given to make.
default_target: all
.PHONY : default_target
#=============================================================================
# Special targets provided by cmake.
# Disable implicit rules so canonical targets will work.
.SUFFIXES:
# Disable VCS-based implicit rules.
% : %,v
# Disable VCS-based implicit rules.
% : RCS/%
# Disable VCS-based implicit rules.
% : RCS/%,v
# Disable VCS-based implicit rules.
% : SCCS/s.%
# Disable VCS-based implicit rules.
% : s.%
.SUFFIXES: .hpux_make_needs_suffix_list
# Command-line flag to silence nested $(MAKE).
$(VERBOSE)MAKESILENT = -s
#Suppress display of executed commands.
$(VERBOSE).SILENT:
# A target that is always out of date.
cmake_force:
.PHONY : cmake_force
#=============================================================================
# Set environment variables for the build.
# The shell in which to execute make rules.
SHELL = /bin/sh
# The CMake executable.
CMAKE_COMMAND = /usr/bin/cmake
# The command to remove a file.
RM = /usr/bin/cmake -E rm -f
# Escaping for special characters.
EQUALS = =
# The top-level source directory on which CMake was run.
CMAKE_SOURCE_DIR = /opt/bytetrack-counter-cpp
# The top-level build directory on which CMake was run.
CMAKE_BINARY_DIR = /opt/bytetrack-counter-cpp/build
#=============================================================================
# Directory level rules for the build root directory
# The main recursive "all" target.
all: CMakeFiles/bytetrack-counter.dir/all
.PHONY : all
# The main recursive "preinstall" target.
preinstall:
.PHONY : preinstall
# The main recursive "clean" target.
clean: CMakeFiles/bytetrack-counter.dir/clean
.PHONY : clean
#=============================================================================
# Target rules for target CMakeFiles/bytetrack-counter.dir
# All Build rule for target.
CMakeFiles/bytetrack-counter.dir/all:
$(MAKE) $(MAKESILENT) -f CMakeFiles/bytetrack-counter.dir/build.make CMakeFiles/bytetrack-counter.dir/depend
$(MAKE) $(MAKESILENT) -f CMakeFiles/bytetrack-counter.dir/build.make CMakeFiles/bytetrack-counter.dir/build
@$(CMAKE_COMMAND) -E cmake_echo_color "--switch=$(COLOR)" --progress-dir=/opt/bytetrack-counter-cpp/build/CMakeFiles --progress-num=1,2,3,4,5,6,7,8,9 "Built target bytetrack-counter"
.PHONY : CMakeFiles/bytetrack-counter.dir/all
# Build rule for subdir invocation for target.
CMakeFiles/bytetrack-counter.dir/rule: cmake_check_build_system
$(CMAKE_COMMAND) -E cmake_progress_start /opt/bytetrack-counter-cpp/build/CMakeFiles 9
$(MAKE) $(MAKESILENT) -f CMakeFiles/Makefile2 CMakeFiles/bytetrack-counter.dir/all
$(CMAKE_COMMAND) -E cmake_progress_start /opt/bytetrack-counter-cpp/build/CMakeFiles 0
.PHONY : CMakeFiles/bytetrack-counter.dir/rule
# Convenience name for target.
bytetrack-counter: CMakeFiles/bytetrack-counter.dir/rule
.PHONY : bytetrack-counter
# clean rule for target.
CMakeFiles/bytetrack-counter.dir/clean:
$(MAKE) $(MAKESILENT) -f CMakeFiles/bytetrack-counter.dir/build.make CMakeFiles/bytetrack-counter.dir/clean
.PHONY : CMakeFiles/bytetrack-counter.dir/clean
#=============================================================================
# Special targets to cleanup operation of make.
# Special rule to run CMake to check the build system integrity.
# No rule that depends on this can have commands that come from listfiles
# because they might be regenerated.
cmake_check_build_system:
$(CMAKE_COMMAND) -S$(CMAKE_SOURCE_DIR) -B$(CMAKE_BINARY_DIR) --check-build-system CMakeFiles/Makefile.cmake 0
.PHONY : cmake_check_build_system
+7
View File
@@ -0,0 +1,7 @@
/opt/bytetrack-counter-cpp/build/CMakeFiles/bytetrack-counter.dir
/opt/bytetrack-counter-cpp/build/CMakeFiles/edit_cache.dir
/opt/bytetrack-counter-cpp/build/CMakeFiles/rebuild_cache.dir
/opt/bytetrack-counter-cpp/build/CMakeFiles/list_install_components.dir
/opt/bytetrack-counter-cpp/build/CMakeFiles/install.dir
/opt/bytetrack-counter-cpp/build/CMakeFiles/install/local.dir
/opt/bytetrack-counter-cpp/build/CMakeFiles/install/strip.dir
@@ -0,0 +1,30 @@
# Consider dependencies only in project.
set(CMAKE_DEPENDS_IN_PROJECT_ONLY OFF)
# The set of languages for which implicit dependencies are needed:
set(CMAKE_DEPENDS_LANGUAGES
)
# The set of dependency files which are needed:
set(CMAKE_DEPENDS_DEPENDENCY_FILES
"/opt/bytetrack-counter-cpp/src/batch_store.cpp" "CMakeFiles/bytetrack-counter.dir/src/batch_store.cpp.o" "gcc" "CMakeFiles/bytetrack-counter.dir/src/batch_store.cpp.o.d"
"/opt/bytetrack-counter-cpp/src/bytetrack.cpp" "CMakeFiles/bytetrack-counter.dir/src/bytetrack.cpp.o" "gcc" "CMakeFiles/bytetrack-counter.dir/src/bytetrack.cpp.o.d"
"/opt/bytetrack-counter-cpp/src/config.cpp" "CMakeFiles/bytetrack-counter.dir/src/config.cpp.o" "gcc" "CMakeFiles/bytetrack-counter.dir/src/config.cpp.o.d"
"/opt/bytetrack-counter-cpp/src/csv_logger.cpp" "CMakeFiles/bytetrack-counter.dir/src/csv_logger.cpp.o" "gcc" "CMakeFiles/bytetrack-counter.dir/src/csv_logger.cpp.o.d"
"/opt/bytetrack-counter-cpp/src/drawing.cpp" "CMakeFiles/bytetrack-counter.dir/src/drawing.cpp.o" "gcc" "CMakeFiles/bytetrack-counter.dir/src/drawing.cpp.o.d"
"/opt/bytetrack-counter-cpp/src/kalman_filter.cpp" "CMakeFiles/bytetrack-counter.dir/src/kalman_filter.cpp.o" "gcc" "CMakeFiles/bytetrack-counter.dir/src/kalman_filter.cpp.o.d"
"/opt/bytetrack-counter-cpp/src/main.cpp" "CMakeFiles/bytetrack-counter.dir/src/main.cpp.o" "gcc" "CMakeFiles/bytetrack-counter.dir/src/main.cpp.o.d"
"/opt/bytetrack-counter-cpp/src/rknn_yolo.cpp" "CMakeFiles/bytetrack-counter.dir/src/rknn_yolo.cpp.o" "gcc" "CMakeFiles/bytetrack-counter.dir/src/rknn_yolo.cpp.o.d"
)
# Targets to which this target links which contain Fortran sources.
set(CMAKE_Fortran_TARGET_LINKED_INFO_FILES
)
# Targets to which this target links which contain Fortran sources.
set(CMAKE_Fortran_TARGET_FORWARD_LINKED_INFO_FILES
)
# Fortran module output directory.
set(CMAKE_Fortran_TARGET_MODULE_DIR "")
@@ -0,0 +1,229 @@
# CMAKE generated file: DO NOT EDIT!
# Generated by "Unix Makefiles" Generator, CMake Version 3.28
# Delete rule output on recipe failure.
.DELETE_ON_ERROR:
#=============================================================================
# Special targets provided by cmake.
# Disable implicit rules so canonical targets will work.
.SUFFIXES:
# Disable VCS-based implicit rules.
% : %,v
# Disable VCS-based implicit rules.
% : RCS/%
# Disable VCS-based implicit rules.
% : RCS/%,v
# Disable VCS-based implicit rules.
% : SCCS/s.%
# Disable VCS-based implicit rules.
% : s.%
.SUFFIXES: .hpux_make_needs_suffix_list
# Command-line flag to silence nested $(MAKE).
$(VERBOSE)MAKESILENT = -s
#Suppress display of executed commands.
$(VERBOSE).SILENT:
# A target that is always out of date.
cmake_force:
.PHONY : cmake_force
#=============================================================================
# Set environment variables for the build.
# The shell in which to execute make rules.
SHELL = /bin/sh
# The CMake executable.
CMAKE_COMMAND = /usr/bin/cmake
# The command to remove a file.
RM = /usr/bin/cmake -E rm -f
# Escaping for special characters.
EQUALS = =
# The top-level source directory on which CMake was run.
CMAKE_SOURCE_DIR = /opt/bytetrack-counter-cpp
# The top-level build directory on which CMake was run.
CMAKE_BINARY_DIR = /opt/bytetrack-counter-cpp/build
# Include any dependencies generated for this target.
include CMakeFiles/bytetrack-counter.dir/depend.make
# Include any dependencies generated by the compiler for this target.
include CMakeFiles/bytetrack-counter.dir/compiler_depend.make
# Include the progress variables for this target.
include CMakeFiles/bytetrack-counter.dir/progress.make
# Include the compile flags for this target's objects.
include CMakeFiles/bytetrack-counter.dir/flags.make
CMakeFiles/bytetrack-counter.dir/src/main.cpp.o: CMakeFiles/bytetrack-counter.dir/flags.make
CMakeFiles/bytetrack-counter.dir/src/main.cpp.o: /opt/bytetrack-counter-cpp/src/main.cpp
CMakeFiles/bytetrack-counter.dir/src/main.cpp.o: CMakeFiles/bytetrack-counter.dir/compiler_depend.ts
@$(CMAKE_COMMAND) -E cmake_echo_color "--switch=$(COLOR)" --green --progress-dir=/opt/bytetrack-counter-cpp/build/CMakeFiles --progress-num=$(CMAKE_PROGRESS_1) "Building CXX object CMakeFiles/bytetrack-counter.dir/src/main.cpp.o"
/usr/bin/c++ $(CXX_DEFINES) $(CXX_INCLUDES) $(CXX_FLAGS) -MD -MT CMakeFiles/bytetrack-counter.dir/src/main.cpp.o -MF CMakeFiles/bytetrack-counter.dir/src/main.cpp.o.d -o CMakeFiles/bytetrack-counter.dir/src/main.cpp.o -c /opt/bytetrack-counter-cpp/src/main.cpp
CMakeFiles/bytetrack-counter.dir/src/main.cpp.i: cmake_force
@$(CMAKE_COMMAND) -E cmake_echo_color "--switch=$(COLOR)" --green "Preprocessing CXX source to CMakeFiles/bytetrack-counter.dir/src/main.cpp.i"
/usr/bin/c++ $(CXX_DEFINES) $(CXX_INCLUDES) $(CXX_FLAGS) -E /opt/bytetrack-counter-cpp/src/main.cpp > CMakeFiles/bytetrack-counter.dir/src/main.cpp.i
CMakeFiles/bytetrack-counter.dir/src/main.cpp.s: cmake_force
@$(CMAKE_COMMAND) -E cmake_echo_color "--switch=$(COLOR)" --green "Compiling CXX source to assembly CMakeFiles/bytetrack-counter.dir/src/main.cpp.s"
/usr/bin/c++ $(CXX_DEFINES) $(CXX_INCLUDES) $(CXX_FLAGS) -S /opt/bytetrack-counter-cpp/src/main.cpp -o CMakeFiles/bytetrack-counter.dir/src/main.cpp.s
CMakeFiles/bytetrack-counter.dir/src/kalman_filter.cpp.o: CMakeFiles/bytetrack-counter.dir/flags.make
CMakeFiles/bytetrack-counter.dir/src/kalman_filter.cpp.o: /opt/bytetrack-counter-cpp/src/kalman_filter.cpp
CMakeFiles/bytetrack-counter.dir/src/kalman_filter.cpp.o: CMakeFiles/bytetrack-counter.dir/compiler_depend.ts
@$(CMAKE_COMMAND) -E cmake_echo_color "--switch=$(COLOR)" --green --progress-dir=/opt/bytetrack-counter-cpp/build/CMakeFiles --progress-num=$(CMAKE_PROGRESS_2) "Building CXX object CMakeFiles/bytetrack-counter.dir/src/kalman_filter.cpp.o"
/usr/bin/c++ $(CXX_DEFINES) $(CXX_INCLUDES) $(CXX_FLAGS) -MD -MT CMakeFiles/bytetrack-counter.dir/src/kalman_filter.cpp.o -MF CMakeFiles/bytetrack-counter.dir/src/kalman_filter.cpp.o.d -o CMakeFiles/bytetrack-counter.dir/src/kalman_filter.cpp.o -c /opt/bytetrack-counter-cpp/src/kalman_filter.cpp
CMakeFiles/bytetrack-counter.dir/src/kalman_filter.cpp.i: cmake_force
@$(CMAKE_COMMAND) -E cmake_echo_color "--switch=$(COLOR)" --green "Preprocessing CXX source to CMakeFiles/bytetrack-counter.dir/src/kalman_filter.cpp.i"
/usr/bin/c++ $(CXX_DEFINES) $(CXX_INCLUDES) $(CXX_FLAGS) -E /opt/bytetrack-counter-cpp/src/kalman_filter.cpp > CMakeFiles/bytetrack-counter.dir/src/kalman_filter.cpp.i
CMakeFiles/bytetrack-counter.dir/src/kalman_filter.cpp.s: cmake_force
@$(CMAKE_COMMAND) -E cmake_echo_color "--switch=$(COLOR)" --green "Compiling CXX source to assembly CMakeFiles/bytetrack-counter.dir/src/kalman_filter.cpp.s"
/usr/bin/c++ $(CXX_DEFINES) $(CXX_INCLUDES) $(CXX_FLAGS) -S /opt/bytetrack-counter-cpp/src/kalman_filter.cpp -o CMakeFiles/bytetrack-counter.dir/src/kalman_filter.cpp.s
CMakeFiles/bytetrack-counter.dir/src/bytetrack.cpp.o: CMakeFiles/bytetrack-counter.dir/flags.make
CMakeFiles/bytetrack-counter.dir/src/bytetrack.cpp.o: /opt/bytetrack-counter-cpp/src/bytetrack.cpp
CMakeFiles/bytetrack-counter.dir/src/bytetrack.cpp.o: CMakeFiles/bytetrack-counter.dir/compiler_depend.ts
@$(CMAKE_COMMAND) -E cmake_echo_color "--switch=$(COLOR)" --green --progress-dir=/opt/bytetrack-counter-cpp/build/CMakeFiles --progress-num=$(CMAKE_PROGRESS_3) "Building CXX object CMakeFiles/bytetrack-counter.dir/src/bytetrack.cpp.o"
/usr/bin/c++ $(CXX_DEFINES) $(CXX_INCLUDES) $(CXX_FLAGS) -MD -MT CMakeFiles/bytetrack-counter.dir/src/bytetrack.cpp.o -MF CMakeFiles/bytetrack-counter.dir/src/bytetrack.cpp.o.d -o CMakeFiles/bytetrack-counter.dir/src/bytetrack.cpp.o -c /opt/bytetrack-counter-cpp/src/bytetrack.cpp
CMakeFiles/bytetrack-counter.dir/src/bytetrack.cpp.i: cmake_force
@$(CMAKE_COMMAND) -E cmake_echo_color "--switch=$(COLOR)" --green "Preprocessing CXX source to CMakeFiles/bytetrack-counter.dir/src/bytetrack.cpp.i"
/usr/bin/c++ $(CXX_DEFINES) $(CXX_INCLUDES) $(CXX_FLAGS) -E /opt/bytetrack-counter-cpp/src/bytetrack.cpp > CMakeFiles/bytetrack-counter.dir/src/bytetrack.cpp.i
CMakeFiles/bytetrack-counter.dir/src/bytetrack.cpp.s: cmake_force
@$(CMAKE_COMMAND) -E cmake_echo_color "--switch=$(COLOR)" --green "Compiling CXX source to assembly CMakeFiles/bytetrack-counter.dir/src/bytetrack.cpp.s"
/usr/bin/c++ $(CXX_DEFINES) $(CXX_INCLUDES) $(CXX_FLAGS) -S /opt/bytetrack-counter-cpp/src/bytetrack.cpp -o CMakeFiles/bytetrack-counter.dir/src/bytetrack.cpp.s
CMakeFiles/bytetrack-counter.dir/src/batch_store.cpp.o: CMakeFiles/bytetrack-counter.dir/flags.make
CMakeFiles/bytetrack-counter.dir/src/batch_store.cpp.o: /opt/bytetrack-counter-cpp/src/batch_store.cpp
CMakeFiles/bytetrack-counter.dir/src/batch_store.cpp.o: CMakeFiles/bytetrack-counter.dir/compiler_depend.ts
@$(CMAKE_COMMAND) -E cmake_echo_color "--switch=$(COLOR)" --green --progress-dir=/opt/bytetrack-counter-cpp/build/CMakeFiles --progress-num=$(CMAKE_PROGRESS_4) "Building CXX object CMakeFiles/bytetrack-counter.dir/src/batch_store.cpp.o"
/usr/bin/c++ $(CXX_DEFINES) $(CXX_INCLUDES) $(CXX_FLAGS) -MD -MT CMakeFiles/bytetrack-counter.dir/src/batch_store.cpp.o -MF CMakeFiles/bytetrack-counter.dir/src/batch_store.cpp.o.d -o CMakeFiles/bytetrack-counter.dir/src/batch_store.cpp.o -c /opt/bytetrack-counter-cpp/src/batch_store.cpp
CMakeFiles/bytetrack-counter.dir/src/batch_store.cpp.i: cmake_force
@$(CMAKE_COMMAND) -E cmake_echo_color "--switch=$(COLOR)" --green "Preprocessing CXX source to CMakeFiles/bytetrack-counter.dir/src/batch_store.cpp.i"
/usr/bin/c++ $(CXX_DEFINES) $(CXX_INCLUDES) $(CXX_FLAGS) -E /opt/bytetrack-counter-cpp/src/batch_store.cpp > CMakeFiles/bytetrack-counter.dir/src/batch_store.cpp.i
CMakeFiles/bytetrack-counter.dir/src/batch_store.cpp.s: cmake_force
@$(CMAKE_COMMAND) -E cmake_echo_color "--switch=$(COLOR)" --green "Compiling CXX source to assembly CMakeFiles/bytetrack-counter.dir/src/batch_store.cpp.s"
/usr/bin/c++ $(CXX_DEFINES) $(CXX_INCLUDES) $(CXX_FLAGS) -S /opt/bytetrack-counter-cpp/src/batch_store.cpp -o CMakeFiles/bytetrack-counter.dir/src/batch_store.cpp.s
CMakeFiles/bytetrack-counter.dir/src/csv_logger.cpp.o: CMakeFiles/bytetrack-counter.dir/flags.make
CMakeFiles/bytetrack-counter.dir/src/csv_logger.cpp.o: /opt/bytetrack-counter-cpp/src/csv_logger.cpp
CMakeFiles/bytetrack-counter.dir/src/csv_logger.cpp.o: CMakeFiles/bytetrack-counter.dir/compiler_depend.ts
@$(CMAKE_COMMAND) -E cmake_echo_color "--switch=$(COLOR)" --green --progress-dir=/opt/bytetrack-counter-cpp/build/CMakeFiles --progress-num=$(CMAKE_PROGRESS_5) "Building CXX object CMakeFiles/bytetrack-counter.dir/src/csv_logger.cpp.o"
/usr/bin/c++ $(CXX_DEFINES) $(CXX_INCLUDES) $(CXX_FLAGS) -MD -MT CMakeFiles/bytetrack-counter.dir/src/csv_logger.cpp.o -MF CMakeFiles/bytetrack-counter.dir/src/csv_logger.cpp.o.d -o CMakeFiles/bytetrack-counter.dir/src/csv_logger.cpp.o -c /opt/bytetrack-counter-cpp/src/csv_logger.cpp
CMakeFiles/bytetrack-counter.dir/src/csv_logger.cpp.i: cmake_force
@$(CMAKE_COMMAND) -E cmake_echo_color "--switch=$(COLOR)" --green "Preprocessing CXX source to CMakeFiles/bytetrack-counter.dir/src/csv_logger.cpp.i"
/usr/bin/c++ $(CXX_DEFINES) $(CXX_INCLUDES) $(CXX_FLAGS) -E /opt/bytetrack-counter-cpp/src/csv_logger.cpp > CMakeFiles/bytetrack-counter.dir/src/csv_logger.cpp.i
CMakeFiles/bytetrack-counter.dir/src/csv_logger.cpp.s: cmake_force
@$(CMAKE_COMMAND) -E cmake_echo_color "--switch=$(COLOR)" --green "Compiling CXX source to assembly CMakeFiles/bytetrack-counter.dir/src/csv_logger.cpp.s"
/usr/bin/c++ $(CXX_DEFINES) $(CXX_INCLUDES) $(CXX_FLAGS) -S /opt/bytetrack-counter-cpp/src/csv_logger.cpp -o CMakeFiles/bytetrack-counter.dir/src/csv_logger.cpp.s
CMakeFiles/bytetrack-counter.dir/src/rknn_yolo.cpp.o: CMakeFiles/bytetrack-counter.dir/flags.make
CMakeFiles/bytetrack-counter.dir/src/rknn_yolo.cpp.o: /opt/bytetrack-counter-cpp/src/rknn_yolo.cpp
CMakeFiles/bytetrack-counter.dir/src/rknn_yolo.cpp.o: CMakeFiles/bytetrack-counter.dir/compiler_depend.ts
@$(CMAKE_COMMAND) -E cmake_echo_color "--switch=$(COLOR)" --green --progress-dir=/opt/bytetrack-counter-cpp/build/CMakeFiles --progress-num=$(CMAKE_PROGRESS_6) "Building CXX object CMakeFiles/bytetrack-counter.dir/src/rknn_yolo.cpp.o"
/usr/bin/c++ $(CXX_DEFINES) $(CXX_INCLUDES) $(CXX_FLAGS) -MD -MT CMakeFiles/bytetrack-counter.dir/src/rknn_yolo.cpp.o -MF CMakeFiles/bytetrack-counter.dir/src/rknn_yolo.cpp.o.d -o CMakeFiles/bytetrack-counter.dir/src/rknn_yolo.cpp.o -c /opt/bytetrack-counter-cpp/src/rknn_yolo.cpp
CMakeFiles/bytetrack-counter.dir/src/rknn_yolo.cpp.i: cmake_force
@$(CMAKE_COMMAND) -E cmake_echo_color "--switch=$(COLOR)" --green "Preprocessing CXX source to CMakeFiles/bytetrack-counter.dir/src/rknn_yolo.cpp.i"
/usr/bin/c++ $(CXX_DEFINES) $(CXX_INCLUDES) $(CXX_FLAGS) -E /opt/bytetrack-counter-cpp/src/rknn_yolo.cpp > CMakeFiles/bytetrack-counter.dir/src/rknn_yolo.cpp.i
CMakeFiles/bytetrack-counter.dir/src/rknn_yolo.cpp.s: cmake_force
@$(CMAKE_COMMAND) -E cmake_echo_color "--switch=$(COLOR)" --green "Compiling CXX source to assembly CMakeFiles/bytetrack-counter.dir/src/rknn_yolo.cpp.s"
/usr/bin/c++ $(CXX_DEFINES) $(CXX_INCLUDES) $(CXX_FLAGS) -S /opt/bytetrack-counter-cpp/src/rknn_yolo.cpp -o CMakeFiles/bytetrack-counter.dir/src/rknn_yolo.cpp.s
CMakeFiles/bytetrack-counter.dir/src/config.cpp.o: CMakeFiles/bytetrack-counter.dir/flags.make
CMakeFiles/bytetrack-counter.dir/src/config.cpp.o: /opt/bytetrack-counter-cpp/src/config.cpp
CMakeFiles/bytetrack-counter.dir/src/config.cpp.o: CMakeFiles/bytetrack-counter.dir/compiler_depend.ts
@$(CMAKE_COMMAND) -E cmake_echo_color "--switch=$(COLOR)" --green --progress-dir=/opt/bytetrack-counter-cpp/build/CMakeFiles --progress-num=$(CMAKE_PROGRESS_7) "Building CXX object CMakeFiles/bytetrack-counter.dir/src/config.cpp.o"
/usr/bin/c++ $(CXX_DEFINES) $(CXX_INCLUDES) $(CXX_FLAGS) -MD -MT CMakeFiles/bytetrack-counter.dir/src/config.cpp.o -MF CMakeFiles/bytetrack-counter.dir/src/config.cpp.o.d -o CMakeFiles/bytetrack-counter.dir/src/config.cpp.o -c /opt/bytetrack-counter-cpp/src/config.cpp
CMakeFiles/bytetrack-counter.dir/src/config.cpp.i: cmake_force
@$(CMAKE_COMMAND) -E cmake_echo_color "--switch=$(COLOR)" --green "Preprocessing CXX source to CMakeFiles/bytetrack-counter.dir/src/config.cpp.i"
/usr/bin/c++ $(CXX_DEFINES) $(CXX_INCLUDES) $(CXX_FLAGS) -E /opt/bytetrack-counter-cpp/src/config.cpp > CMakeFiles/bytetrack-counter.dir/src/config.cpp.i
CMakeFiles/bytetrack-counter.dir/src/config.cpp.s: cmake_force
@$(CMAKE_COMMAND) -E cmake_echo_color "--switch=$(COLOR)" --green "Compiling CXX source to assembly CMakeFiles/bytetrack-counter.dir/src/config.cpp.s"
/usr/bin/c++ $(CXX_DEFINES) $(CXX_INCLUDES) $(CXX_FLAGS) -S /opt/bytetrack-counter-cpp/src/config.cpp -o CMakeFiles/bytetrack-counter.dir/src/config.cpp.s
CMakeFiles/bytetrack-counter.dir/src/drawing.cpp.o: CMakeFiles/bytetrack-counter.dir/flags.make
CMakeFiles/bytetrack-counter.dir/src/drawing.cpp.o: /opt/bytetrack-counter-cpp/src/drawing.cpp
CMakeFiles/bytetrack-counter.dir/src/drawing.cpp.o: CMakeFiles/bytetrack-counter.dir/compiler_depend.ts
@$(CMAKE_COMMAND) -E cmake_echo_color "--switch=$(COLOR)" --green --progress-dir=/opt/bytetrack-counter-cpp/build/CMakeFiles --progress-num=$(CMAKE_PROGRESS_8) "Building CXX object CMakeFiles/bytetrack-counter.dir/src/drawing.cpp.o"
/usr/bin/c++ $(CXX_DEFINES) $(CXX_INCLUDES) $(CXX_FLAGS) -MD -MT CMakeFiles/bytetrack-counter.dir/src/drawing.cpp.o -MF CMakeFiles/bytetrack-counter.dir/src/drawing.cpp.o.d -o CMakeFiles/bytetrack-counter.dir/src/drawing.cpp.o -c /opt/bytetrack-counter-cpp/src/drawing.cpp
CMakeFiles/bytetrack-counter.dir/src/drawing.cpp.i: cmake_force
@$(CMAKE_COMMAND) -E cmake_echo_color "--switch=$(COLOR)" --green "Preprocessing CXX source to CMakeFiles/bytetrack-counter.dir/src/drawing.cpp.i"
/usr/bin/c++ $(CXX_DEFINES) $(CXX_INCLUDES) $(CXX_FLAGS) -E /opt/bytetrack-counter-cpp/src/drawing.cpp > CMakeFiles/bytetrack-counter.dir/src/drawing.cpp.i
CMakeFiles/bytetrack-counter.dir/src/drawing.cpp.s: cmake_force
@$(CMAKE_COMMAND) -E cmake_echo_color "--switch=$(COLOR)" --green "Compiling CXX source to assembly CMakeFiles/bytetrack-counter.dir/src/drawing.cpp.s"
/usr/bin/c++ $(CXX_DEFINES) $(CXX_INCLUDES) $(CXX_FLAGS) -S /opt/bytetrack-counter-cpp/src/drawing.cpp -o CMakeFiles/bytetrack-counter.dir/src/drawing.cpp.s
# Object files for target bytetrack-counter
bytetrack__counter_OBJECTS = \
"CMakeFiles/bytetrack-counter.dir/src/main.cpp.o" \
"CMakeFiles/bytetrack-counter.dir/src/kalman_filter.cpp.o" \
"CMakeFiles/bytetrack-counter.dir/src/bytetrack.cpp.o" \
"CMakeFiles/bytetrack-counter.dir/src/batch_store.cpp.o" \
"CMakeFiles/bytetrack-counter.dir/src/csv_logger.cpp.o" \
"CMakeFiles/bytetrack-counter.dir/src/rknn_yolo.cpp.o" \
"CMakeFiles/bytetrack-counter.dir/src/config.cpp.o" \
"CMakeFiles/bytetrack-counter.dir/src/drawing.cpp.o"
# External object files for target bytetrack-counter
bytetrack__counter_EXTERNAL_OBJECTS =
bytetrack-counter: CMakeFiles/bytetrack-counter.dir/src/main.cpp.o
bytetrack-counter: CMakeFiles/bytetrack-counter.dir/src/kalman_filter.cpp.o
bytetrack-counter: CMakeFiles/bytetrack-counter.dir/src/bytetrack.cpp.o
bytetrack-counter: CMakeFiles/bytetrack-counter.dir/src/batch_store.cpp.o
bytetrack-counter: CMakeFiles/bytetrack-counter.dir/src/csv_logger.cpp.o
bytetrack-counter: CMakeFiles/bytetrack-counter.dir/src/rknn_yolo.cpp.o
bytetrack-counter: CMakeFiles/bytetrack-counter.dir/src/config.cpp.o
bytetrack-counter: CMakeFiles/bytetrack-counter.dir/src/drawing.cpp.o
bytetrack-counter: CMakeFiles/bytetrack-counter.dir/build.make
bytetrack-counter: /usr/lib/aarch64-linux-gnu/libopencv_highgui.so.4.6.0
bytetrack-counter: /usr/lib/aarch64-linux-gnu/libsqlite3.so
bytetrack-counter: /usr/lib/librknnrt.so
bytetrack-counter: /usr/lib/aarch64-linux-gnu/libopencv_videoio.so.4.6.0
bytetrack-counter: /usr/lib/aarch64-linux-gnu/libopencv_imgcodecs.so.4.6.0
bytetrack-counter: /usr/lib/aarch64-linux-gnu/libopencv_imgproc.so.4.6.0
bytetrack-counter: /usr/lib/aarch64-linux-gnu/libopencv_core.so.4.6.0
bytetrack-counter: CMakeFiles/bytetrack-counter.dir/link.txt
@$(CMAKE_COMMAND) -E cmake_echo_color "--switch=$(COLOR)" --green --bold --progress-dir=/opt/bytetrack-counter-cpp/build/CMakeFiles --progress-num=$(CMAKE_PROGRESS_9) "Linking CXX executable bytetrack-counter"
$(CMAKE_COMMAND) -E cmake_link_script CMakeFiles/bytetrack-counter.dir/link.txt --verbose=$(VERBOSE)
# Rule to build all files generated by this target.
CMakeFiles/bytetrack-counter.dir/build: bytetrack-counter
.PHONY : CMakeFiles/bytetrack-counter.dir/build
CMakeFiles/bytetrack-counter.dir/clean:
$(CMAKE_COMMAND) -P CMakeFiles/bytetrack-counter.dir/cmake_clean.cmake
.PHONY : CMakeFiles/bytetrack-counter.dir/clean
CMakeFiles/bytetrack-counter.dir/depend:
cd /opt/bytetrack-counter-cpp/build && $(CMAKE_COMMAND) -E cmake_depends "Unix Makefiles" /opt/bytetrack-counter-cpp /opt/bytetrack-counter-cpp /opt/bytetrack-counter-cpp/build /opt/bytetrack-counter-cpp/build /opt/bytetrack-counter-cpp/build/CMakeFiles/bytetrack-counter.dir/DependInfo.cmake "--color=$(COLOR)"
.PHONY : CMakeFiles/bytetrack-counter.dir/depend
@@ -0,0 +1,25 @@
file(REMOVE_RECURSE
"CMakeFiles/bytetrack-counter.dir/src/batch_store.cpp.o"
"CMakeFiles/bytetrack-counter.dir/src/batch_store.cpp.o.d"
"CMakeFiles/bytetrack-counter.dir/src/bytetrack.cpp.o"
"CMakeFiles/bytetrack-counter.dir/src/bytetrack.cpp.o.d"
"CMakeFiles/bytetrack-counter.dir/src/config.cpp.o"
"CMakeFiles/bytetrack-counter.dir/src/config.cpp.o.d"
"CMakeFiles/bytetrack-counter.dir/src/csv_logger.cpp.o"
"CMakeFiles/bytetrack-counter.dir/src/csv_logger.cpp.o.d"
"CMakeFiles/bytetrack-counter.dir/src/drawing.cpp.o"
"CMakeFiles/bytetrack-counter.dir/src/drawing.cpp.o.d"
"CMakeFiles/bytetrack-counter.dir/src/kalman_filter.cpp.o"
"CMakeFiles/bytetrack-counter.dir/src/kalman_filter.cpp.o.d"
"CMakeFiles/bytetrack-counter.dir/src/main.cpp.o"
"CMakeFiles/bytetrack-counter.dir/src/main.cpp.o.d"
"CMakeFiles/bytetrack-counter.dir/src/rknn_yolo.cpp.o"
"CMakeFiles/bytetrack-counter.dir/src/rknn_yolo.cpp.o.d"
"bytetrack-counter"
"bytetrack-counter.pdb"
)
# Per-language clean rules from dependency scanning.
foreach(lang CXX)
include(CMakeFiles/bytetrack-counter.dir/cmake_clean_${lang}.cmake OPTIONAL)
endforeach()
File diff suppressed because it is too large. Load diff
File diff suppressed because it is too large. Load diff
@@ -0,0 +1,2 @@
# CMAKE generated file: DO NOT EDIT!
# Timestamp file for compiler generated dependencies management for bytetrack-counter.
@@ -0,0 +1,2 @@
# Empty dependencies file for bytetrack-counter.
# This may be replaced when dependencies are built.
@@ -0,0 +1,10 @@
# CMAKE generated file: DO NOT EDIT!
# Generated by "Unix Makefiles" Generator, CMake Version 3.28
# compile CXX with /usr/bin/c++
CXX_DEFINES = -DHAS_RKNN
CXX_INCLUDES = -I/usr/local/include/rknn -I/usr/include/eigen3 -I/opt/bytetrack-counter-cpp/src -isystem /usr/include/opencv4
CXX_FLAGS = -std=c++17
@@ -0,0 +1 @@
/usr/bin/c++ "CMakeFiles/bytetrack-counter.dir/src/main.cpp.o" "CMakeFiles/bytetrack-counter.dir/src/kalman_filter.cpp.o" "CMakeFiles/bytetrack-counter.dir/src/bytetrack.cpp.o" "CMakeFiles/bytetrack-counter.dir/src/batch_store.cpp.o" "CMakeFiles/bytetrack-counter.dir/src/csv_logger.cpp.o" "CMakeFiles/bytetrack-counter.dir/src/rknn_yolo.cpp.o" "CMakeFiles/bytetrack-counter.dir/src/config.cpp.o" "CMakeFiles/bytetrack-counter.dir/src/drawing.cpp.o" -o bytetrack-counter /usr/lib/aarch64-linux-gnu/libopencv_highgui.so.4.6.0 /usr/lib/aarch64-linux-gnu/libsqlite3.so -lpthread /usr/lib/librknnrt.so /usr/lib/aarch64-linux-gnu/libopencv_videoio.so.4.6.0 /usr/lib/aarch64-linux-gnu/libopencv_imgcodecs.so.4.6.0 /usr/lib/aarch64-linux-gnu/libopencv_imgproc.so.4.6.0 /usr/lib/aarch64-linux-gnu/libopencv_core.so.4.6.0
@@ -0,0 +1,10 @@
CMAKE_PROGRESS_1 = 1
CMAKE_PROGRESS_2 = 2
CMAKE_PROGRESS_3 = 3
CMAKE_PROGRESS_4 = 4
CMAKE_PROGRESS_5 = 5
CMAKE_PROGRESS_6 = 6
CMAKE_PROGRESS_7 = 7
CMAKE_PROGRESS_8 = 8
CMAKE_PROGRESS_9 = 9
+1
View File
@@ -0,0 +1 @@
# This file is generated by cmake for dependency checking of the CMakeCache.txt file
+1
View File
@@ -0,0 +1 @@
9
+419
View File
@@ -0,0 +1,419 @@
# CMAKE generated file: DO NOT EDIT!
# Generated by "Unix Makefiles" Generator, CMake Version 3.28
# Default target executed when no arguments are given to make.
default_target: all
.PHONY : default_target
# Allow only one "make -f Makefile2" at a time, but pass parallelism.
.NOTPARALLEL:
#=============================================================================
# Special targets provided by cmake.
# Disable implicit rules so canonical targets will work.
.SUFFIXES:
# Disable VCS-based implicit rules.
% : %,v
# Disable VCS-based implicit rules.
% : RCS/%
# Disable VCS-based implicit rules.
% : RCS/%,v
# Disable VCS-based implicit rules.
% : SCCS/s.%
# Disable VCS-based implicit rules.
% : s.%
.SUFFIXES: .hpux_make_needs_suffix_list
# Command-line flag to silence nested $(MAKE).
$(VERBOSE)MAKESILENT = -s
#Suppress display of executed commands.
$(VERBOSE).SILENT:
# A target that is always out of date.
cmake_force:
.PHONY : cmake_force
#=============================================================================
# Set environment variables for the build.
# The shell in which to execute make rules.
SHELL = /bin/sh
# The CMake executable.
CMAKE_COMMAND = /usr/bin/cmake
# The command to remove a file.
RM = /usr/bin/cmake -E rm -f
# Escaping for special characters.
EQUALS = =
# The top-level source directory on which CMake was run.
CMAKE_SOURCE_DIR = /opt/bytetrack-counter-cpp
# The top-level build directory on which CMake was run.
CMAKE_BINARY_DIR = /opt/bytetrack-counter-cpp/build
#=============================================================================
# Targets provided globally by CMake.
# Special rule for the target edit_cache
edit_cache:
@$(CMAKE_COMMAND) -E cmake_echo_color "--switch=$(COLOR)" --cyan "No interactive CMake dialog available..."
/usr/bin/cmake -E echo No\ interactive\ CMake\ dialog\ available.
.PHONY : edit_cache
# Special rule for the target edit_cache
edit_cache/fast: edit_cache
.PHONY : edit_cache/fast
# Special rule for the target rebuild_cache
rebuild_cache:
@$(CMAKE_COMMAND) -E cmake_echo_color "--switch=$(COLOR)" --cyan "Running CMake to regenerate build system..."
/usr/bin/cmake --regenerate-during-build -S$(CMAKE_SOURCE_DIR) -B$(CMAKE_BINARY_DIR)
.PHONY : rebuild_cache
# Special rule for the target rebuild_cache
rebuild_cache/fast: rebuild_cache
.PHONY : rebuild_cache/fast
# Special rule for the target list_install_components
list_install_components:
@$(CMAKE_COMMAND) -E cmake_echo_color "--switch=$(COLOR)" --cyan "Available install components are: \"Unspecified\""
.PHONY : list_install_components
# Special rule for the target list_install_components
list_install_components/fast: list_install_components
.PHONY : list_install_components/fast
# Special rule for the target install
install: preinstall
@$(CMAKE_COMMAND) -E cmake_echo_color "--switch=$(COLOR)" --cyan "Install the project..."
/usr/bin/cmake -P cmake_install.cmake
.PHONY : install
# Special rule for the target install
install/fast: preinstall/fast
@$(CMAKE_COMMAND) -E cmake_echo_color "--switch=$(COLOR)" --cyan "Install the project..."
/usr/bin/cmake -P cmake_install.cmake
.PHONY : install/fast
# Special rule for the target install/local
install/local: preinstall
@$(CMAKE_COMMAND) -E cmake_echo_color "--switch=$(COLOR)" --cyan "Installing only the local directory..."
/usr/bin/cmake -DCMAKE_INSTALL_LOCAL_ONLY=1 -P cmake_install.cmake
.PHONY : install/local
# Special rule for the target install/local
install/local/fast: preinstall/fast
@$(CMAKE_COMMAND) -E cmake_echo_color "--switch=$(COLOR)" --cyan "Installing only the local directory..."
/usr/bin/cmake -DCMAKE_INSTALL_LOCAL_ONLY=1 -P cmake_install.cmake
.PHONY : install/local/fast
# Special rule for the target install/strip
install/strip: preinstall
@$(CMAKE_COMMAND) -E cmake_echo_color "--switch=$(COLOR)" --cyan "Installing the project stripped..."
/usr/bin/cmake -DCMAKE_INSTALL_DO_STRIP=1 -P cmake_install.cmake
.PHONY : install/strip
# Special rule for the target install/strip
install/strip/fast: preinstall/fast
@$(CMAKE_COMMAND) -E cmake_echo_color "--switch=$(COLOR)" --cyan "Installing the project stripped..."
/usr/bin/cmake -DCMAKE_INSTALL_DO_STRIP=1 -P cmake_install.cmake
.PHONY : install/strip/fast
# The main all target
all: cmake_check_build_system
$(CMAKE_COMMAND) -E cmake_progress_start /opt/bytetrack-counter-cpp/build/CMakeFiles /opt/bytetrack-counter-cpp/build//CMakeFiles/progress.marks
$(MAKE) $(MAKESILENT) -f CMakeFiles/Makefile2 all
$(CMAKE_COMMAND) -E cmake_progress_start /opt/bytetrack-counter-cpp/build/CMakeFiles 0
.PHONY : all
# The main clean target
clean:
$(MAKE) $(MAKESILENT) -f CMakeFiles/Makefile2 clean
.PHONY : clean
# The main clean target
clean/fast: clean
.PHONY : clean/fast
# Prepare targets for installation.
preinstall: all
$(MAKE) $(MAKESILENT) -f CMakeFiles/Makefile2 preinstall
.PHONY : preinstall
# Prepare targets for installation.
preinstall/fast:
$(MAKE) $(MAKESILENT) -f CMakeFiles/Makefile2 preinstall
.PHONY : preinstall/fast
# clear depends
depend:
$(CMAKE_COMMAND) -S$(CMAKE_SOURCE_DIR) -B$(CMAKE_BINARY_DIR) --check-build-system CMakeFiles/Makefile.cmake 1
.PHONY : depend
#=============================================================================
# Target rules for targets named bytetrack-counter
# Build rule for target.
bytetrack-counter: cmake_check_build_system
$(MAKE) $(MAKESILENT) -f CMakeFiles/Makefile2 bytetrack-counter
.PHONY : bytetrack-counter
# fast build rule for target.
bytetrack-counter/fast:
$(MAKE) $(MAKESILENT) -f CMakeFiles/bytetrack-counter.dir/build.make CMakeFiles/bytetrack-counter.dir/build
.PHONY : bytetrack-counter/fast
src/batch_store.o: src/batch_store.cpp.o
.PHONY : src/batch_store.o
# target to build an object file
src/batch_store.cpp.o:
$(MAKE) $(MAKESILENT) -f CMakeFiles/bytetrack-counter.dir/build.make CMakeFiles/bytetrack-counter.dir/src/batch_store.cpp.o
.PHONY : src/batch_store.cpp.o
src/batch_store.i: src/batch_store.cpp.i
.PHONY : src/batch_store.i
# target to preprocess a source file
src/batch_store.cpp.i:
$(MAKE) $(MAKESILENT) -f CMakeFiles/bytetrack-counter.dir/build.make CMakeFiles/bytetrack-counter.dir/src/batch_store.cpp.i
.PHONY : src/batch_store.cpp.i
src/batch_store.s: src/batch_store.cpp.s
.PHONY : src/batch_store.s
# target to generate assembly for a file
src/batch_store.cpp.s:
$(MAKE) $(MAKESILENT) -f CMakeFiles/bytetrack-counter.dir/build.make CMakeFiles/bytetrack-counter.dir/src/batch_store.cpp.s
.PHONY : src/batch_store.cpp.s
src/bytetrack.o: src/bytetrack.cpp.o
.PHONY : src/bytetrack.o
# target to build an object file
src/bytetrack.cpp.o:
$(MAKE) $(MAKESILENT) -f CMakeFiles/bytetrack-counter.dir/build.make CMakeFiles/bytetrack-counter.dir/src/bytetrack.cpp.o
.PHONY : src/bytetrack.cpp.o
src/bytetrack.i: src/bytetrack.cpp.i
.PHONY : src/bytetrack.i
# target to preprocess a source file
src/bytetrack.cpp.i:
$(MAKE) $(MAKESILENT) -f CMakeFiles/bytetrack-counter.dir/build.make CMakeFiles/bytetrack-counter.dir/src/bytetrack.cpp.i
.PHONY : src/bytetrack.cpp.i
src/bytetrack.s: src/bytetrack.cpp.s
.PHONY : src/bytetrack.s
# target to generate assembly for a file
src/bytetrack.cpp.s:
$(MAKE) $(MAKESILENT) -f CMakeFiles/bytetrack-counter.dir/build.make CMakeFiles/bytetrack-counter.dir/src/bytetrack.cpp.s
.PHONY : src/bytetrack.cpp.s
src/config.o: src/config.cpp.o
.PHONY : src/config.o
# target to build an object file
src/config.cpp.o:
$(MAKE) $(MAKESILENT) -f CMakeFiles/bytetrack-counter.dir/build.make CMakeFiles/bytetrack-counter.dir/src/config.cpp.o
.PHONY : src/config.cpp.o
src/config.i: src/config.cpp.i
.PHONY : src/config.i
# target to preprocess a source file
src/config.cpp.i:
$(MAKE) $(MAKESILENT) -f CMakeFiles/bytetrack-counter.dir/build.make CMakeFiles/bytetrack-counter.dir/src/config.cpp.i
.PHONY : src/config.cpp.i
src/config.s: src/config.cpp.s
.PHONY : src/config.s
# target to generate assembly for a file
src/config.cpp.s:
$(MAKE) $(MAKESILENT) -f CMakeFiles/bytetrack-counter.dir/build.make CMakeFiles/bytetrack-counter.dir/src/config.cpp.s
.PHONY : src/config.cpp.s
src/csv_logger.o: src/csv_logger.cpp.o
.PHONY : src/csv_logger.o
# target to build an object file
src/csv_logger.cpp.o:
$(MAKE) $(MAKESILENT) -f CMakeFiles/bytetrack-counter.dir/build.make CMakeFiles/bytetrack-counter.dir/src/csv_logger.cpp.o
.PHONY : src/csv_logger.cpp.o
src/csv_logger.i: src/csv_logger.cpp.i
.PHONY : src/csv_logger.i
# target to preprocess a source file
src/csv_logger.cpp.i:
$(MAKE) $(MAKESILENT) -f CMakeFiles/bytetrack-counter.dir/build.make CMakeFiles/bytetrack-counter.dir/src/csv_logger.cpp.i
.PHONY : src/csv_logger.cpp.i
src/csv_logger.s: src/csv_logger.cpp.s
.PHONY : src/csv_logger.s
# target to generate assembly for a file
src/csv_logger.cpp.s:
$(MAKE) $(MAKESILENT) -f CMakeFiles/bytetrack-counter.dir/build.make CMakeFiles/bytetrack-counter.dir/src/csv_logger.cpp.s
.PHONY : src/csv_logger.cpp.s
src/drawing.o: src/drawing.cpp.o
.PHONY : src/drawing.o
# target to build an object file
src/drawing.cpp.o:
$(MAKE) $(MAKESILENT) -f CMakeFiles/bytetrack-counter.dir/build.make CMakeFiles/bytetrack-counter.dir/src/drawing.cpp.o
.PHONY : src/drawing.cpp.o
src/drawing.i: src/drawing.cpp.i
.PHONY : src/drawing.i
# target to preprocess a source file
src/drawing.cpp.i:
$(MAKE) $(MAKESILENT) -f CMakeFiles/bytetrack-counter.dir/build.make CMakeFiles/bytetrack-counter.dir/src/drawing.cpp.i
.PHONY : src/drawing.cpp.i
src/drawing.s: src/drawing.cpp.s
.PHONY : src/drawing.s
# target to generate assembly for a file
src/drawing.cpp.s:
$(MAKE) $(MAKESILENT) -f CMakeFiles/bytetrack-counter.dir/build.make CMakeFiles/bytetrack-counter.dir/src/drawing.cpp.s
.PHONY : src/drawing.cpp.s
src/kalman_filter.o: src/kalman_filter.cpp.o
.PHONY : src/kalman_filter.o
# target to build an object file
src/kalman_filter.cpp.o:
$(MAKE) $(MAKESILENT) -f CMakeFiles/bytetrack-counter.dir/build.make CMakeFiles/bytetrack-counter.dir/src/kalman_filter.cpp.o
.PHONY : src/kalman_filter.cpp.o
src/kalman_filter.i: src/kalman_filter.cpp.i
.PHONY : src/kalman_filter.i
# target to preprocess a source file
src/kalman_filter.cpp.i:
$(MAKE) $(MAKESILENT) -f CMakeFiles/bytetrack-counter.dir/build.make CMakeFiles/bytetrack-counter.dir/src/kalman_filter.cpp.i
.PHONY : src/kalman_filter.cpp.i
src/kalman_filter.s: src/kalman_filter.cpp.s
.PHONY : src/kalman_filter.s
# target to generate assembly for a file
src/kalman_filter.cpp.s:
$(MAKE) $(MAKESILENT) -f CMakeFiles/bytetrack-counter.dir/build.make CMakeFiles/bytetrack-counter.dir/src/kalman_filter.cpp.s
.PHONY : src/kalman_filter.cpp.s
src/main.o: src/main.cpp.o
.PHONY : src/main.o
# target to build an object file
src/main.cpp.o:
$(MAKE) $(MAKESILENT) -f CMakeFiles/bytetrack-counter.dir/build.make CMakeFiles/bytetrack-counter.dir/src/main.cpp.o
.PHONY : src/main.cpp.o
src/main.i: src/main.cpp.i
.PHONY : src/main.i
# target to preprocess a source file
src/main.cpp.i:
$(MAKE) $(MAKESILENT) -f CMakeFiles/bytetrack-counter.dir/build.make CMakeFiles/bytetrack-counter.dir/src/main.cpp.i
.PHONY : src/main.cpp.i
src/main.s: src/main.cpp.s
.PHONY : src/main.s
# target to generate assembly for a file
src/main.cpp.s:
$(MAKE) $(MAKESILENT) -f CMakeFiles/bytetrack-counter.dir/build.make CMakeFiles/bytetrack-counter.dir/src/main.cpp.s
.PHONY : src/main.cpp.s
src/rknn_yolo.o: src/rknn_yolo.cpp.o
.PHONY : src/rknn_yolo.o
# target to build an object file
src/rknn_yolo.cpp.o:
$(MAKE) $(MAKESILENT) -f CMakeFiles/bytetrack-counter.dir/build.make CMakeFiles/bytetrack-counter.dir/src/rknn_yolo.cpp.o
.PHONY : src/rknn_yolo.cpp.o
src/rknn_yolo.i: src/rknn_yolo.cpp.i
.PHONY : src/rknn_yolo.i
# target to preprocess a source file
src/rknn_yolo.cpp.i:
$(MAKE) $(MAKESILENT) -f CMakeFiles/bytetrack-counter.dir/build.make CMakeFiles/bytetrack-counter.dir/src/rknn_yolo.cpp.i
.PHONY : src/rknn_yolo.cpp.i
src/rknn_yolo.s: src/rknn_yolo.cpp.s
.PHONY : src/rknn_yolo.s
# target to generate assembly for a file
src/rknn_yolo.cpp.s:
$(MAKE) $(MAKESILENT) -f CMakeFiles/bytetrack-counter.dir/build.make CMakeFiles/bytetrack-counter.dir/src/rknn_yolo.cpp.s
.PHONY : src/rknn_yolo.cpp.s
# Help Target
help:
@echo "The following are some of the valid targets for this Makefile:"
@echo "... all (the default if no target is provided)"
@echo "... clean"
@echo "... depend"
@echo "... edit_cache"
@echo "... install"
@echo "... install/local"
@echo "... install/strip"
@echo "... list_install_components"
@echo "... rebuild_cache"
@echo "... bytetrack-counter"
@echo "... src/batch_store.o"
@echo "... src/batch_store.i"
@echo "... src/batch_store.s"
@echo "... src/bytetrack.o"
@echo "... src/bytetrack.i"
@echo "... src/bytetrack.s"
@echo "... src/config.o"
@echo "... src/config.i"
@echo "... src/config.s"
@echo "... src/csv_logger.o"
@echo "... src/csv_logger.i"
@echo "... src/csv_logger.s"
@echo "... src/drawing.o"
@echo "... src/drawing.i"
@echo "... src/drawing.s"
@echo "... src/kalman_filter.o"
@echo "... src/kalman_filter.i"
@echo "... src/kalman_filter.s"
@echo "... src/main.o"
@echo "... src/main.i"
@echo "... src/main.s"
@echo "... src/rknn_yolo.o"
@echo "... src/rknn_yolo.i"
@echo "... src/rknn_yolo.s"
.PHONY : help
#=============================================================================
# Special targets to cleanup operation of make.
# Special rule to run CMake to check the build system integrity.
# No rule that depends on this can have commands that come from listfiles
# because they might be regenerated.
cmake_check_build_system:
$(CMAKE_COMMAND) -S$(CMAKE_SOURCE_DIR) -B$(CMAKE_BINARY_DIR) --check-build-system CMakeFiles/Makefile.cmake 0
.PHONY : cmake_check_build_system
BIN
View File
Binary file not shown.
+82
View File
@@ -0,0 +1,82 @@
# Install script for directory: /opt/bytetrack-counter-cpp
# Set the install prefix
if(NOT DEFINED CMAKE_INSTALL_PREFIX)
set(CMAKE_INSTALL_PREFIX "/usr/local")
endif()
string(REGEX REPLACE "/$" "" CMAKE_INSTALL_PREFIX "${CMAKE_INSTALL_PREFIX}")
# Set the install configuration name.
if(NOT DEFINED CMAKE_INSTALL_CONFIG_NAME)
if(BUILD_TYPE)
string(REGEX REPLACE "^[^A-Za-z0-9_]+" ""
CMAKE_INSTALL_CONFIG_NAME "${BUILD_TYPE}")
else()
set(CMAKE_INSTALL_CONFIG_NAME "")
endif()
message(STATUS "Install configuration: \"${CMAKE_INSTALL_CONFIG_NAME}\"")
endif()
# Set the component getting installed.
if(NOT CMAKE_INSTALL_COMPONENT)
if(COMPONENT)
message(STATUS "Install component: \"${COMPONENT}\"")
set(CMAKE_INSTALL_COMPONENT "${COMPONENT}")
else()
set(CMAKE_INSTALL_COMPONENT)
endif()
endif()
# Install shared libraries without execute permission?
if(NOT DEFINED CMAKE_INSTALL_SO_NO_EXE)
set(CMAKE_INSTALL_SO_NO_EXE "1")
endif()
# Is this installation the result of a crosscompile?
if(NOT DEFINED CMAKE_CROSSCOMPILING)
set(CMAKE_CROSSCOMPILING "FALSE")
endif()
# Set default install directory permissions.
if(NOT DEFINED CMAKE_OBJDUMP)
set(CMAKE_OBJDUMP "/usr/bin/objdump")
endif()
if(CMAKE_INSTALL_COMPONENT STREQUAL "Unspecified" OR NOT CMAKE_INSTALL_COMPONENT)
if(EXISTS "$ENV{DESTDIR}/opt/bytetrack-counter-cpp/bin/bytetrack-counter" AND
NOT IS_SYMLINK "$ENV{DESTDIR}/opt/bytetrack-counter-cpp/bin/bytetrack-counter")
file(RPATH_CHECK
FILE "$ENV{DESTDIR}/opt/bytetrack-counter-cpp/bin/bytetrack-counter"
RPATH "")
endif()
list(APPEND CMAKE_ABSOLUTE_DESTINATION_FILES
"/opt/bytetrack-counter-cpp/bin/bytetrack-counter")
if(CMAKE_WARN_ON_ABSOLUTE_INSTALL_DESTINATION)
message(WARNING "ABSOLUTE path INSTALL DESTINATION : ${CMAKE_ABSOLUTE_DESTINATION_FILES}")
endif()
if(CMAKE_ERROR_ON_ABSOLUTE_INSTALL_DESTINATION)
message(FATAL_ERROR "ABSOLUTE path INSTALL DESTINATION forbidden (by caller): ${CMAKE_ABSOLUTE_DESTINATION_FILES}")
endif()
file(INSTALL DESTINATION "/opt/bytetrack-counter-cpp/bin" TYPE EXECUTABLE FILES "/opt/bytetrack-counter-cpp/build/bytetrack-counter")
if(EXISTS "$ENV{DESTDIR}/opt/bytetrack-counter-cpp/bin/bytetrack-counter" AND
NOT IS_SYMLINK "$ENV{DESTDIR}/opt/bytetrack-counter-cpp/bin/bytetrack-counter")
if(CMAKE_INSTALL_DO_STRIP)
execute_process(COMMAND "/usr/bin/strip" "$ENV{DESTDIR}/opt/bytetrack-counter-cpp/bin/bytetrack-counter")
endif()
endif()
endif()
if(CMAKE_INSTALL_COMPONENT STREQUAL "Unspecified" OR NOT CMAKE_INSTALL_COMPONENT)
include("/opt/bytetrack-counter-cpp/build/CMakeFiles/bytetrack-counter.dir/install-cxx-module-bmi-noconfig.cmake" OPTIONAL)
endif()
if(CMAKE_INSTALL_COMPONENT)
set(CMAKE_INSTALL_MANIFEST "install_manifest_${CMAKE_INSTALL_COMPONENT}.txt")
else()
set(CMAKE_INSTALL_MANIFEST "install_manifest.txt")
endif()
string(REPLACE ";" "\n" CMAKE_INSTALL_MANIFEST_CONTENT
"${CMAKE_INSTALL_MANIFEST_FILES}")
file(WRITE "/opt/bytetrack-counter-cpp/build/${CMAKE_INSTALL_MANIFEST}"
"${CMAKE_INSTALL_MANIFEST_CONTENT}")
+42
View File
@@ -0,0 +1,42 @@
[Unit]
Description=ByteTrack Object Detection Counter (C++ port)
Documentation=https://github.com/ifzhang/ByteTrack
After=network-online.target
Wants=network-online.target
RequiresMountsFor=/opt
[Service]
Type=simple
User=root
Group=root
WorkingDirectory=/opt/bytetrack-counter-cpp
EnvironmentFile=/opt/bytetrack-counter-cpp/.env
ExecStart=/opt/bytetrack-counter-cpp/build/bytetrack-counter
Restart=always
RestartSec=5
RestartPreventExitStatus=0
StandardOutput=journal
StandardError=journal
SyslogIdentifier=bytetrack-counter
LimitNOFILE=65536
LimitNPROC=4096
NoNewPrivileges=no
ProtectSystem=strict
ProtectHome=yes
PrivateTmp=yes
ReadWritePaths=/opt/bytetrack-counter-cpp /tmp /dev/shm/bytetrack-counter /opt/models
ReadOnlyPaths=/etc
TimeoutStopSec=30
KillMode=mixed
KillSignal=SIGTERM
SendSIGKILL=yes
[Install]
WantedBy=multi-user.target
Binary file not shown.
File diff suppressed because it is too large. Load diff
+5
View File
@@ -0,0 +1,5 @@
numpy<2
rknn-toolkit-lite2
opencv-python
flask
python-dotenv
+414
View File
@@ -0,0 +1,414 @@
#include "batch_store.hpp"
#include <filesystem>
#include <fstream>
#include <chrono>
#include <ctime>
#include <sstream>
#include <iomanip>
#include <algorithm>
static std::string now_iso() {
auto now = std::chrono::system_clock::now();
auto t = std::chrono::system_clock::to_time_t(now);
std::ostringstream ss;
ss << std::put_time(std::localtime(&t), "%Y-%m-%dT%H:%M:%S");
return ss.str();
}
BatchStore::BatchStore(const std::string& db_path,
const std::string& state_file,
const std::string& camera_name,
const std::string& object_label,
const std::string& cutoff_time,
float batch_timeout,
float ignore_batch_label_timeout,
int min_object_per_batch,
int min_duration_per_batch,
std::function<void(const std::string&)> logger)
: db_path_(db_path), state_file_(state_file), camera_name_(camera_name),
object_label_(object_label), cutoff_time_str_(cutoff_time),
batch_timeout_(batch_timeout),
ignore_batch_label_timeout_(ignore_batch_label_timeout),
min_object_per_batch_(min_object_per_batch),
min_duration_per_batch_(min_duration_per_batch),
logger_(logger) {
std::filesystem::path dbp(db_path_);
if (dbp.has_parent_path())
std::filesystem::create_directories(dbp.parent_path());
std::filesystem::path sfp(state_file_);
if (sfp.has_parent_path())
std::filesystem::create_directories(sfp.parent_path());
int rc = sqlite3_open(db_path_.c_str(), &db_);
if (rc != SQLITE_OK) throw std::runtime_error("Failed to open database: " + std::string(sqlite3_errmsg(db_)));
init_db();
current_state_ = load_state();
previous_state_ = current_state_;
}
BatchStore::~BatchStore() {
if (db_) sqlite3_close(db_);
}
void BatchStore::init_db() {
const char* sql1 = R"(
CREATE TABLE IF NOT EXISTS batches (
id INTEGER PRIMARY KEY AUTOINCREMENT,
counting_date TEXT NOT NULL,
batch_number INTEGER NOT NULL,
camera_name TEXT NOT NULL,
object_label TEXT NOT NULL,
count INTEGER NOT NULL,
start_time TEXT NOT NULL,
end_time TEXT NOT NULL,
created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
UNIQUE(counting_date, batch_number, camera_name, object_label)
)
)";
const char* sql2 = R"(
CREATE TABLE IF NOT EXISTS daily_summaries (
id INTEGER PRIMARY KEY AUTOINCREMENT,
counting_date TEXT NOT NULL,
camera_name TEXT NOT NULL,
object_label TEXT NOT NULL,
total_count INTEGER NOT NULL DEFAULT 0,
total_batches INTEGER NOT NULL DEFAULT 0,
updated_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
UNIQUE(counting_date, camera_name, object_label)
)
)";
char* err = nullptr;
sqlite3_exec(db_, sql1, nullptr, nullptr, &err);
if (err) { logger_("DB init error: " + std::string(err)); sqlite3_free(err); }
err = nullptr;
sqlite3_exec(db_, sql2, nullptr, nullptr, &err);
if (err) { logger_("DB init error: " + std::string(err)); sqlite3_free(err); }
}
std::string BatchStore::get_counting_date() const {
auto now = std::chrono::system_clock::now();
auto t = std::chrono::system_clock::to_time_t(now);
auto* tm = std::localtime(&t);
int h, m;
sscanf(cutoff_time_str_.c_str(), "%d:%d", &h, &m);
if (tm->tm_hour < h || (tm->tm_hour == h && tm->tm_min < m)) {
std::ostringstream ss;
ss << std::put_time(tm, "%Y-%m-%d");
return ss.str();
} else {
auto tomorrow = now + std::chrono::hours(24);
t = std::chrono::system_clock::to_time_t(tomorrow);
tm = std::localtime(&t);
std::ostringstream ss;
ss << std::put_time(tm, "%Y-%m-%d");
return ss.str();
}
}
json BatchStore::load_state() {
std::ifstream f(state_file_);
if (!f.good()) return nullptr;
try {
json state = json::parse(f);
std::string current_date = get_counting_date();
if (state.value("counting_date", "") != current_date) {
logger_("State file belongs to previous counting day. Finalizing.");
insert_batch(state["counting_date"], state["batch_number"],
state["count"], state["start_time"], now_iso());
std::filesystem::remove(state_file_);
return nullptr;
}
std::ostringstream ss;
ss << "Resumed batch #" << state["batch_number"] << " with count=" << state["count"];
logger_(ss.str());
reset_batch_timer();
return state;
} catch (const std::exception& e) {
logger_("Failed to load state: " + std::string(e.what()));
return nullptr;
}
}
void BatchStore::save_state() {
std::lock_guard<std::mutex> lock(state_mutex_);
if (current_state_.is_null()) {
std::filesystem::remove(state_file_);
return;
}
std::ofstream f(state_file_);
f << current_state_.dump(2);
}
int BatchStore::get_next_batch_number(const std::string& counting_date) {
const char* sql = R"(
SELECT COALESCE(MAX(batch_number), 0)
FROM batches
WHERE counting_date = ? AND camera_name = ? AND object_label = ?
)";
sqlite3_stmt* stmt;
sqlite3_prepare_v2(db_, sql, -1, &stmt, nullptr);
sqlite3_bind_text(stmt, 1, counting_date.c_str(), -1, SQLITE_TRANSIENT);
sqlite3_bind_text(stmt, 2, camera_name_.c_str(), -1, SQLITE_TRANSIENT);
sqlite3_bind_text(stmt, 3, object_label_.c_str(), -1, SQLITE_TRANSIENT);
int result = 0;
if (sqlite3_step(stmt) == SQLITE_ROW)
result = sqlite3_column_int(stmt, 0) + 1;
sqlite3_finalize(stmt);
return result;
}
void BatchStore::start_new_batch(const std::string& counting_date) {
int batch_number = get_next_batch_number(counting_date);
std::string now = now_iso();
json counted_ids = json::array();
if (!previous_state_.is_null() && previous_state_.contains("counted_event_ids")) {
auto& ids = previous_state_["counted_event_ids"];
int start = std::max(0, static_cast<int>(ids.size()) - carry_ids_);
for (int i = start; i < (int)ids.size(); ++i)
counted_ids.push_back(ids[i]);
}
current_state_ = {
{"counting_date", counting_date},
{"batch_number", batch_number},
{"count", 0},
{"start_time", now},
{"last_detection_time", now},
{"counted_event_ids", counted_ids}
};
save_state();
std::ostringstream ss;
ss << "Started batch #" << batch_number << " for " << counting_date;
logger_(ss.str());
}
void BatchStore::reset_batch_timer() {
batch_timer_running_ = true;
if (batch_timer_thread_.joinable()) batch_timer_thread_.detach();
batch_timer_thread_ = std::thread([this]() {
auto start = std::chrono::steady_clock::now();
while (batch_timer_running_) {
auto elapsed = std::chrono::duration_cast<std::chrono::seconds>(
std::chrono::steady_clock::now() - start).count();
if (elapsed >= batch_timeout_) {
on_batch_timeout();
break;
}
std::this_thread::sleep_for(std::chrono::seconds(1));
}
});
}
void BatchStore::on_batch_timeout() {
batch_timer_running_ = false;
logger_("Batch inactivity timeout reached");
end_batch("timeout");
}
void BatchStore::ignore_batch_label_fn() {
if (!ignore_label_active_) {
ignore_label_active_ = true;
ignore_batch_label_ = true;
if (ignore_label_thread_.joinable()) ignore_label_thread_.detach();
ignore_label_thread_ = std::thread([this]() {
auto start = std::chrono::steady_clock::now();
while (ignore_label_active_) {
auto elapsed = std::chrono::duration_cast<std::chrono::seconds>(
std::chrono::steady_clock::now() - start).count();
if (elapsed >= ignore_batch_label_timeout_) {
on_ignore_batch_label_timeout();
break;
}
std::this_thread::sleep_for(std::chrono::seconds(1));
}
});
}
}
void BatchStore::on_ignore_batch_label_timeout() {
ignore_label_active_ = false;
ignore_batch_label_ = false;
}
std::pair<int, bool> BatchStore::record_ayam_crossing(int track_id) {
std::lock_guard<std::mutex> lock(state_mutex_);
std::string counting_date = get_counting_date();
bool started_new = false;
if (current_state_.is_null()) {
start_new_batch(counting_date);
started_new = true;
} else if (current_state_["counting_date"].get<std::string>() != counting_date) {
end_batch_locked("cutoff");
start_new_batch(counting_date);
started_new = true;
}
std::string event_key = std::to_string(track_id);
auto& ids = current_state_["counted_event_ids"];
bool found = false;
for (const auto& id : ids) {
if (id.get<std::string>() == event_key) { found = true; break; }
}
if (!found) {
current_state_["count"] = current_state_["count"].get<int>() + 1;
ids.push_back(event_key);
}
current_state_["last_detection_time"] = now_iso();
save_state();
reset_batch_timer();
return {current_state_["count"].get<int>(), started_new};
}
bool BatchStore::record_talenan_crossing(int track_id) {
if (ignore_batch_label_) return false;
std::lock_guard<std::mutex> lock(state_mutex_);
ignore_batch_label_fn();
end_batch_locked("talenan");
batch_timer_running_ = false;
return true;
}
void BatchStore::end_batch(const std::string& closed_by) {
std::lock_guard<std::mutex> lock(state_mutex_);
end_batch_locked(closed_by);
}
bool BatchStore::end_batch_locked(const std::string& closed_by) {
if (current_state_.is_null()) return false;
previous_state_ = current_state_;
auto state = current_state_;
std::string start_time = state["start_time"];
std::string end_time = now_iso();
// parse duration
std::tm tm = {};
std::istringstream ss(start_time);
ss >> std::get_time(&tm, "%Y-%m-%dT%H:%M:%S");
auto start_tp = std::chrono::system_clock::from_time_t(std::mktime(&tm));
auto end_tp = std::chrono::system_clock::now();
auto duration_sec = std::chrono::duration_cast<std::chrono::seconds>(end_tp - start_tp).count();
int count = state["count"].get<int>();
if (count < min_object_per_batch_ || duration_sec < min_duration_per_batch_) {
current_state_ = nullptr;
save_state();
batch_timer_running_ = false;
return false;
}
try {
insert_batch(state["counting_date"], state["batch_number"],
count, state["start_time"], end_time);
} catch (const std::exception& e) {
logger_("Failed to persist batch: " + std::string(e.what()));
return false;
}
current_state_ = nullptr;
save_state();
batch_timer_running_ = false;
return true;
}
void BatchStore::insert_batch(const std::string& counting_date, int batch_number,
int count, const std::string& start_time, const std::string& end_time) {
const char* sql1 = R"(
INSERT INTO batches (counting_date, batch_number, camera_name, object_label, count, start_time, end_time)
VALUES (?, ?, ?, ?, ?, ?, ?)
)";
sqlite3_stmt* stmt;
sqlite3_prepare_v2(db_, sql1, -1, &stmt, nullptr);
sqlite3_bind_text(stmt, 1, counting_date.c_str(), -1, SQLITE_TRANSIENT);
sqlite3_bind_int(stmt, 2, batch_number);
sqlite3_bind_text(stmt, 3, camera_name_.c_str(), -1, SQLITE_TRANSIENT);
sqlite3_bind_text(stmt, 4, object_label_.c_str(), -1, SQLITE_TRANSIENT);
sqlite3_bind_int(stmt, 5, count);
sqlite3_bind_text(stmt, 6, start_time.c_str(), -1, SQLITE_TRANSIENT);
sqlite3_bind_text(stmt, 7, end_time.c_str(), -1, SQLITE_TRANSIENT);
sqlite3_step(stmt);
sqlite3_finalize(stmt);
const char* sql2 = R"(
INSERT INTO daily_summaries (counting_date, camera_name, object_label, total_count, total_batches)
VALUES (?, ?, ?, ?, 1)
ON CONFLICT(counting_date, camera_name, object_label)
DO UPDATE SET total_count = total_count + excluded.total_count,
total_batches = total_batches + excluded.total_batches,
updated_at = CURRENT_TIMESTAMP
)";
sqlite3_prepare_v2(db_, sql2, -1, &stmt, nullptr);
sqlite3_bind_text(stmt, 1, counting_date.c_str(), -1, SQLITE_TRANSIENT);
sqlite3_bind_text(stmt, 2, camera_name_.c_str(), -1, SQLITE_TRANSIENT);
sqlite3_bind_text(stmt, 3, object_label_.c_str(), -1, SQLITE_TRANSIENT);
sqlite3_bind_int(stmt, 4, count);
sqlite3_step(stmt);
sqlite3_finalize(stmt);
}
int BatchStore::get_closed_total_for_day(const std::string& counting_date) {
const char* sql = R"(
SELECT COALESCE(total_count, 0)
FROM daily_summaries
WHERE counting_date = ? AND camera_name = ? AND object_label = ?
)";
sqlite3_stmt* stmt;
sqlite3_prepare_v2(db_, sql, -1, &stmt, nullptr);
sqlite3_bind_text(stmt, 1, counting_date.c_str(), -1, SQLITE_TRANSIENT);
sqlite3_bind_text(stmt, 2, camera_name_.c_str(), -1, SQLITE_TRANSIENT);
sqlite3_bind_text(stmt, 3, object_label_.c_str(), -1, SQLITE_TRANSIENT);
int result = 0;
if (sqlite3_step(stmt) == SQLITE_ROW)
result = sqlite3_column_int(stmt, 0);
sqlite3_finalize(stmt);
return result;
}
int BatchStore::display_total() {
return get_closed_total_for_day(get_counting_date()) + current_batch_count();
}
int BatchStore::current_batch_number() const {
if (current_state_.is_null()) return 0;
return current_state_.value("batch_number", 0);
}
int BatchStore::current_batch_count() const {
if (current_state_.is_null()) return 0;
return current_state_.value("count", 0);
}
void BatchStore::cutoff_watcher_loop() {
while (!shutdown_flag_) {
std::this_thread::sleep_for(std::chrono::seconds(60));
std::lock_guard<std::mutex> lock(state_mutex_);
if (current_state_.is_null()) continue;
if (current_state_["counting_date"].get<std::string>() != get_counting_date()) {
logger_("Daily cutoff reached - finalizing batch");
end_batch_locked("cutoff");
}
}
}
void BatchStore::start_cutoff_watcher() {
std::thread t(&BatchStore::cutoff_watcher_loop, this);
t.detach();
}
void BatchStore::shutdown() {
shutdown_flag_ = true;
batch_timer_running_ = false;
end_batch("shutdown");
}
+79
View File
@@ -0,0 +1,79 @@
#pragma once
#include <sqlite3.h>
#include <nlohmann/json.hpp>
#include <string>
#include <functional>
#include <thread>
#include <mutex>
#include <atomic>
#include <chrono>
using json = nlohmann::json;
class BatchStore {
public:
BatchStore(const std::string& db_path,
const std::string& state_file,
const std::string& camera_name,
const std::string& object_label,
const std::string& cutoff_time,
float batch_timeout,
float ignore_batch_label_timeout,
int min_object_per_batch,
int min_duration_per_batch,
std::function<void(const std::string&)> logger);
~BatchStore();
void start_cutoff_watcher();
int current_batch_number() const;
int current_batch_count() const;
int display_total();
std::pair<int, bool> record_ayam_crossing(int track_id);
bool record_talenan_crossing(int track_id);
void end_batch(const std::string& closed_by = "manual");
void shutdown();
private:
void init_db();
std::string get_counting_date() const;
json load_state();
void save_state();
int get_next_batch_number(const std::string& counting_date);
void start_new_batch(const std::string& counting_date);
void reset_batch_timer();
void on_batch_timeout();
void ignore_batch_label_fn();
void on_ignore_batch_label_timeout();
bool end_batch_locked(const std::string& closed_by);
void insert_batch(const std::string& counting_date, int batch_number,
int count, const std::string& start_time, const std::string& end_time);
int get_closed_total_for_day(const std::string& counting_date);
void cutoff_watcher_loop();
std::string db_path_;
std::string state_file_;
std::string camera_name_;
std::string object_label_;
std::string cutoff_time_str_;
float batch_timeout_;
float ignore_batch_label_timeout_;
int min_object_per_batch_;
int min_duration_per_batch_;
int carry_ids_ = 50;
std::function<void(const std::string&)> logger_;
sqlite3* db_ = nullptr;
std::mutex state_mutex_;
std::thread batch_timer_thread_;
std::thread ignore_label_thread_;
std::atomic<bool> batch_timer_running_{false};
std::atomic<bool> ignore_label_active_{false};
std::atomic<bool> shutdown_flag_{false};
std::atomic<bool> ignore_batch_label_{false};
json current_state_;
json previous_state_;
};
+198
View File
@@ -0,0 +1,198 @@
#include "bytetrack.hpp"
int KalmanBoxTracker::count = 0;
KalmanBoxTracker::KalmanBoxTracker(const Eigen::Vector4f& bbox_xyxy) : kf() {
KalmanBoxTracker::count++;
track_id = KalmanBoxTracker::count;
float x1 = bbox_xyxy(0), y1 = bbox_xyxy(1), x2 = bbox_xyxy(2), y2 = bbox_xyxy(3);
float w = x2 - x1, h = y2 - y1;
float x = x1 + w / 2.0f, y = y1 + h / 2.0f;
kf.x(0, 0) = x;
kf.x(1, 0) = y;
kf.x(2, 0) = w;
kf.x(3, 0) = h;
}
void KalmanBoxTracker::predict() {
if (kf.x(6) + kf.x(2) <= 0) {
kf.x(6, 0) = 0.0f;
}
kf.predict();
age++;
time_since_update++;
}
void KalmanBoxTracker::update(const Eigen::Vector4f& bbox_xyxy) {
time_since_update = 0;
hits++;
hit_streak++;
float x1 = bbox_xyxy(0), y1 = bbox_xyxy(1), x2 = bbox_xyxy(2), y2 = bbox_xyxy(3);
float w = x2 - x1, h = y2 - y1;
float x = x1 + w / 2.0f, y = y1 + h / 2.0f;
Eigen::Vector4f z;
z << x, y, w, h;
kf.update(z);
}
Eigen::Vector4f KalmanBoxTracker::get_state() const {
float x = kf.x(0, 0), y = kf.x(1, 0), w = kf.x(2, 0), h = kf.x(3, 0);
Eigen::Vector4f xyxy;
xyxy << x - w / 2.0f, y - h / 2.0f, x + w / 2.0f, y + h / 2.0f;
return xyxy;
}
float KalmanBoxTracker::get_cx() const {
return kf.x(0, 0);
}
ByteTracker::ByteTracker(float track_high_thresh, float track_low_thresh,
float match_thresh, int track_buffer, int min_hits)
: high_thresh_(track_high_thresh), low_thresh_(track_low_thresh),
match_thresh_(match_thresh), track_buffer_(track_buffer), min_hits_(min_hits) {}
TrackResult ByteTracker::update(const Eigen::MatrixXf& boxes_xyxy, const Eigen::VectorXf& scores) {
frame_id_++;
int num_dets = static_cast<int>(boxes_xyxy.rows());
std::vector<int> high_indices, low_indices;
std::vector<Eigen::Vector4f> high_dets, low_dets;
if (num_dets > 0) {
for (int i = 0; i < num_dets; ++i) {
if (scores(i) > low_thresh_) {
if (scores(i) > high_thresh_) {
high_indices.push_back(i);
high_dets.push_back(boxes_xyxy.row(i));
} else {
low_indices.push_back(i);
low_dets.push_back(boxes_xyxy.row(i));
}
}
}
}
auto all_tracks = tracked_tracks_;
all_tracks.insert(all_tracks.end(), lost_tracks_.begin(), lost_tracks_.end());
int num_tracks = static_cast<int>(all_tracks.size());
for (auto& trk : all_tracks) {
trk.predict();
}
Eigen::MatrixXf track_boxes(num_tracks, 4);
for (int ti = 0; ti < num_tracks; ++ti) {
track_boxes.row(ti) = all_tracks[ti].get_state();
}
std::unordered_set<int> matched_track_idx;
std::unordered_map<int, int> det_to_track;
std::unordered_map<int, float> tracked_map;
std::unordered_map<int, float> lost_map;
if (num_tracks > 0) {
// first association: high-score dets ↔ all tracks
int n_high = static_cast<int>(high_dets.size());
if (n_high > 0) {
Eigen::MatrixXf high_mat(n_high, 4);
for (int i = 0; i < n_high; ++i) high_mat.row(i) = high_dets[i];
auto iou_mat = ious_xyxy(high_mat, track_boxes);
auto cost_mat = Eigen::MatrixXf::Constant(n_high, num_tracks, 1.0f) - iou_mat;
auto matches = greedy_match(cost_mat, 1.0f - match_thresh_);
for (auto [di, ti] : matches) {
int det_global = high_indices[di];
all_tracks[ti].update(boxes_xyxy.row(det_global));
all_tracks[ti].hit_streak = std::max(1, all_tracks[ti].hit_streak);
matched_track_idx.insert(ti);
det_to_track[det_global] = all_tracks[ti].track_id;
tracked_map[all_tracks[ti].track_id] = all_tracks[ti].get_cx();
}
}
std::vector<int> unmatched_tracks;
for (int t = 0; t < num_tracks; ++t)
if (matched_track_idx.find(t) == matched_track_idx.end())
unmatched_tracks.push_back(t);
// second association: low-score dets ↔ unmatched tracks
int n_low = static_cast<int>(low_dets.size());
int n_unmatched = static_cast<int>(unmatched_tracks.size());
if (n_low > 0 && n_unmatched > 0) {
Eigen::MatrixXf low_mat(n_low, 4);
for (int i = 0; i < n_low; ++i) low_mat.row(i) = low_dets[i];
Eigen::MatrixXf unmatched_boxes(n_unmatched, 4);
for (int i = 0; i < n_unmatched; ++i)
unmatched_boxes.row(i) = track_boxes.row(unmatched_tracks[i]);
auto iou_mat = ious_xyxy(low_mat, unmatched_boxes);
auto cost_mat = Eigen::MatrixXf::Constant(n_low, n_unmatched, 1.0f) - iou_mat;
auto matches2 = greedy_match(cost_mat, 0.5f);
for (auto [di, uti] : matches2) {
int det_global = low_indices[di];
int pool_idx = unmatched_tracks[uti];
all_tracks[pool_idx].update(boxes_xyxy.row(det_global));
all_tracks[pool_idx].hit_streak = std::max(1, all_tracks[pool_idx].hit_streak);
matched_track_idx.insert(pool_idx);
det_to_track[det_global] = all_tracks[pool_idx].track_id;
tracked_map[all_tracks[pool_idx].track_id] = all_tracks[pool_idx].get_cx();
}
}
}
for (int ti = 0; ti < num_tracks; ++ti) {
if (matched_track_idx.find(ti) == matched_track_idx.end())
all_tracks[ti].hit_streak = 0;
}
std::vector<KalmanBoxTracker> new_tracked, new_lost;
for (auto& trk : all_tracks) {
if (trk.time_since_update > track_buffer_) {
removed_tracks_.push_back(std::move(trk));
} else if (trk.time_since_update > 0) {
new_lost.push_back(std::move(trk));
} else {
new_tracked.push_back(std::move(trk));
}
}
tracked_tracks_ = std::move(new_tracked);
lost_tracks_ = std::move(new_lost);
for (const auto& trk : tracked_tracks_) {
if (trk.hit_streak >= min_hits_ || trk.hits >= min_hits_) {
if (tracked_map.find(trk.track_id) == tracked_map.end())
tracked_map[trk.track_id] = trk.get_cx();
}
}
for (const auto& trk : lost_tracks_) {
if (trk.hit_streak >= min_hits_ || trk.hits >= min_hits_) {
lost_map[trk.track_id] = trk.get_cx();
}
}
for (int dg : high_indices) {
if (det_to_track.find(dg) == det_to_track.end()) {
Eigen::Vector4f box = boxes_xyxy.row(dg);
KalmanBoxTracker trk(box);
int tid = trk.track_id;
float cx = trk.get_cx();
tracked_map[tid] = cx;
det_to_track[dg] = tid;
tracked_tracks_.push_back(std::move(trk));
}
}
TrackResult result;
result.tracked_map = tracked_map;
result.det_to_track = det_to_track;
result.lost_map = lost_map;
return result;
}
+56
View File
@@ -0,0 +1,56 @@
#pragma once
#include "kalman_filter.hpp"
#include "nms.hpp"
#include <Eigen/Dense>
#include <vector>
#include <unordered_map>
#include <unordered_set>
#include <cstdint>
class KalmanBoxTracker {
public:
static int count;
KalmanBoxTracker(const Eigen::Vector4f& bbox_xyxy);
void predict();
void update(const Eigen::Vector4f& bbox_xyxy);
Eigen::Vector4f get_state() const;
float get_cx() const;
int track_id;
KalmanFilter kf;
int time_since_update = 0;
int hits = 1;
int hit_streak = 1;
int age = 1;
};
struct TrackResult {
std::unordered_map<int, float> tracked_map;
std::unordered_map<int, int> det_to_track;
std::unordered_map<int, float> lost_map;
};
class ByteTracker {
public:
ByteTracker(float track_high_thresh = 0.5f,
float track_low_thresh = 0.1f,
float match_thresh = 0.8f,
int track_buffer = 30,
int min_hits = 3);
TrackResult update(const Eigen::MatrixXf& boxes_xyxy, const Eigen::VectorXf& scores);
private:
float high_thresh_;
float low_thresh_;
float match_thresh_;
int track_buffer_;
int min_hits_;
int frame_id_ = 0;
std::vector<KalmanBoxTracker> tracked_tracks_;
std::vector<KalmanBoxTracker> lost_tracks_;
std::vector<KalmanBoxTracker> removed_tracks_;
};
+128
View File
@@ -0,0 +1,128 @@
#include "config.hpp"
#include <cstdlib>
#include <fstream>
#include <sstream>
#include <iostream>
AppConfig g_config;
static std::string trim(const std::string& s) {
auto start = s.find_first_not_of(" \t\r\n");
if (start == std::string::npos) return {};
auto end = s.find_last_not_of(" \t\r\n");
return s.substr(start, end - start + 1);
}
static std::string get_env(const std::string& key, const std::string& def = "") {
const char* val = std::getenv(key.c_str());
return val ? std::string(val) : def;
}
void AppConfig::load_from_env(const char* env_path) {
std::string path = ".env";
if (env_path) path = env_path;
// also check env path
const char* env_file = std::getenv("ENV_FILE");
if (env_file) path = env_file;
std::ifstream file(path);
if (file.is_open()) {
std::string line;
while (std::getline(file, line)) {
line = trim(line);
if (line.empty() || line[0] == '#') continue;
auto eq = line.find('=');
if (eq == std::string::npos) continue;
std::string key = trim(line.substr(0, eq));
std::string val = trim(line.substr(eq + 1));
// strip quotes
if (val.size() >= 2 && val.front() == '"' && val.back() == '"')
val = val.substr(1, val.size() - 2);
setenv(key.c_str(), val.c_str(), 1);
}
}
output_dir = get_env("OUTPUT_DIR", output_dir);
db_path = get_env("DB_PATH", output_dir + "/bytetrack_counter.db");
state_file = get_env("STATE_FILE", output_dir + "/current_batch.json");
source = get_env("SOURCE", source);
model_path = get_env("MODEL_PATH", model_path);
camera_name = get_env("CAMERA_NAME", camera_name);
object_label = get_env("OBJECT_LABEL", object_label);
class_ayam = get_env("CLASS_AYAM", class_ayam);
class_talenan = get_env("CLASS_TALENAN", class_talenan);
auto lx = get_env("LINE_X");
if (!lx.empty()) line_x = std::stoi(lx);
auto lxf = get_env("LINE_X_FRAC");
if (!lxf.empty()) line_x_frac = std::stof(lxf);
cross_direction = get_env("CROSS_DIRECTION", cross_direction);
auto imgsz_s = get_env("IMGSZ");
if (!imgsz_s.empty()) imgsz = std::stoi(imgsz_s);
auto half_s = get_env("HALF");
half = (half_s == "true");
auto conf_s = get_env("CONF");
if (!conf_s.empty()) conf = std::stof(conf_s);
auto dev_s = get_env("DEVICE");
if (!dev_s.empty()) device = std::stoi(dev_s);
auto cm_s = get_env("CORE_MASK");
if (!cm_s.empty()) core_mask = std::stoi(cm_s);
auto nc_s = get_env("NUM_CLASSES");
if (!nc_s.empty()) num_classes = std::stoi(nc_s);
auto ss_s = get_env("SCORE_SIGMOID");
score_sigmoid = (ss_s == "true");
auto th_s = get_env("TRACK_HIGH_THRESH");
if (!th_s.empty()) track_high_thresh = std::stof(th_s);
auto tl_s = get_env("TRACK_LOW_THRESH");
if (!tl_s.empty()) track_low_thresh = std::stof(tl_s);
auto tm_s = get_env("TRACK_MATCH_THRESH");
if (!tm_s.empty()) track_match_thresh = std::stof(tm_s);
auto tb_s = get_env("TRACK_BUFFER");
if (!tb_s.empty()) track_buffer = std::stoi(tb_s);
auto tmh_s = get_env("TRACK_MIN_HITS");
if (!tmh_s.empty()) track_min_hits = std::stoi(tmh_s);
daily_cutoff_time = get_env("DAILY_CUTOFF_TIME", daily_cutoff_time);
auto bto_s = get_env("BATCH_TIMEOUT_SECONDS");
if (!bto_s.empty()) batch_timeout_seconds = std::stof(bto_s);
auto ibl_s = get_env("IGNORE_BATCH_LABEL_TIMEOUT_SECONDS");
if (!ibl_s.empty()) ignore_batch_label_timeout = std::stof(ibl_s);
auto mob_s = get_env("MIN_OBJECT_PER_BATCH");
if (!mob_s.empty()) min_object_per_batch = std::stoi(mob_s);
auto mdb_s = get_env("MIN_DURATION_PER_BATCH");
if (!mdb_s.empty()) min_duration_per_batch = std::stoi(mdb_s);
auto ecsv = get_env("EXPORT_CSV");
if (!ecsv.empty()) export_csv = (ecsv == "true");
cross_csv = get_env("CROSS_CSV", output_dir + "/batch_crossings.csv");
auto wf_s = get_env("WARMUP_FRAMES");
if (!wf_s.empty()) warmup_frames = std::stoi(wf_s);
auto rd_s = get_env("RECONNECT_DELAY_SEC");
if (!rd_s.empty()) reconnect_delay_sec = std::stoi(rd_s);
auto mra_s = get_env("MAX_RECONNECT_ATTEMPTS");
if (!mra_s.empty()) max_reconnect_attempts = std::stoi(mra_s);
auto fl_s = get_env("FLUSH_EVERY_N_FRAMES");
if (!fl_s.empty()) flush_every_n_frames = std::stoi(fl_s);
auto tp_s = get_env("TRACKED_PRUNE_SEC");
if (!tp_s.empty()) tracked_prune_sec = std::stoi(tp_s);
auto rv_s = get_env("RECORD_VIDEO");
record_video = (rv_s == "true");
auto vs_s = get_env("VIDEO_SEGMENT_SEC");
if (!vs_s.empty()) video_segment_sec = std::stoi(vs_s);
auto ofps_s = get_env("OUTPUT_FPS");
if (!ofps_s.empty()) output_fps = std::stoi(ofps_s);
auto lse_s = get_env("LIVE_STREAM_ENABLED");
live_stream_enabled = (lse_s == "true");
live_stream_frame_path = get_env("LIVE_STREAM_FRAME_PATH", live_stream_frame_path);
auto lsq_s = get_env("LIVE_STREAM_QUALITY");
if (!lsq_s.empty()) live_stream_quality = std::stoi(lsq_s);
auto lsn_s = get_env("LIVE_STREAM_EVERY_N");
if (!lsn_s.empty()) live_stream_every_n = std::stoi(lsn_s);
rtsp_ffmpeg_options = get_env("OPENCV_FFMPEG_CAPTURE_OPTIONS", rtsp_ffmpeg_options);
}
+68
View File
@@ -0,0 +1,68 @@
#pragma once
#include <string>
#include <cstdint>
struct AppConfig {
std::string output_dir = "/opt/bytetrack-counter-cpp";
std::string db_path;
std::string state_file;
std::string source = "rtsp://user:pass@192.168.0.100:554/stream1";
std::string model_path = "/opt/models/yolo.rknn";
std::string camera_name = "CC1";
std::string object_label = "ayam-potong";
std::string class_ayam = "ayam";
std::string class_talenan = "talenan";
int line_x = -1;
float line_x_frac = 0.5f;
std::string cross_direction = "rtl";
int imgsz = 320;
bool half = false;
float conf = 0.3f;
int device = 0;
int core_mask = 1;
int num_classes = 2;
bool score_sigmoid = false;
float track_high_thresh = 0.5f;
float track_low_thresh = 0.1f;
float track_match_thresh = 0.8f;
int track_buffer = 30;
int track_min_hits = 3;
std::string daily_cutoff_time = "20:00";
float batch_timeout_seconds = 300.0f;
float ignore_batch_label_timeout = 30.0f;
int min_object_per_batch = 60;
int min_duration_per_batch = 60;
bool export_csv = true;
std::string cross_csv;
int warmup_frames = 30;
int reconnect_delay_sec = 3;
int max_reconnect_attempts = 0;
int flush_every_n_frames = 100;
int tracked_prune_sec = 300;
bool record_video = false;
int video_segment_sec = 3600;
int output_fps = 15;
bool live_stream_enabled = false;
std::string live_stream_frame_path = "/dev/shm/bytetrack-counter/live_frame.jpg";
int live_stream_quality = 75;
int live_stream_every_n = 2;
std::string rtsp_ffmpeg_options = "rtsp_transport;tcp|fflags;nobuffer|flags;low_delay";
int cross_flash_frames = 12;
int popup_lifetime = 20;
int line_pulse_frames = 12;
int count_pulse_frames = 15;
int batch_pulse_frames = 20;
void load_from_env(const char* env_path = nullptr);
};
extern AppConfig g_config;
+35
View File
@@ -0,0 +1,35 @@
#include "csv_logger.hpp"
#include <filesystem>
#include <iostream>
CsvLogger::CsvLogger(const std::string& path, const std::vector<std::string>& header) {
std::filesystem::path p(path);
if (p.has_parent_path())
std::filesystem::create_directories(p.parent_path());
bool new_file = !std::filesystem::exists(p) || std::filesystem::file_size(p) == 0;
file_.open(path, std::ios::app);
file_.exceptions(std::ios::failbit | std::ios::badbit);
if (new_file) {
for (size_t i = 0; i < header.size(); ++i) {
if (i > 0) file_ << ",";
file_ << header[i];
}
file_ << "\n";
file_.flush();
}
}
CsvLogger::~CsvLogger() {
if (file_.is_open()) file_.close();
}
void CsvLogger::write_row(const std::vector<std::string>& row) {
for (size_t i = 0; i < row.size(); ++i) {
if (i > 0) file_ << ",";
file_ << row[i];
}
file_ << "\n";
file_.flush();
}
+15
View File
@@ -0,0 +1,15 @@
#pragma once
#include <string>
#include <vector>
#include <fstream>
class CsvLogger {
public:
explicit CsvLogger(const std::string& path, const std::vector<std::string>& header);
~CsvLogger();
void write_row(const std::vector<std::string>& row);
private:
std::ofstream file_;
};
+171
View File
@@ -0,0 +1,171 @@
#include "drawing.hpp"
#include "config.hpp"
#include <cmath>
#include <filesystem>
#include <fstream>
const std::vector<std::pair<int, int>> SKELETON = {
{0, 1}, {4, 3}, {1, 2}, {3, 2}, {2, 6}, {2, 5}, {2, 7}, {7, 8}
};
const std::vector<cv::Scalar> SK_COLORS = {
{255, 255, 0}, {255, 255, 0}, {255, 0, 255}, {255, 0, 255},
{0, 255, 0}, {255, 255, 0}, {255, 0, 0}, {0, 200, 200}
};
int resolve_line_x(int frame_width, int line_x_opt, float line_x_frac) {
if (line_x_opt >= 0) return line_x_opt;
if (std::abs(line_x_frac - 0.5f) > 1e-6f) return static_cast<int>(frame_width * line_x_frac);
return frame_width / 2;
}
bool crossed_line(float prev_cx, float cx, int line_x, const std::string& direction) {
if (direction == "ltr") return prev_cx < line_x && cx >= line_x;
if (direction == "both") return (prev_cx > line_x && cx <= line_x) || (prev_cx < line_x && cx >= line_x);
return prev_cx > line_x && cx <= line_x;
}
void overlay_rect(cv::Mat& img, int x1, int y1, int x2, int y2, const cv::Scalar& color, float alpha) {
x1 = std::max(0, x1); y1 = std::max(0, y1);
x2 = std::min(img.cols, x2); y2 = std::min(img.rows, y2);
if (x2 <= x1 || y2 <= y1) return;
cv::Mat roi = img(cv::Rect(x1, y1, x2 - x1, y2 - y1));
cv::Mat patch(roi.size(), roi.type(), color);
cv::addWeighted(patch, alpha, roi, 1.0f - alpha, 0, roi);
}
void draw_pill(cv::Mat& img, const std::string& text, int x, int y,
const cv::Scalar& bg, const cv::Scalar& fg,
double font_scale, int pad_x, int pad_y) {
int baseline = 0;
cv::Size ts = cv::getTextSize(text, cv::FONT_HERSHEY_SIMPLEX, font_scale, 1, &baseline);
int x1 = x, y1 = y - ts.height - pad_y;
int x2 = x + ts.width + pad_x * 2, y2 = y + baseline + pad_y;
cv::rectangle(img, cv::Rect(x1, y1, x2 - x1, y2 - y1), bg, -1);
cv::rectangle(img, cv::Rect(x1, y1, x2 - x1, y2 - y1), C_BORDER, 1);
cv::putText(img, text, cv::Point(x + pad_x, y), cv::FONT_HERSHEY_SIMPLEX, font_scale, fg, 1, cv::LINE_AA);
}
void draw_elegant_counting_line(cv::Mat& img, int line_x, int h, int pulse_remaining) {
float strength = pulse_remaining / std::max(12.0f, 1.0f);
float glow_alpha = 0.12f + 0.18f * strength;
for (int offset : {14, 9, 5}) {
cv::Scalar color(static_cast<int>(C_LINE_GLOW[0] * glow_alpha),
static_cast<int>(C_LINE_GLOW[1] * glow_alpha),
static_cast<int>(C_LINE_GLOW[2] * glow_alpha));
cv::line(img, cv::Point(line_x - offset, 0), cv::Point(line_x - offset, h), color, 1, cv::LINE_AA);
cv::line(img, cv::Point(line_x + offset, 0), cv::Point(line_x + offset, h), color, 1, cv::LINE_AA);
}
int dash_len = 18, gap = 12;
for (int y = 0; y < h; y += dash_len + gap) {
int ye = std::min(y + dash_len, h);
cv::line(img, cv::Point(line_x, y), cv::Point(line_x, ye), C_LINE_CORE, 2, cv::LINE_AA);
}
cv::putText(img, "COUNT LINE", cv::Point(line_x - 46, 24),
cv::FONT_HERSHEY_SIMPLEX, 0.42, C_LINE_CORE, 1, cv::LINE_AA);
}
void draw_hero_count(cv::Mat& img, int line_x, int h, int count, int pulse_remaining) {
std::string text = std::to_string(count);
float boost = 0.35f * (pulse_remaining / std::max(15.0f, 1.0f));
double font_scale = 1.6 + boost;
int thickness = static_cast<int>(3 + boost);
int baseline = 0;
cv::Size ts = cv::getTextSize(text, cv::FONT_HERSHEY_SIMPLEX, font_scale, thickness, &baseline);
int pad = 14;
int tx = line_x - ts.width / 2;
int ty = h / 2 + ts.height / 2;
overlay_rect(img, tx - pad, ty - ts.height - pad, tx + ts.width + pad, ty + pad / 2, C_PANEL, 0.78f);
cv::rectangle(img, cv::Rect(tx - pad, ty - ts.height - pad,
ts.width + pad * 2, ts.height + pad + pad / 2),
C_LINE_CORE, 2);
cv::putText(img, text, cv::Point(tx, ty), cv::FONT_HERSHEY_SIMPLEX, font_scale, C_GREEN, thickness, cv::LINE_AA);
}
void draw_hud(cv::Mat& img, int w, int batch_num, int batch_count, int total_ayam,
double elapsed_sec, double rate, const std::string& camera_id, const std::string& clock) {
int bar_h = 52;
overlay_rect(img, 0, 0, w, bar_h, C_PANEL, 0.72f);
cv::line(img, cv::Point(0, bar_h), cv::Point(w, bar_h), C_BORDER, 1);
cv::putText(img, "BATCH", cv::Point(16, 20), cv::FONT_HERSHEY_SIMPLEX, 0.45, C_MUTED, 1, cv::LINE_AA);
std::string batch_label = batch_num ? std::to_string(batch_num) : "\xe2\x80\x94";
cv::putText(img, batch_label, cv::Point(16, 44), cv::FONT_HERSHEY_SIMPLEX, 0.9, C_ACCENT, 2, cv::LINE_AA);
cv::putText(img, "COUNT", cv::Point(100, 20), cv::FONT_HERSHEY_SIMPLEX, 0.45, C_MUTED, 1, cv::LINE_AA);
cv::putText(img, std::to_string(batch_count), cv::Point(100, 44), cv::FONT_HERSHEY_SIMPLEX, 0.9, C_GREEN, 2, cv::LINE_AA);
cv::putText(img, "TOTAL", cv::Point(190, 20), cv::FONT_HERSHEY_SIMPLEX, 0.45, C_MUTED, 1, cv::LINE_AA);
cv::putText(img, std::to_string(total_ayam), cv::Point(190, 44), cv::FONT_HERSHEY_SIMPLEX, 0.7, C_TEXT, 1, cv::LINE_AA);
cv::putText(img, "UPTIME", cv::Point(280, 20), cv::FONT_HERSHEY_SIMPLEX, 0.45, C_MUTED, 1, cv::LINE_AA);
char buf[32];
snprintf(buf, sizeof(buf), "%.1fh", elapsed_sec / 3600.0);
cv::putText(img, buf, cv::Point(280, 44), cv::FONT_HERSHEY_SIMPLEX, 0.7, C_TEXT, 1, cv::LINE_AA);
cv::putText(img, "RATE", cv::Point(380, 20), cv::FONT_HERSHEY_SIMPLEX, 0.45, C_MUTED, 1, cv::LINE_AA);
snprintf(buf, sizeof(buf), "%.1f/min", rate);
cv::putText(img, buf, cv::Point(380, 44), cv::FONT_HERSHEY_SIMPLEX, 0.7, C_ACCENT, 1, cv::LINE_AA);
std::string cam_label = "CAM " + camera_id;
cv::putText(img, cam_label, cv::Point(w - 180, 20), cv::FONT_HERSHEY_SIMPLEX, 0.45, C_MUTED, 1, cv::LINE_AA);
}
void draw_footer(cv::Mat& img, int w, int h, int frame_idx, const std::string& live_tag) {
int bar_h = 28;
overlay_rect(img, 0, h - bar_h, w, h, C_PANEL, 0.55f);
char buf[64];
snprintf(buf, sizeof(buf), "%s | Frame %d", live_tag.c_str(), frame_idx);
cv::putText(img, buf, cv::Point(12, h - 9), cv::FONT_HERSHEY_SIMPLEX, 0.45, C_MUTED, 1, cv::LINE_AA);
}
void draw_skeleton_bold(cv::Mat& img, const std::vector<std::vector<cv::Point2f>>& kpts) {
for (size_t i = 0; i < SKELETON.size(); ++i) {
int a = SKELETON[i].first, b = SKELETON[i].second;
if (a < (int)kpts.size() && b < (int)kpts.size()) {
int xa = static_cast<int>(kpts[a][0].x), ya = static_cast<int>(kpts[a][0].y);
int xb = static_cast<int>(kpts[b][0].x), yb = static_cast<int>(kpts[b][0].y);
if (xa > 0 && ya > 0 && xb > 0 && yb > 0)
cv::line(img, cv::Point(xa, ya), cv::Point(xb, yb), SK_COLORS[i], 3, cv::LINE_AA);
}
}
for (const auto& kp : kpts) {
if (!kp.empty()) {
int x = static_cast<int>(kp[0].x), y = static_cast<int>(kp[0].y);
if (x > 0 && y > 0) {
cv::circle(img, cv::Point(x, y), 6, cv::Scalar(255, 255, 255), -1, cv::LINE_AA);
cv::circle(img, cv::Point(x, y), 6, cv::Scalar(40, 40, 40), 2, cv::LINE_AA);
}
}
}
}
std::vector<Popup> draw_popups(cv::Mat& img, const std::vector<Popup>& popups, int frame_idx) {
std::vector<Popup> alive;
for (const auto& pop : popups) {
int age = frame_idx - pop.born;
if (age > g_config.popup_lifetime) continue;
alive.push_back(pop);
float fade = 1.0f - static_cast<float>(age) / g_config.popup_lifetime;
cv::Scalar color(static_cast<int>(C_GREEN[0] * fade),
static_cast<int>(C_GREEN[1] * fade),
static_cast<int>(C_GREEN[2] * fade));
int y = pop.y - static_cast<int>(age * 1.8f);
cv::putText(img, pop.text, cv::Point(pop.x, y),
cv::FONT_HERSHEY_SIMPLEX, 0.7, color, 2, cv::LINE_AA);
}
return alive;
}
void draw_batch_banner(cv::Mat& img, int w, int batch_num, int pulse_remaining) {
if (pulse_remaining <= 0) return;
std::string text = "NEW BATCH " + std::to_string(batch_num);
int baseline = 0;
cv::Size ts = cv::getTextSize(text, cv::FONT_HERSHEY_SIMPLEX, 0.8, 2, &baseline);
int x1 = w / 2 - ts.width / 2 - 16, y1 = 62;
int x2 = w / 2 + ts.width / 2 + 16, y2 = 62 + ts.height + 20;
overlay_rect(img, x1, y1, x2, y2, C_PANEL, 0.7f);
cv::rectangle(img, cv::Rect(x1, y1, x2 - x1, y2 - y1), C_ACCENT, 2);
cv::putText(img, text, cv::Point(w / 2 - ts.width / 2, 62 + ts.height + 4),
cv::FONT_HERSHEY_SIMPLEX, 0.8, C_ACCENT, 2, cv::LINE_AA);
}
+44
View File
@@ -0,0 +1,44 @@
#pragma once
#include <opencv2/opencv.hpp>
#include <string>
#include <vector>
#include <tuple>
#include <cstdint>
inline const cv::Scalar C_PANEL(18, 24, 28);
inline const cv::Scalar C_BORDER(75, 85, 90);
inline const cv::Scalar C_ACCENT(60, 200, 255);
inline const cv::Scalar C_GREEN(100, 220, 80);
inline const cv::Scalar C_TEXT(235, 235, 235);
inline const cv::Scalar C_MUTED(150, 150, 150);
inline const cv::Scalar C_AYAM_BOX(255, 165, 0);
inline const cv::Scalar C_TALENAN_BOX(60, 120, 220);
inline const cv::Scalar C_LINE_CORE(255, 220, 180);
inline const cv::Scalar C_LINE_GLOW(220, 160, 100);
extern const std::vector<std::pair<int, int>> SKELETON;
extern const std::vector<cv::Scalar> SK_COLORS;
int resolve_line_x(int frame_width, int line_x_opt, float line_x_frac);
bool crossed_line(float prev_cx, float cx, int line_x, const std::string& direction);
void overlay_rect(cv::Mat& img, int x1, int y1, int x2, int y2, const cv::Scalar& color, float alpha = 0.65f);
void draw_pill(cv::Mat& img, const std::string& text, int x, int y,
const cv::Scalar& bg, const cv::Scalar& fg = C_TEXT,
double font_scale = 0.45, int pad_x = 6, int pad_y = 4);
void draw_elegant_counting_line(cv::Mat& img, int line_x, int h, int pulse_remaining = 0);
void draw_hero_count(cv::Mat& img, int line_x, int h, int count, int pulse_remaining = 0);
void draw_hud(cv::Mat& img, int w, int batch_num, int batch_count, int total_ayam,
double elapsed_sec, double rate, const std::string& camera_id, const std::string& clock);
void draw_footer(cv::Mat& img, int w, int h, int frame_idx, const std::string& live_tag);
void draw_skeleton_bold(cv::Mat& img, const std::vector<std::vector<cv::Point2f>>& kpts);
struct Popup {
int x, y;
int born;
std::string text;
};
std::vector<Popup> draw_popups(cv::Mat& img, const std::vector<Popup>& popups, int frame_idx);
void draw_batch_banner(cv::Mat& img, int w, int batch_num, int pulse_remaining);
+59
View File
@@ -0,0 +1,59 @@
#include "kalman_filter.hpp"
KalmanFilter::KalmanFilter() {
constexpr int ndim = kStateDim;
motion_mat_ = Eigen::Matrix<float, kTotalDim, kTotalDim>::Identity();
for (int i = 0; i < ndim; ++i) {
motion_mat_(i, ndim + i) = 1.0f;
}
update_mat_ = Eigen::Matrix<float, kStateDim, kTotalDim>::Zero();
for (int i = 0; i < ndim; ++i) {
update_mat_(i, i) = 1.0f;
}
x = Eigen::Matrix<float, kTotalDim, 1>::Zero();
P = Eigen::Matrix<float, kTotalDim, kTotalDim>::Identity() * 10.0f;
}
void KalmanFilter::predict() {
Eigen::Matrix<float, kTotalDim, 1> std_vec;
std_vec <<
std_weight_position_ * x(2),
std_weight_position_ * x(3),
std_weight_position_ * x(2),
std_weight_position_ * x(3),
std_weight_velocity_ * x(2),
std_weight_velocity_ * x(3),
std_weight_velocity_ * x(2),
std_weight_velocity_ * x(3);
Eigen::Matrix<float, kTotalDim, kTotalDim> Q = std_vec.array().square().matrix().asDiagonal();
x = motion_mat_ * x;
P = motion_mat_ * P * motion_mat_.transpose() + Q;
}
void KalmanFilter::update(const Eigen::Vector4f& z) {
Eigen::Matrix<float, kTotalDim, 1> std_vec;
std_vec <<
std_weight_position_ * z(2),
std_weight_position_ * z(3),
std_weight_position_ * z(2),
std_weight_position_ * z(3),
0, 0, 0, 0;
Eigen::Matrix<float, kStateDim, kStateDim> R = std_vec.head<kStateDim>().array().square().matrix().asDiagonal();
auto H = update_mat_;
Eigen::Matrix<float, kStateDim, kStateDim> S = H * P * H.transpose() + R;
Eigen::Matrix<float, kTotalDim, kStateDim> K = P * H.transpose() * S.inverse();
Eigen::Matrix<float, kStateDim, 1> y = z - H * x;
x = x + K * y;
Eigen::Matrix<float, kTotalDim, kTotalDim> I_KH =
Eigen::Matrix<float, kTotalDim, kTotalDim>::Identity() - K * H;
P = I_KH * P * I_KH.transpose() + K * R * K.transpose();
}
+24
View File
@@ -0,0 +1,24 @@
#pragma once
#include <Eigen/Dense>
#include <cmath>
#include <cstdint>
class KalmanFilter {
public:
static constexpr int kStateDim = 4;
static constexpr int kTotalDim = 2 * kStateDim;
KalmanFilter();
void predict();
void update(const Eigen::Vector4f& z);
Eigen::Matrix<float, kTotalDim, 1> x;
Eigen::Matrix<float, kTotalDim, kTotalDim> P;
private:
Eigen::Matrix<float, kTotalDim, kTotalDim> motion_mat_;
Eigen::Matrix<float, kStateDim, kTotalDim> update_mat_;
float std_weight_position_ = 1.0f / 20.0f;
float std_weight_velocity_ = 1.0f / 160.0f;
};
+391
View File
@@ -0,0 +1,391 @@
#include "config.hpp"
#include "bytetrack.hpp"
#include "batch_store.hpp"
#include "csv_logger.hpp"
#include "rknn_yolo.hpp"
#include "drawing.hpp"
#include "nms.hpp"
#include <opencv2/opencv.hpp>
#include <Eigen/Dense>
#include <csignal>
#include <iostream>
#include <chrono>
#include <thread>
#include <unordered_map>
#include <unordered_set>
#include <deque>
#include <ctime>
#include <filesystem>
static std::atomic<bool> shutdown_requested{false};
static void signal_handler(int) {
shutdown_requested = true;
std::cout << "\nShutdown requested — finishing current frame..." << std::endl;
}
static std::string now_str() {
auto now = std::chrono::system_clock::now();
auto t = std::chrono::system_clock::to_time_t(now);
std::ostringstream ss;
ss << std::put_time(std::localtime(&t), "%Y-%m-%d %H:%M:%S");
return ss.str();
}
static cv::VideoCapture open_capture(const std::string& source) {
bool is_live = source.substr(0, 7) == "rtsp://" || source.substr(0, 7) == "http://";
if (is_live) {
setenv("OPENCV_FFMPEG_CAPTURE_OPTIONS", g_config.rtsp_ffmpeg_options.c_str(), 1);
}
cv::VideoCapture cap(source, cv::CAP_FFMPEG);
cap.set(cv::CAP_PROP_BUFFERSIZE, 1);
return cap;
}
static void warmup_stream(cv::VideoCapture& cap, int n) {
std::cout << "Warming up stream..." << std::endl;
cv::Mat frame;
for (int i = 0; i < n; ++i) cap.read(frame);
std::cout << "Stream ready!" << std::endl;
}
struct TrackedInfo {
float cx;
std::chrono::steady_clock::time_point ts;
};
static void prune_stale_tracks(std::unordered_map<int, TrackedInfo>& tracked, double prune_sec) {
auto now = std::chrono::steady_clock::now();
std::vector<int> stale;
for (auto& [tid, info] : tracked) {
auto age = std::chrono::duration_cast<std::chrono::seconds>(now - info.ts).count();
if (age > prune_sec) stale.push_back(tid);
}
for (int tid : stale) tracked.erase(tid);
}
int main(int argc, char* argv[]) {
signal(SIGINT, signal_handler);
signal(SIGTERM, signal_handler);
const char* env_path = argc > 1 ? argv[1] : nullptr;
g_config.load_from_env(env_path);
std::cout << "Starting ByteTrack Counter (C++)" << std::endl;
std::cout << "Camera: " << g_config.camera_name << std::endl;
std::cout << "Source: " << g_config.source << std::endl;
std::cout << "Model: " << g_config.model_path << std::endl;
std::cout << "DB: " << g_config.db_path << std::endl;
int class_ayam = 0;
int class_talenan = 1;
auto logger = [](const std::string& msg) {
std::cout << "[" << now_str() << "] " << msg << std::endl;
};
BatchStore store(g_config.db_path, g_config.state_file,
g_config.camera_name, g_config.object_label,
g_config.daily_cutoff_time,
g_config.batch_timeout_seconds,
g_config.ignore_batch_label_timeout,
g_config.min_object_per_batch,
g_config.min_duration_per_batch,
logger);
store.start_cutoff_watcher();
std::unique_ptr<CsvLogger> cross_logger;
if (g_config.export_csv) {
cross_logger = std::make_unique<CsvLogger>(g_config.cross_csv,
std::vector<std::string>{"batch", "frame", "timestamp", "chicken_id"});
}
RKNNYOLO model(g_config.model_path, g_config.core_mask,
g_config.imgsz, g_config.conf, 0.45f,
g_config.num_classes, 0, g_config.score_sigmoid);
ByteTracker ayam_tracker(g_config.track_high_thresh, g_config.track_low_thresh,
g_config.track_match_thresh, g_config.track_buffer,
g_config.track_min_hits);
ByteTracker talenan_tracker(g_config.track_high_thresh, g_config.track_low_thresh,
g_config.track_match_thresh, g_config.track_buffer,
g_config.track_min_hits);
std::unordered_set<int> ayam_line_crossed;
std::unordered_set<int> talenan_line_crossed;
std::unordered_map<int, int> ayam_cross_flash;
std::unordered_map<int, int> talenan_cross_flash;
int line_pulse = 0, count_pulse = 0, batch_pulse = 0;
std::vector<Popup> popups;
auto session_start = std::chrono::steady_clock::now();
int frame_idx = 0;
cv::VideoCapture cap = open_capture(g_config.source);
bool is_live = g_config.source.substr(0, 7) == "rtsp://" ||
g_config.source.substr(0, 7) == "http://";
if (!cap.isOpened()) {
std::cerr << "Cannot open source: " << g_config.source << std::endl;
store.shutdown();
return 1;
}
if (is_live && g_config.warmup_frames > 0)
warmup_stream(cap, g_config.warmup_frames);
int w = static_cast<int>(cap.get(cv::CAP_PROP_FRAME_WIDTH));
int h = static_cast<int>(cap.get(cv::CAP_PROP_FRAME_HEIGHT));
double fps_prop = cap.get(cv::CAP_PROP_FPS);
if (fps_prop <= 1) fps_prop = g_config.output_fps;
int line_x = resolve_line_x(w, g_config.line_x, g_config.line_x_frac);
std::cout << "RKNN+ByteTrack counter | " << w << "x" << h << " @ "
<< fps_prop << "fps | line x=" << line_x
<< " | cross=" << g_config.cross_direction << std::endl;
int reconnect_count = 0;
std::unordered_map<int, TrackedInfo> ayam_tracked;
std::unordered_map<int, TrackedInfo> talenan_tracked;
while (!shutdown_requested) {
cv::Mat frame;
cap >> frame;
if (frame.empty()) {
if (!is_live) break;
reconnect_count++;
std::cout << "Stream dropped (attempt " << reconnect_count
<< "), reconnecting..." << std::endl;
cap.release();
std::this_thread::sleep_for(std::chrono::seconds(g_config.reconnect_delay_sec));
cap = open_capture(g_config.source);
if (!cap.isOpened()) break;
w = static_cast<int>(cap.get(cv::CAP_PROP_FRAME_WIDTH));
h = static_cast<int>(cap.get(cv::CAP_PROP_FRAME_HEIGHT));
line_x = resolve_line_x(w, g_config.line_x, g_config.line_x_frac);
continue;
}
auto elapsed_sec = std::chrono::duration_cast<std::chrono::seconds>(
std::chrono::steady_clock::now() - session_start).count();
auto mono = std::chrono::steady_clock::now();
bool ayam_crossed_frame = false, batch_closed_frame = false, batch_started_frame = false;
std::vector<Detection> detections = model(frame);
if (!detections.empty()) {
std::vector<Eigen::Vector4f> ayam_boxes, talenan_boxes;
std::vector<float> ayam_scores, talenan_scores;
std::vector<float> ayam_cx_list, talenan_cx_list;
std::vector<std::vector<std::vector<cv::Point2f>>> ayam_kpts_list;
for (const auto& det : detections) {
const auto& bbox = det.bbox;
float cx = (bbox(0) + bbox(2)) / 2.0f;
if (det.cls == class_talenan) {
talenan_boxes.push_back(bbox);
talenan_scores.push_back(det.score);
talenan_cx_list.push_back(cx);
} else if (det.cls == class_ayam) {
ayam_boxes.push_back(bbox);
ayam_scores.push_back(det.score);
ayam_cx_list.push_back(cx);
ayam_kpts_list.push_back(det.keypoints);
}
}
int na = static_cast<int>(ayam_boxes.size());
int nt = static_cast<int>(talenan_boxes.size());
Eigen::MatrixXf ayam_mat(na, 4), talenan_mat(nt, 4);
Eigen::VectorXf ayam_scores_vec(na), talenan_scores_vec(nt);
for (int i = 0; i < na; ++i) {
ayam_mat.row(i) = ayam_boxes[i];
ayam_scores_vec(i) = ayam_scores[i];
}
for (int i = 0; i < nt; ++i) {
talenan_mat.row(i) = talenan_boxes[i];
talenan_scores_vec(i) = talenan_scores[i];
}
TrackResult ayam_tr = ayam_tracker.update(ayam_mat, ayam_scores_vec);
TrackResult talenan_tr = talenan_tracker.update(talenan_mat, talenan_scores_vec);
// Process talenan crossings
for (int di = 0; di < nt; ++di) {
auto it = talenan_tr.det_to_track.find(di);
if (it == talenan_tr.det_to_track.end()) continue;
int tid = it->second;
float cx = talenan_cx_list[di];
auto tit = talenan_tracked.find(tid);
if (tit != talenan_tracked.end()) {
float prev_cx = tit->second.cx;
if (crossed_line(prev_cx, cx, line_x, g_config.cross_direction) &&
talenan_line_crossed.find(tid) == talenan_line_crossed.end()) {
talenan_line_crossed.insert(tid);
if (store.record_talenan_crossing(tid)) {
batch_closed_frame = true;
talenan_cross_flash[tid] = g_config.cross_flash_frames;
popups.push_back({
static_cast<int>(cx) - 20,
static_cast<int>((talenan_boxes[di](1) + talenan_boxes[di](3)) / 2),
frame_idx, "BATCH CLOSED"
});
}
}
}
talenan_tracked[tid] = {cx, mono};
}
// Process ayam crossings
for (int di = 0; di < na; ++di) {
auto it = ayam_tr.det_to_track.find(di);
if (it == ayam_tr.det_to_track.end()) continue;
int tid = it->second;
float cx = ayam_cx_list[di];
auto tit = ayam_tracked.find(tid);
if (tit != ayam_tracked.end()) {
float prev_cx = tit->second.cx;
if (crossed_line(prev_cx, cx, line_x, g_config.cross_direction) &&
ayam_line_crossed.find(tid) == ayam_line_crossed.end()) {
ayam_line_crossed.insert(tid);
auto [count, started_new] = store.record_ayam_crossing(tid);
if (cross_logger) {
std::ostringstream frame_str, tid_str;
frame_str << frame_idx;
tid_str << tid;
cross_logger->write_row({
std::to_string(store.current_batch_number()),
frame_str.str(),
now_str(),
tid_str.str()
});
}
ayam_crossed_frame = true;
if (started_new) batch_started_frame = true;
ayam_cross_flash[tid] = g_config.cross_flash_frames;
popups.push_back({
static_cast<int>(cx) - 12,
static_cast<int>((ayam_boxes[di](1) + ayam_boxes[di](3)) / 2),
frame_idx, "+1"
});
}
}
ayam_tracked[tid] = {cx, mono};
}
// Track lost tracks for continuity
for (auto& [tid, cx] : ayam_tr.lost_map) {
if (ayam_tracked.find(tid) == ayam_tracked.end())
ayam_tracked[tid] = {cx, mono};
}
// Draw talenan
for (int di = 0; di < nt; ++di) {
auto it = talenan_tr.det_to_track.find(di);
if (it == talenan_tr.det_to_track.end()) continue;
int tid = it->second;
const auto& bbox = talenan_boxes[di];
int x1 = static_cast<int>(bbox(0)), y1 = static_cast<int>(bbox(1));
int x2 = static_cast<int>(bbox(2)), y2 = static_cast<int>(bbox(3));
int flash = talenan_cross_flash.count(tid) ? talenan_cross_flash[tid] : 0;
cv::Scalar color = flash > 0 ? C_GREEN : C_TALENAN_BOX;
cv::rectangle(frame, cv::Point(x1, y1), cv::Point(x2, y2), color, flash > 0 ? 3 : 2);
draw_pill(frame, "TALENAN " + std::to_string(tid), x1, y1 - 4, color);
}
// Draw ayam
for (int di = 0; di < na; ++di) {
auto it = ayam_tr.det_to_track.find(di);
if (it == ayam_tr.det_to_track.end()) continue;
int tid = it->second;
const auto& bbox = ayam_boxes[di];
int x1 = static_cast<int>(bbox(0)), y1 = static_cast<int>(bbox(1));
int x2 = static_cast<int>(bbox(2)), y2 = static_cast<int>(bbox(3));
int flash = ayam_cross_flash.count(tid) ? ayam_cross_flash[tid] : 0;
cv::Scalar color = flash > 0 ? C_GREEN : C_AYAM_BOX;
cv::rectangle(frame, cv::Point(x1, y1), cv::Point(x2, y2), color, flash > 0 ? 3 : 2);
draw_pill(frame, "ID " + std::to_string(tid), x1, y1 - 4, color);
if (di < (int)ayam_kpts_list.size() && !ayam_kpts_list[di].empty())
draw_skeleton_bold(frame, ayam_kpts_list[di]);
}
}
if (ayam_crossed_frame) {
line_pulse = g_config.line_pulse_frames;
count_pulse = g_config.count_pulse_frames;
}
if (batch_closed_frame) {
line_pulse = g_config.line_pulse_frames;
}
if (batch_started_frame) {
batch_pulse = g_config.batch_pulse_frames;
}
int batch_num = store.current_batch_number();
int batch_count = store.current_batch_count();
int display_total = store.display_total();
double elapsed = static_cast<double>(elapsed_sec);
double rate = elapsed > 0 ? (display_total / elapsed * 60.0) : 0.0;
draw_elegant_counting_line(frame, line_x, h, line_pulse);
draw_hero_count(frame, line_x, h, batch_count, count_pulse);
draw_hud(frame, w, batch_num, batch_count, display_total,
elapsed, rate, g_config.camera_name, now_str());
draw_batch_banner(frame, w, batch_num, batch_pulse);
draw_footer(frame, w, h, frame_idx, is_live ? "LIVE-RKNN-BT" : "FILE-RKNN-BT");
popups = draw_popups(frame, popups, frame_idx);
// Flash decay
for (auto& flash_map : {&ayam_cross_flash, &talenan_cross_flash}) {
for (auto it = flash_map->begin(); it != flash_map->end(); ) {
it->second--;
if (it->second <= 0) it = flash_map->erase(it);
else ++it;
}
}
line_pulse = std::max(0, line_pulse - 1);
count_pulse = std::max(0, count_pulse - 1);
batch_pulse = std::max(0, batch_pulse - 1);
if (g_config.live_stream_enabled && frame_idx % g_config.live_stream_every_n == 0) {
try {
std::filesystem::path p(g_config.live_stream_frame_path);
if (p.has_parent_path())
std::filesystem::create_directories(p.parent_path());
std::vector<uint8_t> jpeg;
cv::imencode(".jpg", frame, jpeg,
{cv::IMWRITE_JPEG_QUALITY, g_config.live_stream_quality});
std::ofstream f(g_config.live_stream_frame_path, std::ios::binary);
f.write(reinterpret_cast<const char*>(jpeg.data()), jpeg.size());
} catch (...) {}
}
frame_idx++;
if (frame_idx % g_config.flush_every_n_frames == 0) {
std::cout << "[" << now_str() << "] Frame " << frame_idx
<< " | Batch " << batch_num << ": " << batch_count
<< " | Total: " << display_total
<< " | Uptime " << (elapsed / 3600.0) << "h" << std::endl;
}
prune_stale_tracks(ayam_tracked, g_config.tracked_prune_sec);
prune_stale_tracks(talenan_tracked, g_config.tracked_prune_sec);
}
cap.release();
store.shutdown();
std::cout << "\n=== Batch Summary (SQLite) ===" << std::endl;
std::cout << "Database: " << g_config.db_path << std::endl;
return 0;
}
+86
View File
@@ -0,0 +1,86 @@
#pragma once
#include <Eigen/Dense>
#include <vector>
#include <algorithm>
#include <numeric>
inline std::vector<int> nms(const Eigen::MatrixXf& boxes, const Eigen::VectorXf& scores, float iou_thr = 0.45f) {
std::vector<int> order(scores.size());
std::iota(order.begin(), order.end(), 0);
std::sort(order.begin(), order.end(), [&](int a, int b) { return scores(a) > scores(b); });
std::vector<int> keep;
while (!order.empty()) {
int idx = order[0];
keep.push_back(idx);
if (order.size() == 1) break;
std::vector<int> remain;
for (size_t i = 1; i < order.size(); ++i) {
int j = order[i];
float xx1 = std::max(boxes(idx, 0), boxes(j, 0));
float yy1 = std::max(boxes(idx, 1), boxes(j, 1));
float xx2 = std::min(boxes(idx, 2), boxes(j, 2));
float yy2 = std::min(boxes(idx, 3), boxes(j, 3));
float w = std::max(0.0f, xx2 - xx1);
float h = std::max(0.0f, yy2 - yy1);
float inter = w * h;
float area_i = (boxes(idx, 2) - boxes(idx, 0)) * (boxes(idx, 3) - boxes(idx, 1));
float area_j = (boxes(j, 2) - boxes(j, 0)) * (boxes(j, 3) - boxes(j, 1));
float iou = inter / (area_i + area_j - inter + 1e-16f);
if (iou < iou_thr) remain.push_back(j);
}
order = remain;
}
return keep;
}
inline Eigen::MatrixXf ious_xyxy(const Eigen::MatrixXf& boxes_a, const Eigen::MatrixXf& boxes_b) {
int n = static_cast<int>(boxes_a.rows());
int m = static_cast<int>(boxes_b.rows());
if (n == 0 || m == 0) return Eigen::MatrixXf::Zero(n, m);
Eigen::MatrixXf iou_mat(n, m);
for (int i = 0; i < n; ++i) {
for (int j = 0; j < m; ++j) {
float xx1 = std::max(boxes_a(i, 0), boxes_b(j, 0));
float yy1 = std::max(boxes_a(i, 1), boxes_b(j, 1));
float xx2 = std::min(boxes_a(i, 2), boxes_b(j, 2));
float yy2 = std::min(boxes_a(i, 3), boxes_b(j, 3));
float iw = std::max(0.0f, xx2 - xx1);
float ih = std::max(0.0f, yy2 - yy1);
float inter = iw * ih;
float area_a = (boxes_a(i, 2) - boxes_a(i, 0)) * (boxes_a(i, 3) - boxes_a(i, 1));
float area_b = (boxes_b(j, 2) - boxes_b(j, 0)) * (boxes_b(j, 3) - boxes_b(j, 1));
iou_mat(i, j) = inter / (area_a + area_b - inter + 1e-16f);
}
}
return iou_mat;
}
inline std::vector<std::pair<int, int>> greedy_match(const Eigen::MatrixXf& cost_matrix, float threshold = 0.3f) {
if (cost_matrix.size() == 0) return {};
int n = static_cast<int>(cost_matrix.rows());
int m = static_cast<int>(cost_matrix.cols());
std::vector<std::tuple<float, int, int>> flat;
flat.reserve(n * m);
for (int i = 0; i < n; ++i)
for (int j = 0; j < m; ++j)
flat.emplace_back(cost_matrix(i, j), i, j);
std::sort(flat.begin(), flat.end());
std::vector<bool> row_used(n, false);
std::vector<bool> col_used(m, false);
std::vector<std::pair<int, int>> pairs;
for (const auto& [cost, i, j] : flat) {
if (cost >= threshold) break;
if (row_used[i] || col_used[j]) continue;
row_used[i] = true;
col_used[j] = true;
pairs.emplace_back(i, j);
}
return pairs;
}
+230
View File
@@ -0,0 +1,230 @@
#include "rknn_yolo.hpp"
#include "nms.hpp"
#include <iostream>
#ifdef HAS_RKNN
#include "rknn_api.h"
RKNNYOLO::RKNNYOLO(const std::string& model_path, int core_mask, int imgsz,
float conf, float iou, int num_classes, int num_keypoints, bool score_sigmoid)
: imgsz_(imgsz), conf_(conf), iou_(iou), num_classes_(num_classes),
num_keypoints_(num_keypoints), score_sigmoid_(score_sigmoid) {
FILE* fp = fopen(model_path.c_str(), "rb");
if (!fp) {
std::cerr << "Failed to open RKNN model: " << model_path << std::endl;
return;
}
fseek(fp, 0, SEEK_END);
size_t model_size = ftell(fp);
fseek(fp, 0, SEEK_SET);
std::vector<uint8_t> model_data(model_size);
fread(model_data.data(), 1, model_size, fp);
fclose(fp);
int ret = rknn_init(&rknn_ctx_, model_data.data(), model_size,
0, nullptr);
if (ret != 0) {
std::cerr << "Failed to init RKNN (ret=" << ret << ")" << std::endl;
return;
}
rknn_set_core_mask(rknn_ctx_, static_cast<rknn_core_mask>(core_mask));
rknn_input_output_num io_num;
ret = rknn_query(rknn_ctx_, RKNN_QUERY_IN_OUT_NUM, &io_num, sizeof(io_num));
if (ret != 0) {
std::cerr << "Failed to query RKNN IO" << std::endl;
return;
}
std::cout << "IO nums: inputs=" << io_num.n_input << " outputs=" << io_num.n_output << std::endl;
rknn_tensor_attr in_attr;
memset(&in_attr, 0, sizeof(in_attr));
if (io_num.n_input > 0) {
in_attr.index = 0;
ret = rknn_query(rknn_ctx_, RKNN_QUERY_INPUT_ATTR, &in_attr, sizeof(in_attr));
if (ret == 0) {
std::cout << "Input attr: fmt=" << in_attr.fmt << " type=" << in_attr.type
<< " n_dims=" << in_attr.n_dims << " dims=[";
for (uint32_t d = 0; d < in_attr.n_dims; ++d) {
if (d > 0) std::cout << ",";
std::cout << in_attr.dims[d];
}
std::cout << "]" << std::endl;
}
in_attr.dims[0] = 1;
in_attr.dims[1] = imgsz_;
in_attr.dims[2] = imgsz_;
in_attr.dims[3] = 3;
in_attr.n_dims = 4;
ret = rknn_set_input_shapes(rknn_ctx_, io_num.n_input, &in_attr);
if (ret != 0) {
std::cerr << "Failed to set input shapes (ret=" << ret << ")" << std::endl;
} else {
std::cout << "Input shapes set: [1," << imgsz_ << "," << imgsz_ << ",3]" << std::endl;
}
}
if (io_num.n_output > 0) {
rknn_tensor_attr out_attr;
memset(&out_attr, 0, sizeof(out_attr));
out_attr.index = 0;
ret = rknn_query(rknn_ctx_, RKNN_QUERY_OUTPUT_ATTR, &out_attr, sizeof(out_attr));
if (ret == 0 && out_attr.n_dims >= 2) {
int first_dim = out_attr.n_dims > 1 ? out_attr.dims[out_attr.n_dims - 2] : 0;
int last_dim = out_attr.dims[out_attr.n_dims - 1];
if (first_dim == num_classes_ + 4) {
output_transposed_ = true;
output_n_pred_ = last_dim;
} else if (last_dim == num_classes_ + 4) {
output_transposed_ = false;
output_n_pred_ = first_dim;
}
std::cout << "Output shape: [";
for (uint32_t d = 0; d < out_attr.n_dims; ++d) {
if (d > 0) std::cout << ", ";
std::cout << out_attr.dims[d];
}
std::cout << "] transposed=" << (output_transposed_ ? "true" : "false")
<< " n_pred=" << output_n_pred_ << std::endl;
}
}
loaded_ = true;
std::cout << "RKNN model loaded: " << model_path << " imgsz=" << imgsz_
<< " core_mask=" << core_mask << std::endl;
}
RKNNYOLO::~RKNNYOLO() {
if (loaded_ && rknn_ctx_) {
rknn_destroy(rknn_ctx_);
}
}
cv::Mat RKNNYOLO::preprocess(const cv::Mat& frame, Eigen::Vector4f& gains) {
int h0 = frame.rows, w0 = frame.cols;
float scale = std::min((float)imgsz_ / h0, (float)imgsz_ / w0);
int nh = static_cast<int>(h0 * scale), nw = static_cast<int>(w0 * scale);
cv::Mat resized;
cv::resize(frame, resized, cv::Size(nw, nh), 0, 0, cv::INTER_LINEAR);
cv::Mat letterbox(imgsz_, imgsz_, CV_8UC3, cv::Scalar(114, 114, 114));
int dy = (imgsz_ - nh) / 2, dx = (imgsz_ - nw) / 2;
resized.copyTo(letterbox(cv::Rect(dx, dy, nw, nh)));
cv::Mat rgb;
cv::cvtColor(letterbox, rgb, cv::COLOR_BGR2RGB);
gains << scale, scale, (float)dy, (float)dx;
return rgb;
}
std::vector<Detection> RKNNYOLO::operator()(const cv::Mat& frame) {
std::vector<Detection> detections;
if (!loaded_) return detections;
int h0 = frame.rows, w0 = frame.cols;
Eigen::Vector4f gains;
cv::Mat rgb = preprocess(frame, gains);
float scale = gains(0);
int pad_y = static_cast<int>(gains(2)), pad_x = static_cast<int>(gains(3));
rknn_input inputs[1];
memset(inputs, 0, sizeof(inputs));
inputs[0].index = 0;
inputs[0].type = RKNN_TENSOR_UINT8;
inputs[0].fmt = RKNN_TENSOR_NHWC;
inputs[0].buf = rgb.data;
inputs[0].size = imgsz_ * imgsz_ * 3;
rknn_inputs_set(rknn_ctx_, 1, inputs);
rknn_output outputs[1];
memset(outputs, 0, sizeof(outputs));
outputs[0].want_float = 1;
rknn_run(rknn_ctx_, nullptr);
rknn_outputs_get(rknn_ctx_, 1, outputs, nullptr);
float* out_data = (float*)outputs[0].buf;
int n_pred = output_n_pred_;
if (n_pred <= 0) n_pred = (int)(outputs[0].size / sizeof(float)) / (4 + num_classes_);
int stride = 4 + num_classes_;
for (int i = 0; i < n_pred; ++i) {
float cx, cy, w, h;
float cls_scores[15];
if (output_transposed_) {
cx = out_data[i];
cy = out_data[i + n_pred];
w = out_data[i + n_pred * 2];
h = out_data[i + n_pred * 3];
for (int c = 0; c < num_classes_; ++c)
cls_scores[c] = out_data[i + n_pred * (4 + c)];
} else {
float* pred = out_data + i * stride;
cx = pred[0]; cy = pred[1]; w = pred[2]; h = pred[3];
for (int c = 0; c < num_classes_; ++c)
cls_scores[c] = pred[4 + c];
}
float x1 = cx - w / 2, y1 = cy - h / 2, x2 = cx + w / 2, y2 = cy + h / 2;
float max_score = 0;
int best_cls = 0;
for (int c = 0; c < num_classes_; ++c) {
float s = score_sigmoid_ ? (1.0f / (1.0f + std::exp(-cls_scores[c]))) : cls_scores[c];
if (s > max_score) { max_score = s; best_cls = c; }
}
if (max_score > conf_) {
x1 = (x1 - pad_x) / scale; y1 = (y1 - pad_y) / scale;
x2 = (x2 - pad_x) / scale; y2 = (y2 - pad_y) / scale;
x1 = std::clamp(x1, 0.0f, (float)w0);
y1 = std::clamp(y1, 0.0f, (float)h0);
x2 = std::clamp(x2, 0.0f, (float)w0);
y2 = std::clamp(y2, 0.0f, (float)h0);
Detection det;
det.bbox << x1, y1, x2, y2;
det.score = max_score;
det.cls = best_cls;
detections.push_back(det);
}
}
rknn_outputs_release(rknn_ctx_, 1, outputs);
return detections;
}
#else
// Stub implementation when RKNN is not available
RKNNYOLO::RKNNYOLO(const std::string& model_path, int core_mask, int imgsz,
float conf, float iou, int num_classes, int num_keypoints, bool score_sigmoid)
: imgsz_(imgsz), conf_(conf), iou_(iou), num_classes_(num_classes),
num_keypoints_(num_keypoints), score_sigmoid_(score_sigmoid) {
std::cerr << "WARNING: Built without RKNN support. Model path: " << model_path << std::endl;
}
RKNNYOLO::~RKNNYOLO() {}
cv::Mat RKNNYOLO::preprocess(const cv::Mat& frame, Eigen::Vector4f& gains) {
int h0 = frame.rows, w0 = frame.cols;
float scale = std::min((float)imgsz_ / h0, (float)imgsz_ / w0);
int nh = static_cast<int>(h0 * scale), nw = static_cast<int>(w0 * scale);
cv::Mat resized;
cv::resize(frame, resized, cv::Size(nw, nh), 0, 0, cv::INTER_LINEAR);
cv::Mat letterbox(imgsz_, imgsz_, CV_8UC3, cv::Scalar(114, 114, 114));
int dy = (imgsz_ - nh) / 2, dx = (imgsz_ - nw) / 2;
resized.copyTo(letterbox(cv::Rect(dx, dy, nw, nh)));
cv::Mat rgb;
cv::cvtColor(letterbox, rgb, cv::COLOR_BGR2RGB);
gains << scale, scale, (float)dy, (float)dx;
return rgb;
}
std::vector<Detection> RKNNYOLO::operator()(const cv::Mat& frame) {
return {};
}
#endif
+51
View File
@@ -0,0 +1,51 @@
#pragma once
#include <opencv2/opencv.hpp>
#include <Eigen/Dense>
#include <vector>
#include <string>
#ifdef HAS_RKNN
#include "rknn_api.h"
#endif
struct Detection {
Eigen::Vector4f bbox;
float score;
int cls;
std::vector<std::vector<cv::Point2f>> keypoints;
};
class RKNNYOLO {
public:
RKNNYOLO(const std::string& model_path,
int core_mask = 1,
int imgsz = 320,
float conf = 0.3f,
float iou = 0.45f,
int num_classes = 2,
int num_keypoints = 0,
bool score_sigmoid = false);
~RKNNYOLO();
std::vector<Detection> operator()(const cv::Mat& frame);
bool is_loaded() const { return loaded_; }
private:
cv::Mat preprocess(const cv::Mat& frame, Eigen::Vector4f& gains);
int imgsz_;
float conf_;
float iou_;
int num_classes_;
int num_keypoints_;
bool score_sigmoid_;
bool loaded_ = false;
bool output_transposed_ = false;
int output_n_pred_ = 0;
#ifdef HAS_RKNN
rknn_context rknn_ctx_ = 0;
#endif
};