Building the LLVM Flang Fortran compiler

Nvidia is supporting the adding of Fortran compilation to LLVM via Flang. Currently, getting the LLVM Flang Fortran compiler requires building from source, which is a resource-intensive process. Here are some tips for compiling Flang.

  1. You need a moderately powerful PC to compile Flang with > 100 GB of free space on the drive you build Flang on (the install is small, but the build is large).
  2. Be careful not to use too much RAM with the -j option of make for building Flang. It maxed out RAM on a PC with 32 GB of RAM with make -j7. Maybe try make -j2 or just plain make.
  3. follow the Flang build instructions sequentially. Don’t try to build later parts while earlier parts are still building, this will not work properly.

Leave a Comment