NAME

Alien::OpenMP - Encapsulate system info for OpenMP

SYNOPSIS

use Alien::OpenMP;
say Alien::OpenMP->cflags;
say Alien::OpenMP->lddlflags;
say Alien::OpenMP->auto_include;

DESCRIPTION

Alien::OpenMP provides the compiler and linker flags needed to enable OpenMP for the C compiler configured into the running Perl.

The module intentionally follows Perl's $Config{cc} toolchain. Perl XS and Inline::C builds normally inherit that compiler and its ABI/linker settings, so an unrelated ENV{CC} is not treated as an implicit request to switch compilers. ABI-compatible alternate compilers may be usable by applications, but they are outside the default Alien::OpenMP toolchain contract.

Compilers Supported by this module

gcc

GCC uses -fopenmp for compilation and runtime linkage. Compiler family is detected from predefined macros rather than the executable filename, so names such as gcc-16 and target-prefixed GCC drivers are supported.

clang EXPERIMENTAL

Upstream LLVM Clang uses -fopenmp. Apple Clang on macOS requires an external OpenMP runtime (normally libomp from Homebrew or MacPorts), for which Alien::OpenMP adds the required include/library paths.

Note On Compiler Support

The compiler configured into the running Perl is the authoritative toolchain. A compile/link probe verifies that the selected flags, omp.h, and OpenMP runtime actually work before installation succeeds.

METHODS

cflags

Return compiler flags used to enable OpenMP.

lddlflags

Return linker flags used to enable/link OpenMP.

openmp_version

Return the dated value advertised by the compiler's _OPENMP macro.

version

Return the corresponding OpenMP specification version. This is the specification date advertised by the compiler, not a guarantee that every feature of that specification is implemented.

Inline

Support Inline::C's with => 'Alien::OpenMP' integration, including OpenMP compiler/linker flags and #include <omp.h>.

AUTHOR

OODLER 577 <oodler@cpan.org>

COPYRIGHT AND LICENSE

Copyright (C) 2021 by oodler577

This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.

SEE ALSO

PDL, OpenMP::Environment, https://gcc.gnu.org/onlinedocs/libgomp/index.html.