zbyszek pushed to blosc (epel7). "Fix build on arm"

notifications at fedoraproject.org notifications at fedoraproject.org
Thu May 28 18:30:44 UTC 2015


From 9a54e5bf586613d74ea93bb50654f868e1481256 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= <zbyszek at in.waw.pl>
Date: Thu, 7 May 2015 14:03:00 -0400
Subject: Fix build on arm


diff --git a/0001-Fix-cmake-system-check.patch b/0001-Fix-cmake-system-check.patch
new file mode 100644
index 0000000..3f8fdad
--- /dev/null
+++ b/0001-Fix-cmake-system-check.patch
@@ -0,0 +1,47 @@
+From 023d185a1e9f104f15b7800d13cf3c1b9169ab72 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= <zbyszek at in.waw.pl>
+Date: Thu, 7 May 2015 12:35:32 -0400
+Subject: [PATCH] Fix cmake system check
+
+Apparently the check was always evaluating to true, because cmake simply
+sets the variable to whatever is on the right, not evaluating the expression.
+
+The list of architectures was also completely random. Those seems to
+be the available options (under Linux):
+
+i386 i686 x86_64 ia64 alpha amd64 arm armeb armel hppa m32r m68k mips
+mipsel powerpc ppc64 s390 s390x sh3 sh3eb sh4 sh4eb sparc
+---
+ CMakeLists.txt | 9 ++++++---
+ 1 file changed, 6 insertions(+), 3 deletions(-)
+
+diff --git a/CMakeLists.txt b/CMakeLists.txt
+index 69b6525a95..39e3dcf0d9 100644
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -139,8 +139,11 @@ endif(NOT CMAKE_BUILD_TYPE)
+ # by the compiler. Note we DO NOT check which hardware features are supported
+ # by this (the host) system, because we want to be able to support compiling
+ # for newer hardware on older machines as well as cross-compilation.
+-set(SYSTEM_PROCESSOR_INTEL_X86 ((CMAKE_SYSTEM_PROCESSOR STREQUAL i686) OR (CMAKE_SYSTEM_PROCESSOR STREQUAL x86) OR (CMAKE_SYSTEM_PROCESSOR STREQUAL AMD64)))
+-if(SYSTEM_PROCESSOR_INTEL_X86)
++message(STATUS "Building for system processor ${CMAKE_SYSTEM_PROCESSOR}.")
++if(CMAKE_SYSTEM_PROCESSOR STREQUAL i386 OR
++   CMAKE_SYSTEM_PROCESSOR STREQUAL i686 OR
++   CMAKE_SYSTEM_PROCESSOR STREQUAL x86_64 OR
++   CMAKE_SYSTEM_PROCESSOR STREQUAL amd64)
+     if(CMAKE_C_COMPILER_ID STREQUAL GNU)
+         set(COMPILER_SUPPORT_SSE2 TRUE)
+         if(CMAKE_C_COMPILER_VERSION VERSION_GREATER 4.7 OR CMAKE_C_COMPILER_VERSION VERSION_EQUAL 4.7)
+@@ -175,7 +178,7 @@ if(SYSTEM_PROCESSOR_INTEL_X86)
+         # Unrecognized compiler. Emit a warning message to let the user know hardware-acceleration won't be available.
+         message(WARNING "Unable to determine which ${CMAKE_SYSTEM_PROCESSOR} hardware features are supported by the C compiler (${CMAKE_C_COMPILER_ID} ${CMAKE_C_COMPILER_VERSION}).")
+     endif()
+-else(SYSTEM_PROCESSOR_INTEL_X86)
++else()
+     # If the target system processor isn't recognized, emit a warning message to alert the user
+     # that hardware-acceleration support won't be available but allow configuration to proceed.
+     message(WARNING "Unrecognized system processor ${CMAKE_SYSTEM_PROCESSOR}. Cannot determine which hardware features (${CMAKE_C_COMPILER_ID} ${CMAKE_C_COMPILER_VERSION}) supports, so hardware-accelerated implementations will not be available.")
+-- 
+2.1.0
+
diff --git a/0002-Fix-compilation-on-unknown-archs.patch b/0002-Fix-compilation-on-unknown-archs.patch
new file mode 100644
index 0000000..a593814
--- /dev/null
+++ b/0002-Fix-compilation-on-unknown-archs.patch
@@ -0,0 +1,27 @@
+From 97227c72cb6108b58bfa704b43324e82d1b86f47 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= <zbyszek at in.waw.pl>
+Date: Thu, 7 May 2015 13:24:45 -0400
+Subject: [PATCH] Fix compilation on "unknown" archs
+
+---
+ blosc/shuffle.c | 4 ++++
+ 1 file changed, 4 insertions(+)
+
+diff --git a/blosc/shuffle.c b/blosc/shuffle.c
+index 0fd97b7cbf..9d02389f35 100644
+--- a/blosc/shuffle.c
++++ b/blosc/shuffle.c
+@@ -217,6 +217,10 @@ static blosc_cpu_features blosc_get_cpu_features(void) {
+   #warning Hardware-acceleration detection not implemented for the target architecture. Only the generic shuffle/unshuffle routines will be available.
+   #endif
+ 
++static blosc_cpu_features blosc_get_cpu_features(void) {
++  return BLOSC_HAVE_NOTHING;
++}
++
+ #endif
+ 
+ static shuffle_implementation_t
+-- 
+2.1.0
+
diff --git a/blosc.spec b/blosc.spec
index 3495664..2a4e121 100644
--- a/blosc.spec
+++ b/blosc.spec
@@ -6,6 +6,8 @@ Version: 1.6.1
 Release: 1%{?dist}
 License: MIT
 Source: https://github.com/FrancescAlted/blosc/archive/v%{version}.tar.gz
+Patch0: 0001-Fix-cmake-system-check.patch
+Patch1: 0002-Fix-compilation-on-unknown-archs.patch
 URL:  https://github.com/FrancescAlted/blosc
 BuildRequires: cmake
 BuildRequires: lz4-devel
@@ -37,7 +39,7 @@ The blosc-bench package contains a benchmark suite which evaluates
 the performance of Blosc, and compares it with memcpy.
 
 %prep
-%setup -q -n c-%{name}-%{version}
+%autosetup -n c-%{name}-%{version} -p1
 rm -r internal-complibs/snappy* internal-complibs/zlib*
 
 # Fix rpath issue
-- 
cgit v0.10.2


	http://pkgs.fedoraproject.org/cgit/blosc.git/commit/?h=epel7&id=9a54e5bf586613d74ea93bb50654f868e1481256


More information about the scm-commits mailing list