Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 668444 - media-libs/openimageio-1.8.13 : CMake Error at src/.../FindOpenEXR.cmake:59 (string):
Summary: media-libs/openimageio-1.8.13 : CMake Error at src/.../FindOpenEXR.cmake:59 (...
Status: RESOLVED DUPLICATE of bug 668412
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal with 1 vote (vote)
Assignee: Gentoo Graphics Project
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2018-10-12 13:18 UTC by Toralf Förster
Modified: 2018-12-09 22:00 UTC (History)
11 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
emerge-info.txt (emerge-info.txt,17.05 KB, text/plain)
2018-10-12 13:18 UTC, Toralf Förster
Details
CMakeError.log (CMakeError.log,3.20 KB, text/plain)
2018-10-12 13:18 UTC, Toralf Förster
Details
CMakeOutput.log (CMakeOutput.log,56.32 KB, text/plain)
2018-10-12 13:18 UTC, Toralf Förster
Details
emerge-history.txt (emerge-history.txt,252.44 KB, text/plain)
2018-10-12 13:18 UTC, Toralf Förster
Details
environment (environment,150.61 KB, text/plain)
2018-10-12 13:18 UTC, Toralf Förster
Details
etc.portage.tbz2 (etc.portage.tbz2,20.96 KB, application/x-bzip)
2018-10-12 13:18 UTC, Toralf Förster
Details
logs.tbz2 (logs.tbz2,5.43 KB, application/x-bzip)
2018-10-12 13:18 UTC, Toralf Förster
Details
media-libs:openimageio-1.8.13:20181011-222542.log (media-libs:openimageio-1.8.13:20181011-222542.log,5.81 KB, text/plain)
2018-10-12 13:18 UTC, Toralf Förster
Details
temp.tbz2 (temp.tbz2,33.25 KB, application/x-bzip)
2018-10-12 13:18 UTC, Toralf Förster
Details
oiio_OpenEXR_header_file_relocation.patch (oiio_OpenEXR_header_file_relocation.patch,2.35 KB, patch)
2018-10-17 20:39 UTC, Attila Tóth
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Toralf Förster gentoo-dev 2018-10-12 13:18:02 UTC
-- Compiling with SIMD level sse2,sse3,ssse3,sse4.1,sse4.2,avx,avx2,f16c
-- Setting Namespace to: OpenImageIO_v1_8
CMake Error at src/cmake/modules/FindOpenEXR.cmake:59 (string):
  string sub-command REGEX, mode MATCHALL needs at least 5 arguments total to
  command.
Call Stack (most recent call first):

  -------------------------------------------------------------------

  This is an unstable amd64 chroot image at a tinderbox (==build bot)
  name: 17.0_libressl_20181006-210858

  -------------------------------------------------------------------

gcc-config -l:
 [1] x86_64-pc-linux-gnu-7.3.1
 [2] x86_64-pc-linux-gnu-8.2.0 *

Available Python interpreters, in order of preference:
  [1]   python3.7
  [2]   python3.6
  [3]   python2.7 (fallback)
  [4]   pypy (fallback)
Available Ruby profiles:
  [1]   ruby23 (with Rubygems)
  [2]   ruby25 (with Rubygems) *



emerge -qpvO media-libs/openimageio
[ebuild   R   ] media-libs/openimageio-1.8.13  USE="libressl ssl truetype -colorio -doc -ffmpeg -field3d -gif -jpeg2k -opencv -opengl -ptex -python -qt5 -raw" CPU_FLAGS_X86="avx avx2 f16c sse2 sse3 sse4_1 sse4_2 ssse3 -avx512f" PYTHON_SINGLE_TARGET="python3_6 -python2_7 -python3_4 -python3_5" PYTHON_TARGETS="python2_7 python3_6 -python3_4 -python3_5"
Comment 1 Toralf Förster gentoo-dev 2018-10-12 13:18:05 UTC
Created attachment 550814 [details]
emerge-info.txt
Comment 2 Toralf Förster gentoo-dev 2018-10-12 13:18:08 UTC
Created attachment 550816 [details]
CMakeError.log
Comment 3 Toralf Förster gentoo-dev 2018-10-12 13:18:10 UTC
Created attachment 550818 [details]
CMakeOutput.log
Comment 4 Toralf Förster gentoo-dev 2018-10-12 13:18:13 UTC
Created attachment 550820 [details]
emerge-history.txt
Comment 5 Toralf Förster gentoo-dev 2018-10-12 13:18:16 UTC
Created attachment 550822 [details]
environment
Comment 6 Toralf Förster gentoo-dev 2018-10-12 13:18:19 UTC
Created attachment 550824 [details]
etc.portage.tbz2
Comment 7 Toralf Förster gentoo-dev 2018-10-12 13:18:22 UTC
Created attachment 550826 [details]
logs.tbz2
Comment 8 Toralf Förster gentoo-dev 2018-10-12 13:18:25 UTC
Created attachment 550828 [details]
media-libs:openimageio-1.8.13:20181011-222542.log
Comment 9 Toralf Förster gentoo-dev 2018-10-12 13:18:27 UTC
Created attachment 550830 [details]
temp.tbz2
Comment 10 Jeremy Stent 2018-10-13 16:33:48 UTC
This seems to be caused by media-libs/openexr-2.3.0 not including the version in the file /usr/include/OpenEXR/OpenEXRConfig.h
If you add the line below to that file, then you get past this error.

#define OPENEXR_VERSION_STRING 2.3.0
#define OPENEXR_VERSION_MAJOR 2
#define OPENEXR_VERSION_MINOR 3
Comment 11 Dennis Schridde 2018-10-17 09:04:36 UTC
Please note that there is another error:

CMake Error at src/cmake/externalpackages.cmake:68 (if):                                             
  if given arguments:                                                                                   
                                                                                                                                             
    "VERSION_LESS" "2.0.0"                                                                                                        
                                                                                                                
  Unknown arguments specified

Does this hint at <media-libs/openexr-2 being required?

Does this further hint at the installed version of dev-util/cmake (3.12.3 in my case) not supporting the syntax used by media-libs/openimageio-1.8.13's CMakeLists.txt?
Comment 12 Attila Tóth 2018-10-17 20:14:04 UTC
(In reply to Dennis Schridde from comment #11)
> Please note that there is another error:
> 
> CMake Error at src/cmake/externalpackages.cmake:68 (if):                    
> 
>   if given arguments:                                                       
> 
>                                                                             
> 
>     "VERSION_LESS" "2.0.0"                                                  
> 
>                                                                             
> 
>   Unknown arguments specified
> 
> Does this hint at <media-libs/openexr-2 being required?
> 
> Does this further hint at the installed version of dev-util/cmake (3.12.3 in
> my case) not supporting the syntax used by media-libs/openimageio-1.8.13's
> CMakeLists.txt?

I don't think this is the case here. In src/cmake/modules/FindOpenEXR.cmake:
"
# Try to figure out version number
if (EXISTS "${OPENEXR_INCLUDE_PATH}/OpenEXR/ImfMultiPartInputFile.h")
    # Must be at least 2.0
"

The basic problem here seems to be, that while bumping OpenEXR version to 2.3.0, for some reason they reorganized the header file location of those two mentioned before. The files now in the original place are now stubs doing conditional further includes. The header files containing the actual useful stuff had been relocated to /usr/include/x86_64-pc-linux-gnu/OpenEXR/OpenEXRConfig.h. The stub header checks for several architectures (i386, mips, sparc, s390, powerpc64) and returns error except for x86_64 - for which it includes the relocated header file. Screaming into my pillow: WHY? - f* it.
Comment 13 Attila Tóth 2018-10-17 20:37:41 UTC
If the path the cmake module looks for the header is correct, the error messages about the incorrect number of arguments and about VERSION_LESS go away.
Comment 14 Attila Tóth 2018-10-17 20:39:01 UTC
Created attachment 551748 [details, diff]
oiio_OpenEXR_header_file_relocation.patch

Patch to correct the behavior of FindOpenEXR module in case of recent OpenEXR. Works for me.
Comment 15 Greg Turner 2018-10-18 00:31:33 UTC
(In reply to Attila Tóth from comment #14)
> Created attachment 551748 [details, diff] [details, diff]
> oiio_OpenEXR_header_file_relocation.patch
> 
> Patch to correct the behavior of FindOpenEXR module in case of recent
> OpenEXR. Works for me.

Likewise, however, this patch is not going to be correct for anyone on any platform other than multilib x86 iiuc.  Obviously, that's most of us, but something more clever will need to be done to make this Gentoo-ly correct.

So... the idea cmake has here, is to make configure faster, by just grepping the header files for #defines rather than parsing them?  If so, that is pretty outrageous....  Imagine how many man-hours must be lost every day debugging corner-cases owing to this "optimization".  Anyhow, par for the course, I guess.

Upstream has a pkgconfig patch that applies but it doesn't seem to work OOTB either.  hmmm....  OK, well I tried.  Now I think I will adopt your patch for personal use, Attila :)
Comment 16 cyrillic 2018-10-20 20:26:35 UTC
(In reply to Greg Turner from comment #15)
> Upstream has a pkgconfig patch that applies but it doesn't seem to work OOTB
> either.  hmmm....  OK, well I tried.  Now I think I will adopt your patch
> for personal use, Attila :)

I have been using media-libs/openimageio-1.8.15 which already includes this pkgconfig patch, and no it does not work :(

Adding oiio_OpenEXR_header_file_relocation.patch however does the trick, so now I am happy.
Comment 17 Helmut Jarausch 2018-10-23 14:40:18 UTC
(In reply to cyrillic from comment #16)
> (In reply to Greg Turner from comment #15)
> > Upstream has a pkgconfig patch that applies but it doesn't seem to work OOTB
> > either.  hmmm....  OK, well I tried.  Now I think I will adopt your patch
> > for personal use, Attila :)
> 
> I have been using media-libs/openimageio-1.8.15 which already includes this
> pkgconfig patch, and no it does not work :(
> 
> Adding oiio_OpenEXR_header_file_relocation.patch however does the trick, so
> now I am happy.

I have been less lucky.
I get
CMake Error at /usr/share/cmake/Modules/FindPackageHandleStandardArgs.cmake:137 (message):
  Could NOT find OpenEXR: Found unsuitable version "1.6.1", but required is
  at least "2.0" (found /usr/include)
Call Stack (most recent call first):
  /usr/share/cmake/Modules/FindPackageHandleStandardArgs.cmake:376 (_FPHSA_FAILURE_MESSAGE)
  src/cmake/modules/FindOpenEXR.cmake:160 (find_package_handle_standard_args)
  src/cmake/externalpackages.cmake:62 (find_package)
  CMakeLists.txt:118 (include)

I don't understand this since I only have media-libs/openexr-2.2.0-r2 and
media-libs/ilmbase-2.2.0-r1 installed here.
CMakeError.log shows
/usr/lib/gcc/x86_64-pc-linux-gnu/8.2.0/../../../../x86_64-pc-linux-gnu/bin/ld: CMakeFiles/cmTC_3425c.dir/CheckSymbolExists.c.o: in function `main':
CheckSymbolExists.c:(.text.startup+0x3): undefined reference to `pthread_create'
Comment 18 Attila Tóth 2018-10-23 20:29:14 UTC
(In reply to Helmut Jarausch from comment #17)
> (In reply to cyrillic from comment #16)
> > (In reply to Greg Turner from comment #15)
> > > Upstream has a pkgconfig patch that applies but it doesn't seem to work OOTB
> > > either.  hmmm....  OK, well I tried.  Now I think I will adopt your patch
> > > for personal use, Attila :)
> > 
> > I have been using media-libs/openimageio-1.8.15 which already includes this
> > pkgconfig patch, and no it does not work :(
> > 
> > Adding oiio_OpenEXR_header_file_relocation.patch however does the trick, so
> > now I am happy.
> 
> I have been less lucky.
> I get
> CMake Error at
> /usr/share/cmake/Modules/FindPackageHandleStandardArgs.cmake:137 (message):
>   Could NOT find OpenEXR: Found unsuitable version "1.6.1", but required is
>   at least "2.0" (found /usr/include)
> Call Stack (most recent call first):
>   /usr/share/cmake/Modules/FindPackageHandleStandardArgs.cmake:376
> (_FPHSA_FAILURE_MESSAGE)
>   src/cmake/modules/FindOpenEXR.cmake:160 (find_package_handle_standard_args)
>   src/cmake/externalpackages.cmake:62 (find_package)
>   CMakeLists.txt:118 (include)
> 
> I don't understand this since I only have media-libs/openexr-2.2.0-r2 and
> media-libs/ilmbase-2.2.0-r1 installed here.
> CMakeError.log shows
> /usr/lib/gcc/x86_64-pc-linux-gnu/8.2.0/../../../../x86_64-pc-linux-gnu/bin/
> ld: CMakeFiles/cmTC_3425c.dir/CheckSymbolExists.c.o: in function `main':
> CheckSymbolExists.c:(.text.startup+0x3): undefined reference to
> `pthread_create'

Where are OpenEXRConfig.h(s) and IlmBaseConfig.h(s) located in /usr/include in your case?
Comment 19 cyrillic 2018-10-24 01:33:20 UTC
(In reply to Helmut Jarausch from comment #17)

> I don't understand this since I only have media-libs/openexr-2.2.0-r2 and
> media-libs/ilmbase-2.2.0-r1 installed here.

I think the relocation patch only works for >=2.3.0 versions of these packages.
Comment 20 Attila Tóth 2018-10-24 07:40:35 UTC
(In reply to cyrillic from comment #19)
> (In reply to Helmut Jarausch from comment #17)
> 
> > I don't understand this since I only have media-libs/openexr-2.2.0-r2 and
> > media-libs/ilmbase-2.2.0-r1 installed here.
> 
> I think the relocation patch only works for >=2.3.0 versions of these
> packages.

That is what I'm also thinking of.
Comment 21 Randy Andy 2018-10-24 15:08:51 UTC
The relocation patch works for me too, but I was also on 
media-libs/openexr-2.3.0 version.
Comment 22 Ștefan Talpalaru 2018-10-31 14:31:30 UTC
A patched media-libs/openimageio-1.8.15 is available in my overlay: https://github.com/stefantalpalaru/gentoo-overlay
Comment 23 Ștefan Talpalaru 2018-10-31 14:34:08 UTC
I also replaced the (no longer in use) "USE_CPP14=ON" CMake option (also broken in 1.8.13) with "USE_CPP=14".
Comment 24 Brian Evans Gentoo Infrastructure gentoo-dev 2018-11-04 01:31:12 UTC

*** This bug has been marked as a duplicate of bug 668412 ***
Comment 25 cyrillic 2018-12-09 21:32:00 UTC
Upstream started using pkgconfig correctly with version 1.8.17
Now it builds fine without the header relocation patch :)
Comment 26 Ștefan Talpalaru 2018-12-09 22:00:37 UTC
Version bumped to 1.8.17 in my overlay.