Bug 252994 - graphics/GraphicsMagick gcc-c++11-lib not needed for OPENMP
Summary: graphics/GraphicsMagick gcc-c++11-lib not needed for OPENMP
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: arm64 Any
: --- Affects Many People
Assignee: Po-Chuan Hsieh
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2021-01-25 12:07 UTC by rasmus
Modified: 2021-06-30 20:56 UTC (History)
1 user (show)

See Also:
bugzilla: maintainer-feedback? (sunpoet)


Attachments
Omit gcc-c11+11-lib dependency, thereby omitting gcc dependency (438 bytes, text/plain)
2021-01-25 12:07 UTC, rasmus
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description rasmus 2021-01-25 12:07:46 UTC
Created attachment 221899 [details]
Omit gcc-c11+11-lib dependency, thereby omitting gcc dependency

FreeBSD 12.2 - aarch64

gcc is a dependency for GraphicsMagick (recently bumped from gcc9 to gcc10) if OPENMP is chosen (default). It's a massive unneeded (AFAIK) dependency. 

Omitting:

OPENMP_USES=           compiler:gcc-c++11-lib

from Makefile, makes GraphicsMagick compile and OPENMP works fine:

$ gm benchmark -stepthreads 1 -duration 10 convert \
>   -size 2048x1080 pattern:granite -operator all Noise-Gaussian 30% null:
Results: 1 threads 23 iter 8.97s user 10.083170s total 2.281 iter/s 2.564 iter/cpu 1.00 speedup 1.000 karp-flatt
Results: 2 threads 41 iter 16.70s user 10.192252s total 4.023 iter/s 2.455 iter/cpu 1.76 speedup 0.134 karp-flatt
$

Example of OPENMP taken from GM documentation:

http://www.graphicsmagick.org/OpenMP.html

I have only aarch64 machines to test on.

Patchfile included.
Comment 1 VVD 2021-01-25 20:43:10 UTC
amd64 too.

And a lot of other ports too:
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=252379
Comment 2 Po-Chuan Hsieh freebsd_committer 2021-03-03 18:50:22 UTC
(In reply to rasmus from comment #0)
(In reply to VVD from comment #1)

I believe it works on amd64 and aarch64. However, Jan pointed out that "some Clang architectures like armv6 and armv7 still lack libomp thus use GCC via USES=compiler:gcc-c++11-lib" in bug #252379 comment #38. That means the complete patch might need a check for ARCH.
Comment 3 commit-hook freebsd_committer 2021-06-30 20:49:54 UTC
A commit in branch main references this bug:

URL: https://cgit.FreeBSD.org/ports/commit/?id=6716b025bba4e1cef2ee837f2941ddbd56fbb299

commit 6716b025bba4e1cef2ee837f2941ddbd56fbb299
Author:     Po-Chuan Hsieh <sunpoet@FreeBSD.org>
AuthorDate: 2021-06-30 20:35:21 +0000
Commit:     Po-Chuan Hsieh <sunpoet@FreeBSD.org>
CommitDate: 2021-06-30 20:43:33 +0000

    graphics/GraphicsMagick: Use openmp from Clang on aarch64 and amd64

    - Bump PORTREVISION for package change

    PR:             252994
    Reported by:    <rasmus@gal.dk>

 graphics/GraphicsMagick/Makefile | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)
Comment 4 Po-Chuan Hsieh freebsd_committer 2021-06-30 20:56:15 UTC
This should fix the problem, at least for aarch64 and amd64.
Thanks!