Generated by GPT-5-mini| Flang | |
|---|---|
![]() Software: LLVM Developer GroupScreenshot: VulcanSphere · Apache License 2.0 · source | |
| Name | Flang |
| Title | Flang |
| Developer | NVIDIA, The LLVM Project, AMD, Hewlett Packard Enterprise, Intel Corporation |
| Released | 2019 |
| Programming language | C++, Fortran |
| Operating system | Linux, macOS, Microsoft Windows |
| Platform | x86-64, ARM, POWER Architecture |
| License | Apache License |
Flang is an open-source Fortran front-end and compiler infrastructure component in the LLVM ecosystem designed to parse, analyze, and compile Fortran sources into intermediate representation and native machine code. It provides interoperability with projects such as LLVM, Clang, GCC, Intel Fortran Compiler toolchains and targets high-performance computing platforms like NVIDIA GPUs, AMD accelerators, and CPU families from Intel Corporation and ARM. Flang is used in academic, industrial, and national laboratory projects alongside compilers and tools from Hewlett Packard Enterprise and national research centers.
Flang originated as a community effort to produce a modern Fortran front-end compatible with the LLVM project, sparked by interest from organizations including NVIDIA and contributors from Cray Research-era ecosystems. Early development intersected with work at Oak Ridge National Laboratory and collaborations involving Hewlett Packard Enterprise, leading to upstream contributions into LLVM repositories. Parallel initiatives such as PGI/NVIDIA HPC SDK and Intel Parallel Studio influenced design goals, and integrations with runtimes from OpenMP and OpenACC efforts reflected momentum toward heterogeneous computing. Over time Flang incorporated features inspired by legacy compilers like gfortran from the GNU Project and attempted to address compatibility with codebases tested against Intel Fortran Compiler outputs.
Flang's design centers on a Fortran-conforming parser, semantic analysis, and lowering to LLVM Intermediate Representation to leverage back-end optimizations and code generation from LLVM. Key features include support for Fortran 2003 and Fortran 2008 constructs, intrinsic procedures, array syntax, and interoperability with C ABIs used in projects like MPI implementations and CUDA bindings. Flang integrates with OpenMP directives for multi-threading and supports accelerator offloading patterns similar to OpenACC. It aims for compatibility with test suites used by ECMWF and scientific codes developed at Lawrence Livermore National Laboratory and Los Alamos National Laboratory.
The Flang front-end is implemented in C++, leveraging parser and semantic modules to produce LLVM IR consumed by the LLVM optimizer and code generator. The architecture separates lexical analysis, parsing, semantic checks, and code lowering, enabling reuse of back-end infrastructure like LLD and MLIR where applicable. It interacts with runtime libraries for array descriptors and I/O modeled after interfaces used by NetCDF and HDF5 ecosystems common in scientific workflows at NASA and European Space Agency. Cross-project collaboration aligns Flang's interfaces with build systems such as CMake and package managers used across Debian, Fedora, and Red Hat Enterprise Linux distributions.
Flang is invoked via driver programs compatible with workflows that historically used gfortran, ifort from Intel Corporation, or proprietary compilers from Cray Research and PGI. Tooling around Flang includes debuggers like GDB, profilers such as perf and Intel VTune Amplifier, and static analyzers that integrate with Clang Static Analyzer-style toolchains. Continuous integration and testing often use services provided by GitHub, GitLab, and cloud platforms from Amazon Web Services, Google Cloud Platform, and Microsoft Azure for reproducible builds and regression tests. Build and package distribution for HPC centers coordinate with Spack and EasyBuild used by supercomputing centers including Oak Ridge National Laboratory.
Flang aims to produce performance comparable with established compilers like gfortran and Intel Fortran Compiler on CPU targets, while enabling offload to accelerators supported by NVIDIA and AMD ecosystems. Performance tuning often leverages LLVM-level optimizations, vectorization using SSE/AVX extensions on Intel and AMD CPUs, and code generation for PTX targets in GPU workflows. Compatibility testing includes benchmark suites from SPEC and scientific benchmarks used by institutions such as Argonne National Laboratory. Interoperability with libraries like BLAS, LAPACK, and ScaLAPACK is a common validation path for numerical performance.
Flang development is community-driven within the larger LLVM Project governance model, with contributions from corporate sponsors including NVIDIA and research contributors from institutions like Lawrence Berkeley National Laboratory. The community communicates via mailing lists, GitHub/Phabricator-style review systems, and attends conferences such as LLVM Developers' Meeting and Supercomputing Conference. Collaboration with maintainers of gfortran, OpenMP, and vendor SDKs fosters portability and standard conformance. Educational and outreach efforts involve tutorials at events organized by ACM and IEEE communities.
Flang is distributed under permissive terms aligned with the Apache License preferred by LLVM-aligned projects, facilitating integration into proprietary and open-source stacks deployed by vendors like NVIDIA and distributors such as Canonical and SUSE. Binary distributions appear in HPC-centric package repositories managed by Spack, EasyBuild, and Linux distributions including Debian and Fedora. Commercial packaging and support are offered by vendors integrating Flang into productized toolchains for enterprises and research institutions such as Hewlett Packard Enterprise and national labs.
Category:Fortran compilers