Created attachment 193076 [details] necessary changes for switching to flang There are lot of known problems with gfortran when clang is involved, e.g.: https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=196862 This patch switches to using flang compiler (on amd64 only) and resolves gcc linking issues. Note: - deleted file "files/patch-exports+Makefile" (backward compatibility checked on gfortran builds) - patched "Makefile" contains a "ditry" arch check, I believe it's the best available option now until "flang" will be set by default for all amd64 ports in fortran.mk.
Created attachment 193122 [details] poudriere log for a patched port
There are 2 issues with this patch: 1. The correct way to do this is using the port option FLANG, see math/R how this is done there. Please resubmit the patch doing this 2. Some people might disagree with this, not sure. This adds a certain level of complexity. Also, for this all ports that depend on lapack should probably be rebuilt and retested.
Created attachment 193137 [details] necessary changes for switching to flang A less-destructive switch to flang (OPTION).
Created attachment 193138 [details] poudriere log for a patched port
Created attachment 193167 [details] proper handling of non-supported archs
The patch no longer applies. I'm afraid it needs to be updated.
There is no reason to refresh the patch yet. The thing that is now called "flang" is a completely different project than the one from back then in 2018. At the moment, the new Flang isn't able to compile anything, so it is impossible to switch to it. Once the new Flang matures, it will be included in the devel/llvmXX port (I presume), and then we will be able to make a switch.
devel/flang expired today.
(In reply to Rene Ladan from comment #8) Hopefully, at some point the devel/llvmXY port will eventually provide a new flang suitable to be hooked into USES=fortran
(In reply to Gleb Popov from comment #9) LFortran seems very interesting: see <https://lfortran.org/>.
Looking at other repos they use GCC 11 (or 12) with gfortran, is that still troublesome?
Iād like to add at least one alternative in Mk/Uses/fortran.mk, maybe LFortran or flang-new, but they are not yet ready.
Does openblas now require FLANG as openblas fails to build in poudriere on a system with the FLANG option disabled for LLVM. (arm64) openblas options: 00:00:01] ---Begin OPTIONS List--- [00:00:01] ===> The following configuration options are available for openblas-0.3.20,1: [00:00:01] AVX=on: Support Advanced Vector Extensions (AVX) [00:00:01] AVX2=on: Support Advanced Vector Extensions 2 (AVX2) [00:00:01] DYNAMIC_ARCH=off: Optimize for multiple CPU types, otherwise for this CPU [00:00:01] INTERFACE64=on: Use 8 byte integers on 64-bit architectures [00:00:01] OPENMP=on: Use OpenMP for threading [00:00:01] ===> Use 'make config' to modify these settings build failure: [00:00:11] =======================<phase: build >============================ [00:00:11] ===== env: NO_DEPENDS=yes USER=root UID=0 GID=0 [00:00:11] ===> Building for openblas-0.3.20,1 [00:00:11] gmake[1]: Entering directory '/wrkdirs/usr/ports/math/openblas/work/OpenBLAS-0.3.20' [00:00:11] getarch.c:1553:2: error: "The TARGET specified on the command line or in Makefile.rule is not supported. Please choose a target from TargetList.txt" [00:00:11] #error "The TARGET specified on the command line or in Makefile.rule is not supported. Please choose a target from TargetList.txt" [00:00:11] ^ [00:00:11] 1 error generated. [00:00:11] gmake[1]: *** [Makefile.prebuild:74: getarch] Error 1 [00:00:11] Makefile.system:283: Makefile.conf: No such file or directory [00:00:11] gmake[1]: *** No rule to make target 'Makefile.conf'. Stop. [00:00:11] gmake[1]: Leaving directory '/wrkdirs/usr/ports/math/openblas/work/OpenBLAS-0.3.20' [00:00:11] ===> Compilation failed unexpectedly. [00:00:11] Try to set MAKE_JOBS_UNSAFE=yes and rebuild before reporting the failure to [00:00:11] the maintainer. [00:00:11] *** Error code 1 [00:00:11] [00:00:11] Stop. [00:00:11] make: stopped in /usr/ports/math/openblas [00:00:11] =>> Cleaning up wrkdir [00:00:11] ===> Cleaning for openblas-0.3.20,1 [00:00:11] build of math/openblas | openblas-0.3.20,1 ended at Fri Mar 31 04:17:59 BST 2023 [00:00:11] build time: 00:00:11
sorry that should read AMD64
(In reply to void from comment #14) ignore me, the issue was caused by having cputype defined for my cpu inn make.conf