From 8a8b42f088243217502c79fb03fb2f494dd12727 Mon Sep 17 00:00:00 2001 From: Stefan Doerr Date: Wed, 22 Jan 2025 11:41:09 +0200 Subject: [PATCH] faking the PyInit_ function so that Windows linker works --- torchmdnet/extensions/torchmdnet_extensions.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/torchmdnet/extensions/torchmdnet_extensions.cpp b/torchmdnet/extensions/torchmdnet_extensions.cpp index cb1eb318..8bce0123 100644 --- a/torchmdnet/extensions/torchmdnet_extensions.cpp +++ b/torchmdnet/extensions/torchmdnet_extensions.cpp @@ -15,6 +15,16 @@ #include #endif +#ifdef _WIN32 +#define EXTENSION_API __declspec(dllexport) +#else +#define EXTENSION_API +#endif + +extern "C" EXTENSION_API PyObject* PyInit_torchmdnet_extensions(void) { + return NULL; +} + /* @brief Returns true if the current torch CUDA stream is capturing. * This function is required because the one available in torch is not compatible with TorchScript. * @return True if the current torch CUDA stream is capturing.