openexr: CMake builds produce invalid pkg-config files

After updating IlmBase and OpenEXR to 2.4.0 and changing to CMake, IlmBase.pc and OpenEXR.pc contains bogus entries for libdir, etc.

Before:

$ cat IlmBase.pc
prefix=/gnu/store/p78hb0ifsam4d6l20sj69wzn262myx67-ilmbase-2.3.0
exec_prefix=${prefix}
libdir=${exec_prefix}/lib
includedir=${prefix}/include
OpenEXR_includedir=${prefix}/include/OpenEXR

Name: IlmBase
Description: Base math and exception libraries
Version: 2.3.0
Libs: -L${libdir} -lImath -lHalf -lIex -lIexMath -lIlmThread -pthread
Cflags: -pthread -I${OpenEXR_includedir}

$ cat OpenEXR.pc
prefix=/gnu/store/i2gxm1zpz1yqcinycv85mjxiw99vqzy4-openexr-2.3.0
exec_prefix=${prefix}
libdir=${exec_prefix}/lib
includedir=${prefix}/include
OpenEXR_includedir=${prefix}/include/OpenEXR

Name: OpenEXR
Description: OpenEXR image library
Version: 2.3.0

Libs: -L${libdir} -lIlmImf
Cflags: -I${OpenEXR_includedir}
Requires: IlmBase
Libs.private: -lz

After:

$ cat IlmBase.pc
prefix=/gnu/store/zfqx6sd92bjxpfzq7wii7hn5f34s18qm-ilmbase-2.4.0
exec_prefix=bin
libdir=lib
includedir=include
libsuffix=-2_4
Name: IlmBase
Description: Base math and exception libraries
Version: 2.4.0
Requires:
Conflicts:
Libs: -L${libdir} -lImath${libsuffix} -lHalf${libsuffix} -lIex${libsuffix} -lIexMath${libsuffix} -lIlmThread${libsuffix} -pthread
Cflags: -pthread -I${includedir} -I${includedir}/OpenEXR

$ cat OpenEXR.pc
prefix=/gnu/store/qlijvn28x8h6fv85ph1p91c337hvf5dx-openexr-2.4.0
exec_prefix=bin
libdir=lib
includedir=include
OpenEXR_includedir=include/OpenEXR
libsuffix=-2_4

Name: OpenEXR
Description: OpenEXR image library
Version: 2.4.0

Libs: -L${libdir} -lIlmImf${libsuffix}
Cflags: -I${OpenEXR_includedir}
Requires: IlmBase
Libs.private: -lz

IlmBase and OpenEXR are built separately. It’s not clear to me why $prefix is missing from the newer pkg-config files. Ideas?

About this issue

  • Original URL
  • State: closed
  • Created 5 years ago
  • Comments: 15 (5 by maintainers)

Most upvoted comments

I was able to get OpenEXR to install by adding -std=c++11 to the extra_compile_flags in setup.py, as Igritz and peterhillman suggested. Here’s the file with it added:

from distutils.core import setup
from distutils.extension import Extension
from distutils.command.build_py import build_py as _build_py

from os import system

from distutils.core import setup, Extension

version = "1.3.2"
setup(name='OpenEXR',
  author = 'James Bowman',
  author_email = 'jamesb@excamera.com',
  url = 'http://www.excamera.com/sphinx/articles-openexr.html',
  description = "Python bindings for ILM's OpenEXR image file format",
  long_description = "Python bindings for ILM's OpenEXR image file format",
  version=version,
  ext_modules=[ 
    Extension('OpenEXR',
              ['OpenEXR.cpp'],
              include_dirs=['/usr/include/OpenEXR', '/usr/local/include/OpenEXR', '/opt/local/include/OpenEXR'],
              library_dirs=['/usr/local/lib', '/opt/local/lib'],
              libraries=['Iex', 'Half', 'Imath', 'IlmImf', 'z'],
              extra_compile_args=['-g', '-std=c++11', '-DVERSION="%s"' % version])
  ],
  py_modules=['Imath'],
)

Then, I did python setup.py install in the terminal.