annotate fft/fftw/fftw-3.3.4/m4/ax_openmp.m4 @ 40:223f770b5341 kissfft-double tip

Try a double-precision kissfft
author Chris Cannam
date Wed, 07 Sep 2016 10:40:32 +0100
parents 26056e866c29
children
rev   line source
Chris@19 1 dnl @synopsis AX_OPENMP([ACTION-IF-FOUND[, ACTION-IF-NOT-FOUND]])
Chris@19 2 dnl @summary determine how to compile programs using OpenMP
Chris@19 3 dnl @category InstalledPackages
Chris@19 4 dnl
Chris@19 5 dnl This macro tries to find out how to compile programs that
Chris@19 6 dnl use OpenMP, a standard API and set of compiler directives for
Chris@19 7 dnl parallel programming (see http://www.openmp.org/).
Chris@19 8 dnl
Chris@19 9 dnl On success, it sets the OPENMP_CFLAGS/OPENMP_CXXFLAGS/OPENMP_FFLAGS
Chris@19 10 dnl output variable to the flag (e.g. -omp) used both to compile *and* link
Chris@19 11 dnl OpenMP programs in the current language.
Chris@19 12 dnl
Chris@19 13 dnl NOTE: You are assumed to not only compile your program with these
Chris@19 14 dnl flags, but also link it with them as well.
Chris@19 15 dnl
Chris@19 16 dnl If you want to compile everything with OpenMP, you should set:
Chris@19 17 dnl
Chris@19 18 dnl CFLAGS="$CFLAGS $OPENMP_CFLAGS"
Chris@19 19 dnl #OR# CXXFLAGS="$CXXFLAGS $OPENMP_CXXFLAGS"
Chris@19 20 dnl #OR# FFLAGS="$FFLAGS $OPENMP_FFLAGS"
Chris@19 21 dnl
Chris@19 22 dnl (depending on the selected language).
Chris@19 23 dnl
Chris@19 24 dnl The user can override the default choice by setting the corresponding
Chris@19 25 dnl environment variable (e.g. OPENMP_CFLAGS).
Chris@19 26 dnl
Chris@19 27 dnl ACTION-IF-FOUND is a list of shell commands to run if an OpenMP
Chris@19 28 dnl flag is found, and ACTION-IF-NOT-FOUND is a list of commands
Chris@19 29 dnl to run it if it is not found. If ACTION-IF-FOUND is not specified,
Chris@19 30 dnl the default action will define HAVE_OPENMP.
Chris@19 31 dnl
Chris@19 32 dnl @version 2006-11-20
Chris@19 33 dnl @license GPLWithACException
Chris@19 34 dnl @author Steven G. Johnson <stevenj@alum.mit.edu>
Chris@19 35
Chris@19 36 AC_DEFUN([AX_OPENMP], [
Chris@19 37 AC_PREREQ(2.59) dnl for _AC_LANG_PREFIX
Chris@19 38
Chris@19 39 AC_CACHE_CHECK([for OpenMP flag of _AC_LANG compiler], ax_cv_[]_AC_LANG_ABBREV[]_openmp, [save[]_AC_LANG_PREFIX[]FLAGS=$[]_AC_LANG_PREFIX[]FLAGS
Chris@19 40 ax_cv_[]_AC_LANG_ABBREV[]_openmp=unknown
Chris@19 41 # Flags to try: -fopenmp (gcc), -openmp (icc), -mp (SGI & PGI),
Chris@19 42 # -xopenmp (Sun), -omp (Tru64), -qsmp=omp (AIX), none
Chris@19 43 ax_openmp_flags="-fopenmp -openmp -mp -xopenmp -omp -qsmp=omp none"
Chris@19 44 if test "x$OPENMP_[]_AC_LANG_PREFIX[]FLAGS" != x; then
Chris@19 45 ax_openmp_flags="$OPENMP_[]_AC_LANG_PREFIX[]FLAGS $ax_openmp_flags"
Chris@19 46 fi
Chris@19 47 for ax_openmp_flag in $ax_openmp_flags; do
Chris@19 48 case $ax_openmp_flag in
Chris@19 49 none) []_AC_LANG_PREFIX[]FLAGS=$save[]_AC_LANG_PREFIX[] ;;
Chris@19 50 *) []_AC_LANG_PREFIX[]FLAGS="$save[]_AC_LANG_PREFIX[]FLAGS $ax_openmp_flag" ;;
Chris@19 51 esac
Chris@19 52 AC_TRY_LINK_FUNC(omp_set_num_threads,
Chris@19 53 [ax_cv_[]_AC_LANG_ABBREV[]_openmp=$ax_openmp_flag; break])
Chris@19 54 done
Chris@19 55 []_AC_LANG_PREFIX[]FLAGS=$save[]_AC_LANG_PREFIX[]FLAGS
Chris@19 56 ])
Chris@19 57 if test "x$ax_cv_[]_AC_LANG_ABBREV[]_openmp" = "xunknown"; then
Chris@19 58 m4_default([$2],:)
Chris@19 59 else
Chris@19 60 if test "x$ax_cv_[]_AC_LANG_ABBREV[]_openmp" != "xnone"; then
Chris@19 61 OPENMP_[]_AC_LANG_PREFIX[]FLAGS=$ax_cv_[]_AC_LANG_ABBREV[]_openmp
Chris@19 62 fi
Chris@19 63 m4_default([$1], [AC_DEFINE(HAVE_OPENMP,1,[Define if OpenMP is enabled])])
Chris@19 64 fi
Chris@19 65 AC_SUBST(OPENMP_[]_AC_LANG_PREFIX[]FLAGS)
Chris@19 66 ])dnl AX_OPENMP