Skip to content

Commit

Permalink
[usrp] init
Browse files Browse the repository at this point in the history
  • Loading branch information
sjkelly committed Aug 31, 2021
1 parent 4eb57af commit 2fd217b
Showing 1 changed file with 61 additions and 0 deletions.
61 changes: 61 additions & 0 deletions U/USRPHardwareDriver/build_tarballs.jl
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
# Note that this script can accept some limited command-line arguments, run
# `julia build_tarballs.jl --help` to see a usage message.
using BinaryBuilder, Pkg

name = "USRPHardwareDriver"
version = v"4.1.0"

# Collection of sources required to complete build
sources = [
GitSource("https://github.com/EttusResearch/uhd.git", "f633b497ff931c3c180d00148fc66e4feb8b8b6a")
]

dependencies = [
Dependency("boost_jll"; compat="=1.76.0"), # max gcc7
Dependency("libusb_jll", compat="1.0.24"),
]

# Bash recipe for building across all platforms
script = raw"""
cd uhd/host
#code generators, only needed at build time
apk add py3-mako py3-ruamel.yaml
mkdir build && cd build
cmake -DCMAKE_INSTALL_PREFIX=${prefix} \
-DCMAKE_TOOLCHAIN_FILE=${CMAKE_TARGET_TOOLCHAIN} \
-DCMAKE_BUILD_TYPE=Release \
-DENABLE_EXAMPLES=OFF \
-DENABLE_TESTS=OFF \
-DENABLE_PYTHON_API=OFF \
..
make -j${nproc}
make install
"""

# These are the platforms we will build for by default, unless further
# platforms are passed in on the command line
# TODO: Windows has several issues with boost threads. There is a WIP branch:
# https://github.com/JuliaTelecom/uhd/tree/juliatelecom/patch-v4.1.0.1
platforms = filter!(p -> !Sys.iswindows(p) && !in(arch(p),("armv7l","armv6l")), supported_platforms(;experimental=true))
platforms = expand_cxxstring_abis(platforms)
# For some reasons, building for CXX03 string ABI doesn't actually work, skip it
filter!(x -> cxxstring_abi(x) != "cxx03", platforms)

# The products that we will ensure are always built
products = Product[
ExecutableProduct("uhd_cal_rx_iq_balance", :uhd_cal_rx_iq_balance),
ExecutableProduct("uhd_cal_tx_iq_balance", :uhd_cal_tx_iq_balance),
ExecutableProduct("uhd_find_devices", :uhd_find_devices),
ExecutableProduct("uhd_adc_self_cal", :uhd_adc_self_cal),
ExecutableProduct("uhd_cal_tx_dc_offset", :uhd_cal_tx_dc_offset),
ExecutableProduct("uhd_config_info", :uhd_config_info),
ExecutableProduct("uhd_image_loader", :uhd_image_loader),
ExecutableProduct("uhd_usrp_probe", :uhd_usrp_probe),
LibraryProduct("libuhd", :libuhd)
]

# Build the tarballs, and possibly a `build.jl` as well.
# gcc7 constraint from boost
build_tarballs(ARGS, name, version, sources, script, platforms, products, dependencies; julia_compat="1.6", preferred_gcc_version=v"7")

0 comments on commit 2fd217b

Please sign in to comment.