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

Python interface windows support #51

Open
mrmbernardi opened this issue Jan 30, 2024 · 4 comments
Open

Python interface windows support #51

mrmbernardi opened this issue Jan 30, 2024 · 4 comments

Comments

@mrmbernardi
Copy link
Contributor

Windows support is alluded to on this line:

"windows": "SZ3c.dll",

However it doesn't work since sys.platform returns win32 for Windows, not windows.

I have tried to use Sz3 through python on windows by patching this bug and building SZ3c with G++ and with MsBuild, but no matter what I tried I couldn't get it to work properly.

Perhaps to interface with python properly, it needs to be built with MsBuild and the functions need to be defined properly with __declspec like here:

# define ZSTDLIB_API __declspec(dllexport) ZSTDLIB_VISIBILITY

@ayzk
Copy link
Collaborator

ayzk commented Jan 30, 2024

@mrmbernardi Thanks for pointing out the issue. I've changed the return to win32 from Windows. Have you tried the methods mentioned in this thread? #5 (comment)

@mrmbernardi
Copy link
Contributor Author

Yes, when build with MSYS2, UCRT64, and G++, I get library not found errors from python (this is the error when the library is found but cannot be loaded for another reason).

If I build with MsBuild, the library is successfully loaded but the names are not mangled correctly.

@ayzk
Copy link
Collaborator

ayzk commented Jan 31, 2024

@mrmbernardi Just to clarify, the executable can run on Win but the Python binding has problems, right?

@mrmbernardi
Copy link
Contributor Author

When I build MsBuild, the executable works. If I build with MSYS UCRT, I get an entry point not found error.

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

No branches or pull requests

2 participants