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

Remove all build-time header generation #606

Merged

Conversation

cary-ilm
Copy link
Member

@cary-ilm cary-ilm commented Nov 2, 2019

Add toFloat.h, eLut.h, b44ExpLogTable.h, dwaLookups.h as first-class headers, and remove the associated cmake/autoconf build rules.

Also:

  • add tests in HalfTest and IlmImfTest to validate that the internal tables have the proper values (using
    code from the generation programs)
  • move the dwaLookups symbols to the OPENEXR_IMF_INTERNAL_NAMESPACE. They were in the
    global namespace.
    -The original generation program code is still in the repo, although it's no longer compiled or used.

The rationale behind this is to simplify the build process, as the header generation is a frequent source of problems for users building the library, at the cost of disk space. At 6258948 bytes, dwaLookups.h is now the single largest file in the project repo, although it's only 13% of the total repo size, only about twice the size of several of the included test .exr images, so not onerously large.

The original idea discussed in the TSC was to retain make targets to generate the headers, but after considering it further, it seems more appropriate to just do the validation with code inside the test projects. This removes all the complexity of building the generation programs from the Makefiles once and for all, rather than just moving the complexity into the test project Makefiles.

- removed the auto-generation step from the build process
- added test in HalfTest

Signed-off-by: Cary Phillips <cary@ilm.com>
- remove auto-generation of the header tables
- add test to IlmImfTest to validate the headers

Signed-off-by: Cary Phillips <cary@ilm.com>
Also:
- added comments to the new tests
- fixed export headers in Makefile.am

Signed-off-by: Cary Phillips <cary@ilm.com>
Signed-off-by: Cary Phillips <cary@ilm.com>
Copy link
Contributor

@meshula meshula left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks Cary!

@kdt3rd
Copy link
Contributor

kdt3rd commented Nov 6, 2019

Looks fine mostly, although shouldn't we leave the targets to build the generate programs? If you want, you can add an EXCLUDE_FROM_ALL tag to the add_executable calls

@cary-ilm
Copy link
Member Author

cary-ilm commented Nov 6, 2019 via email

@axxel
Copy link
Contributor

axxel commented Nov 7, 2019

Since the space occupied by the headers was discussed: they are obviously not meant for human consumption. So a substantial amount of space could be saved by choosing a different layout:

  • remove all whitespace inside the arrays
  • use plain ints instead of hex literals

@cary-ilm cary-ilm added the Needs Discussion To be discussed in the technical steering committee label Nov 14, 2019
@cary-ilm
Copy link
Member Author

I experimented with reducing the whitespace, and the files got smaller, but not by enough to justify disturbing the code. There is definitely bloat here, as some of these could be generated efficiently at runtime, but I don't think space concerns are significant.

@cary-ilm cary-ilm merged commit d778a0b into AcademySoftwareFoundation:master Nov 14, 2019
@cary-ilm cary-ilm deleted the half-autogenerated-headers branch November 14, 2019 22:48
@cary-ilm cary-ilm added this to the v2.5.0 milestone Apr 26, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Needs Discussion To be discussed in the technical steering committee v2.5.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants