Skip to content

Direct link to libpython3.so is not needed#1224

Open
lamikr wants to merge 1 commit intometa-pytorch:mainfrom
lamikr:libpython_linking_to_custom_ops_libs_not_needed
Open

Direct link to libpython3.so is not needed#1224
lamikr wants to merge 1 commit intometa-pytorch:mainfrom
lamikr:libpython_linking_to_custom_ops_libs_not_needed

Conversation

@lamikr
Copy link

@lamikr lamikr commented Feb 5, 2026

There is no need to link custom_ops libraries directly against the libpython as python interpreter will load the python related dependencies at runtime.

Building, linking and execution of applications using torchcodec will work without linking the custom_ops libraries directly against the libpython-library.

I have tested this fix on environment which have
python 3.12 installed but does not have separate libpython library installed.

Related to: #1164

There is no need to link custom_ops libraries directly against the
libpython as python interpreter will load the python related
dependencies at runtime.

Building, linking and execution of applications using torchcodec
will work without linking the custom_ops libraries
directly against the libpython-library.

I have tested this fix on environment which have
python 3.12 installed but does not have separate libpython library
installed.

Related to: meta-pytorch#1164

Signed-off-by: Mika Laitio <mika.laitio@amd.com>
@pytorch-bot
Copy link

pytorch-bot bot commented Feb 5, 2026

🔗 Helpful Links

🧪 See artifacts and rendered test results at hud.pytorch.org/pr/meta-pytorch/torchcodec/1224

Note: Links to docs will display an error until the docs builds have been completed.

❌ 2 New Failures

As of commit 22db42a with merge base 65ed0d5 (image):

NEW FAILURES - The following jobs have failed:

This comment was automatically generated by Dr. CI and updates every 15 minutes.

@meta-cla
Copy link

meta-cla bot commented Feb 5, 2026

Hi @lamikr!

Thank you for your pull request and welcome to our community.

Action Required

In order to merge any pull request (code, docs, etc.), we require contributors to sign our Contributor License Agreement, and we don't seem to have one on file for you.

Process

In order for us to review and merge your suggested changes, please sign at https://code.facebook.com/cla. If you are contributing on behalf of someone else (eg your employer), the individual CLA may not be sufficient and your employer may need to sign the corporate CLA.

Once the CLA is signed, our tooling will perform checks and validations. Afterwards, the pull request will be tagged with CLA signed. The tagging process may take up to 1 hour after signing. Please give it that time before contacting us about it.

If you have received this in error or have any questions, please contact us at cla@meta.com. Thanks!

@mollyxu
Copy link
Contributor

mollyxu commented Feb 10, 2026

Hi @lamikr, thanks for looking into this and creating the PR! We don't know the exact reason that libpython3.so was there for all environments.

From the CI, it seems like removing this would lead to a fatal error on windows due to cannot open file 'python310.lib' [C:\actions-runner\_work\torchcodec\torchcodec\meta-pytorch\torchcodec\build\temp.win-amd64-cpython-310\Release\src\torchcodec\_core\libtorchcodec_custom_ops6.vcxproj]

If you can fix the error on windows in the CI we would be happy to take another look!

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