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 fixes for OSL on Windows #1920

Closed

Conversation

jstone-lucasfilm
Copy link
Member

@jstone-lucasfilm jstone-lucasfilm commented Jan 8, 2025

Description

This changelist contains two fixes for OSL builds on the Windows platform, both of which were authored by Kai Rohmer at NVIDIA.

Tests

With these fixes in place, OSL builds on Windows now include testshade and testrender, where these two applications would previously fail to build.

For visual validation, I'm attaching the latest MaterialX render comparisons between GLSL and OSL, where the OSL renders are using the codebase in OSL main plus these two fixes.

MaterialXRenderTests_01_07_2025_GitHub.pdf

Checklist:

  • I have read the contribution guidelines.
  • I have updated the documentation, if applicable.
  • I have ensured that the change is tested somewhere in the testsuite (adding new test cases if necessary).
  • My code follows the prevailing code style of this project. If I haven't
    already run clang-format v17 before submitting, I definitely will look at
    the CI test that runs clang-format and fix anything that it highlights as
    being nonconforming.

Copy link

linux-foundation-easycla bot commented Jan 8, 2025

CLA Not Signed

@@ -2,6 +2,8 @@
# SPDX-License-Identifier: BSD-3-Clause
# https://github.com/AcademySoftwareFoundation/OpenShadingLanguage

set (LLVM_COMPILE_FLAGS ${LLVM_COMPILE_FLAGS} "-std=c++17")
Copy link
Collaborator

Choose a reason for hiding this comment

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

This one doesn't feel right. Shouldn't it use whatever standard is used by the rest of the codebase, instead of hard-coding it to 17?

Copy link
Member Author

Choose a reason for hiding this comment

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

That sounds like a good request for an improvement to this change, and I'm CC'ing @krohmerNV for his thoughts.

Copy link
Member Author

Choose a reason for hiding this comment

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

As an initial proposal for this improvement, perhaps it could be written as follows?

set (LLVM_COMPILE_FLAGS ${LLVM_COMPILE_FLAGS} -std=c++${CMAKE_CXX_STANDARD})

Copy link
Member Author

Choose a reason for hiding this comment

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

I've made the change described above, and have verified that the OSL build for Windows works as before.

This changelist contains two fixes for OSL builds on the Windows platform, both of which were authored by Kai Rohmer at NVIDIA.

Signed-off-by: Jonathan Stone <[email protected]>
@jstone-lucasfilm
Copy link
Member Author

As an update on the Contributor License Agreement, it sounds like Lucasfilm may not have contributed to OSL before, so it's going through the approval process now!

Comment on lines +5 to +6
set (LLVM_COMPILE_FLAGS ${LLVM_COMPILE_FLAGS} -std=c++${CMAKE_CXX_STANDARD})

Copy link
Collaborator

Choose a reason for hiding this comment

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

I ran into this as well, but there is actually a better solution!

@lgritz
Copy link
Collaborator

lgritz commented Jan 12, 2025

I think my Windows CI PR is going to subsume this. I still think you should push the CLA through the bureaucracy so you've got the ducks in a row for the next time somebody from ILM needs to make an OSL patch. But I suspect this PR is ultimately not going to be merged.

@jstone-lucasfilm
Copy link
Member Author

No problem, Larry, and a set of Windows fixes directly from the OSL team is even better from my perspective. I'll close out this PR, but will continue with the Lucasfilm approval process so that we can contribute in the future.

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

Successfully merging this pull request may close these issues.

2 participants