buildrootschalter/package/clapack/clapack-0002-cmake-make-test-build-sensitive-to-BUILD_TESTING.patch
Samuel Martin dd5dbe627f clapack: new package
This package provides BLAS and LAPACK libraries.

Though it is common to find implementation of these two libraries in
Fortran, this package provides a C-implementation for both, because:
- Fortran support has been deprecated in Buildroot since the 2013.11
  release;
- most of the external toolchains do not provide a Fortran compiler.

Often BLAS build-systems build some test programs and run them to
generate some source files or adjust some build optimizations, naively
assuming they are building the library for the build-machine. This does
not play well when cross-compiling.

This implementation has this defect too, by building and running a tool
generating a header.
However, the build-system allows to pass an empty header.
So, we have to patch the CMake to build the generator (but never
install it) and correctly support building with and without this header
provided by the user.

Also, some CMake patches are needed to fix the build and install rules.

[Peter: needs largefile, fix _LICENSE_FILES, tweak patch desc]
Signed-off-by: Samuel Martin <s.martin49@gmail.com>
Reviewed-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
2014-05-04 09:10:55 +02:00

81 lines
2.3 KiB
Diff

From 834c221936d9c460b44e3a65b6fedfb3193f491b Mon Sep 17 00:00:00 2001
From: Samuel Martin <s.martin49@gmail.com>
Date: Sat, 11 Jan 2014 21:33:12 +0100
Subject: [PATCH 2/6] cmake: make test build sensitive to BUILD_TESTING
This patch prevent from wasting time building the tests if it's our
wish.
The test build takes a significant amount of time, and the binaries
are not installed.
Signed-off-by: Samuel Martin <s.martin49@gmail.com>
---
BLAS/TESTING/CMakeLists.txt | 3 +++
CMakeLists.txt | 9 ++++++---
TESTING/CMakeLists.txt | 4 ++++
3 files changed, 13 insertions(+), 3 deletions(-)
diff --git a/BLAS/TESTING/CMakeLists.txt b/BLAS/TESTING/CMakeLists.txt
index ec2c587..e7dc0b7 100644
--- a/BLAS/TESTING/CMakeLists.txt
+++ b/BLAS/TESTING/CMakeLists.txt
@@ -25,6 +25,9 @@
# make single FRC=FRC
#
#######################################################################
+if(NOT BUILD_TESTING)
+ return()
+endif()
macro(add_blas_test name src)
get_filename_component(baseNAME ${src} NAME_WE)
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 320ccc6..0a362c0 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -1,6 +1,5 @@
cmake_minimum_required(VERSION 2.6)
project(CLAPACK C)
-enable_testing()
include(CTest)
if(WIN32 AND NOT CYGWIN)
@@ -11,7 +10,9 @@ else()
set(SECOND_SRC ${CLAPACK_SOURCE_DIR}/INSTALL/second.c)
set(DSECOND_SRC ${CLAPACK_SOURCE_DIR}/INSTALL/dsecnd.c)
endif()
-enable_testing()
+if(NOT BUILD_TESTING)
+ enable_testing()
+endif()
option(USE_BLAS_WRAP "pre-pend f2c_ to each function in blas" OFF)
if(NOT USE_BLAS_WRAP)
# _zrotg_ seems to be missing in the wrap header
@@ -21,7 +22,9 @@ include_directories(${CLAPACK_SOURCE_DIR}/INCLUDE)
add_subdirectory(F2CLIBS)
add_subdirectory(BLAS)
add_subdirectory(SRC)
-add_subdirectory(TESTING)
+if(NOT BUILD_TESTING)
+ add_subdirectory(TESTING)
+endif()
set(CLAPACK_VERSION 3.2.1)
set(CPACK_PACKAGE_VERSION_MAJOR 3)
set(CPACK_PACKAGE_VERSION_MINOR 2)
diff --git a/TESTING/CMakeLists.txt b/TESTING/CMakeLists.txt
index d59359d..f6b083a 100644
--- a/TESTING/CMakeLists.txt
+++ b/TESTING/CMakeLists.txt
@@ -1,3 +1,7 @@
+if(NOT BUILD_TESTING)
+ return()
+endif()
+
if(MSVC_VERSION)
# string(REPLACE "/STACK:10000000" "/STACK:900000000000000000"
# CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS}")
--
1.8.5.3