If graphics/ImageMagick (currently ImageMagick-6.9.9.28_2,1) is built with the following packages installed: devel/opencl devel/ocl-icd lang/beignet lang/clover ... then running convert(1) (from ImageMagick) with certain parameters will fail: % convert foo.png -colorspace Gray foo2.png Device open failed, aborting... : CommandLine Error: Option 'enable-value-profiling' registered more than once! LLVM ERROR: inconsistency in registered CommandLine options Nothing to output ! This was first noticed when building x11-wm/awesome on a system (amd64) with lang/beignet & lang/clover installed. You can reproduce it by installing devel/ocl-icd, devel/opencl, lang/beignet and lang/clover packages (maybe just lang/beignet??), then trying 'make build' in x11-wm/awesome. The configure stage for ImageMagick detects the opencl include files & libraries and will link with libOpenCL if detected. Then if the lang/beignet and lang/clover ports are installed then convert will use them at run-time. That triggers the error. I have not yet done any in depth digging into ImageMagick to see more details about this. Workaround: configure ImageMagick with --disable-opencl
Simple test case: #include <CL/opencl.h> #include <stdio.h> int main() { unsigned int uu; printf("rc: %d\n", clGetPlatformIDs(0, 0, &uu)); printf("uu: %u\n", uu); return 0; } % cc -Wall -I/usr/local/include -L/usr/local/lib -lOpenCL cl.c -o cl % ./cl X server found. dri2 connection failed! Device open failed, aborting... : CommandLine Error: Option 'enable-value-profiling' registered more than once! LLVM ERROR: inconsistency in registered CommandLine options Nothing to output ! clGetPlatformIDs() apparently is calling exit when it detectes what it thinks is an error (a very impolite think for a library to be doing). convert is calling clGetPlatformIDs under the covers. If you move away /usr/local/lib/beignet/libbeignet.so, clGetPlatformIDs returns a 0 and uu in the above STC is 2. Unknown yet why libOpenCL has this behavior. That seems to be the crux of this bug, but it has infected ImageMagick, and perhaps a workaround may be useful (OPENCL option? default off? for now?).
Other bugs with similar failures: bug 223879 bug 224584 bug 231226
See also https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=852746
See Bug 233495 . I tried to gather issues and direct the issue to the root of the problem. It seems, that developers of POCL are aware of the problem, see for this here: https://github.com/pocl/pocl/issues/474 As refered in Bug 233495, the issue seems to root here: https://bugs.llvm.org/show_bug.cgi?id=30587 and http://lists.llvm.org/pipermail/llvm-bugs/2016-October/051237.html
FYI, beignet was removed today as it was expired.