Commit 6847fc4b authored by Emmanuel Bertin's avatar Emmanuel Bertin
Browse files

Fixed obsolete autoconf macros in configure.ac

Added control of the number of threads in MKL calls.
Added support for negative NTHREADS (= max number of threads).
Pushed version number to 2.18.1.
parent aa52c8bf
......@@ -8944,18 +8944,6 @@ AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS],
[AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"])
])
# Copyright (C) 1996, 1997, 2000, 2001, 2003, 2005
# Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
# serial 8
# AM_CONFIG_HEADER is obsolete. It has been replaced by AC_CONFIG_HEADERS.
AU_DEFUN([AM_CONFIG_HEADER], [AC_CONFIG_HEADERS($@)])
# Do all the work for Automake. -*- Autoconf -*-
# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
......
......@@ -23,7 +23,7 @@ dnl You should have received a copy of the GNU General Public License
dnl along with AstrOmatic software.
dnl If not, see <http://www.gnu.org/licenses/>.
dnl
dnl Last modified: 09/07/2012
dnl Last modified: 11/07/2012
dnl
dnl %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
dnl
......@@ -63,6 +63,7 @@ dnl --------------------
dnl Set internal flags
dnl --------------------
AC_DEFINE(HAVE_MKL,1, [Define if you have the MKL libraries.])
AC_DEFINE(HAVE_FFTW,1, [Define if you have the FFTW libraries.])
AC_DEFINE(HAVE_LAPACK,1, [Define if you have the LAPACK libraries.])
AC_DEFINE(HAVE_LAPACKE,1, [Define if you have the LAPACKe libraries.])
......@@ -71,6 +72,7 @@ dnl --------------------
dnl Set include files
dnl --------------------
AC_DEFINE_UNQUOTED(MKL_H, "mkl.h", [MKL header filename.])
AC_DEFINE_UNQUOTED(FFTW_H, "fftw/fftw3_mkl.h", [FFTW header filename.])
AC_DEFINE_UNQUOTED(LAPACK_H, "mkl_lapack.h", [LAPACK header filename.])
AC_DEFINE_UNQUOTED(LAPACKE_H, "mkl_lapacke.h", [LAPACKe header filename.])
......
......@@ -116,6 +116,9 @@
/* Define to 1 if you have the `mkdir' function. */
#undef HAVE_MKDIR
/* Define if you have the MKL libraries. */
#undef HAVE_MKL
/* Define to 1 if you have a working `mmap' system call. */
#undef HAVE_MMAP
......@@ -191,6 +194,9 @@
*/
#undef LT_OBJDIR
/* MKL header filename. */
#undef MKL_H
/* Name of package */
#undef PACKAGE
......
#! /bin/sh
# Guess values for system-dependent variables and create Makefiles.
# Generated by GNU Autoconf 2.68 for sextractor 2.18.0.
# Generated by GNU Autoconf 2.68 for sextractor 2.18.1.
#
# Report bugs to <bertin@iap.fr>.
#
......@@ -570,8 +570,8 @@ MAKEFLAGS=
# Identity of this package.
PACKAGE_NAME='sextractor'
PACKAGE_TARNAME='sextractor'
PACKAGE_VERSION='2.18.0'
PACKAGE_STRING='sextractor 2.18.0'
PACKAGE_VERSION='2.18.1'
PACKAGE_STRING='sextractor 2.18.1'
PACKAGE_BUGREPORT='bertin@iap.fr'
PACKAGE_URL=''
......@@ -763,7 +763,7 @@ with_gnu_ld
with_sysroot
enable_libtool_lock
enable_largefile
with_atlas
with_atlas_libdir
with_atlas_incdir
with_fftw
with_fftw_incdir
......@@ -1324,7 +1324,7 @@ if test "$ac_init_help" = "long"; then
# Omit some internal or obsolete options to make the list less imposing.
# This message is too long to be a string in the A/UX 3.1 sh.
cat <<_ACEOF
\`configure' configures sextractor 2.18.0 to adapt to many kinds of systems.
\`configure' configures sextractor 2.18.1 to adapt to many kinds of systems.
Usage: $0 [OPTION]... [VAR=VALUE]...
......@@ -1394,7 +1394,7 @@ fi
if test -n "$ac_init_help"; then
case $ac_init_help in
short | recursive ) echo "Configuration of sextractor 2.18.0:";;
short | recursive ) echo "Configuration of sextractor 2.18.1:";;
esac
cat <<\_ACEOF
......@@ -1435,12 +1435,12 @@ Optional Packages:
--with-gnu-ld assume the C compiler uses GNU ld [default=no]
--with-sysroot=DIR Search for dependent libraries within DIR
(or the compiler's sysroot if not specified).
--with-atlas=<ATLAS library path>
--with-atlas-libdir=<ATLAS library path>
Provide an alternative path to the ATLAS library
--with-atlas-incdir=<ATLAS include dir>
Provide an alternative path to the ATLAS include
directory
--with-fftw=<FFTW library path>
--with-fftw-libdir=<FFTW library path>
Provide an alternative path to the FFTW library
--with-fftw-incdir=<FFTW include dir>
Provide an alternative path to the FFTW include
......@@ -1525,7 +1525,7 @@ fi
test -n "$ac_init_help" && exit $ac_status
if $ac_init_version; then
cat <<\_ACEOF
sextractor configure 2.18.0
sextractor configure 2.18.1
generated by GNU Autoconf 2.68
Copyright (C) 2010 Free Software Foundation, Inc.
......@@ -1948,7 +1948,7 @@ cat >config.log <<_ACEOF
This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake.
It was created by sextractor $as_me 2.18.0, which was
It was created by sextractor $as_me 2.18.1, which was
generated by GNU Autoconf 2.68. Invocation command line was
$ $0 $@
......@@ -2753,7 +2753,7 @@ fi
# Define the identity of the package.
PACKAGE='sextractor'
VERSION='2.18.0'
VERSION='2.18.1'
cat >>confdefs.h <<_ACEOF
......@@ -11728,7 +11728,7 @@ fi
done
# Checks for INTEL math header files.
if test "$enable_icc" = "yes" -a "$CC" = "icc"; then
if test "$enable_icc" = "yes"; then
for ac_header in mathimf.h
do :
ac_fn_c_check_header_mongrel "$LINENO" "mathimf.h" "ac_cv_header_mathimf_h" "$ac_includes_default"
......@@ -12783,9 +12783,9 @@ fi
# Provide special options for ATLAS
# Check whether --with-atlas was given.
if test "${with_atlas+set}" = set; then :
withval=$with_atlas;
# Check whether --with-atlas-libdir was given.
if test "${with_atlas_libdir+set}" = set; then :
withval=$with_atlas_libdir;
fi
......@@ -13300,6 +13300,9 @@ fi
$as_echo "#define HAVE_MKL 1" >>confdefs.h
$as_echo "#define HAVE_FFTW 1" >>confdefs.h
......@@ -13311,6 +13314,11 @@ $as_echo "#define HAVE_LAPACKE 1" >>confdefs.h
cat >>confdefs.h <<_ACEOF
#define MKL_H "mkl.h"
_ACEOF
cat >>confdefs.h <<_ACEOF
#define FFTW_H "fftw/fftw3_mkl.h"
_ACEOF
......@@ -15505,7 +15513,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
# report actual input values of CONFIG_FILES etc. instead of their
# values after options handling.
ac_log="
This file was extended by sextractor $as_me 2.18.0, which was
This file was extended by sextractor $as_me 2.18.1, which was
generated by GNU Autoconf 2.68. Invocation command line was
CONFIG_FILES = $CONFIG_FILES
......@@ -15571,7 +15579,7 @@ _ACEOF
cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`"
ac_cs_version="\\
sextractor config.status 2.18.0
sextractor config.status 2.18.1
configured by $0, generated by GNU Autoconf 2.68,
with options \\"\$ac_cs_config\\"
......
......@@ -22,7 +22,7 @@
# You should have received a copy of the GNU General Public License
# along with SExtractor. If not, see <http://www.gnu.org/licenses/>.
#
# Last modified: 09/07/2012
# Last modified: 11/07/2012
#
#%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
......@@ -31,10 +31,10 @@ define([AC_CACHE_LOAD],)
define([AC_CACHE_SAVE],)
# This is your standard Bertin source code...
AC_INIT(sextractor, 2.18.0, [bertin@iap.fr])
AC_INIT(sextractor, 2.18.1, [bertin@iap.fr])
AC_CONFIG_SRCDIR(src/makeit.c)
AC_CONFIG_AUX_DIR(autoconf)
AM_CONFIG_HEADER(config.h)
AC_CONFIG_HEADERS(config.h)
AM_INIT_AUTOMAKE
date=`date +%Y-%m-%d`
date2=`date +"%a %b %d %Y"`
......@@ -58,7 +58,7 @@ AC_MSG_RESULT([*********** Configuring: $PACKAGE $VERSION ($date) **********])
# Provide special option for choosing automatically the compilation flags.
AC_MSG_CHECKING([if compilation flags should be set automatically])
AC_ARG_ENABLE(auto-flags,
[AC_HELP_STRING([--enable-auto-flags],
[AS_HELP_STRING([--enable-auto-flags],
[Let the configure script choose the compilation flags \
(off by default)])],
AC_MSG_RESULT([yes]),
......@@ -67,7 +67,7 @@ AC_ARG_ENABLE(auto-flags,
# Provide special option for the Linux Intel C compiler
AC_MSG_CHECKING([whether we should use the INTEL compiler])
AC_ARG_ENABLE(icc,
[AC_HELP_STRING([--enable-icc],
[AS_HELP_STRING([--enable-icc],
[Enable special mode for compilation with the Intel compiler \
(off by default)])],
CC="icc"
......@@ -105,7 +105,7 @@ AC_HEADER_STDC
AC_CHECK_HEADERS([fcntl.h limits.h malloc.h stdlib.h string.h sys/mman.h \
sys/types.h unistd.h])
# Checks for INTEL math header files.
if test "$enable_icc" = "yes" -a "$CC" = "icc"; then
if test "$enable_icc" = "yes"; then
AC_CHECK_HEADERS(mathimf.h)
fi
......@@ -134,25 +134,25 @@ AC_SYS_LARGEFILE
AC_FUNC_FSEEKO
# Provide special options for ATLAS
AC_ARG_WITH(atlas,
[AC_HELP_STRING([--with-atlas=<ATLAS library path>],
AC_ARG_WITH(atlas-libdir,
[AS_HELP_STRING([--with-atlas-libdir=<ATLAS library path>],
[Provide an alternative path to the ATLAS library])])
AC_ARG_WITH(atlas-incdir,
[AC_HELP_STRING([--with-atlas-incdir=<ATLAS include dir>],
[AS_HELP_STRING([--with-atlas-incdir=<ATLAS include dir>],
[Provide an alternative path to the ATLAS include directory])])
# Provide special options for FFTW
AC_ARG_WITH(fftw,
[AC_HELP_STRING([--with-fftw=<FFTW library path>],
[AS_HELP_STRING([--with-fftw-libdir=<FFTW library path>],
[Provide an alternative path to the FFTW library])])
AC_ARG_WITH(fftw-incdir,
[AC_HELP_STRING([--with-fftw-incdir=<FFTW include dir>],
[AS_HELP_STRING([--with-fftw-incdir=<FFTW include dir>],
[Provide an alternative path to the FFTW include directory])])
# Provide a special option for the default XSLT URL
with_xsl_url="file://"$(URBI_RESOLVE_DIR([$datadir]))"/$PACKAGE_NAME/$PACKAGE_NAME.xsl"
AC_ARG_WITH(xsl_url,
[AC_HELP_STRING([--with-xsl_url=<default URL for XSLT filter>],
[AS_HELP_STRING([--with-xsl_url=<default URL for XSLT filter>],
[Provide an alternative default URL of the XSLT filter])])
AC_DEFINE_UNQUOTED([XSL_URL], "$with_xsl_url",[Default URL of the XSLT filter])
......@@ -161,7 +161,7 @@ AC_DEFINE_UNQUOTED([XSL_URL], "$with_xsl_url",[Default URL of the XSLT filter])
enable_model_fitting="yes"
AC_MSG_CHECKING([if model-fitting should be disabled])
AC_ARG_ENABLE([model-fitting],
[AC_HELP_STRING([--disable-model-fitting],
[AS_HELP_STRING([--disable-model-fitting],
[Disable model-fitting and library dependencies (enabled by default)])],
if test "$enable_model_fitting" = "no"; then
AC_MSG_RESULT([yes])
......@@ -172,7 +172,7 @@ AC_ARG_ENABLE([model-fitting],
# Set flags for multithreading
n_pthreads=16
AC_ARG_ENABLE(threads,
[AC_HELP_STRING([--enable-threads@<:@=<max_number_of_threads>@:>@],
[AS_HELP_STRING([--enable-threads@<:@=<max_number_of_threads>@:>@],
[Enable multhreading (on with up to 16 threads by default)])],
if test "$enableval" = "no"; then
use_pthreads="no"
......@@ -190,7 +190,7 @@ use_pthreads="no"
# Provide special option for gprof profiling
AC_MSG_CHECKING([for gprof profiler mode])
AC_ARG_ENABLE(gprof,
[AC_HELP_STRING([--enable-gprof],
[AS_HELP_STRING([--enable-gprof],
[Enable special mode for compilation with the gprof profiler \
(off by default)])],
AC_MSG_RESULT([yes]),
......@@ -199,7 +199,7 @@ AC_ARG_ENABLE(gprof,
# Enable linking options for making the executable as portable as possible.
AC_MSG_CHECKING([best linking option])
AC_ARG_ENABLE(best-link,
[AC_HELP_STRING([--enable-best-link],
[AS_HELP_STRING([--enable-best-link],
[Choose the right combination of static and dynamic linking to make \
the executable as portable as possible (off by default)])],
AC_MSG_RESULT([yes]),
......
......@@ -252,9 +252,9 @@ $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps)
exit 1;; \
esac; \
done; \
echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu man/Makefile'; \
echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign man/Makefile'; \
$(am__cd) $(top_srcdir) && \
$(AUTOMAKE) --gnu man/Makefile
$(AUTOMAKE) --foreign man/Makefile
.PRECIOUS: Makefile
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
@case '$?' in \
......
.TH SEXTRACTOR "1" "July 2012" "SExtractor 2.18.0" "User Commands"
.TH SEXTRACTOR "1" "July 2012" "SExtractor 2.18.1" "User Commands"
.SH NAME
sex \- extract a source catalogue from an astronomical FITS image
.SH SYNOPSIS
......
......@@ -346,9 +346,9 @@ $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps)
exit 1;; \
esac; \
done; \
echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu src/Makefile'; \
echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign src/Makefile'; \
$(am__cd) $(top_srcdir) && \
$(AUTOMAKE) --gnu src/Makefile
$(AUTOMAKE) --foreign src/Makefile
.PRECIOUS: Makefile
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
@case '$?' in \
......
......@@ -258,9 +258,9 @@ $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps)
exit 1;; \
esac; \
done; \
echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu src/fits/Makefile'; \
echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign src/fits/Makefile'; \
$(am__cd) $(top_srcdir) && \
$(AUTOMAKE) --gnu src/fits/Makefile
$(AUTOMAKE) --foreign src/fits/Makefile
.PRECIOUS: Makefile
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
@case '$?' in \
......
......@@ -260,9 +260,9 @@ $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps)
exit 1;; \
esac; \
done; \
echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu src/levmar/Makefile'; \
echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign src/levmar/Makefile'; \
$(am__cd) $(top_srcdir) && \
$(AUTOMAKE) --gnu src/levmar/Makefile
$(AUTOMAKE) --foreign src/levmar/Makefile
.PRECIOUS: Makefile
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
@case '$?' in \
......
......@@ -7,7 +7,7 @@
*
* This file part of: SExtractor
*
* Copyright: (C) 1993-2011 Emmanuel Bertin -- IAP/CNRS/UPMC
* Copyright: (C) 1993-2012 Emmanuel Bertin -- IAP/CNRS/UPMC
*
* License: GNU General Public License
*
......@@ -22,7 +22,7 @@
* You should have received a copy of the GNU General Public License
* along with SExtractor. If not, see <http://www.gnu.org/licenses/>.
*
* Last modified: 25/03/2011
* Last modified: 11/07/2012
*
*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
......@@ -125,7 +125,7 @@
{"MEMORY_BUFSIZE", P_INT, &prefs.mem_bufsize, 8, 65534},
{"MEMORY_OBJSTACK", P_INT, &prefs.clean_stacksize, 16,65536},
{"MEMORY_PIXSTACK", P_INT, &prefs.mem_pixstack, 1000, 10000000},
{"NTHREADS", P_INT, &prefs.nthreads, 0, THREADS_PREFMAX},
{"NTHREADS", P_INT, &prefs.nthreads, -THREADS_PREFMAX, THREADS_PREFMAX},
{"PARAMETERS_NAME", P_STRING, prefs.param_name},
{"PATTERN_TYPE", P_KEY, &prefs.pattern_type, 0,0, 0.0,0.0,
{"RINGS-QUADPOLE", "RINGS-OCTOPOLE", "RINGS-HARMONIC", "GAUSS-LAGUERRE",
......
......@@ -22,7 +22,7 @@
* You should have received a copy of the GNU General Public License
* along with SExtractor. If not, see <http://www.gnu.org/licenses/>.
*
* Last modified: 18/04/2012
* Last modified: 11/07/2012
*
*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
......@@ -36,6 +36,7 @@
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
#if defined(USE_THREADS) \
&& (defined(__APPLE__) || defined(FREEBSD) || defined(NETBSD)) /* BSD, Apple */
#include <sys/types.h>
......@@ -44,6 +45,10 @@
#include <sys/mpctl.h>
#endif
#ifdef HAVE_MKL
#include MKL_H
#endif
#include "define.h"
#include "globals.h"
#include "back.h"
......@@ -398,6 +403,7 @@ Set number of threads and endianity.
void preprefs()
{
char str[80];
unsigned short ashort=1;
#ifdef USE_THREADS
int nproc;
......@@ -408,7 +414,7 @@ void preprefs()
/* Multithreading */
#ifdef USE_THREADS
if (!prefs.nthreads)
if (prefs.nthreads <= 0)
{
/*-- Get the number of processors for parallel builds */
/*-- See, e.g. http://ndevilla.free.fr/threads */
......@@ -434,12 +440,13 @@ void preprefs()
#endif
if (nproc>0)
prefs.nthreads = nproc;
prefs.nthreads = ((prefs.nthreads) && nproc>(-prefs.nthreads))?
-prefs.nthreads : nproc;
else
{
prefs.nthreads = 2;
warning("Cannot find the number of CPUs on this system:",
"NTHREADS defaulted to 2");
prefs.nthreads = prefs.nthreads? -prefs.nthreads : 2;
sprintf(str, "NTHREADS defaulted to %d", prefs.nthreads);
warning("Cannot find the number of CPUs on this system:", str);
}
}
#ifndef HAVE_ATLAS_MP
......@@ -449,6 +456,10 @@ void preprefs()
"Performance will be degraded.");
#endif
#ifdef HAVE_MKL
mkl_set_num_threads(prefs.nthreads);
#endif
#else
if (prefs.nthreads != 1)
{
......@@ -457,6 +468,30 @@ void preprefs()
"this build of " BANNER " is single-threaded");
}
#endif
/* Override INTEL CPU detection routine to help performance on 3rd-party CPUs */
#if defined(__INTEL_COMPILER) && defined (USE_CPUREDISPATCH)
__get_cpuid(1, &eax, &ebx, &ecx, &edx);
if (ecx&bit_AVX)
__intel_cpu_indicator = 0x20000;
else if (ecx&bit_SSE4_2)
__intel_cpu_indicator = 0x8000;
else if (ecx&bit_SSE4_1)
__intel_cpu_indicator = 0x2000;
else if (ecx&bit_SSSE3)
__intel_cpu_indicator = 0x1000;
else if (ecx&bit_SSE3)
__intel_cpu_indicator = 0x0800;
else if (edx&bit_SSE2)
__intel_cpu_indicator = 0x0200;
else if (edx&bit_SSE)
__intel_cpu_indicator = 0x0080;
else if (edx&bit_MMX)
__intel_cpu_indicator = 0x0008;
else
__intel_cpu_indicator = 0x0001;
#endif
}
......
......@@ -259,9 +259,9 @@ $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps)
exit 1;; \
esac; \
done; \
echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu src/wcs/Makefile'; \
echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign src/wcs/Makefile'; \
$(am__cd) $(top_srcdir) && \
$(AUTOMAKE) --gnu src/wcs/Makefile
$(AUTOMAKE) --foreign src/wcs/Makefile
.PRECIOUS: Makefile
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
@case '$?' in \
......
......@@ -206,9 +206,9 @@ $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps)
exit 1;; \
esac; \
done; \
echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu tests/Makefile'; \
echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign tests/Makefile'; \
$(am__cd) $(top_srcdir) && \
$(AUTOMAKE) --gnu tests/Makefile
$(AUTOMAKE) --foreign tests/Makefile
.PRECIOUS: Makefile
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
@case '$?' in \
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment