Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Is this project dead? openexr_ctl will not build with ctl and ignores --disable-ctltest #68

Closed
themaddoctor opened this issue Oct 5, 2017 · 25 comments

Comments

@themaddoctor
Copy link

themaddoctor commented Oct 5, 2017

Using
CTL-ctl-1.5.2.tar.gz
CTL-openexr_ctl-1.0.1.tar.gz

Getting

using pkg-config to set CTL_CXXFLAGS and CTL_LDFLAGS:
   CTL_CXXFLAGS = -pthread -I/usr/include/CTL 
   CTL_LDFLAGS = -L/usr/lib64 
   CTL_LIBS = -L/usr/lib64 -lIlmCtlSimd -lIlmCtlMath -lIlmCtl -pthread 
checking for OpenEXR... yes
Compiled and ran OpenEXR test program.
checking for CTL... no
*** Could not run the CTL test program, checking why...
*** The test program could not be compiled.  Is CTL installed?
*** Check that the cflags (below) includes the CTL include directory
***
*** Flags used by the test:
***     cflags: -g -O2 -pthread -I/usr/include/CTL  
***     ldflags:  -L/usr/lib64 
***
*** You can also run configure with --disable-ctltest to skip this test.
configure: error: The ctl test program failed.

--disable-ctltest is also ignored.

@aforsythe
Copy link
Member

aforsythe commented Oct 5, 2017 via email

@themaddoctor
Copy link
Author

themaddoctor commented Oct 5, 2017 via email

@aforsythe
Copy link
Member

aforsythe commented Oct 6, 2017 via email

@themaddoctor
Copy link
Author

themaddoctor commented Oct 6, 2017 via email

@zachlewis
Copy link
Collaborator

I remember looking into the openexr viewer stuff not terribly long ago... it seems like the codebase diverged at some point, and whatever CTL module the test is looking for has long since been moved. I think I even tracked it down at some point, but in the end, it didn't help with building the openexr viewer utility. I didn't really pursue the problem much further... I think the openexr viewer stuff was built in 2004 (? could be totally wrong), and CTL development seemed to wane... Over the past four or five years, though, AMPAS and friends' contributions and restructuring (and ultimate forking off from OpenEXR itself, if I'm not mistaken) has left the original openexr viewer stuff in the dust.

If you're aiming to leverage CTL as part of a viewer buffer process, you might be happier trying the Tuttle / Natron OpenFX CTL node (can't remember what the status of that is), or having a look at @JGoldstone's nukeNode branch of his CTL fork -- the functionality is limited (for now, only the main function, if present, is evaluated, per specified NukeCtl node), but it provides a fairly direct and stable means to work / batch process with CTL...

@aforsythe
Copy link
Member

aforsythe commented Oct 11, 2017 via email

@zachlewis
Copy link
Collaborator

zachlewis commented Oct 11, 2017

Ah, thaaaat's right... good call, Alex. I think that's exactly where the "missing" CTL modules live... .../CTL/OpenEXR_CTL/CtlModules. I'm talking with our pipeline superstar right now who's been doing a lot of cross-platform builds of... everything... recently, to see if we can remember why we gave up on openexr_viewers itself.

Apparently, we were able to build, but not able to execute; and this may be a function of trying to append additional paths the $CTL_MODULE_PATH (which I think is verboten), this could very well just be a matter of keeping the missing CTLs within the singular module path... but I vaguely recall a naming conflict with the "utilities.ctl" somewhere along the line.

(In any case, I trust that openexr_viewers really should be built against openexr_ctl-1.0.1, presumably when the CTL codebase split from OpenEXR). If I have time this week, I'll see if I can further investigate / verify.

