Skip to content

Commit

Permalink
Remove VOLK as a submodule
Browse files Browse the repository at this point in the history
This removes the volk/ submodule pointer and updates the CMake to detect
VOLK like any other dependency. The VOLK_MIN_VERSION CMake variable is
added (and set to 2.1.0).

The GR_VOLK_LIB variable is replaced with Volk::volk everywhere.
The VOLK_INSTALL_LIBRARY_DIR and VOLK_INSTALL_INCLUDE_DIR variables
weren't used and were removed.

CMake will now fail if VOLK cannot be detected. Therefore, ENABLE_VOLK
was also removed as a variable; all in-tree components may assume the
existence of VOLK.
  • Loading branch information
mbr0wn committed Apr 12, 2020
1 parent bad1040 commit 80c0447
Show file tree
Hide file tree
Showing 21 changed files with 22 additions and 93 deletions.
4 changes: 0 additions & 4 deletions .gitmodules
@@ -1,4 +0,0 @@
[submodule "volk"]
path = volk
url = https://github.com/gnuradio/volk.git
branch = master
67 changes: 10 additions & 57 deletions CMakeLists.txt
Expand Up @@ -55,6 +55,7 @@ set(GCC_MIN_VERSION "4.8.4")
set(CLANG_MIN_VERSION "3.4.0")
set(APPLECLANG_MIN_VERSION "500")
set(MSVC_MIN_VERSION "1800")
set(VOLK_MIN_VERSION "2.1.0")

# Enable generation of compile_commands.json for code completion engines
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
Expand Down Expand Up @@ -368,67 +369,19 @@ endif()


########################################################################
# Setup volk as a subproject
# Detect and configure VOLK
########################################################################
message(STATUS "")
message(STATUS "Configuring VOLK support...")
find_package(Volk ${VOLK_MIN_VERSION} REQUIRED)
message(STATUS " Found VOLK:")
message(STATUS " * Version: ${VOLK_VERSION}")
message(STATUS " * Libraries: ${VOLK_LIBRARIES}")
message(STATUS " * Includes: ${VOLK_INCLUDE_DIRS}")

OPTION(ENABLE_INTERNAL_VOLK "Enable internal VOLK only" ON)
UNSET(Volk_FOUND)
if(NOT ENABLE_INTERNAL_VOLK)
find_package(Volk)
set(GR_VOLK_LIB "Volk::volk")
if(NOT Volk_FOUND)
message(STATUS " External VOLK not found; checking internal.")
endif()
endif()
if(NOT Volk_FOUND)
find_file(INTREE_VOLK_FOUND
volk/volk_common.h
PATHS ${CMAKE_CURRENT_SOURCE_DIR}/volk/include
NO_DEFAULT_PATH
NO_CMAKE_FIND_ROOT_PATH
)

if(NOT INTREE_VOLK_FOUND)
message(STATUS " VOLK submodule is not checked out.")
message(STATUS " To check out the VOLK submodule, use:")
message(STATUS " git pull --recurse-submodules=on")
message(STATUS " git submodule update --init")
if(ENABLE_INTERNAL_VOLK)
message(STATUS " External VOLK disabled.")
endif()
message(STATUS " Override with -DENABLE_INTERNAL_VOLK=ON/OFF")
message(STATUS "")
message(FATAL_ERROR "VOLK required but not found.")
endif()

add_subdirectory(volk)
# if the above command returns, then VOLK is enabled

include(GrComponent)
GR_REGISTER_COMPONENT("volk" ENABLE_VOLK)

SET(VOLK_INCLUDE_DIRS
${CMAKE_CURRENT_SOURCE_DIR}/volk/include
${CMAKE_CURRENT_BINARY_DIR}/volk/include
)

set(GR_VOLK_LIB "volk")

SET(VOLK_INSTALL_LIBRARY_DIR ${CMAKE_INSTALL_PREFIX}/lib)
SET(VOLK_INSTALL_INCLUDE_DIR ${CMAKE_INSTALL_PREFIX}/include)
else()
message(STATUS " An external VOLK has been found and will be used for build.")
SET(ENABLE_VOLK TRUE)

get_filename_component(VOLK_INSTALL_LIBRARY_DIR "${VOLK_LIBRARIES}" DIRECTORY)
SET(VOLK_INSTALL_INCLUDE_DIR ${VOLK_INCLUDE_DIRS})
endif(NOT Volk_FOUND)

message(STATUS " Override with -DENABLE_INTERNAL_VOLK=ON/OFF")

# Handle logging
########################################################################
# Configure Log4CPP
########################################################################
find_package(LOG4CPP REQUIRED)

