Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 29 additions & 1 deletion .github/workflows/android_build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ jobs:

# All dependencies
- name: Install dependencies
run: sudo DEBIAN_FRONTEND=noninteractive apt-get install -y cmake python3-mako curl
run: sudo DEBIAN_FRONTEND=noninteractive apt-get install -y cmake python3-mako libgtest-dev libfmt-dev curl

- name: Install sccache
shell: bash
Expand All @@ -60,6 +60,33 @@ jobs:
- name: Install Android NDK
run: $GITHUB_WORKSPACE/android-sdk-linux/cmdline-tools/bin/sdkmanager --sdk_root=$GITHUB_WORKSPACE/android-sdk-linux --install "ndk;27.2.12479018" --channel=3

# Build fmt for the Android target. The host libfmt-dev package cannot
# be used by the Android toolchain.
- name: Install fmt and GoogleTest for Android
shell: bash
run: |
git clone --depth 1 --branch 12.1.0 https://github.com/fmtlib/fmt.git fmt-src
cmake -S fmt-src -B fmt-build \
-DCMAKE_TOOLCHAIN_FILE=$GITHUB_WORKSPACE/android-sdk-linux/ndk/27.2.12479018/build/cmake/android.toolchain.cmake \
-DANDROID_ABI=${{ matrix.arch.name }} \
-DANDROID_PLATFORM=android-34 \
-DFMT_TEST=OFF \
-DFMT_DOC=OFF \
-DCMAKE_INSTALL_PREFIX=$GITHUB_WORKSPACE/android-fmt
cmake --build fmt-build -j $(nproc)
cmake --install fmt-build

git clone --depth 1 --branch v1.18.0 https://github.com/google/googletest.git gtest-src
cmake -S gtest-src -B gtest-build \
-DCMAKE_TOOLCHAIN_FILE=$GITHUB_WORKSPACE/android-sdk-linux/ndk/27.2.12479018/build/cmake/android.toolchain.cmake \
-DANDROID_ABI=${{ matrix.arch.name }} \
-DANDROID_PLATFORM=android-34 \
-DBUILD_GMOCK=OFF \
-DINSTALL_GTEST=ON \
-DCMAKE_INSTALL_PREFIX=$GITHUB_WORKSPACE/android-gtest
cmake --build gtest-build -j $(nproc)
cmake --install gtest-build

# Setup build directory
- name: Setup ${{ matrix.arch.name }}
shell: bash
Expand All @@ -70,6 +97,7 @@ jobs:
-DCMAKE_TOOLCHAIN_FILE=$GITHUB_WORKSPACE/android-sdk-linux/ndk/27.2.12479018/build/cmake/android.toolchain.cmake \
-DANDROID_ABI=${{ matrix.arch.name }} \
-DANDROID_PLATFORM=android-34 \
-DCMAKE_PREFIX_PATH="$GITHUB_WORKSPACE/android-fmt;$GITHUB_WORKSPACE/android-gtest" \
${{ steps.enable_sccache.outputs.CXX_LAUNCHER }} \
${{ steps.enable_sccache.outputs.C_LAUNCHER }}

Expand Down
8 changes: 7 additions & 1 deletion .github/workflows/run-tests-rvv.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,14 @@ jobs:
submodules: "recursive"
- name: Install packages
run: |
sudo dpkg --add-architecture riscv64
sudo tee /etc/apt/sources.list.d/riscv64.list > /dev/null <<'EOF'
deb [arch=riscv64] http://ports.ubuntu.com/ubuntu-ports noble main universe
deb [arch=riscv64] http://ports.ubuntu.com/ubuntu-ports noble-updates main universe
deb [arch=riscv64] http://ports.ubuntu.com/ubuntu-ports noble-security main universe
EOF
sudo DEBIAN_FRONTEND=noninteractive apt-get update -q -y
sudo DEBIAN_FRONTEND=noninteractive apt-get install -y python3-mako cmake qemu-user-static g++-14-riscv64-linux-gnu clang-18 curl
sudo DEBIAN_FRONTEND=noninteractive apt-get install -y python3-mako libgtest-dev:riscv64 libfmt-dev:riscv64 cmake qemu-user-static g++-14-riscv64-linux-gnu clang-18 curl
sudo scripts/ci/install_sccache.bash
mkdir build
cd build
Expand Down
8 changes: 5 additions & 3 deletions .github/workflows/run-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -268,9 +268,11 @@ jobs:
with:
python-version: "3.12"
- name: dependencies
run: pip install mako
run: |
pip install mako
vcpkg install fmt:x64-windows gtest:x64-windows
- name: configure
run: mkdir build && cd build && cmake -DPython3_FIND_REGISTRY=NEVER ..
run: mkdir build && cd build && cmake -DPython3_FIND_REGISTRY=NEVER -DCMAKE_TOOLCHAIN_FILE=C:/vcpkg/scripts/buildsystems/vcpkg.cmake -DVCPKG_TARGET_TRIPLET=x64-windows ..
- name: build
run: cmake --build build --config Release --target INSTALL -j4
- name: test
Expand Down Expand Up @@ -322,7 +324,7 @@ jobs:
with:
submodules: "recursive"
- name: dependencies
run: pip3 install --break-system-packages mako && brew install orc
run: pip3 install --break-system-packages mako && brew install orc fmt
- name: configure
run: mkdir build && cd build && cmake -DCMAKE_C_FLAGS="-Werror" -DCMAKE_CXX_FLAGS="-Werror" -DBUILD_EXECUTABLE=ON ..
- name: build
Expand Down
50 changes: 26 additions & 24 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ if(CMAKE_C_COMPILER_ID MATCHES "Clang|GNU")
endif()

