annotate src/fftw-3.3.5/m4/ax_openmp.m4 @ 169:223a55898ab9 tip default

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