Created attachment 260862 [details] failed configure log While testing net/openmpi on riscv64, I found that gfortran tests in ./configure fail for not finding the file libgfortran.spec. I fixed it temporarily in net/openmpi, but the issue should be fixed in gcc13 (and later?) itself. # gfortran doesn't find libgfortran.spec on riscv64 .if ${ARCH} == "riscv64" FCFLAGS+= -B${LOCALBASE}/lib/gcc${GCC_DEFAULT} .endif I don't need this patch with amd64, i386 or aarch64.
The good bit in the log file is this: configure:29488: checking if Fortran compiler works configure:29520: gfortran13 -o conftest -Wl,-rpath=/usr/local/lib/gcc13 -fallow-argument-mismatch -Wl,-rpath=/usr/local/lib/gcc13 -L/usr/local/lib/gcc13 -fstack-protector-strong conftest.f -L/usr/local/lib >&5 gfortran13: fatal error: cannot read spec file 'libgfortran.spec': No such file or directory compilation terminated. configure:29520: $? = 1 configure: program exited with status 1 configure: failed program was: | program main | | end configure:29537: result: no configure:29552: error: Could not run a simple Fortran program. Aborting.
A commit in branch main references this bug: URL: https://cgit.FreeBSD.org/ports/commit/?id=aa66bd5c025a60c8666684914aa766baa9c49c26 commit aa66bd5c025a60c8666684914aa766baa9c49c26 Author: Laurent Chardon <laurent.chardon@gmail.com> AuthorDate: 2025-06-02 01:28:48 +0000 Commit: Vladimir Druzenko <vvd@FreeBSD.org> CommitDate: 2025-06-02 01:40:19 +0000 net/openmpi: Update 5.0.7 => 5.0.8 Changelog: https://docs.open-mpi.org/en/v5.0.8/release-notes/changelog/v5.0.x.html Replace PORTVERSION with DISTVERSION in MASTER_SITES. Fix warnings from portclippy. Add workaround for gfortran on riscv64. PR: 287212 287211 net/openmpi/Makefile | 13 ++++++++----- net/openmpi/distinfo | 6 +++--- net/openmpi/pkg-plist | 11 +++++++++-- 3 files changed, 20 insertions(+), 10 deletions(-)
This is an issue for the fortran@ team, so I assign it to it. I also add Thierry and Steve who are in the team according to https://wiki.freebsd.org/Fortran . At first glance I would say that FCFLAGS+= -B${LOCALBASE}/lib/gcc${GCC_DEFAULT} needs to be added to Uses/fortran.mk, however I have no idea why this is necessary on riscv64 only.
Created attachment 261068 [details] Patch for Mk/Uses/fortran.mk The attached patch should not break anything. Laurent, could you please check if it fixes your issue?
Thanks Thierry for the patch! I'm away for a couple of weeks, I'll test when I come back. In the meantime, and just looking at the info included in the patch patch since I'm on my phone, should it be gcc${_GCC_VER} instead of gcc${GCC_DEFAULT}?
Created attachment 261095 [details] Patch for Mk/Uses/fortran.mk Yes, you're right, thanks! ATM _GCC_VER and GCC_DEFAULT have the same value, but it might change.