[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: detection and support of OpenMP

From: Paul Eggert
Subject: Re: detection and support of OpenMP
Date: Mon, 21 May 2007 10:52:18 -0700
User-agent: Gnus/5.110006 (No Gnus v0.6) Emacs/21.4 (gnu/linux)

Bruno Haible <address@hidden> writes:

> 2007-05-17  Bruno Haible  <address@hidden>
>       * lib/autoconf/c.m4 (_AC_LANG_OPENMP, AC_OPENMP): New macros.
>       * doc/autoconf.texi (Generic Compiler Characteristics): Document
>       AC_OPENMP.
>       * NEWS: Mention AC_OPENMP.

Thanks much.  I installed that, after tweaking the documentation a
bit.  Here's the documentation I installed:

@defmac AC_OPENMP
@cvindex _OPENMP
OpenMP (@url{}) specifies extensions of C, C++,
and Fortran that simplify optimization of shared memory parallelism,
which is a common problem on multicore CPUs.

If the current language is C, the macro @code{AC_C_OPENMP} sets the
variable @code{OPENMP_CFLAGS} to the C compiler flags needed for
supporting address@hidden  @code{OPENMP_CFLAGS} is set to empty if the
compiler already supports OpenMP, if it has no way to activate OpenMP
support, or if the user rejects OpenMP support by invoking
@samp{configure} with the @samp{--disable-openmp} option.

@code{OPENMP_CFLAGS} needs to be used when compiling programs, when
preprocessing program source, and when linking programs.  Therefore you
need to add @code{$(OPENMP_CFLAGS)} to the @code{CFLAGS} of C programs
that use address@hidden  If you preprocess OpenMP-specific C code, you also
need to add @code{$(OPENMP_CFLAGS)} to @code{CPPFLAGS}.  The presence of
OpenMP support is revealed at compile time by the preprocessor macro

Linking a program with @code{OPENMP_CFLAGS} typically adds one more
shared library to the program's dependencies, so its use is recommended
only on programs that actually require OpenMP.

If the current language is C++, @code{AC_OPENMP} sets the variable
@code{OPENMP_CXXFLAGS}, suitably for the C++ compiler.  The same remarks
hold as for C.

If the current language is Fortran 77 or Fortran, @code{AC_OPENMP} sets
the variable @code{OPENMP_FFLAGS} or @code{OPENMP_FCFLAGS},
respectively.  Similar remarks as for C hold, except that
@code{CPPFLAGS} is not used for Fortran, and no preprocessor macro
signals OpenMP support.
@end defmac

reply via email to

[Prev in Thread] Current Thread [Next in Thread]