Skip to content

Conversation

@grdanny
Copy link
Contributor

@grdanny grdanny commented Sep 27, 2025

Description

sub task of : #4387
for sep 2025 dev days.

Adding a autobuild cmake file for openjpeg.

Matching the latest version like in the yet unmerged:
#4910

Tests

I built it locally - I can see it's downloading the files from github and building them.
I can run the tests.

Checklist:

  • I have read the contribution guidelines.
  • I have updated the documentation, if applicable. (Check if there is no
    need to update the documentation, for example if this is a bug fix that
    doesn't change the API.)
  • I have ensured that the change is tested somewhere in the testsuite
    (adding new test cases if necessary).
  • If I added or modified a C++ API call, I have also amended the
    corresponding Python bindings (and if altering ImageBufAlgo functions, also
    exposed the new functionality as oiiotool options).
  • My code follows the prevailing code style of this project. If I haven't
    already run clang-format before submitting, I definitely will look at the CI
    test that runs clang-format and fix anything that it highlights as being
    nonconforming.

@grdanny grdanny added the devdays25 DevDays 2025 project label Sep 27, 2025
@lgritz
Copy link
Collaborator

lgritz commented Sep 27, 2025

I think this is correct, but in ci.yml, in the "all local builds" job, you'll want to remove the setting of env variable OPENJPEG_VERSION=v2.5.4 because that will trigger the external script build_OpenJPEG.bash before the build. You don't want that, in this case you want to be sure you're forcing the autobuild one.

@grdanny grdanny force-pushed the openjpeg_autobuild branch 5 times, most recently from 80dac5b to d41f053 Compare October 11, 2025 03:05
@grdanny grdanny marked this pull request as ready for review October 11, 2025 03:37
@grdanny grdanny force-pushed the openjpeg_autobuild branch from 76fd0cb to 71e5199 Compare October 13, 2025 00:56
@lgritz
Copy link
Collaborator

lgritz commented Oct 14, 2025

I pushed some fixes to the OpenJPEG build methodology. It was all about getting correct static libraries built and recognized.

@grdanny
Copy link
Contributor Author

grdanny commented Oct 14, 2025

I see, so if I'm running the bash script the does the OpenJpeg build and install I end up with these files:

oiio/ext/dist/lib64/pkgconfig/libopenjp2.pc
oiio/ext/dist/lib64/libopenjp2.a
oiio/ext/dist/lib64/libopenjp2.so
oiio/ext/dist/lib64/libopenjp2.so.7
oiio/ext/dist/lib64/libopenjp2.so.2.5.4

So basically we are telling the OpenImageIO build to prefer the "libopenjp2.a"?

Thanks for the help with this.

Copy link
Contributor Author

@grdanny grdanny left a comment

Choose a reason for hiding this comment

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

this looks good to me now if it looks good to you btw. Thanks again.

@lgritz
Copy link
Collaborator

lgritz commented Oct 14, 2025

Aha, thanks for reminding me about the bash script. I need to adjust that, too.

@lgritz
Copy link
Collaborator

lgritz commented Oct 14, 2025

I pushed one more amendment, to build_OpenJPEG.bash:

  • Build it with position independent code always (lets us use the static library from a dynamic library).
  • Allow a control to optionally disable building the dynamic libs.

That's for the bash script. The cmake auto-builder already does this (in my prior patch) and should default to the static library.

Copy link
Collaborator

@lgritz lgritz left a comment

Choose a reason for hiding this comment

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

Seems to fully work now

@lgritz
Copy link
Collaborator

lgritz commented Oct 14, 2025

Wait, I think I need one more adjustment. Stay tuned.

Copy link
Collaborator

@lgritz lgritz left a comment

Choose a reason for hiding this comment

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

I think it all works now

@lgritz lgritz merged commit 2ccad14 into AcademySoftwareFoundation:main Oct 15, 2025
64 checks passed
@grdanny
Copy link
Contributor Author

grdanny commented Oct 15, 2025

Thanks for helping me take this to the finish line.

lgritz added a commit to lgritz/OpenImageIO that referenced this pull request Oct 17, 2025
…cy (AcademySoftwareFoundation#4911)

sub task of :
AcademySoftwareFoundation#4387
for sep 2025 dev days.

Adding a autobuild cmake file for OpenJPEG.

Includes some changes to recognize and use static OpenJPEG if available.

---------

Signed-off-by: grdanny <[email protected]>
Signed-off-by: Larry Gritz <[email protected]>
Co-authored-by: Larry Gritz <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

devdays25 DevDays 2025 project

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants