Flang support state

Since FreeBSD is based on Clang that is part of llvm project, I was wondering which Fortran compiler to use. Ideally, it would be nice to use Flang to avoid installing another C compiler to get gfortran if possible.
By searching through forum, I have found that previously there was a pkg of 'flang-clang' that has stopped being developed(?) in 2018, and lot's of forum posts telling to disable flang when compiling llvm. Is there any relatively simple way to obtain Flang?
 
I found this thread while researching Clang and LLVM. I am a newbie to Unix and FreeBSD. I was perusing a command list and noticed fort77 but it is outdated and not present in FreeBSD 14.2. I read about cc, which lead me to Clang and LLVM. I also noticed Flang and checked my system but it is not present. I noticed this post and tried glang in sh and i have it. I installed gcc and it comes with the package. Which makes me wonder: why not install a gcc version instead of seeking a standalone?

GNU fortran (gfortran):
gcc version 13, 14 15 (FreeBSD ports collection) et cetera

install it yourself.
pkg search gcc
gcc13-13.3.0_2
gcc14-14.2.0_3
amd64-gcc13-13.2.0_2
amd64-gcc14-14.1.0
gcc14-devel-14.2.1.s20250329,1
gcc15-devel-15.0.1.s20250330

lots of choices. then at the prompt:
$ which gfortran
$ gfortran --version
$ gfortran -v

more Fortran information:
Classic Flang: https://github.com/flang-compiler/flang
New Flang: https://flang.llvm.org/docs/
LLVM project: https://github.com/llvm/llvm-project/releases
LLVM website: https://llvm.org/
 
Back
Top