list(INSERT CMAKE_MODULE_PATH 0 ${CMAKE_CURRENT_SOURCE_DIR}/cmake/Modules
) #location for custom "Modules"
)#location for custom "Modules"

include(CMakeDependentOption)
include(VolkBuildTypes)
Expand Down Expand Up @@ -94,7 +94,7 @@ set(CROSSCOMPILE_MULTILIB

if(MSVC)
add_definitions(-D_USE_MATH_DEFINES
) #enables math constants on all supported versions of MSVC
)#enables math constants on all supported versions of MSVC
add_compile_options(/W1) #reduce warnings
add_compile_options(/wo4309)
add_compile_options(/wd4752)
Expand All @@ -105,17 +105,22 @@ endif(MSVC)
########################################################################
# Build options
########################################################################
set(VOLK_STATIC_DISPATCH "" CACHE STRING
"Static dispatch to a specific machine (e.g. neonv8). Empty means dynamic dispatch.")
set(VOLK_STATIC_DISPATCH
""
CACHE
STRING
"Static dispatch to a specific machine (e.g. neonv8). Empty means dynamic dispatch."
)
option(ENABLE_UTILITY_APPS "Enable utility apps" ON)
option(ENABLE_TESTING "Enable QA testing" ON)
option(ENABLE_MODTOOL "Enable volk_modtool python utility" ON)
cmake_dependent_option(ENABLE_PROFILING "Launch system profiler after build" OFF "ENABLE_UTILITY_APPS;NOT CMAKE_CROSSCOMPILING" OFF)
cmake_dependent_option(ENABLE_PROFILING "Launch system profiler after build" OFF
"ENABLE_UTILITY_APPS;NOT CMAKE_CROSSCOMPILING" OFF)

########################################################################
# Print summary of options
########################################################################
if (VOLK_STATIC_DISPATCH)
if(VOLK_STATIC_DISPATCH)
message(STATUS "Using static dispatch for: ${VOLK_STATIC_DISPATCH}")
else()
message(STATUS "Using dynamic dispatch.")
Expand All @@ -125,15 +130,15 @@ if(ENABLE_UTILITY_APPS)
message(STATUS "Utility apps enabled.")
endif()

if (ENABLE_TESTING)
if(ENABLE_TESTING)
message(STATUS "Testing enabled.")
endif()

if (ENABLE_MODTOOL)
if(ENABLE_MODTOOL)
message(STATUS "volk_modtool python utility enabled.")
endif()

if (ENABLE_PROFILING)
if(ENABLE_PROFILING)
message(STATUS "Launch system profiler after build enabled.")
endif()

Expand All @@ -143,8 +148,10 @@ endif()

