-
Notifications
You must be signed in to change notification settings - Fork 144
About Flang
Flang is a Fortran front-end designed for integration with LLVM, with open source licensing consistent with Clang C++ and LLVM, and suitable for deployment and interoperability with Clang/LLVM across a wide variety of systems.
The goals of Flang are:
- Ensure Flang becomes a self-sustaining open source project
- Attract additional developers from the (broad) community to create a critical mass of contributors
- Deliver single-core CPU performance comparable or better than that of gfortran
- Enable multicore CPU and GPU programming with a robust and performant implementation of OpenMP
- Create a source base that can be readily re-hosted and re-targeted to future systems as easily as Clang and LLVM
- Create a source base in which researchers and developers can ramp up and be productive quickly
- Create a source base that is componentized to a degree that enables re-use of elements of Flang in tools projects
The first four of these goals have been largely addressed by the current Flang compiler.
The Flang project team has determined that the last three goals cannot be achieved in a reasonable time with the current code base. A new project has been launched, F18, to address these issues. This project has been adopted by LLVM as its Fortran front-end. We are working now to upstream the Flang source to the LLVM monorepo.
The public GitHub repository for Flang was created May 11, 2017. In the first year, over 500 commits and 900 tests have been added to the repository. Over 1600 commits have been added to the repository since its inception.
CMake Version 3.10 added support for Flang.
Spack supports building and using Flang.
A Windows port has been initiated by the broader Flang community.
ARM Ltd. introduced a commercially supported Fortran compiler for ARM/HPC November 13, 2017.
F18, the new front-end for the LLVM Fortran compiler, was announced at EuroLLVM April 17, 2018.
Flang is a fairly complete Fortran 2003 compiler. Some work has been done to implement features of Fortran 2008 and Fortran 2018.
The following Fortran 2008 features have been implemented:
- Pointers to internal procedures
- DO CONCURRENT
- ERROR STOP
- CONTIGUOUS attribute
- G0 edit descriptor
- BACK optional argument on MAXLOC/MINLOC
- BLOCK construct
- Allocation of polymorphic variables
- EXECUTE_COMMAND_LINE
- Vector NORM2
- Multiple sourced allocations in a single statement
The full status of the Fortran 2008 features can be found in the Fortran 2008 Features page.
Flang already implements most of OpenMP 4.5 for multi-core CPUs. This functionality is enabled by default with -fopenmp. It is implemented on top of the existing pre-4.5 OpenMP runtime API (kmpc).
NVIDIA is following the Clang 7.0 model to add offload support to Flang. This support can be enabled by building Flang with -DFLANG_OPENMP_GPU_NVIDIA=ON.
We have fixed many Flang issues, and provided other bug fixes:
- Fixes from the PGI Fortran compiler
- Bugs related to structure constructors
- Bugs related to finalizers
- Fixes for OpenMP
See the GitHub Issues list for the current status on issues.