Updating GCC_DEFAULT from GCC 11 to GCC 12 is blocked by the fact that building this port with GCC 12 on amd64 fails. The error message is the following: grid/derivatives_inc.F90:717:54: 717 | !$omp parallel do private(tmp, ip, idim1, idim2) | ^ Fatal Error: Sorry, polymorphic arrays not yet supported for firstprivate compilation terminated. gmake[3]: *** [Makefile:3167: grid/derivatives.lo] Error 1 Please see also the log in the URL field. This URL might be useful to solve the issue: http://gcc.gnu.org/gcc-12/porting_to.html .
Octopus bug report: https://gitlab.com/octopus-code/octopus/-/issues/587
Is there any progress on this bug report? Is there anything I could do to help? This is one of last three bugs that is blocking the update off GCC default version according to the most recent exp-run. If the bug is complex and requires more time, please also consider setting USE_GCC=11. Thanks.
A commit in branch main references this bug: URL: https://cgit.FreeBSD.org/ports/commit/?id=0e853a10fc56a3e2d827db16629dde19374a0de2 commit 0e853a10fc56a3e2d827db16629dde19374a0de2 Author: Yuri Victorovich <yuri@FreeBSD.org> AuthorDate: 2022-10-30 20:10:58 +0000 Commit: Yuri Victorovich <yuri@FreeBSD.org> CommitDate: 2022-10-30 20:11:58 +0000 science/octopus: Add USE_GCC=11 octopus isn't yet compatible with gcc-12. PR: 266196 Reported by: salvadore@ science/octopus/Makefile | 1 + 1 file changed, 1 insertion(+)
USE_GCC=11 was added.
I am sorry, but I have to re-open this bug report: according to Antoine's exp-run, it still fails with GCC 12. New log: http://package18.nyi.freebsd.org/data/123amd64-default-foo/2022-11-12_19h30m16s/logs/octopus-11.4_2.log I think I know what is the problem here. The dependency on GCC is not pulled in directly, but through USES=fortran, thus USE_GCC is ignored. So the issue can probably be fixed by setting the dependency on gfortran11 explicitely and dropping USE=fortran. Although, in the long term it might be a better idea to improve USES=fortran so that an explicit version can be required (I think it cannot at the moment, am I wrong?) I add fortran@ and gerald@, in case they have some smarter solution to suggest.
(In reply to Lorenzo Salvadore from comment #5) It looks like a deficiency/bug in USES=fortran that it ignores USE_GCC.
Created attachment 238118 [details] Do not ignore USE_GCC Would the attached patch do the expected thing?
Thanks Thierry. Your patch looks as a good starting point, however I see two issues: - if I add DEFAULT_VERSIONS+=gcc=12 to my /etc/make.conf and then run make -V BUILD_DEPENDS in science/octopus I still get gfortran12:lang/gcc12; - USE_GCC also supports notations such as USE_GCC=11+ and USE_GCC=11+:BUILD, so I fear something more complex than _GCC_VER=${USE_GCC} is needed. Thanks for working on this.
(In reply to Lorenzo Salvadore from comment #8) OK, I see! Does Mk/bsd.gcc.mk provide a variable with the chosen GCC version? (I don’t see it). If not, is it possible to export one?
I think the variable you need is _USE_GCC. Gerald, since you are still maintaining bsd.gcc.mk, do you confirm we can safely use this variable in this context?
(In reply to Lorenzo Salvadore from comment #10) Remark: the variables prefixed by "_" are not intended to be exported.
(In reply to Thierry Thomas from comment #11) Ah thanks, I did not know that. I assumed _USE_GCC would have worked since make -V _USE_GCC gives me output.
(In reply to Lorenzo Salvadore from comment #8) > - USE_GCC also supports notations such as USE_GCC=11+ and > USE_GCC=11+:BUILD, so I fear something more complex than > _GCC_VER=${USE_GCC} is needed. I noticed the same and it got me thinking: Between this report and PR267215 and there only being two(!) ports left that use the USE_GCC=X+ notation (security/openssl-unsafe and x11-wm/hyprland-devel, and the former having it disabled), maybe the time has come to end of life it? Even if we don't, Thierry's patch does not run into any special cases, so KISS (Keep It Simple Sweatheart) and go with that patch? (In reply to Lorenzo Salvadore from comment #10) > I think the variable you need is _USE_GCC. Gerald, since you are > still maintaining bsd.gcc.mk, do you confirm we can safely use this > variable in this context? (In reply to Thierry Thomas from comment #11) > Remark: the variables prefixed by "_" are not intended to be exported. Both of you are right. :-) Thierry, you are definitely right about variables whose name starts with a "_". That was my intention here. Practically I think we can make this an exception since it's within the Mk/ infrastructure and document this use in bsd.gcc.mk. Thierry and Salvadore, if you want to proceed with this patch I'm good (Reviewed by: gerald) and volunteer adding such a note as follow-up.
Created attachment 238126 [details] Do not ignore USE_GCC If everybody agrees, see my newer patch, with _USE_GCC. You can commit it.
(In reply to Thierry Thomas from comment #14) Running "make -V BUILD_DEPENDS" in science/octopus still gives me gfortran12:lang/gcc12 when I have DEFAULT_VERSIONS+=gcc=12, although the port has USE_GCC=11. Something is still wrong somewhere. Is it something about my test environment? Do you have the same output Thierry?
Created attachment 238127 [details] Respect USE_GCC for gfortran You are right: it did not work! It seems we have to patch both bsd.gcc.mk and Uses/fortran.mk - unless you find a simpler solution. The attached patch seems OK for me.
Created attachment 238129 [details] Alternative patch for making gfortran respect USE_GCC Your patch works Thierry, but it seems it is not necessary to modify bsd.gcc.mk: the second patch you submitted also works if you change the test condition with the one you used in the third patch. Please see attachment.
Comment on attachment 238129 [details] Alternative patch for making gfortran respect USE_GCC Great!
Comment on attachment 238129 [details] Alternative patch for making gfortran respect USE_GCC (In reply to Thierry Thomas from comment #18) Are you in fortran@ Thierry? Is the change maintainer-approved?
Comment on attachment 238129 [details] Alternative patch for making gfortran respect USE_GCC Approved, with fortran hat.
A commit in branch main references this bug: URL: https://cgit.FreeBSD.org/ports/commit/?id=4191c71fbd229e5a96382bc6fa271a1ce5668b0f commit 4191c71fbd229e5a96382bc6fa271a1ce5668b0f Author: Lorenzo Salvadore <salvadore@FreeBSD.org> AuthorDate: 2022-11-16 14:43:40 +0000 Commit: Lorenzo Salvadore <salvadore@FreeBSD.org> CommitDate: 2022-11-16 21:38:54 +0000 Mk/Uses/fortran.mk: Make gfortran respect USE_GCC Allow choosing a specific version of gfortran through USE_GCC variable. PR: 266196 Approved by: thierry (fortran) Co-authored by: thierry Mk/Uses/fortran.mk | 4 ++++ 1 file changed, 4 insertions(+)
Now we should be able to safely close this PR. Assign to myself as per triaging rules (assign to committer that committed the fix). Thanks everyone for working on this.
A commit in branch main references this bug: URL: https://cgit.FreeBSD.org/ports/commit/?id=9b5f5ab8482f105311d01a32260ef32bba4a2628 commit 9b5f5ab8482f105311d01a32260ef32bba4a2628 Author: Gerald Pfeifer <gerald@FreeBSD.org> AuthorDate: 2023-01-09 00:32:48 +0000 Commit: Gerald Pfeifer <gerald@FreeBSD.org> CommitDate: 2023-01-09 00:34:15 +0000 Mk/bsd.gcc.mk: Remove support for USE_GCC=X+ At this point most ports that employ USE_GCC have the USE_GCC=yes form, some have USE_GCC=X (where X is an older version of GCC than the current default), and none is left with USE_GCC=X+. To reduce complexity and since we are actively tracking upstream GCC with our default version, remove support for the USE_GCC=X+ form. This also derisks Mk/Uses/fortran.mk which aligns with USE_GCC after commit 4191c71fbd229e5a96382bc6fa271a1ce5668b0f. [1] PR: 266196 [1] Mk/bsd.gcc.mk | 32 +++++--------------------------- 1 file changed, 5 insertions(+), 27 deletions(-)