Are classic flang, AMD flang and LLVM flang 3 different compilers? If not, which ones are the same?
classic-flang GitHub - flang-compiler/flang: Flang is a Fortran language front-end designed for integration with LLVM.
AMD AOCC seems to extend Classic Flang https://docs.amd.com/r/en-US/57222-AOCC-user-guide/Support-for-Annex-F-IEEE-754/IEC-559-of-C99/C11
and AMD’s Next-Gen Fortran Compiler will is a downstream flavor of LLVM-Flang Introducing AMD’s Next-Gen Fortran Compiler — ROCm Blogs
They are all different.
But the first two, Classic Flang and AOCC, have common lineage.
LLVM Flang is the odd one out. Implemented in C++, the entire front-end has been written from scratch (first commit was Jan 25, 2018 but I am told the project started mid-2017).
There is also the Arm Fortran compiler (armflang
),
Arm® Fortran Compiler is a Linux user space Fortran compiler for server and High Performance Computing (HPC) Arm-based platforms. Arm Fortran Compiler is built on the open-source Clang front-end and the LLVM 18.1.1-based optimization and code generation back-end.
The current version (24.04) is based on the Classic Flang front-end.
Thank you all. I already have gfortran, g95, ifort, ifx, lfortran and AMD flang in my Ubuntu system and tried to install LLVM flang, following the instructions in Getting Started. While the first cmake
command was running this message appeared:
[2049/6786] Building CXX object tools/....MLIRMemRefDialect.dir/MemRefOps.cpp.o
FAILED: tools/mlir/lib/Dialect/MemRef/IR/CMakeFiles/obj.MLIRMemRefDialect.dir/MemRefOps.cpp.o
/usr/bin/c++ -DGTEST_HAS_RTTI=0 -D_DEBUG -D_GLIBCXX_ASSERTIONS -D_GNU_SOURCE -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -I/home/john/build/tools/mlir/lib/Dialect/MemRef/IR -I/home/john/llvm-project/mlir/lib/Dialect/MemRef/IR -I/home/john/build/tools/mlir/include -I/home/john/llvm-project/mlir/include -I/home/john/build/include -I/home/john/llvm-project/llvm/include -I/home/john/miniforge3/envs/lf/include -fPIC -fno-semantic-interposition -fvisibility-inlines-hidden -Werror=date-time -fno-lifetime-dse -Wall -Wextra -Wno-unused-parameter -Wwrite-strings -Wcast-qual -Wno-missing-field-initializers -pedantic -Wno-long-long -Wimplicit-fallthrough -Wno-maybe-uninitialized -Wno-nonnull -Wno-class-memaccess -Wno-redundant-move -Wno-pessimizing-move -Wno-noexcept-type -Wdelete-non-virtual-dtor -Wsuggest-override -Wno-comment -Wno-misleading-indentation -Wctad-maybe-unsupported -fdiagnostics-color -ffunction-sections -fdata-sections -Wundef -O3 -DNDEBUG -std=c++17 -fno-exceptions -funwind-tables -fno-rtti -UNDEBUG -MD -MT tools/mlir/lib/Dialect/MemRef/IR/CMakeFiles/obj.MLIRMemRefDialect.dir/MemRefOps.cpp.o -MF tools/mlir/lib/Dialect/MemRef/IR/CMakeFiles/obj.MLIRMemRefDialect.dir/MemRefOps.cpp.o.d -o tools/mlir/lib/Dialect/MemRef/IR/CMakeFiles/obj.MLIRMemRefDialect.dir/MemRefOps.cpp.o -c /home/john/llvm-project/mlir/lib/Dialect/MemRef/IR/MemRefOps.cpp
c++: fatal error: Killed signal terminated program cc1plus
compilation terminated.
[2062/6786] Building CXX object lib/Tr...strumentation.dir/InstrProfiling.cpp.o
ninja: build stopped: subcommand failed.
Is there a way to recover from there or should I just delete all the files that had been put in my machine and abandon LLVM flang? (I am a Fortran programmer not a systems expert.)
Maybe you could try LLVM Debian/Ubuntu nightly packages
The killed signal is an indication that the build is running out of memory. LLVM flang build needs lots of memory. On Ubuntu laptop with 64GB of RAM I can build debug flang by limiting the build to 8 compilation threads and 1 link thread. This way I get the successful build and the machine is still somewhat usable while building.
Thank you Eugene. To avoid unnecessary software bloat I am getting rid of
the many Gb that LLVM flang put on my machine. I can live without that
compiler.