diff -Nurd -x'*~' sextractor-2.19.5.orig/Makefile.am sextractor-2.19.5/Makefile.am --- sextractor-2.19.5.orig/Makefile.am 2012-07-09 10:08:59.000000000 -0400 +++ sextractor-2.19.5/Makefile.am 2015-11-24 02:08:48.000000000 -0500 @@ -26,6 +26,7 @@ # #%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +ACLOCAL_AMFLAGS = -I autoconf AUTOMAKE_OPTIONS = foreign no-dependencies SUBDIRS = man src tests dist_pkgdata_DATA = config/* xsl/sextractor.xsl diff -Nurd -x'*~' sextractor-2.19.5.orig/acx_accelerate.m4 sextractor-2.19.5/acx_accelerate.m4 --- sextractor-2.19.5.orig/acx_accelerate.m4 1969-12-31 19:00:00.000000000 -0500 +++ sextractor-2.19.5/acx_accelerate.m4 2015-11-24 02:04:52.000000000 -0500 @@ -0,0 +1,82 @@ +dnl +dnl acx_accelerate.m4 +dnl +dnl Set up options for using the Mac OSX Accelerate Framework. +dnl +dnl %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +dnl +dnl This file part of: AstrOmatic software +dnl +dnl Copyright: (C) 2003-2013 Emmanuel Bertin -- IAP/CNRS/UPMC +dnl +dnl License: GNU General Public License +dnl +dnl AstrOmatic software is free software: you can redistribute it and/or +dnl modify it under the terms of the GNU General Public License as +dnl published by the Free Software Foundation, either version 3 of the +dnl License, or (at your option) any later version. +dnl AstrOmatic software is distributed in the hope that it will be useful, +dnl but WITHOUT ANY WARRANTY; without even the implied warranty of +dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +dnl GNU General Public License for more details. +dnl You should have received a copy of the GNU General Public License +dnl along with AstrOmatic software. +dnl If not, see . +dnl +dnl Last modified: 02/11/2014 +dnl +dnl %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +dnl +dnl @synopsis ACX_ACCEL([MKL_DIR, ILP64_FLAG, STATIC_FLAG, CONV_LIBS]) +dnl +dnl This macro sets the MKL_CFLAGS, MKL_LDFLAGS and MKL_LIBS variables to +dnl for compiling and linking with INTEL's MKL. A coma-separated list of +dnl convenience libraries may be included in the linked group for static linking. +dnl You may wish to use these variables in your default CFLAGS: +dnl +dnl CFLAGS="$CFLAGS $MKL_CFLAGS" +dnl +dnl You may wish to use these variables in your default LDFLAGS: +dnl +dnl LDFLAGS="$LDFLAGS $MKL_LDLAGS" +dnl +dnl You may wish to use these variables in your default LIBS: +dnl +dnl LIBS="$LIBS $MKL_LIBS" +dnl + +AC_DEFUN([ACX_ACCEL], [ +AC_REQUIRE([AC_CANONICAL_HOST]) + + +dnl -------------------------- +dnl Exit if host is not MacOSX +dnl -------------------------- +case $host_os in + darwin* ) ;; + *) + ACCEL_WARN="Accelerate only available on Mac OSX" + AC_SUBST(ACCEL_WARN) + exit +esac + +acx_accelerate_ok=no +AC_CHECK_HEADERS([Accelerate/Accelerate.h], [acx_accelerate_ok=yes]) +AC_SUBST(ACCEL_LIBS, "-framework Accelerate") +AC_SUBST(MKL_LDFLAGS, "") + +dnl -------------------- +dnl Set internal flags +dnl -------------------- + +AC_DEFINE(HAVE_ACCELERATE,1, [Define if you have the Accelerate libraries.]) +AC_DEFINE(HAVE_LAPACK,1, [Define if you have the LAPACK libraries.]) + +dnl -------------------- +dnl Set include files +dnl -------------------- + +AC_DEFINE(ACCELERATE_H, "Accelerate/Accelerate.h", [Accelerate header filename.]) +AC_DEFINE(LAPACK_H, "Accelerate/Accelerate.h", [LAPACK header filename.]) + +])dnl ACX_ACCEL diff -Nurd -x'*~' sextractor-2.19.5.orig/configure.ac sextractor-2.19.5/configure.ac --- sextractor-2.19.5.orig/configure.ac 2013-12-14 12:12:32.000000000 -0500 +++ sextractor-2.19.5/configure.ac 2015-11-24 02:08:28.000000000 -0500 @@ -34,6 +34,7 @@ AC_INIT(sextractor, 2.19.5, [bertin@iap.fr]) AC_CONFIG_SRCDIR(src/makeit.c) AC_CONFIG_AUX_DIR(autoconf) +AC_CONFIG_MACRO_DIRS([autoconf]) AC_CONFIG_HEADERS(config.h) AM_INIT_AUTOMAKE date=`date +%Y-%m-%d` @@ -48,6 +49,7 @@ sinclude(acx_atlas.m4) sinclude(acx_fftw.m4) sinclude(acx_mkl.m4) +sinclude(acx_accelerate.m4) sinclude(acx_prog_cc_optim.m4) sinclude(acx_pthread.m4) sinclude(acx_urbi_resolve_dir.m4) @@ -85,6 +87,15 @@ AC_MSG_RESULT([yes]), AC_MSG_RESULT([no])) +# Provide special options for Apple Accelerate +AC_MSG_CHECKING([whether we should use Appel's Accelerate]) +AC_ARG_ENABLE(accelerate, + [AS_HELP_STRING([--enable-accelerate], + [Use Apple's Accelerate for linear algebra (off by default)])], + CC="cc" + AC_MSG_RESULT([yes]), + AC_MSG_RESULT([no])) + # Checks for programs. AC_LANG(C) @@ -243,13 +254,19 @@ AC_MSG_WARN([$FFTW_WARN]) fi, AC_MSG_ERROR([$FFTW_ERROR Exiting.])) +################ handle the Apple Accelerate framework (linear algebra) ###### + if test x$enable_accelerate = xyes; then + ACX_ACCEL() + LIBS="$ACCEL_LIBS $LIBS" + else ################## handle the ATLAS library(linear algebra) ################## - ACX_ATLAS($with_atlas_libdir,$with_atlas_incdir,$use_pthreads, - LIBS="$ATLAS_LIBS $LIBS" - if test x$ATLAS_WARN != x; then - AC_MSG_WARN([$ATLAS_WARN]) - fi, - AC_MSG_ERROR([$ATLAS_ERROR Exiting.])) + ACX_ATLAS($with_atlas_libdir,$with_atlas_incdir,$use_pthreads, + LIBS="$ATLAS_LIBS $LIBS" + if test x$ATLAS_WARN != x; then + AC_MSG_WARN([$ATLAS_WARN]) + fi, + AC_MSG_ERROR([$ATLAS_ERROR Exiting.])) + fi fi fi AM_CONDITIONAL(USE_MODEL, [test x$enable_model_fitting != xno]) diff -Nurd -x'*~' sextractor-2.19.5.orig/src/pattern.c sextractor-2.19.5/src/pattern.c --- sextractor-2.19.5.orig/src/pattern.c 2012-07-09 11:01:16.000000000 -0400 +++ sextractor-2.19.5/src/pattern.c 2015-11-24 02:04:52.000000000 -0500 @@ -54,6 +54,10 @@ #include ATLAS_LAPACK_H #endif +#ifdef HAVE_ACCELERATE +#include ACCELERATE_H +#endif + #ifdef HAVE_LAPACKE #include LAPACKE_H #endif @@ -125,7 +129,7 @@ } return pattern; - } + } /****** pattern_end *********************************************************** @@ -219,6 +223,10 @@ /* Solve the system */ #if defined(HAVE_LAPACKE) LAPACKE_dposv(LAPACK_COL_MAJOR, 'L', nvec, 1, alpha, nvec, beta, nvec); +#elif defined(HAVE_ACCELERATE) + int info,n_beta=1; + char* upper_or_lower="U"; + dposv_(upper_or_lower, &nvec, &n_beta, alpha, &nvec, beta, &nvec, &info); #else clapack_dposv(CblasRowMajor, CblasUpper, nvec, 1, alpha, nvec, beta, nvec); #endif