########################################################################
Expand Down
15 changes: 3 additions & 12 deletions docs/doxygen/Doxyfile.in
Expand Up @@ -174,11 +174,7 @@ STRIP_FROM_INC_PATH = @CMAKE_SOURCE_DIR@/gnuradio-runtime/include \
@CMAKE_SOURCE_DIR@/gr-wavelet/include \
@CMAKE_BINARY_DIR@/gr-wavelet/include \
@CMAKE_SOURCE_DIR@/gr-zeromq/include \
@CMAKE_BINARY_DIR@/gr-zeromq/include \
@CMAKE_SOURCE_DIR@/volk/include \
@CMAKE_BINARY_DIR@/volk/include \
@CMAKE_SOURCE_DIR@/volk/tmpl \
@CMAKE_BINARY_DIR@/volk/tmpl
@CMAKE_BINARY_DIR@/gr-zeromq/include

# If the SHORT_NAMES tag is set to YES, doxygen will generate much shorter
# (but less readable) file names. This can be useful if your file system
Expand Down Expand Up @@ -726,9 +722,7 @@ RECURSIVE = YES
# Note that relative paths are relative to the directory from which doxygen is
# run.

EXCLUDE = @abs_top_srcdir@/volk \
@abs_top_builddir@/volk \
@abs_top_builddir@/cmake/msvc \
EXCLUDE = @abs_top_builddir@/cmake/msvc \
@abs_top_builddir@/docs/doxygen/html \
@abs_top_builddir@/docs/doxygen/xml \
@abs_top_builddir@/docs/doxygen/other/doxypy.py \
Expand Down Expand Up @@ -793,10 +787,7 @@ EXCLUDE = @abs_top_srcdir@/volk \
@abs_top_srcdir@/gr-wavelet/lib \
@abs_top_builddir@/gr-wavelet/lib \
@abs_top_srcdir@/gr-zeromq/lib \
@abs_top_builddir@/gr-zeromq/lib \
@abs_top_srcdir@/volk/cmake/msvc \
@abs_top_builddir@/volk/cmake/msvc \
@abs_top_srcdir@/volk/kernels/volk/volk_8u_conv_k7_r2puppet_8u.h
@abs_top_builddir@/gr-zeromq/lib

