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

Build-time options for where to get Imath #944

Merged
merged 1 commit into from
Mar 3, 2021

Conversation

lgritz
Copy link
Contributor

@lgritz lgritz commented Feb 26, 2021

It's super convenient that the openexr build will automatically download
and incorporate Imath. But what if you want to test a specific Imath
PR, experimental changes in your own repo, or simply want to sync to a
particular commit or branch that is different than what's hard coded?

This patch adds cmake options that let you set the repo and the tag
for the Imath auto-build. Of course, they default to the official
ASWF Imath repo and the master branch (which will be changed to a release
tag, when it exists).

Signed-off-by: Larry Gritz lg@larrygritz.com

It's super convenient that the openexr build will automatically download
and incorporate Imath. But what if you want to test a specific Imath
PR, experimental changes in your own repo, or simply want to sync to a
particular commit or branch that is different than what's hard coded?

This patch adds cmake options that let you set the repo and the tag
for the Imath auto-build. Of course, they default to the official
ASWF Imath repo and the master branch (which will be changed to a release
tag, when it exists).

Signed-off-by: Larry Gritz <lg@larrygritz.com>
@@ -246,6 +246,11 @@ endif()
#######################################

# Check to see if Imath is installed outside of the current build directory.
set(IMATH_REPO "https://github.com/AcademySoftwareFoundation/Imath.git" CACHE STRING
"Repo for auto-build of Imath")
set(IMATH_TAG "master" CACHE STRING
Copy link
Contributor

Choose a reason for hiding this comment

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

Does it make sense to pin it to a specific version instead of using master?
What happens if I check out this state in one year - may be in the meanwhile something has changed which breaks the build, because the future Imath master does not work with this version - I would suggest pinning it to a specific version - same is done here: https://github.com/AcademySoftwareFoundation/openexr/blob/master/bazel/third_party/openexr.bzl
The Bazel build could also use master for Imath - but this would make also testing in the CI random

Copy link
Contributor Author

Choose a reason for hiding this comment

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

That's what the comment says right after that -- that it's "master" but needs to be changed by the release, so point to a specific tag.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Line 253:

#TODO: ^^ Release should not clone from master, this is a place holder

Copy link
Contributor

Choose a reason for hiding this comment

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

Sorry - I should read everything ;)

@lgritz
Copy link
Contributor Author

lgritz commented Feb 26, 2021

The other thing that this patch enables is to make it easy for our CI to test openexr versus different Imath versions. In particular, while we usually will build against the latest Imath release, we can have one test always build against Imath master ("has anything gone into imath recently that breaks openexr?").

Copy link
Member

@cary-ilm cary-ilm left a comment

Choose a reason for hiding this comment

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

LGTM

@peterhillman
Copy link
Contributor

is it also possible to point to a local working copy of Imath to build from? That would help when modifying Imath and immediately testing the changes in OpenEXR. Otherwise, it would be necessary to reinstall Imath before rebuilding OpenEXR, or else doing a commit and push to a git repo, each time there was a change

@lgritz
Copy link
Contributor Author

lgritz commented Feb 27, 2021

@peterhillman I'm pretty sure that already works, with -DImath_ROOT=/path/to/imath

@lgritz
Copy link
Contributor Author

lgritz commented Feb 27, 2021

Oh, I see what you mean. Just make OpenEXR pick it up from your other checkout, not that you have to build/install first.

@lgritz
Copy link
Contributor Author

lgritz commented Feb 27, 2021

@peterhillman I think that's a good idea, but possibly a bigger change to the build logic.

@cary-ilm cary-ilm merged commit f48bd5b into AcademySoftwareFoundation:master Mar 3, 2021
@cary-ilm cary-ilm added the Build A problem with building or installing the library. label Mar 21, 2021
@lgritz lgritz deleted the lg-imathrepo branch April 3, 2021 01:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Build A problem with building or installing the library. v3.0.0-beta
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants