Hi ports --
Now that flang has been enabled for arm64, attached are two diffs: one to allow
flang to be used as MODFORTRAN_COMPILER, and the other the associated manual
page tweak in ports-modules.5 to reflect the new option.
This is mostly for the benefit of arm64, since it has no fortran compiler
available to it other than flang.
I can confirm that flang can build itself (which requires a fortran compiler)
and math/blas successfully builds and packages on arm64. I'm building
math/lapack right now and so far all is good. I will go through all the ports
that use MODULES=fortran and give it a try with flang on arm64 and send patches
for those that successfully compile after these changes go in.
OK? Comments?
~Brian
Index: fortran.port.mk
===================================================================
RCS file: /cvs/ports/infrastructure/mk/fortran.port.mk,v
retrieving revision 1.14
diff -u -p -r1.14 fortran.port.mk
--- fortran.port.mk 2 Sep 2016 13:02:24 -0000 1.14
+++ fortran.port.mk 27 Jun 2018 00:33:04 -0000
@@ -20,6 +20,10 @@ MODFORTRAN_WANTLIB += gfortran>=3
. if ${MACHINE_ARCH} == "amd64" || ${MACHINE_ARCH} == "i386"
MODFORTRAN_WANTLIB += quadmath
. endif
+.elif ${MODFORTRAN_COMPILER:L} == "flang"
+MODFORTRAN_BUILD_DEPENDS += lang/flang/flang
+MODFORTRAN_LIB_DEPENDS += lang/flang/flang
+MODFORTRAN_WANTLIB += flang
.else
-ERRORS += "Fatal: MODFORTRAN_COMPILER must be one of: g77 gfortran"
+ERRORS += "Fatal: MODFORTRAN_COMPILER must be one of: g77 gfortran flang"
.endif
Index: port-modules.5
===================================================================
RCS file: /cvs/src/share/man/man5/port-modules.5,v
retrieving revision 1.232
diff -u -p -r1.232 port-modules.5
--- port-modules.5 3 Jun 2018 10:25:10 -0000 1.232
+++ port-modules.5 27 Jun 2018 00:30:27 -0000
@@ -831,7 +831,7 @@ Sets
.Ev MODFORTRAN_BUILD_DEPENDS .
Set
.Ev MODFORTRAN_COMPILER
-to `g77' or `gfortran', depending on what the port requires.
+to `g77', `gfortran', or `flang', depending on what the port requires.
The default is `g77'.
The dependencies are chosen according to
.Ev MODFORTRAN_COMPILER .