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

Autodesk: Build with zlib static library #3130

Open
wants to merge 1 commit into
base: dev
Choose a base branch
from

Conversation

erikaharrison-adsk
Copy link
Contributor

Description of Change(s)

We need to be able to support using a static zlib library. This change provides that.

Fixes Issue(s)

  • N/A
  • I have verified that all unit tests pass with the proposed changes
  • I have submitted a signed Contributor License Agreement

@jesschimein
Copy link
Contributor

Filed as internal issue #USD-9779

@jesschimein
Copy link
Contributor

/AzurePipelines run

Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@dgovil dgovil added the build Build-related issue/PR label Oct 23, 2024
@dgovil
Copy link
Collaborator

dgovil commented Oct 23, 2024

A related issue is that we only need Zlib to build on Windows. Does this affect your PR at all? #2988

@yangel2017
Copy link

Yes, #2988 will affect my PR. Using static zlib need to build zlib from the source but not from the system installed one. If #2988 merges first, my PR needs to update.

@dgovil
Copy link
Collaborator

dgovil commented Oct 25, 2024

Would you only need to support static builds on Windows? Or would you need to support them on Linux and Mac too, where the OS vends it?

@yangel2017
Copy link

We would like to support static builds on Windows, Mac and Linux.

@dgovil
Copy link
Collaborator

dgovil commented Oct 26, 2024

Okay. Just a few more questions:

1.If I understand the change correctly, this would make it always statically linked. I think many of us would still prefer to use dynamic linking, especially on platforms where the OS provides it.

  1. Zlib is used by multiple dependencies, that all default to being dynamically linked in. Wouldn't this PR cause each of them to statically link Zlib, resulting in multiple runtime copies of it?

  2. I presume you also bundle those dependencies into your products.
    Would it be better for you to link against the version of each dependency in your product instead, rather than having USD build them again for you?

@yangel2017
Copy link

We propose this because when an application uses usd with dynamic zlib library of version A, and the application itself also dynamic links zlib libraries with version B, if version A and B are not compatible then the problem occurs. Use static libraries can avoid the problem. But it indeed may result in multiple runtime copies of it.

@dgovil
Copy link
Collaborator

dgovil commented Oct 30, 2024

I think this would need to be an option perhaps? I don't agree with the approach of making this a default as I think being dynamically provided by the OS is the more preferable option for a wider range of uses.

@asluk
Copy link
Collaborator

asluk commented Oct 30, 2024

I agree that it needs to be optional 🙏🏼

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
build Build-related issue/PR
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants