Skip to content

WITH_PYTHON Cmake option does not work anymore? #259

@GericoVi

Description

@GericoVi

It seems the capability to compile the library without linking to the Python library introduced in #196 no longer works?

#213 seems to have introduced the torch/extension.h include in the csrc/extensions.h:

diff --git a/csrc/extensions.h b/csrc/extensions.h
index def1780..2c8d704 100644
--- a/csrc/extensions.h
+++ b/csrc/extensions.h
@@ -1,6 +1,5 @@
-
-#include <torch/torch.h>
-#include "sparse.h"
+#include "macros.h"
+#include <torch/extension.h>

 // for getpid()
 #ifdef _WIN32

torch/extension.h' includes Python.h. Was there a reason for this? Is the WITH_PYTHON=OFF` capability not supported anymore?

Error when trying to build on windows MSVC with the WITH_PYTHON flag set to false:
C:\Users\geric\Downloads\libtorch-win-shared-with-deps-1.12.0+cpu\libtorch\include\torch\csrc\python_headers.h(10): fatal error C1083: Cannot open include file: 'Python.h': No such file or directory

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions