diff --git a/.gitignore b/.gitignore index ac84cdc..0728111 100644 --- a/.gitignore +++ b/.gitignore @@ -3,11 +3,10 @@ .cache/ .vscode/ -build*/ +/build/ +/dist/ .xmake/ compile_commands.json -vcpkg_installed/ -vcpkg/ x64-linux/ arm64-linux/ @@ -45,7 +44,6 @@ arm64-linux/ *.la *.a *.lib -app-sdk/ # Executables *.exe @@ -59,7 +57,6 @@ tags logs/ # Testing artifacts -config/ data/ Testing/ diff --git a/CMakeLists.txt b/CMakeLists.txt index 6b227a3..2bf0699 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -60,7 +60,7 @@ set_target_properties(synapse-example-app PROPERTIES target_include_directories(synapse-example-app PUBLIC - ${CMAKE_CURRENT_SOURCE_DIR}/include + ${CMAKE_CURRENT_SOURCE_DIR}/src PRIVATE ${PROTO_OUT_DIR} ) @@ -76,3 +76,7 @@ target_link_libraries(synapse-example-app PRIVATE spdlog::spdlog ) + +# Packaging configuration +set(CPACK_PACKAGE_DIRECTORY "${CMAKE_SOURCE_DIR}/dist") +include(CPack) diff --git a/CMakePresets.json b/CMakePresets.json index 2478420..4c736d4 100644 --- a/CMakePresets.json +++ b/CMakePresets.json @@ -1,90 +1,90 @@ { - "version": 6, - "cmakeMinimumRequired": { - "major": 3, - "minor": 20, - "patch": 1 - }, - "configurePresets": [ - { - "name": "dynamic", - "displayName": "Configure (Dynamic)", - "description": "Configure (Dynamic)", - "binaryDir": "${sourceDir}/build", - "generator": "Unix Makefiles", - "cacheVariables": { - "CMAKE_TOOLCHAIN_FILE": { - "type": "FILEPATH", - "value": "$env{VCPKG_ROOT}/scripts/buildsystems/vcpkg.cmake" - }, - "BUILD_SHARED_LIBS": { - "type": "BOOL", - "value": "ON" - } - } + "version": 6, + "cmakeMinimumRequired": { + "major": 3, + "minor": 20, + "patch": 1 + }, + "configurePresets": [ + { + "name": "dynamic", + "displayName": "Configure (Dynamic)", + "description": "Configure (Dynamic)", + "binaryDir": "${sourceDir}/build/host", + "generator": "Unix Makefiles", + "cacheVariables": { + "CMAKE_TOOLCHAIN_FILE": { + "type": "FILEPATH", + "value": "$env{VCPKG_ROOT}/scripts/buildsystems/vcpkg.cmake" + }, + "BUILD_SHARED_LIBS": { + "type": "BOOL", + "value": "ON" }, - { - "name": "dynamic-aarch64", - "displayName": "Configure aarch64 (Dynamic)", - "description": "Configure aarch64 (Dynamic)", - "binaryDir": "${sourceDir}/build-aarch64", - "generator": "Unix Makefiles", - "cacheVariables": { - "CMAKE_TOOLCHAIN_FILE": { - "type": "FILEPATH", - "value": "$env{VCPKG_ROOT}/scripts/buildsystems/vcpkg.cmake" - }, - "VCPKG_INSTALLED_DIR": { - "type": "FILEPATH", - "value": "$env{VCPKG_INSTALLED_DIR}" - }, - "BUILD_SHARED_LIBS": { - "type": "BOOL", - "value": "ON" - }, - "BUILD_FOR_ARM64": { - "type": "BOOL", - "value": "ON" - }, - "BUILD_FOR_QCS6490": { - "type": "BOOL", - "value": "ON" - }, - "CMAKE_BUILD_TYPE": { - "type": "STRING", - "value": "Release" - } - } + "VCPKG_INSTALLED_DIR": { + "type": "FILEPATH", + "value": "${sourceDir}/build/host/vcpkg_installed" } - ], - "buildPresets": [ - { - "name": "debug", - "configurePreset": "dynamic", - "displayName": "Build (Debug)", - "description": "Build (Debug)", - "configuration": "Debug" + } + }, + { + "name": "dynamic-aarch64", + "displayName": "Configure aarch64 (Dynamic)", + "description": "Configure aarch64 (Dynamic)", + "binaryDir": "${sourceDir}/build/aarch64", + "generator": "Unix Makefiles", + "cacheVariables": { + "CMAKE_TOOLCHAIN_FILE": { + "type": "FILEPATH", + "value": "$env{VCPKG_ROOT}/scripts/buildsystems/vcpkg.cmake" + }, + "VCPKG_INSTALLED_DIR": { + "type": "FILEPATH", + "value": "${sourceDir}/build/host/vcpkg_installed" }, - { - "name": "release", - "configurePreset": "dynamic", - "displayName": "Build (Release)", - "description": "Build (Release)", - "configuration": "Release" + "BUILD_SHARED_LIBS": { + "type": "BOOL", + "value": "ON" }, - { - "name": "cross", - "configurePreset": "dynamic-aarch64", - "displayName": "Build (aarch64 Debug)", - "description": "Build (aarch64 Debug)", - "configuration": "Debug" + "BUILD_FOR_ARM64": { + "type": "BOOL", + "value": "ON" }, - { - "name": "cross-release", - "configurePreset": "dynamic-aarch64", - "displayName": "Build (aarch64 Release)", - "description": "Build (aarch64 Release)", - "configuration": "Release" + "CMAKE_BUILD_TYPE": { + "type": "STRING", + "value": "Release" } - ] + } + } + ], + "buildPresets": [ + { + "name": "debug", + "configurePreset": "dynamic", + "displayName": "Build (Debug)", + "description": "Build (Debug)", + "configuration": "Debug" + }, + { + "name": "release", + "configurePreset": "dynamic", + "displayName": "Build (Release)", + "description": "Build (Release)", + "configuration": "Release" + }, + { + "name": "cross", + "configurePreset": "dynamic-aarch64", + "displayName": "Build (aarch64 Debug)", + "description": "Build (aarch64 Debug)", + "configuration": "Debug" + }, + { + "name": "cross-release", + "configurePreset": "dynamic-aarch64", + "displayName": "Build (aarch64 Release)", + "description": "Build (aarch64 Release)", + "configuration": "Release" + } + ] } diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..65db546 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,131 @@ +# syntax=docker/dockerfile:1 + +# Unified builder for both linux/arm64 (native) and linux/amd64 (cross-compile → arm64) +ARG TARGETPLATFORM +FROM ubuntu:20.04 AS base + +ARG TARGETPLATFORM +ARG VCPKG_COMMIT=0f88ecb8528605f91980b90a2c5bad88e3cb565f + +# ----------------------------------------------------------------------------- +# Base environment variables +# ----------------------------------------------------------------------------- +ENV DEBIAN_FRONTEND=noninteractive \ + VCPKG_ROOT=/vcpkg \ + PATH="${PATH}:/vcpkg" + +# ----------------------------------------------------------------------------- +# APT sources – add arm64 repos when we are on an amd64 host (cross-compiling) +# ----------------------------------------------------------------------------- +RUN set -eux; \ + if [ "${TARGETPLATFORM}" = "linux/amd64" ]; then \ + dpkg --add-architecture arm64; \ + # Mark the default entries as amd64-only (avoid downloading both arch indices) + sed 's/^deb http/deb [arch=amd64] http/' -i /etc/apt/sources.list; \ + echo "deb [arch=arm64] http://ports.ubuntu.com/ focal main restricted" > /etc/apt/sources.list.d/arm64-cross-compile.list; \ + echo "deb [arch=arm64] http://ports.ubuntu.com/ focal-updates main restricted" >> /etc/apt/sources.list.d/arm64-cross-compile.list; \ + fi + +# ----------------------------------------------------------------------------- +# Core build dependencies (split for native vs cross compile) +# ----------------------------------------------------------------------------- +RUN set -eux; \ + apt-get update; \ + if [ "${TARGETPLATFORM}" = "linux/amd64" ]; then \ + apt-get install -y --no-install-recommends \ + autoconf autoconf-archive build-essential \ + gcc-10-aarch64-linux-gnu g++-10-aarch64-linux-gnu binutils-aarch64-linux-gnu \ + git curl wget ca-certificates gpg unzip tar pkg-config \ + libssl-dev libtool zip ninja-build gosu \ + python3 python3-setuptools python3-jinja2 python3-pip \ + libudev-dev:arm64 libudev-dev qemu-user-static; \ + else \ + apt-get install -y --no-install-recommends \ + autoconf autoconf-archive build-essential \ + gcc-10 g++-10 \ + git curl wget ca-certificates gpg unzip tar pkg-config \ + libssl-dev libtool zip ninja-build gosu \ + python3 python3-setuptools python3-jinja2 python3-pip \ + libudev-dev; \ + fi; \ + rm -rf /var/lib/apt/lists/* + +# ----------------------------------------------------------------------------- +# Ruby tool-chain for packaging helpers (common to both) +# ----------------------------------------------------------------------------- +RUN set -eux; \ + apt-get update; \ + apt-get install -y --no-install-recommends ruby-full ruby-dev rubygems build-essential; \ + rm -rf /var/lib/apt/lists/* + +# ----------------------------------------------------------------------------- +# Compiler selection tweaks (native vs cross) +# ----------------------------------------------------------------------------- +RUN set -eux; \ + if [ "${TARGETPLATFORM}" = "linux/amd64" ]; then \ + # Provide un-suffixed symlinks for the cross compiler to simplify build scripts + ln -s /usr/bin/aarch64-linux-gnu-gcc-10 /usr/bin/aarch64-linux-gnu-gcc; \ + ln -s /usr/bin/aarch64-linux-gnu-g++-10 /usr/bin/aarch64-linux-gnu-g++; \ + else \ + # Make gcc-10 the system default on native arm64 + update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-10 100 --slave /usr/bin/g++ g++ /usr/bin/g++-10; \ + fi + +# ----------------------------------------------------------------------------- +# CMake 3.28 (identical for both platforms) +# ----------------------------------------------------------------------------- +RUN set -eux; \ + wget -O - https://apt.kitware.com/keys/kitware-archive-latest.asc 2>/dev/null | gpg --dearmor - | tee /usr/share/keyrings/kitware-archive-keyring.gpg >/dev/null; \ + echo 'deb [signed-by=/usr/share/keyrings/kitware-archive-keyring.gpg] https://apt.kitware.com/ubuntu/ focal main' > /etc/apt/sources.list.d/kitware.list; \ + apt-get update; \ + apt-get install -y --no-install-recommends kitware-archive-keyring \ + cmake=3.28.6-0kitware1ubuntu20.04.1 cmake-data=3.28.6-0kitware1ubuntu20.04.1; \ + rm -rf /var/lib/apt/lists/* + +# ----------------------------------------------------------------------------- +# Install helpful Ruby gems (same for both) +# ----------------------------------------------------------------------------- +RUN gem install dotenv -v 2.8.1 && gem install --no-document fpm + +# ----------------------------------------------------------------------------- +# vcpkg: clone, bootstrap, and install packages for arm64 target +# ----------------------------------------------------------------------------- +ENV VCPKG_FORCE_SYSTEM_BINARIES=true +RUN git clone https://github.com/microsoft/vcpkg.git "${VCPKG_ROOT}" && \ + cd "${VCPKG_ROOT}" && \ + git checkout "${VCPKG_COMMIT}" && \ + ./bootstrap-vcpkg.sh -disableMetrics + +# copy project-specific ports and manifest before installing +COPY vcpkg.json "${VCPKG_ROOT}/vcpkg.json" +COPY external "${VCPKG_ROOT}/external/" + +RUN cd "${VCPKG_ROOT}" && \ + ./vcpkg install \ + --triplet arm64-linux-dynamic-release \ + --x-install-root "$PWD/build/host/vcpkg_installed" \ + --clean-after-build + +# ----------------------------------------------------------------------------- +# Install Synapse SDK from internal repository (same steps on both) +# ----------------------------------------------------------------------------- +ARG SDK_VERSION=0.3.0 +COPY keys/science-repo-public.asc /usr/share/keyrings/scifi-repo-science-public.asc +RUN set -eux; \ + apt-get update && apt-get install -y --no-install-recommends ca-certificates; \ + echo "deb [signed-by=/usr/share/keyrings/scifi-repo-science-public.asc] https://pub-879bfa29e67b4cd6b0c78b0d4cc3aa59.r2.dev/scifi focal main" > /etc/apt/sources.list.d/repo-science.list; \ + apt-get update && apt-get install -y synapse-app-sdk="${SDK_VERSION}"; \ + rm -rf /var/lib/apt/lists/* + +# ----------------------------------------------------------------------------- +# Export environment variables used by CMake tool-chain +# ----------------------------------------------------------------------------- +ENV VCPKG_INSTALLATION_ROOT="${VCPKG_ROOT}" +ENV CMAKE_TOOLCHAIN_FILE="${VCPKG_ROOT}/scripts/buildsystems/vcpkg.cmake" +ENV VCPKG_INSTALLED_DIR="${VCPKG_ROOT}/build/host/vcpkg_installed" + +# ----------------------------------------------------------------------------- +# Final workspace & entrypoint +# ----------------------------------------------------------------------------- +WORKDIR /home/workspace +CMD ["/bin/bash"] \ No newline at end of file diff --git a/README.md b/README.md index 45ec04c..97ec650 100644 --- a/README.md +++ b/README.md @@ -4,19 +4,44 @@ An example of how to build and deploy a synapse app ## Bootstrapping -Make sure you have docker, python3, and synapsectl installed on your system. +Make sure you have docker running, and python3.10+ installed. ```bash git submodule update --init --recursive + +pip install -r ${REPO_ROOT}/client/requirements.txt ``` -## Build / Deploy +## Build When your app is ready to go, you can deploy it to your Synapse device: ```bash -synapsectl -u "your-device-identifier" deploy /path/to/app/ +synapsectl build ${REPO_ROOT} +``` + +## Deploy + +```bash +synapsectl -u "your-device-identifier" deploy ${REPO_ROOT} ``` -It will first prompt you for some device details, subsequent attempts will only re-prompt if your -device has changed +## Run + +To start the app: + +```bash +synapsectl -u "your-device-identifier" start ${REPO_ROOT}/config/simulator_32ch.json +``` + +To listen to joystick output: + +```bash +python3 ${REPO_ROOT}/client/listen_to_joystick.py --device-ip +``` + +To stop the app: + +```bash +synapsectl -u "your-device-identifier" stop +``` diff --git a/client/listen_to_joystick.py b/client/listen_to_joystick.py new file mode 100644 index 0000000..0cecf14 --- /dev/null +++ b/client/listen_to_joystick.py @@ -0,0 +1,88 @@ +#!/usr/bin/env python3 +"""listen_to_joystick.py + +A minimal client that connects to a Synapse device tap (default: "joystick_out"), +reads 2-element float tensors published by the FixedWeightDecoder example, and +prints the (x, y) values to stdout. +""" + +import argparse +import struct +import sys +from typing import Tuple + +import numpy as np +from synapse.api.datatype_pb2 import Tensor +from synapse.client.taps import Tap + + +def parse_args() -> argparse.Namespace: + """CLI argument parser.""" + parser = argparse.ArgumentParser( + description="Listen to a Synapse tap and dump joystick (x, y) values" + ) + parser.add_argument( + "--device-ip", required=True, help="IP address of the Synapse device" + ) + parser.add_argument( + "--tap-name", + default="joystick_out", + help="Name of the tap to connect to (default: joystick_out)", + ) + return parser.parse_args() + + +def tensor_to_xy(tensor: Tensor) -> Tuple[float, float]: + """Convert a 2-element float Tensor message to an (x, y) tuple.""" + # The FixedWeightDecoder publishes little-endian 32-bit floats + data = tensor.data + if tensor.endianness == Tensor.Endianness.TENSOR_BIG_ENDIAN: + # Convert big-endian bytes to little-endian before np.frombuffer + data = struct.unpack(f">{len(data) // 4}f", data) + arr = np.array(data, dtype=np.float32) + else: + arr = np.frombuffer(data, dtype=np.float32) + + if arr.size < 2: + raise ValueError(f"Expected at least 2 floats, got {arr.size}") + return float(arr[0]), float(arr[1]) + + +def main() -> None: + args = parse_args() + + tap = Tap(args.device_ip) + try: + tap.connect(args.tap_name) + except Exception as exc: + print( + f"Failed to connect to tap '{args.tap_name}' at {args.device_ip}: {exc}", + file=sys.stderr, + ) + sys.exit(1) + + print( + f"Connected to tap '{args.tap_name}' at {args.device_ip}. Press Ctrl-C to exit." + ) + + try: + while True: + raw = tap.read() + if raw is None: + continue # no message yet + tensor = Tensor() + tensor.ParseFromString(raw) + try: + x, y = tensor_to_xy(tensor) + except ValueError as e: + print(f"Warning: {e}", file=sys.stderr) + continue + print(f"x = {x:.3f}\ty = {y:.3f}") + except KeyboardInterrupt: + print("\nInterrupted — closing tap.") + finally: + tap.close() + + +if __name__ == "__main__": + main() diff --git a/client/requirements.txt b/client/requirements.txt new file mode 100644 index 0000000..7b47ac4 --- /dev/null +++ b/client/requirements.txt @@ -0,0 +1,3 @@ +numpy +protobuf +science-synapse diff --git a/config/simulator_32ch.json b/config/simulator_32ch.json new file mode 100644 index 0000000..41a3b02 --- /dev/null +++ b/config/simulator_32ch.json @@ -0,0 +1,66 @@ +{ + "nodes": [ + { + "type": "kApplication", + "id": 2, + "application": { + "name": "synapse-example-app" + } + }, + { + "type": "kBroadbandSource", + "id": 1, + "broadbandSource": { + "peripheral_id": 100, + "sample_rate_hz": 32000, + "bit_width": 12, + "signal": { + "electrode": { + "channels": [ + { "id": 0, "electrode_id": 122, "reference_id": 513 }, + { "id": 1, "electrode_id": 126, "reference_id": 513 }, + { "id": 2, "electrode_id": 116, "reference_id": 513 }, + { "id": 3, "electrode_id": 120, "reference_id": 513 }, + { "id": 4, "electrode_id": 110, "reference_id": 513 }, + { "id": 5, "electrode_id": 114, "reference_id": 513 }, + { "id": 6, "electrode_id": 104, "reference_id": 513 }, + { "id": 7, "electrode_id": 108, "reference_id": 513 }, + { "id": 8, "electrode_id": 98, "reference_id": 513 }, + { "id": 9, "electrode_id": 66, "reference_id": 513 }, + { "id": 10, "electrode_id": 92, "reference_id": 513 }, + { "id": 11, "electrode_id": 60, "reference_id": 513 }, + { "id": 12, "electrode_id": 86, "reference_id": 513 }, + { "id": 13, "electrode_id": 54, "reference_id": 513 }, + { "id": 14, "electrode_id": 80, "reference_id": 513 }, + { "id": 15, "electrode_id": 48, "reference_id": 513 }, + { "id": 16, "electrode_id": 74, "reference_id": 513 }, + { "id": 17, "electrode_id": 38, "reference_id": 513 }, + { "id": 18, "electrode_id": 68, "reference_id": 513 }, + { "id": 19, "electrode_id": 36, "reference_id": 513 }, + { "id": 20, "electrode_id": 62, "reference_id": 513 }, + { "id": 21, "electrode_id": 0, "reference_id": 512 }, + { "id": 22, "electrode_id": 56, "reference_id": 513 }, + { "id": 23, "electrode_id": 4, "reference_id": 512 }, + { "id": 24, "electrode_id": 50, "reference_id": 513 }, + { "id": 25, "electrode_id": 12, "reference_id": 513 }, + { "id": 26, "electrode_id": 44, "reference_id": 513 }, + { "id": 27, "electrode_id": 14, "reference_id": 513 }, + { "id": 28, "electrode_id": 42, "reference_id": 513 }, + { "id": 29, "electrode_id": 20, "reference_id": 513 }, + { "id": 30, "electrode_id": 32, "reference_id": 513 }, + { "id": 31, "electrode_id": 26, "reference_id": 513 } + ], + "low_cutoff_hz": 57, + "high_cutoff_hz": 13489 + } + } + } + } + ], + "connections": [ + { + "src_node_id": 1, + "dst_node_id": 2 + } + ] +} diff --git a/ops/keys/science-repo-public.asc b/keys/science-repo-public.asc similarity index 100% rename from ops/keys/science-repo-public.asc rename to keys/science-repo-public.asc diff --git a/ops/docker/Dockerfile b/ops/docker/Dockerfile deleted file mode 100644 index 325785b..0000000 --- a/ops/docker/Dockerfile +++ /dev/null @@ -1,103 +0,0 @@ -FROM ubuntu:20.04 - -ARG VCPKG_COMMIT=0f88ecb8528605f91980b90a2c5bad88e3cb565f - -ENV DEBIAN_FRONTEND=noninteractive - -# We need to be able to cross compile -RUN dpkg --add-architecture arm64 && \ - sed 's/^deb http/deb [arch=amd64] http/' -i '/etc/apt/sources.list' && \ - echo "deb [arch=arm64] http://ports.ubuntu.com/ focal main restricted" >> /etc/apt/sources.list.d/arm64-cross-compile.list && \ - echo "deb [arch=arm64] http://ports.ubuntu.com/ focal-updates main restricted" >> /etc/apt/sources.list.d/arm64-cross-compile.list - -# Build dependss -RUN apt-get update && apt-get install -y \ - autoconf \ - autoconf-archive \ - build-essential \ - gcc-10-aarch64-linux-gnu \ - g++-10-aarch64-linux-gnu \ - binutils-aarch64-linux-gnu \ - git \ - curl \ - wget \ - ca-certificates \ - gpg \ - unzip \ - tar \ - pkg-config \ - libssl-dev \ - libtool \ - zip \ - ninja-build \ - gosu \ - python3 \ - python3-setuptools \ - python3-jinja2 \ - libudev-dev:arm64 \ - libudev-dev \ - qemu-user-static \ - python3-pip \ - autoconf \ - && rm -rf /var/lib/apt/lists/* - -# Package depends -RUN apt-get update && apt-get install -y \ - ruby-full \ - ruby-dev \ - rubygems \ - build-essential - -RUN ln -s /usr/bin/aarch64-linux-gnu-gcc-10 /usr/bin/aarch64-linux-gnu-gcc && \ - ln -s /usr/bin/aarch64-linux-gnu-g++-10 /usr/bin/aarch64-linux-gnu-g++ - - # Install CMake -RUN wget -O - https://apt.kitware.com/keys/kitware-archive-latest.asc 2>/dev/null | \ - gpg --dearmor - | tee /usr/share/keyrings/kitware-archive-keyring.gpg >/dev/null && \ - echo 'deb [signed-by=/usr/share/keyrings/kitware-archive-keyring.gpg] https://apt.kitware.com/ubuntu/ focal main' \ - | tee /etc/apt/sources.list.d/kitware.list >/dev/null && \ - apt-get update && \ - apt-get install -y --no-install-recommends \ - kitware-archive-keyring \ - cmake=3.28.6-0kitware1ubuntu20.04.1 \ - cmake-data=3.28.6-0kitware1ubuntu20.04.1 \ - && rm -rf /var/lib/apt/lists/* - -# Older versions of dotenv for older versions of ubuntu -RUN gem install dotenv -v 2.8.1 -RUN gem install --no-document fpm - -# VCPKG setup -ENV VCPKG_ROOT=/vcpkg \ - PATH="${PATH}:/vcpkg" - -ENV VCPKG_FORCE_SYSTEM_BINARIES=true -RUN git clone https://github.com/microsoft/vcpkg.git ${VCPKG_ROOT} && \ - cd ${VCPKG_ROOT} && \ - git checkout ${VCPKG_COMMIT} && \ - ./bootstrap-vcpkg.sh -disableMetrics - -COPY vcpkg.json ${VCPKG_ROOT} -COPY external ${VCPKG_ROOT}/external/ - -RUN cd ${VCPKG_ROOT} && \ - ./vcpkg install --triplet arm64-linux-dynamic-release --clean-after-build - -# Set up and install our synapse SDK package -# Make sure we have science keys -ARG SDK_VERSION=0.3.0 -COPY ops/keys/science-repo-public.asc /usr/share/keyrings/scifi-repo-science-public.asc -RUN apt-get update && \ - apt-get install -y --no-install-recommends ca-certificates && \ - echo "deb [signed-by=/usr/share/keyrings/scifi-repo-science-public.asc] https://pub-879bfa29e67b4cd6b0c78b0d4cc3aa59.r2.dev/scifi focal main" > /etc/apt/sources.list.d/repo-science.list && \ - apt-get update && \ - apt-get install -y synapse-app-sdk=${SDK_VERSION} && \ - rm -rf /var/lib/apt/lists/* - -ENV VCPKG_INSTALLATION_ROOT=${VCPKG_ROOT} -ENV CMAKE_TOOLCHAIN_FILE=${VCPKG_ROOT}/scripts/buildsystems/vcpkg.cmake -ENV VCPKG_INSTALLED_DIR=${VCPKG_ROOT}/vcpkg_installed - -# Entry point for the container -WORKDIR /home/workspace -CMD ["/bin/bash"] diff --git a/ops/docker/Dockerfile.arm64 b/ops/docker/Dockerfile.arm64 deleted file mode 100644 index 1d503da..0000000 --- a/ops/docker/Dockerfile.arm64 +++ /dev/null @@ -1,99 +0,0 @@ -FROM ubuntu:20.04 - -# Base ARGs -ARG VCPKG_COMMIT=0f88ecb8528605f91980b90a2c5bad88e3cb565f - -# VCPKG Environment -ENV DEBIAN_FRONTEND=noninteractive \ - VCPKG_ROOT=/vcpkg \ - PATH="${PATH}:/vcpkg" - -# Base packages needed -RUN apt-get update && apt-get install -y \ - autoconf \ - autoconf-archive \ - build-essential \ - git \ - curl \ - wget \ - ca-certificates \ - gpg \ - unzip \ - tar \ - pkg-config \ - libssl-dev \ - libtool \ - zip \ - ninja-build \ - gosu \ - python3 \ - python3-setuptools \ - python3-jinja2 \ - libudev-dev \ - python3-pip \ - && rm -rf /var/lib/apt/lists/* - -RUN apt-get update && apt-get install -y \ - ruby-full \ - ruby-dev \ - rubygems \ - build-essential - -# Install GCC 10 for C++20 support (like with span) -RUN apt-get update && apt-get install -y \ - gcc-10 \ - g++-10 \ - && rm -rf /var/lib/apt/lists/* - -# Set GCC 10 as default -RUN update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-10 100 \ - --slave /usr/bin/g++ g++ /usr/bin/g++-10 - -# Install CMake -RUN wget -O - https://apt.kitware.com/keys/kitware-archive-latest.asc 2>/dev/null | \ - gpg --dearmor - | tee /usr/share/keyrings/kitware-archive-keyring.gpg >/dev/null && \ - echo 'deb [signed-by=/usr/share/keyrings/kitware-archive-keyring.gpg] https://apt.kitware.com/ubuntu/ focal main' \ - | tee /etc/apt/sources.list.d/kitware.list >/dev/null && \ - apt-get update && \ - apt-get install -y --no-install-recommends \ - kitware-archive-keyring \ - cmake=3.28.6-0kitware1ubuntu20.04.1 \ - cmake-data=3.28.6-0kitware1ubuntu20.04.1 \ - && rm -rf /var/lib/apt/lists/* - -# VCPKG setup -ENV VCPKG_ROOT=/vcpkg \ - PATH="${PATH}:/vcpkg" - -ENV VCPKG_FORCE_SYSTEM_BINARIES=true -RUN git clone https://github.com/microsoft/vcpkg.git ${VCPKG_ROOT} && \ - cd ${VCPKG_ROOT} && \ - git checkout ${VCPKG_COMMIT} && \ - ./bootstrap-vcpkg.sh -disableMetrics - -COPY vcpkg.json ${VCPKG_ROOT} -COPY external ${VCPKG_ROOT}/external/ - -# Install only ARM64 packages, remove x64 installation -RUN cd ${VCPKG_ROOT} && \ - ./vcpkg install --triplet arm64-linux-dynamic-release --clean-after-build - -ARG SDK_VERSION=0.3.0 -COPY ops/keys/science-repo-public.asc /usr/share/keyrings/scifi-repo-science-public.asc -RUN apt-get update && \ - apt-get install -y --no-install-recommends ca-certificates && \ - echo "deb [signed-by=/usr/share/keyrings/scifi-repo-science-public.asc] https://pub-879bfa29e67b4cd6b0c78b0d4cc3aa59.r2.dev/scifi focal main" > /etc/apt/sources.list.d/repo-science.list && \ - apt-get update && \ - apt-get install -y synapse-app-sdk=${SDK_VERSION} && \ - rm -rf /var/lib/apt/lists/* - -ENV VCPKG_INSTALLATION_ROOT=${VCPKG_ROOT} -ENV CMAKE_TOOLCHAIN_FILE=${VCPKG_ROOT}/scripts/buildsystems/vcpkg.cmake -ENV VCPKG_INSTALLED_DIR=${VCPKG_ROOT}/vcpkg_installed - -# Older versions of dotenv for older versions of ubuntu -RUN gem install dotenv -v 2.8.1 -RUN gem install --no-document fpm - -WORKDIR /home/workspace -CMD ["/bin/bash"] \ No newline at end of file diff --git a/src/fixed_weight_decoder.cpp b/src/fixed_weight_decoder.cpp index f1a5517..79871f3 100644 --- a/src/fixed_weight_decoder.cpp +++ b/src/fixed_weight_decoder.cpp @@ -1,4 +1,4 @@ -#include "apps/fixed_weight_decoder.hpp" +#include "fixed_weight_decoder.hpp" #include #include #include diff --git a/include/apps/fixed_weight_decoder.hpp b/src/fixed_weight_decoder.hpp similarity index 100% rename from include/apps/fixed_weight_decoder.hpp rename to src/fixed_weight_decoder.hpp