(This issue seems to duplicate issue #37 )

@themaddoctor
Copy link
Author

themaddoctor commented Oct 11, 2017 via email

@dracwyrm
Copy link

CTL v1.5.2 builds openexr_ctl, so you don't need the external package. Just make sure it's enabled at configure time. I had to patch both OpenEXR and CTL to get it to build right. The CMake version of OpenEXR does not install the needed Pkg-Config files, but there is a Pull Request for that.

The patches that are being used by Gentoo Linux are suitable for all distros and OSes (and submitted in PRs). You can find how we build and patch CTL here by reading the 1.5.2 ebuild file:
https://github.com/dracwyrm/gentoo-ebuilds/tree/master/media-libs/ctl

And OpenEXR viewers here by reading the 2.2.0-r1 ebuild:
https://github.com/dracwyrm/gentoo-ebuilds/tree/master/media-gfx/openexr_viewers

The IlmBase and OpenEXR are here:
https://github.com/dracwyrm/gentoo-ebuilds/tree/master/media-libs/ilmbase
https://github.com/dracwyrm/gentoo-ebuilds/tree/master/media-libs/openexr
In case you want those patches.

We are using Autotools for the OpenEXR family because that's how the ebuilds were originally done. We will switch to CMake when the mass amount of CMake issues have been fixed as our patchset would be huge to fix them all.

However, CTL and OpenEXR_Viewers fully compile and install, but you do need the .pc files installed to use Pkg-Config -- it's the best way to find all versions of OpenEXR.

The .pc files for CTL are seriously broken, so they are fixed by the patch as well.

Hope this helps.

@themaddoctor
Copy link
Author

themaddoctor commented Oct 12, 2017 via email

@themaddoctor
Copy link
Author

themaddoctor commented Oct 17, 2017 via email

@dracwyrm
Copy link

dracwyrm commented Oct 18, 2017

@themaddoctor I managed to fix the issue. You need to recompile CTL with the latest update of the patch from this PR: #67
Then compile OpenEXR_Viewers against it. :)

checking for OpenEXR... yes
Compiled and ran OpenEXR test program.
checking for OpenEXR_CTL... yes
Compiled and ran OpenEXR_CTL test program.

@themaddoctor
Copy link
Author

themaddoctor commented Oct 18, 2017

If you are referring to this patch:
https://github.com/dracwyrm/gentoo-ebuilds/blob/master/media-libs/ctl/files/ctl-1.5.2-Use-GNUInstallDirs-and-fix-PkgConfig-files.patch

Then I did use it, and still it did not find CTL.

tar -xf CTL-ctl-1.5.2.tar.gz
cd CTL-ctl-1.5.2
patch -N -p1 -i ../ctl-1.5.2-Use-GNUInstallDirs-and-fix-PkgConfig-files.patch
cmake -DCMAKE_INSTALL_PREFIX=/usr -DCMAKE_INSTALL_DOCDIR=share/doc/ctl -DCMAKE_INSTALL_LIBDIR=lib64
make
sed -i '/assert.h/a#include <string.h>' unittest/IlmCtl/testExamples.cpp
sed -i '/assert.h/a#include <string.h>' unittest/IlmCtl/testVarying.cpp
sed -i '/assert.h/a#include <string.h>' unittest/IlmCtl/testVaryingReturn.cpp
make check
make install
cd ..
rm -rf CTL-ctl-1.5.2
mv /usr/lib64/{CM,cm}ake

tar -xf openexr_viewers-2.2.0.tar.gz
cd openexr_viewers-2.2.0
patch -N -p1 -i ../openexr_viewers-2.2.0-Remove-nVidia-automagic.patch
sed -i 's@AM_CONFIG_HEADER@AC_CONFIG_HEADERS@' configure.ac
aclocal
automake --add-missing
autoreconf
autoconf
PKG_CONFIG_PATH=/usr/lib64/pkgconfig:/usr/share/pkgconfig ./configure
--prefix=/usr --libdir=/usr/lib64

Compiled and ran OpenEXR test program.
checking for OpenEXR_CTL... no
*** Could not run the OpenEXR_CTL test program, checking why...
*** The test program could not be compiled. Is OpenEXR_CTL installed?
*** Check that the cflags (below) includes the OpenEXR_CTL include directory


*** Flags used by the test:
*** cflags: -g -O2 -pthread;-I/usr/include/OpenEXR -pthread
-I/usr/include/OpenEXR -I/usr/include/CTL -I/usr/include/OpenEXR
*** ldflags: -L/usr/lib64
-L/usr/lib64;-lImath;-lHalf;-lIex;-lIexMath;-lIlmThread;-pthread
-L/usr/lib64