# The EXCLUDE_SYMLINKS tag can be used to select whether or not files or
# directories that are symbolic links (a Unix file system feature) are excluded
Expand Down
1 change: 0 additions & 1 deletion gnuradio-runtime/CMakeLists.txt
Expand Up @@ -25,7 +25,6 @@ GR_CHECK_LINUX_SCHED_AVAIL()
include(GrComponent)
GR_REGISTER_COMPONENT("gnuradio-runtime" ENABLE_GNURADIO_RUNTIME
Boost_FOUND
ENABLE_VOLK
PYTHONINTERP_FOUND
MPLIB_FOUND
LOG4CPP_FOUND
Expand Down
2 changes: 1 addition & 1 deletion gnuradio-runtime/lib/CMakeLists.txt
Expand Up @@ -188,7 +188,7 @@ endif(ENABLE_GR_CTRLPORT)

target_link_libraries(gnuradio-runtime PUBLIC
gnuradio-pmt
${GR_VOLK_LIB}
Volk::volk
Boost::program_options
Boost::filesystem
Boost::system
Expand Down
1 change: 0 additions & 1 deletion gr-analog/CMakeLists.txt
Expand Up @@ -16,7 +16,6 @@ include(GrBoost)
include(GrComponent)
GR_REGISTER_COMPONENT("gr-analog" ENABLE_GR_ANALOG
Boost_FOUND
ENABLE_VOLK
ENABLE_GNURADIO_RUNTIME
ENABLE_GR_BLOCKS
ENABLE_GR_FFT
Expand Down
1 change: 0 additions & 1 deletion gr-blocks/CMakeLists.txt
Expand Up @@ -16,7 +16,6 @@ include(GrBoost)
include(GrComponent)
GR_REGISTER_COMPONENT("gr-blocks" ENABLE_GR_BLOCKS
Boost_FOUND
ENABLE_VOLK
ENABLE_GNURADIO_RUNTIME
)

Expand Down
6 changes: 3 additions & 3 deletions gr-blocks/lib/CMakeLists.txt
Expand Up @@ -175,9 +175,9 @@ add_library(gnuradio-blocks
)

target_link_libraries(gnuradio-blocks
gnuradio-runtime
${GR_VOLK_LIB}
)
gnuradio-runtime
Volk::volk
)

target_include_directories(gnuradio-blocks
PUBLIC
Expand Down
1 change: 0 additions & 1 deletion gr-channels/CMakeLists.txt
Expand Up @@ -16,7 +16,6 @@ include(GrBoost)
include(GrComponent)

GR_REGISTER_COMPONENT("gr-channels" ENABLE_GR_CHANNELS
ENABLE_VOLK
Boost_FOUND
ENABLE_GNURADIO_RUNTIME
ENABLE_GR_BLOCKS
Expand Down
1 change: 0 additions & 1 deletion gr-digital/CMakeLists.txt
Expand Up @@ -16,7 +16,6 @@ include(GrBoost)
include(GrComponent)
GR_REGISTER_COMPONENT("gr-digital" ENABLE_GR_DIGITAL
Boost_FOUND
ENABLE_VOLK
ENABLE_GNURADIO_RUNTIME
ENABLE_GR_FFT
ENABLE_GR_FILTER
Expand Down
2 changes: 1 addition & 1 deletion gr-digital/lib/CMakeLists.txt
Expand Up @@ -98,7 +98,7 @@ target_link_libraries(gnuradio-digital PUBLIC
gnuradio-blocks
gnuradio-analog
Boost::boost
${GR_VOLK_LIB}
Volk::volk
)


Expand Down
1 change: 0 additions & 1 deletion gr-dtv/CMakeLists.txt
Expand Up @@ -21,7 +21,6 @@ GR_REGISTER_COMPONENT("gr-dtv" ENABLE_GR_DTV
ENABLE_GR_ANALOG
ENABLE_GR_FILTER
ENABLE_GR_FEC
ENABLE_VOLK
)

SET(GR_PKG_DTV_EXAMPLES_DIR ${GR_PKG_DATA_DIR}/examples/dtv)
Expand Down
2 changes: 1 addition & 1 deletion gr-dtv/lib/CMakeLists.txt
Expand Up @@ -73,7 +73,7 @@ target_link_libraries(gnuradio-dtv PUBLIC
gnuradio-analog
gnuradio-filter
gnuradio-fec
${GR_VOLK_LIB}
Volk::volk
)

target_include_directories(gnuradio-dtv
Expand Down
1 change: 0 additions & 1 deletion gr-fec/CMakeLists.txt
Expand Up @@ -18,7 +18,6 @@ include(GrComponent)
find_package(GSL)

GR_REGISTER_COMPONENT("gr-fec" ENABLE_GR_FEC
ENABLE_VOLK
Boost_FOUND
ENABLE_GNURADIO_RUNTIME
ENABLE_GR_BLOCKS
Expand Down
1 change: 0 additions & 1 deletion gr-fft/CMakeLists.txt
Expand Up @@ -18,7 +18,6 @@ find_package(FFTW3f)
include(GrComponent)

GR_REGISTER_COMPONENT("gr-fft" ENABLE_GR_FFT
ENABLE_VOLK
Boost_FOUND
ENABLE_GNURADIO_RUNTIME
ENABLE_GR_BLOCKS
Expand Down
2 changes: 1 addition & 1 deletion gr-fft/lib/CMakeLists.txt
Expand Up @@ -20,7 +20,7 @@ add_library(gnuradio-fft
target_link_libraries(gnuradio-fft PUBLIC
gnuradio-runtime
fftw3f::fftw3f
${GR_VOLK_LIB}
Volk::volk
)

target_include_directories(gnuradio-fft
Expand Down
1 change: 0 additions & 1 deletion gr-filter/CMakeLists.txt
Expand Up @@ -16,7 +16,6 @@ include(GrBoost)
include(GrComponent)

GR_REGISTER_COMPONENT("gr-filter" ENABLE_GR_FILTER
ENABLE_VOLK
Boost_FOUND
ENABLE_GNURADIO_RUNTIME
ENABLE_GR_FFT
Expand Down
2 changes: 1 addition & 1 deletion gr-filter/lib/CMakeLists.txt
Expand Up @@ -59,7 +59,7 @@ target_link_libraries(gnuradio-filter PUBLIC
gnuradio-runtime
gnuradio-fft
gnuradio-blocks
${GR_VOLK_LIB}
Volk::volk
)

target_include_directories(gnuradio-filter
Expand Down
1 change: 0 additions & 1 deletion gr-qtgui/CMakeLists.txt
Expand Up @@ -35,7 +35,6 @@ GR_REGISTER_COMPONENT("gr-qtgui" ENABLE_GR_QTGUI
Boost_FOUND
QT_FOUND
QWT_FOUND
ENABLE_VOLK
ENABLE_GNURADIO_RUNTIME
ENABLE_GR_FFT
ENABLE_GR_FILTER
Expand Down
2 changes: 1 addition & 1 deletion gr-qtgui/lib/CMakeLists.txt
Expand Up @@ -67,7 +67,7 @@ target_link_libraries(gnuradio-qtgui PUBLIC
gnuradio-runtime
gnuradio-fft
gnuradio-filter
${GR_VOLK_LIB}
Volk::volk
qwt::qwt
Qt5::Widgets
)
Expand Down
1 change: 0 additions & 1 deletion volk
Submodule volk deleted from aae9fe

0 comments on commit 80c0447

Please sign in to comment.