From a6464f20d86e334174a381f110186f2f59211345 Mon Sep 17 00:00:00 2001 From: "Peter W. Draper" <p.w.draper@durham.ac.uk> Date: Thu, 4 Jun 2015 18:31:59 +0100 Subject: [PATCH] Don't compile examples that require CBLAS and LAPACK when packages are not available --- configure.ac | 5 +++++ examples/Makefile.am | 5 ++++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/configure.ac b/configure.ac index 3928803..3ec22c1 100644 --- a/configure.ac +++ b/configure.ac @@ -143,6 +143,11 @@ AC_MSG_RESULT($rtc_ok) # Check for feenableexcept, should be present in C99, also checks for -lm. AC_CHECK_LIB([m],[feenableexcept]) +# Some examples require CBLAS and LAPACK, check for that and set conditional. +AC_CHECK_HEADER([cblas.h]) +AC_CHECK_HEADER([lapacke.h]) +AM_CONDITIONAL([HAVECBLAS], [test $ac_cv_header_cblas_h = "yes" -a $ac_cv_header_lapacke_h = "yes"]) + # Check for git, needed for revision stamps. AC_PATH_PROG([GIT_CMD], [git]) AC_SUBST([GIT_CMD]) diff --git a/examples/Makefile.am b/examples/Makefile.am index 61c0267..e3f0f9a 100644 --- a/examples/Makefile.am +++ b/examples/Makefile.am @@ -22,7 +22,10 @@ AM_CFLAGS = -I../src -DCPU_TPS=2.67e9 -DTIMERS AM_LDFLAGS = # Set-up the library -bin_PROGRAMS = test test_qr test_bh test_bh_sorted test_fmm_sorted +bin_PROGRAMS = test test_bh test_bh_sorted test_fmm_sorted +if HAVECBLAS +bin_PROGRAMS += test_qr +endif # Sources for test test_SOURCES = test.c -- GitLab