*** You can also run configure with --disable-openexrctltest to skip this test.
The OpenEXR_CTL package could not be found. Will build and install
playexr and exrdisplay without ctl support

@themaddoctor
Copy link
Author

/usr/lib64/pkgconfig/CTL.pc
libdir=/usr/lib64
includedir=/usr/include
CTL_includedir=/usr/include/CTL:

Name: CTL
Description: CTL interpreter library
Version: 1.5.2
Libs: -L${libdir} -lIlmCtlSimd -lIlmCtlMath -lIlmCtl -L/usr/lib64;-lImath;-lHalf;-lIex;-lIexMath;-lIlmThread;-
pthread
Cflags: -pthread;-I/usr/include/OpenEXR -I${CTL_includedir}

/usr/lib64/pkgconfig/OpenEXR_CTL.pc:

libdir=/usr/lib64
includedir=/usr/include
OpenEXR_includedir=/usr/include/OpenEXR

Name: OpenEXR_CTL
Description: Simplified OpenEXR interface to CTL
Version: 1.5.2
Libs: -L${libdir} -lIlmImfCtl
Cflags: -I${OpenEXR_includedir}
Requires: CTL,OpenEXR

@themaddoctor
Copy link
Author

Oh, Jeez. This is just so stupid. Adding "--with-pkg-config" did it. Configured with CTL, and compiled (after replacing libtool with a newer one).

@themaddoctor
Copy link
Author

Now:
Cannot find CTL module "transform RRT"

@themaddoctor themaddoctor reopened this Oct 18, 2017
@aforsythe
Copy link
Member

aforsythe commented Oct 18, 2017 via email

@dracwyrm
Copy link

dracwyrm commented Oct 18, 2017

@themaddoctor

Name: CTL
Description: CTL interpreter library
Version: 1.5.2
Libs: -L${libdir} -lIlmCtlSimd -lIlmCtlMath -lIlmCtl -L/usr/lib64;-lImath;-lHalf;-lIex;-lIexMath;-lIlmThread;-
pthread
Cflags: -pthread;-I/usr/include/OpenEXR -I${CTL_includedir}

That is the old one. I updated the patch right before my last comment. Your CTL.pc file should look like:

libdir=/usr/lib64
includedir=/usr/include
CTL_includedir=/usr/include/CTL

Name: CTL
Description: CTL interpreter library
Version: 1.5.2
Libs: -L${libdir} -lIlmCtlSimd -lIlmCtlMath -lIlmCtl
Cflags: -I${CTL_includedir}
Requires: IlmBase

What's actually is stupid is that the semicolons in the .pc file were causing the fail, so the updated patch to remove the @ilmbase...@ code and just made IlmBase required which combines the flags of the two files correctly. Such a simple fix for that headache.

I don't know what to do about the modules being found though. :(

@themaddoctor
Copy link
Author

themaddoctor commented Oct 18, 2017 via email

@dracwyrm
Copy link

@themaddoctor What code are you using that generates it? If it's private code, would you be able to share a sample code that reproduces this?

@themaddoctor
Copy link
Author

themaddoctor commented Oct 19, 2017 via email

@dracwyrm
Copy link

@themaddoctor Why? openexr_ctl is compiled and installed with CTL 1.54 now, so you don't need the external package.

@themaddoctor
Copy link
Author

themaddoctor commented Oct 19, 2017 via email

@aforsythe
Copy link
Member

In order to recognize the CTL modules, you need to set the CTL_MODULE_PATH environment variable. See section 5.3.3 of https://github.com/ampas/CTL/blob/master/doc/CtlManual.pdf

@dracwyrm
Copy link

@themaddoctor I can confirm what @aforsythe said. I set export CTL_MODULE_PATH="/usr/lib64/CTL". Then I had to copy over both transform ctl files from the CTL-openexr_ctl-1.0.1.tar.gz to that directory, and it worked. I can open the test image AllHalfValues.exr using exrdisplay.

I think I will update the patch to add in the environment variable and missing files so I can update my ebuild with it. Maybe even find all missing ctl modules.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants