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
8 changes: 8 additions & 0 deletions ci_config.json
Original file line number Diff line number Diff line change
Expand Up @@ -1733,6 +1733,14 @@
"tinyfsm:build_examples=true"
]
},
"volk": {
"build_options": [
"volk:tests=enabled"
],
"python_packages": [
"mako"
]
},
"wayland": {
"_comment": [
"- relies on Linux-specific APIs",
Expand Down
8 changes: 8 additions & 0 deletions releases.json
Original file line number Diff line number Diff line change
Expand Up @@ -5000,6 +5000,14 @@
"0.1.3-1"
]
},
"volk": {
"dependency_names": [
"volk"
],
"versions": [
"3.3.0-1"
]
},
"vorbis": {
"dependency_names": [
"vorbis",
Expand Down
47 changes: 47 additions & 0 deletions subprojects/packagefiles/volk/cpu_features/meson.build
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
cpu_features_args = ['-DSTACK_LINE_READER_BUFFER_SIZE=1024']
cpu_features_deps = []
if host_machine.system() == 'darwin'
cpu_features_args += '-DHAVE_SYSCTLBYNAME'
endif

cpu_features_sources = files(
'src/filesystem.c',
'src/impl_aarch64_linux_or_android.c',
'src/impl_aarch64_macos_or_iphone.c',
'src/impl_aarch64_windows.c',
'src/impl_arm_linux_or_android.c',
'src/impl_loongarch_linux.c',
'src/impl_mips_linux_or_android.c',
'src/impl_ppc_linux.c',
'src/impl_riscv_linux.c',
'src/impl_s390x_linux.c',
'src/impl_x86_freebsd.c',
'src/impl_x86_linux_or_android.c',
'src/impl_x86_macos.c',
'src/impl_x86_windows.c',
'src/stack_line_reader.c',
'src/string_view.c',
)

if not cpu_is_x86 and host_machine.system() != 'windows'
cpu_features_sources += files('src/hwcaps.c')
if cc.has_header_symbol('sys/auxv.h', 'getauxval')
cpu_features_args += '-DHAVE_STRONG_GETAUXVAL'
elif cc.has_header('dlfcn.h')
cpu_features_args += '-DHAVE_DLFCN_H'
cpu_features_deps += dependency(
'dl',
required: false,
)
endif
endif

cpu_features_lib = static_library(
'cpu_features',
cpu_features_sources,
c_args: cpu_features_args,
include_directories: include_directories('include', 'include/internal'),
dependencies: cpu_features_deps,
)

volk_incs += include_directories('include')
46 changes: 46 additions & 0 deletions subprojects/packagefiles/volk/include/volk/meson.build
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
version_conf = configuration_data()
version_conf.set('VERSION_INFO_MAJOR_VERSION', version_parts[0])
version_conf.set('VERSION_INFO_MINOR_VERSION', version_parts[1])
version_conf.set('VERSION_INFO_MAINT_VERSION', version_parts[2])
version_conf.set(
'VOLK_VERSION_DECIMAL',
version_parts[0].to_int() * 10000 + version_parts[1].to_int() * 100 + version_parts[2].to_int(),
)

volk_version_h = configure_file(
input: 'volk_version.h.in',
output: 'volk_version.h',
configuration: version_conf,
install_dir: get_option('includedir') / 'volk',
)

volk_gen_headers = []
foreach name : ['volk', 'volk_cpu', 'volk_config_fixed', 'volk_typedefs']
volk_gen_headers += custom_target(
input: meson.project_source_root() / 'tmpl' / (name + '.tmpl.h'),
output: name + '.h',
command: tmpl_command,
depend_files: tmpl_depends,
install: true,
install_dir: get_option('includedir') / 'volk',
)
endforeach

install_headers(
'constants.h',
'saturation_arithmetic.h',
'volk_alloc.hh',
'volk_avx2_fma_intrinsics.h',
'volk_avx2_intrinsics.h',
'volk_avx512_intrinsics.h',
'volk_avx_intrinsics.h',
'volk_common.h',
'volk_complex.h',
'volk_malloc.h',
'volk_neon_intrinsics.h',
'volk_prefs.h',
'volk_sse3_intrinsics.h',
'volk_sse_intrinsics.h',
kernel_headers,
subdir: 'volk',
)
197 changes: 197 additions & 0 deletions subprojects/packagefiles/volk/lib/meson.build
Original file line number Diff line number Diff line change
@@ -0,0 +1,197 @@
lib_incs = [volk_incs, include_directories('.')]
lib_args = volk_args + ['-Dvolk_EXPORTS']
tmpl_dir = meson.project_source_root() / 'tmpl'

volk_machines_h = custom_target(
input: tmpl_dir / 'volk_machines.tmpl.h',
output: 'volk_machines.h',
command: tmpl_command,
depend_files: tmpl_depends,
)

volk_sources = [volk_machines_h, volk_gen_headers]
foreach name : ['volk', 'volk_cpu', 'volk_machines']
volk_sources += custom_target(
input: tmpl_dir / (name + '.tmpl.c'),
output: name + '.' + src_ext,
command: tmpl_command,
depend_files: tmpl_depends,
)
endforeach

foreach name : ['volk_prefs', 'volk_rank_archs', 'volk_malloc']
if is_msvc
volk_sources += configure_file(
input: name + '.c',
output: name + '.cc',
copy: true,
)
else
volk_sources += files(name + '.c')
endif
endforeach

# Each machine is compiled with the flags of its archs
volk_link_whole = []
machine_defs = []
compiler_info = []
foreach machine : available_machines
flags = machine_flags[machine]
machine_src = custom_target(
input: tmpl_dir / 'volk_machine_xxx.tmpl.c',
output: 'volk_machine_@0@.@1@'.format(machine, src_ext),
command: tmpl_command + [machine],
depend_files: tmpl_depends,
)
volk_link_whole += static_library(
'volk_machine_' + machine,
machine_src,
volk_machines_h,
volk_gen_headers,
c_args: lib_args + flags,
cpp_args: lib_args + flags,
include_directories: lib_incs,
gnu_symbol_visibility: 'hidden',
)
machine_defs += '-DLV_MACHINE_' + machine.to_upper()
compiler_info += ':::'.join(machine, compiler_name, ' '.join(flags))
endforeach

if 'neonv7' in available_archs
neon_asm = []
foreach name : run_command(
glob_command,
meson.project_source_root() / 'kernels' / 'volk' / 'asm' / 'neon',
'*.s',
check: true,
).stdout().strip().split(';')
neon_asm += files('..' / 'kernels' / 'volk' / 'asm' / 'neon' / name)
endforeach
volk_link_whole += static_library(
'volk_neon_asm',
neon_asm,
c_args: arch_flags['neonv7'],
)
endif

if cpu_family == 'riscv64'
foreach name : run_command(
glob_command,
meson.project_source_root() / 'kernels' / 'volk' / 'asm' / 'riscv',
'*.s',
check: true,
).stdout().strip().split(';')
volk_sources += files('..' / 'kernels' / 'volk' / 'asm' / 'riscv' / name)
endforeach
endif

if have_orc
foreach name : run_command(
glob_command,
meson.project_source_root() / 'kernels' / 'volk' / 'asm' / 'orc',
'*.orc',
check: true,
).stdout().strip().split(';')
volk_sources += custom_target(
input: '..' / 'kernels' / 'volk' / 'asm' / 'orc' / name,
output: '@BASENAME@.' + src_ext,
command: [
orcc,
'--include',
'math.h',
'--implementation',
'--include',
'volk/volk_complex.h',
'-o',
'@OUTPUT@',
'@INPUT@',
],
)
endforeach
endif

constants_conf = configuration_data()
constants_conf.set('prefix', get_option('prefix').replace('\\', '\\\\'))
constants_conf.set('VERSION', meson.project_version())
constants_conf.set(
'cmake_c_compiler_version',
'@0@ @1@'.format(cc.get_id(), cc.version()),
)
constants_conf.set('COMPILER_INFO', '\\n'.join(compiler_info))
constants_conf.set('available_machines', ';'.join(available_machines))
volk_sources += configure_file(
input: 'constants.c.in',
output: 'constants.' + src_ext,
configuration: constants_conf,
)

if use_cpu_features
volk_link_whole += cpu_features_lib
endif

volk_lib = library(
'volk',
volk_sources,
c_args: lib_args + machine_defs,
cpp_args: lib_args + machine_defs,
include_directories: lib_incs,
link_whole: volk_link_whole,
dependencies: [
cc.find_library(
'm',
required: false,
),
cpu_features_deps,
orc_dep,
],
gnu_symbol_visibility: 'hidden',
version: meson.project_version(),
soversion: soversion,
install: true,
)

# Otherwise VOLK_API is __declspec(dllimport), which a static library can't satisfy
volk_dep_args = []
if is_msvc and get_option('default_library') == 'static'
volk_dep_args += '-Dvolk_EXPORTS'
endif

volk_dep = declare_dependency(
compile_args: volk_dep_args,
link_with: volk_lib,
include_directories: volk_public_incs,
sources: volk_gen_headers,
)
meson.override_dependency('volk', volk_dep)

fmt_dep = dependency(
'fmt',
required: get_option('tests'),
)
if fmt_dep.found()
test_incs = lib_incs
if is_msvc
# Shadows cmake/msvc/sys/time.h, which clang-cl rejects
test_incs = [include_directories('msvc'), test_incs]
endif
volk_test_all = executable(
'volk_test_all',
'testqa.cc',
'qa_utils.cc',
cpp_args: volk_args,
include_directories: test_incs,
dependencies: [volk_dep, fmt_dep],
)
foreach kernel : kernel_names
# Its tolerance is at the accuracy limit of the non-FMA SIMD kernels, which
# makes it flaky; fixed upstream after 3.3.0 (gnuradio/volk@58ef9ce)
if kernel == 'volk_32f_log2_32f'
continue
endif
test(
kernel,
volk_test_all,
args: kernel,
)
endforeach
endif
10 changes: 10 additions & 0 deletions subprojects/packagefiles/volk/lib/msvc/sys/time.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
/*
* Upstream's cmake/msvc/sys/time.h does #include < time.h >, which clang-cl
* rejects. qa_utils.cc only includes <sys/time.h> for CLOCKS_PER_SEC.
*/
#ifndef VOLK_WRAP_SYS_TIME_H
#define VOLK_WRAP_SYS_TIME_H

#include <time.h>

#endif
Loading
Loading