File tree 5 files changed +24
-21
lines changed
5 files changed +24
-21
lines changed Original file line number Diff line number Diff line change @@ -1961,7 +1961,7 @@ cc_library(
1961
1961
1962
1962
pybind_extension (
1963
1963
name = "_C" ,
1964
- srcs = ["torch/csrc/stub.cpp " ],
1964
+ srcs = ["torch/csrc/stub.c " ],
1965
1965
deps = [
1966
1966
":torch_python"
1967
1967
],
Original file line number Diff line number Diff line change @@ -579,7 +579,6 @@ def configure_extension_build():
579
579
else :
580
580
extra_link_args = []
581
581
extra_compile_args = [
582
- '-std=c++14' ,
583
582
'-Wall' ,
584
583
'-Wextra' ,
585
584
'-Wno-strict-overflow' ,
@@ -604,9 +603,9 @@ def configure_extension_build():
604
603
library_dirs .append (lib_path )
605
604
606
605
main_compile_args = []
607
- main_libraries = ['shm' , ' torch_python' ]
606
+ main_libraries = ['torch_python' ]
608
607
main_link_args = []
609
- main_sources = ["torch/csrc/stub.cpp " ]
608
+ main_sources = ["torch/csrc/stub.c " ]
610
609
611
610
if cmake_cache_vars ['USE_CUDA' ]:
612
611
library_dirs .append (
@@ -647,7 +646,7 @@ def make_relative_rpath(path):
647
646
C = Extension ("torch._C" ,
648
647
libraries = main_libraries ,
649
648
sources = main_sources ,
650
- language = 'c++ ' ,
649
+ language = 'c' ,
651
650
extra_compile_args = main_compile_args + extra_compile_args ,
652
651
include_dirs = [],
653
652
library_dirs = library_dirs ,
@@ -661,7 +660,7 @@ def make_relative_rpath(path):
661
660
extensions .append (DL )
662
661
663
662
# These extensions are built by cmake and copied manually in build_extensions()
664
- # inside the build_ext implementaiton
663
+ # inside the build_ext implementation
665
664
extensions .append (
666
665
Extension (
667
666
name = str ('caffe2.python.caffe2_pybind11_state' ),
Original file line number Diff line number Diff line change @@ -621,6 +621,7 @@ static void LogAPIUsageOnceFromPython(const std::string& event) {
621
621
}
622
622
}
623
623
624
+ extern " C"
624
625
#ifdef _WIN32
625
626
__declspec (dllexport)
626
627
#endif
Original file line number Diff line number Diff line change
1
+ #include <Python.h>
2
+
3
+ #ifdef _WIN32
4
+ __declspec(dllimport )
5
+ #endif
6
+ extern PyObject * initModule (void );
7
+
8
+ #ifndef _WIN32
9
+ #ifdef __cplusplus
10
+ extern "C"
11
+ #endif
12
+ __attribute__((visibility ("default" ))) PyObject * PyInit__C (void );
13
+ #endif
14
+
15
+ PyMODINIT_FUNC PyInit__C (void )
16
+ {
17
+ return initModule ();
18
+ }
Load Diff This file was deleted.
You can’t perform that action at this time.
0 commit comments