# cpu_features - only needed for dynamic dispatch (runtime CPU detection)
if(NOT VOLK_STATIC_DISPATCH)
if(CMAKE_SYSTEM_PROCESSOR MATCHES
"(^mips)|(^arm)|(^aarch64)|(x86_64)|(AMD64|amd64)|(^i.86$)|(^powerpc)|(^ppc)|(^riscv)")
if(CMAKE_SYSTEM_PROCESSOR
MATCHES
"(^mips)|(^arm)|(^aarch64)|(x86_64)|(AMD64|amd64)|(^i.86$)|(^powerpc)|(^ppc)|(^riscv)"
)
option(VOLK_CPU_FEATURES "Volk uses cpu_features" ON)
else()
option(VOLK_CPU_FEATURES "Volk uses cpu_features" OFF)
Expand Down Expand Up @@ -243,11 +250,8 @@ if(${CMAKE_BUILD_TYPE} STREQUAL "Coverage")
# modifications as done in the past for GNU Radio.
include(CodeCoverage)
append_coverage_compiler_flags()
setup_target_for_coverage_gcovr_html(
NAME coverage
EXECUTABLE "ctest"
DEPENDENCIES volk_profile
)
setup_target_for_coverage_gcovr_html(NAME coverage EXECUTABLE "ctest" DEPENDENCIES
volk_profile)
endif()

########################################################################
Expand Down Expand Up @@ -303,8 +307,8 @@ set(VOLK_INSTALL_HEADERS

if(NOT VOLK_STATIC_DISPATCH)
list(APPEND VOLK_INSTALL_HEADERS
${CMAKE_CURRENT_SOURCE_DIR}/include/volk/volk_prefs.h
${CMAKE_CURRENT_BINARY_DIR}/include/volk/volk_cpu.h)
${CMAKE_CURRENT_SOURCE_DIR}/include/volk/volk_prefs.h
${CMAKE_CURRENT_BINARY_DIR}/include/volk/volk_cpu.h)
endif()

install(
Expand Down Expand Up @@ -384,12 +388,10 @@ if(ENABLE_TESTING OR ENABLE_UTILITY_APPS)
if(NOT ENABLE_STATIC_LIBS)
find_package(fmt QUIET)
endif()
if(NOT fmt_FOUND)
if(ENABLE_STATIC_LIBS)
message(STATUS "Static build: using FetchContent to build fmt as static library ...")
else()
message(STATUS "fmt package not found. Using FetchContent to download ...")
endif()
if(ENABLE_STATIC_LIBS AND NOT fmt_FOUND)
message(
STATUS "Static build: using FetchContent to build fmt as static library ...")

include(FetchContent)
FetchContent_Declare(
fmt
Expand Down
13 changes: 7 additions & 6 deletions appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,15 @@
#
# SPDX-License-Identifier: LGPL-3.0-or-later
#
image: Visual Studio 2022
image: Visual Studio 2026
cache:
- packages -> appveyor.yml
environment:
environment:
matrix:
- job_name: VS 17 2022 / python 3.12
APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2022
CMAKE_GENERATOR: Visual Studio 17 2022
- job_name: VS 2026 / python 3.12
APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2026
CMAKE_GENERATOR: Ninja
PYTHON: "C:\\Python312"

install:
Expand All @@ -25,11 +25,12 @@ install:
print(sys.platform, platform.machine(), struct.calcsize('P')*8)"
- pip --version
- pip install mako
- C:\Tools\vcpkg\vcpkg.exe install fmt:x64-windows gtest:x64-windows
before_build:
- git submodule update --init --recursive
- cmake -G "%CMAKE_GENERATOR%" -A x64 -DCMAKE_BUILD_TYPE:STRING=Release -DENABLE_ORC:BOOL=OFF -DENABLE_TESTING:BOOL=ON -DPython3_FIND_REGISTRY=NEVER .
- cmake -G "%CMAKE_GENERATOR%" -DCMAKE_BUILD_TYPE:STRING=Release -DENABLE_ORC:BOOL=OFF -DENABLE_TESTING:BOOL=ON -DPython3_FIND_REGISTRY=NEVER -DCMAKE_TOOLCHAIN_FILE=C:/Tools/vcpkg/scripts/buildsystems/vcpkg.cmake -DVCPKG_TARGET_TRIPLET=x64-windows .
build_script:
- cmake --build . --config Release --target INSTALL
- cmake --build . --config Release --target install
test_script:
- ctest -V --output-on-failure -C Release
after_test:
Expand Down
5 changes: 5 additions & 0 deletions tests/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,11 @@ target_link_libraries(volk_tests
)

include(GoogleTest)
if(WIN32)
# Windows cannot run volk_tests during the build because its dependent DLLs
# are not available from the test executable's build directory yet.
set(CMAKE_GTEST_DISCOVER_TESTS_DISCOVERY_MODE PRE_TEST)
endif()
gtest_discover_tests(volk_tests)


Expand Down
Loading