From 0226ddecd5ae8c9f1d714c1e604f8a4e547e4359 Mon Sep 17 00:00:00 2001 From: Kevin Mihelich Date: Tue, 26 Apr 2016 00:10:38 +0000 Subject: [PATCH] added community/libvolk --- .../0001-Use-NEON-for-ARMv7-only.patch | 59 +++++++++++++++++++ community/libvolk/PKGBUILD | 52 ++++++++++++++++ 2 files changed, 111 insertions(+) create mode 100644 community/libvolk/0001-Use-NEON-for-ARMv7-only.patch create mode 100644 community/libvolk/PKGBUILD diff --git a/community/libvolk/0001-Use-NEON-for-ARMv7-only.patch b/community/libvolk/0001-Use-NEON-for-ARMv7-only.patch new file mode 100644 index 000000000..ad00acc3e --- /dev/null +++ b/community/libvolk/0001-Use-NEON-for-ARMv7-only.patch @@ -0,0 +1,59 @@ +From ddace4afd21c7c41ab76b849346425d7b412a38e Mon Sep 17 00:00:00 2001 +From: Kevin Mihelich +Date: Mon, 25 Apr 2016 18:03:26 -0600 +Subject: [PATCH] Use NEON for ARMv7 only + +Signed-off-by: Kevin Mihelich +--- + lib/CMakeLists.txt | 14 +++++++++++--- + 1 file changed, 11 insertions(+), 3 deletions(-) + +diff --git a/lib/CMakeLists.txt b/lib/CMakeLists.txt +index 1accb59..19746d5 100644 +--- a/lib/CMakeLists.txt ++++ b/lib/CMakeLists.txt +@@ -250,6 +250,14 @@ if(NOT CPU_IS_x86) + endif(NOT CPU_IS_x86) + + ######################################################################## ++# if the CPU is not ARMv7, eliminate NEON ++######################################################################## ++ ++if(NOT ${CMAKE_SYSTEM_PROCESSOR} MATCHES "armv7.*") ++ OVERRULE_ARCH(neon "Architecture is not ARMv7") ++endif(NOT ${CMAKE_SYSTEM_PROCESSOR} MATCHES "armv7.*") ++ ++######################################################################## + # implement overruling in the ORC case, + # since ORC always passes flag detection + ######################################################################## +@@ -414,7 +422,7 @@ include_directories( + # Handle ASM support + # on by default, but let users turn it off + ######################################################################## +-if(${CMAKE_VERSION} VERSION_GREATER "2.8.9") ++if((${CMAKE_VERSION} VERSION_GREATER "2.8.9") AND (${CMAKE_SYSTEM_PROCESSOR} MATCHES "armv7.*")) + set(ASM_ARCHS_AVAILABLE "neon") + + set(FULL_C_FLAGS "${CMAKE_C_FLAGS}" "${CMAKE_CXX_COMPILER_ARG1}") +@@ -443,7 +451,7 @@ if(${CMAKE_VERSION} VERSION_GREATER "2.8.9") + message(STATUS "asm flags: ${CMAKE_ASM_FLAGS}") + endforeach(ARCH) + +-else(${CMAKE_VERSION} VERSION_GREATER "2.8.9") ++else((${CMAKE_VERSION} VERSION_GREATER "2.8.9") AND (${CMAKE_SYSTEM_PROCESSOR} MATCHES "armv7.*")) + message(STATUS "Not enabling ASM support. CMake >= 2.8.10 required.") + foreach(machine_name ${available_machines}) + string(REGEX MATCH "neon" NEON_MACHINE ${machine_name}) +@@ -451,7 +459,7 @@ else(${CMAKE_VERSION} VERSION_GREATER "2.8.9") + message(FATAL_ERROR "CMake >= 2.8.10 is required for ARM NEON support") + endif() + endforeach() +-endif(${CMAKE_VERSION} VERSION_GREATER "2.8.9") ++endif((${CMAKE_VERSION} VERSION_GREATER "2.8.9") AND (${CMAKE_SYSTEM_PROCESSOR} MATCHES "armv7.*")) + + ######################################################################## + # Handle orc support +-- +2.8.0 + diff --git a/community/libvolk/PKGBUILD b/community/libvolk/PKGBUILD new file mode 100644 index 000000000..1f1abaf5e --- /dev/null +++ b/community/libvolk/PKGBUILD @@ -0,0 +1,52 @@ +# $Id$ +# Maintainer: Kyle Keen + +# ALARM: Kevin Mihelich +# - patch to not build neon on !ARMv7 + +pkgname=libvolk +pkgver=1.2.2 +pkgrel=1 +pkgdesc="The Vector-Optimized Library of Kernels from Gnuradio" +arch=('i686' 'x86_64') +url="http://libvolk.org/" +license=('GPL3') +depends=('gcc-libs' 'boost-libs' 'orc' 'python2') +makedepends=('boost' 'cmake' 'python2-cheetah') +source=("http://libvolk.org/releases/volk-$pkgver.tar.gz" + '0001-Use-NEON-for-ARMv7-only.patch') +md5sums=('540e2c55e525c04920e0e63d0de530b3' + 'da3b1d0b0f859697c743563ee55152d3') + +# doxygen for docs + +prepare() { + cd "$srcdir/volk-$pkgver" + sed -i -e "s|#![ ]*/usr/bin/env python$|&2|" $(find ./ -name '*.py') + patch -p1 -i ../0001-Use-NEON-for-ARMv7-only.patch +} + +build() { + export PYTHON=python2 + cd "$srcdir/volk-$pkgver" + + mkdir -p build + cd build + cmake \ + -DPYTHON_EXECUTABLE=$(which python2) \ + -DCMAKE_INSTALL_PREFIX=/usr -Wno-dev ../ + make +} + +check() { + cd "$srcdir/volk-$pkgver/build" + export PYTHON=python2 + if [[ "$CARCH" == "x86_64" ]]; then + make test + fi +} + +package() { + cd "$srcdir/volk-$pkgver/build" + make DESTDIR="$pkgdir" install +}