Created attachment 207104 [details] patch On GCC architectures, there's no need for installing libomp and since GCC9 it actually breaks build. While here, also add USES=xorg.
Hello Piotr, When I test in poudriere, the build does not break when depending on devel/openmp. http://pkg.awarnach.mathstat.dal.ca/data/12amd64-default/2019-09-02_17h03m38s/logs/R-3.6.1_1.log However, there are problems when I remove the dependency on devel/openmp. - "checking for cc option to support OpenMP... unsupported". - "checking for c++ -std=gnu++11 option to support OpenMP... unsupported" - "checking whether OpenMP SIMD reduction is supported... no" http://pkg.awarnach.mathstat.dal.ca/data/12amd64-default/2019-09-02_17h18m29s/logs/R-3.6.1_1.log USES=xorg, should now be added, however, it should only be added when the X11 knob is on. So, we should add X11_USES=xorg. Please let me know if I am misunderstanding something.
(In reply to Joseph Mingrone from comment #1) I don't think I understand what you mean. You clearly use Clang. If you remove OpenMP dependency, you don't get OpenMP. Isn't that how it should be?
I thought you were referring to the knob for building the fortran code with gfortran or flang. It's confusing because gfortran is part of gcc. I just applied your patch, then added USE_GCC=yes, however devel/openmp is still pulled in and the build fails. http://pkg.awarnach.mathstat.dal.ca/data/12amd64-default/2019-09-02_19h11m56s/logs/errors/R-3.6.1_1.log Is my test inappropriate? If not, could you check the logic in .if ! ${PORT_OPTIONS:MFLANG} && ${PORT_OPTIONS:MOPENMP} && ${CHOSEN_COMPILER_TYPE} == clang
(In reply to Joseph Mingrone from comment #3) Hm, you're right. It looks like LIB_DEPENDS can't be modified after bsd.port.pre.mk is included, but that's when CHOSEN_COMPILER_TYPE is defined. Could you then exclude FLANG option on powerpc64? According to devel/flang/Makefile, it's only for amd64 anyway.
Created attachment 207167 [details] Fix build on GCC archs Piotr, could you test whether this patch fixes the problem?
I guess I have to admit that I am confused by the following in the latest patch: +X11_USES= xorg X11_USE= xorg=ice,sm,x11,xext,xmu,xscrnsaver,xt
There was a recent change with the way xorg is handled in ports. See the comment in https://svnweb.freebsd.org/ports?view=revision&revision=509895
(In reply to Joseph Mingrone from comment #5) Yes, this patch works.
A commit references this bug: Author: jrm Date: Thu Sep 19 19:55:44 UTC 2019 New revision: 512371 URL: https://svnweb.freebsd.org/changeset/ports/512371 Log: math/R: Fix dependency condition for devel/openmp libomp is provided by - LLVM, which gets pulled in with FLANG - gcc So, we *must* only depend on devel/openmp when - the OPENMP knob is on - FLANG is off (guaranteed to be off for all archs except amd64) - clang is the C compiler. But, we cannot modify LIB_DEPENDS after CHOSEN_COMPILER_TYPE is defined, so for now, limit the OPENMP knob for i386 and amd64 where clang is the default compiler. This will be moot after 12.1 when openmp will be in base. PR: 240279 Reported by: pkubaj Reviewed by: pkubaj Changes: head/math/R/Makefile
Thanks for reporting.