Opened 8 years ago
Last modified 4 years ago
#54050 reopened enhancement
ImageMagick: variant to enable or disable multiprocessing with openmp
Reported by: | kencu (Ken) | Owned by: | ryandesign (Ryan Carsten Schmidt) |
---|---|---|---|
Priority: | Normal | Milestone: | |
Component: | ports | Version: | |
Keywords: | Cc: | ||
Port: | ImageMagick |
Description
Imagemagick has the capacity for multiprocessing, which can be desirable in some, but apparently not all, circumstances.
Multiprocessing with OpenMP is automatically compiled into imagemagic, without specifically being requested, if the compiler supports this. As of this writing, the latest Xcode 8.3.2 does not appear to support OpenMP.
$ /usr/bin/clang --version Apple LLVM version 8.1.0 (clang-802.0.42) Target: x86_64-apple-darwin16.5.0 Thread model: posix
during configuration of imagemagick:
checking for /usr/bin/clang++ option to support OpenMP... unsupported
As usual, it's not easy to figure out exactly what version of clang/llvm this corresponds to. Perhaps it is indeed a new enough version, but OpenMP support is not compiled into Apple's XCode version of clang?
I confirm that both macports-clang-3.8.1 and macports-clang-3.9.1 automatically enable and build in OpenMP support during the build of imagemagick.
To disable multiprocessing during a build with these compilers, you must specifically pass the flag --disable-openmp
.
To achieve granular control over multiprocessing, it might desirable to have the default configure flags include --disable-openmp
, and then have a specific openmp
variant that either deletes or replaces this flag with --enable-openmp
(both would accomplish the same end result, one is more obvious in it's intent though), and then passes in a requirement for clang-3.8.1 or newer.
A brief read through the OpenMP clang info suggests that the OpenMP support is becoming more robust as clang versions progress, so perhaps the best idea would be to require the newest clang available to get the best OpenMP support.
It is to be noted that even if OpenMP support is compiled in to Imagemagick, it appears that it can be controlled and essentially disabled by adjusting certain environment variables.
Change History (10)
comment:1 Changed 8 years ago by ryandesign (Ryan Carsten Schmidt)
Cc: | ryandesign removed |
---|---|
Owner: | set to ryandesign |
Port: | ImageMagick added; imagemagick removed |
Status: | new → assigned |
Summary: | imagemagick - logic to enable or disable multiprocessing with openmp → ImageMagick: variant to enable or disable multiprocessing with openmp |
comment:2 follow-up: 3 Changed 8 years ago by kencu (Ken)
And I learn another something new -- the port search field in the ticket box is case sensitive.... so my search for tickets against 'imagemagick' turned up only one ticket about a different issue, but 'ImageMagick' turns up a number of previous tickets, as you mention....
comment:3 Changed 8 years ago by ryandesign (Ryan Carsten Schmidt)
comment:4 Changed 8 years ago by kencu (Ken)
comment:5 Changed 7 years ago by kencu (Ken)
So what do we think, Ryan? Should I close out that PR that implements this, and leave the patch here?
comment:6 Changed 7 years ago by kencu (Ken)
https://patch-diff.githubusercontent.com/raw/macports/macports-ports/pull/456.patch
if there is any interest in this someday.
comment:7 Changed 6 years ago by kencu (Ken)
Resolution: | → wontfix |
---|---|
Status: | assigned → closed |
we can put this in the cupboard after a year, I think. Those interested can find the ticket or the PR with the fix for their own use.
comment:8 Changed 6 years ago by ryandesign (Ryan Carsten Schmidt)
Resolution: | wontfix |
---|---|
Status: | closed → reopened |
I said in comment:1 that I agree with this ticket, so please don't close it. Closing the ticket will not help anybody find it or work on it. I am merely not taking responsibility for merging these changes at this time. There were some problems with the PR, including the use of compiler.whitelist
instead of compiler.blacklist
. If you or anybody else would like to fix up the PR and merge it and be responsible for any issues that arise, please do so.
comment:9 Changed 6 years ago by kencu (Ken)
OK. I'll admit I thought it was not going to meet the cut. But given this, I'm prepared to make whatever changes we need to do to get this done. I do believe that having a MP version of this port would be useful to all of us with multiprocessor Macs (which is pretty much everyone these days). Let's do what it takes to get this over the finish line.
I agree with all this.
Note that there are multiple preexisting open tickets about ImageMagick OpenMP support.