Opened 5 years ago

Closed 3 years ago

#58074 closed request (fixed)

request: flang Fortran compiler

Reported by: iqgrande Owned by:
Priority: Normal Milestone:
Component: ports Version: 2.5.4
Keywords: Cc: MarcusCalhoun-Lopez (Marcus Calhoun-Lopez), cooljeanius (Eric Gallager), Dave-Allured (Dave Allured), amagela (Anthony M. Agelastos), michaelld (Michael Dickens)
Port:

Description

Greetings:

Flang is an in-development Fortran compiler built atop LLVM. I have heard that it is starting to become usable for broader use. I think the macOS platform and MacPorts are ideal for it. Would you consider adding it? Thank you for your help with this.

flang-compiler

Kind regards, Anthony

Change History (14)

comment:1 Changed 5 years ago by MarcusCalhoun-Lopez (Marcus Calhoun-Lopez)

Cc: MarcusCalhoun-Lopez added

comment:2 Changed 5 years ago by MarcusCalhoun-Lopez (Marcus Calhoun-Lopez)

This might not be feasible in the short term.
There has been a open issue for about a year and a half.
There is a pull request, but it currently conflicts.

comment:4 Changed 4 years ago by cooljeanius (Eric Gallager)

Cc: cooljeanius added

comment:5 Changed 4 years ago by Dave-Allured (Dave Allured)

Cc: Dave-Allured added

comment:6 Changed 4 years ago by kencu (Ken)

Flang has now been committed as a full project into the llvm/clang mixture, and so it will be available soon in that fashion.

We could install it along with clang, which makes sense in comparison to how gcc does things (when you get gcc, you get gfortran).

Alternately, it could be a separate installable port/project, like libomp/libcxx/libtapi/libunwind are.

Anyway, once we kick the tires a bit, it should be coming along soon.

comment:7 Changed 3 years ago by amagela (Anthony M. Agelastos)

LLVM version 11.0 has been released which should have the Fortran items. Are there plans to create a LLVM 11 port or should I create a separate request for that? Thank you for all of your wonderful help with this. MacPorts is utterly indispensable and you all do a wonderful job with it.

comment:8 Changed 3 years ago by amagela (Anthony M. Agelastos)

Cc: amagela added

comment:9 Changed 3 years ago by michaelld (Michael Dickens)

Cc: michaelld added

comment:10 Changed 3 years ago by kencu (Ken)

Flang is in LLVM-11, but it doesn't work to compile fortran code yet. It requires the installation of a completely separate fortran compiler that does the actual fortan compiling at this point in time. That compiler does not do any ARM compiling, as far as I know. It's a tried-and-true commercial fortran compiler that was a competitor for gcc's fortran compiler, and I guess they threw in the towel and donated it to the LLVM project, to be gradually integrated into LLVM.

SO - useless for us at present. Although it's coming.

I'll add flang to the llvm offerings in due course, I guess -- although what use it will be I am not sure, other than for testing.

At some point, it will be fully integrated to compile FORTRAN to LLVM bitcode and then become a full member of the team.

Last edited 3 years ago by kencu (Ken) (previous) (diff)

comment:11 Changed 3 years ago by kencu (Ken)

BTW -- no need to create a ticket for llvm-11. Now that it's finally released (quite delayed due to many last minute things that had to be fixed before the RC's were passed) I'll create the port for it soonishly.

comment:12 Changed 3 years ago by kencu (Ken)

so I'm building flang from llvm-11 locally without troubles...the current driver just passes the code off for compiling, but it now uses gfortran by default (configurable with an env var), so it's a bit easier than installing a custom fortran compiler as it was before.

I could make it as a variant of clang to install flang, or as a fully separate subport...subport is cleaner, but requires building everything yet again. I will ponder.

The next major step, getting flang to actually compile something itself, has started.... flang-new.

it is available as of llvm-12. At present, it can respond to -version and -h, so not so robust yet.

comment:13 Changed 3 years ago by kencu (Ken)

thing is, I can imagine that we could want flang to always be installed with clang, like gfortran is always installed with gcc, so perhaps we just always include it on systems that can build it.

It's looking kinda huge, though....but much simpler to do that.

comment:14 Changed 3 years ago by kencu (Ken)

Resolution: fixed
Status: newclosed
Note: See TracTickets for help on using tickets.