diff --git a/CMakeLists.txt b/CMakeLists.txt index c1733a99e91..c8af5f00b5c 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1097,9 +1097,6 @@ if(NOT MSVC) append_cxx_flag_if_supported("-Wno-error=redundant-move" CMAKE_CXX_FLAGS) endif() else() - # Define export functions for AOTI. - add_compile_definitions(EXPORT_AOTI_FUNCTIONS) - # skip unwanted includes from windows.h add_compile_definitions(WIN32_LEAN_AND_MEAN) # Windows SDK broke compatibility since version 25131, but introduced this diff --git a/caffe2/CMakeLists.txt b/caffe2/CMakeLists.txt index 96bdcfef41f..ade009d4573 100644 --- a/caffe2/CMakeLists.txt +++ b/caffe2/CMakeLists.txt @@ -779,7 +779,6 @@ endif() if(NOT BUILD_LIBTORCHLESS) add_library(torch_cpu ${Caffe2_CPU_SRCS}) -# target_compile_definitions(torch_cpu PRIVATE -DEXPORT_AOTI_FUNCTIONS) if(HAVE_SOVERSION) set_target_properties(torch_cpu PROPERTIES VERSION ${TORCH_VERSION} SOVERSION ${TORCH_SOVERSION}) @@ -964,7 +963,6 @@ elseif(USE_CUDA) set(CUDA_LINK_LIBRARIES_KEYWORD) torch_compile_options(torch_cuda) # see cmake/public/utils.cmake target_compile_definitions(torch_cuda PRIVATE USE_CUDA) - # target_compile_definitions(torch_cuda PRIVATE -DEXPORT_AOTI_FUNCTIONS) if(USE_CUFILE) target_link_libraries(torch_cuda PRIVATE torch::cufile) @@ -1056,7 +1054,6 @@ if(USE_XPU) add_library(torch_xpu ${Caffe2_XPU_SRCS}) torch_compile_options(torch_xpu) # see cmake/public/utils.cmake target_compile_definitions(torch_xpu PRIVATE USE_XPU) - # target_compile_definitions(torch_xpu PRIVATE -DEXPORT_AOTI_FUNCTIONS) if(WIN32) target_compile_options(torch_xpu PRIVATE /permissive-) endif() diff --git a/torch/CMakeLists.txt b/torch/CMakeLists.txt index 1ebe195609e..b123023d2fd 100644 --- a/torch/CMakeLists.txt +++ b/torch/CMakeLists.txt @@ -310,7 +310,6 @@ endif() add_library(torch_python SHARED ${TORCH_PYTHON_SRCS}) torch_compile_options(torch_python) # see cmake/public/utils.cmake -# target_compile_definitions(torch_python PRIVATE -DEXPORT_AOTI_FUNCTIONS) if(NOT WIN32) target_compile_options(torch_python PRIVATE $<$: -fvisibility=default>) diff --git a/torch/csrc/inductor/aoti_torch/c/shim.h b/torch/csrc/inductor/aoti_torch/c/shim.h index aea6873e8d8..4c6c9afcacc 100644 --- a/torch/csrc/inductor/aoti_torch/c/shim.h +++ b/torch/csrc/inductor/aoti_torch/c/shim.h @@ -44,11 +44,8 @@ // to symbol clashes at link time if libtorch is included in a DLL and binary // that depends on the DLL. As a short term fix, we don't export the symbols. // In the long term, this will need to be addressed when Windows is supported. -#ifdef EXPORT_AOTI_FUNCTIONS -#define AOTI_TORCH_EXPORT __declspec(dllexport) -#else -#define AOTI_TORCH_EXPORT __declspec(dllimport) -#endif +// #define AOTI_TORCH_EXPORT __declspec(dllexport) +#define AOTI_TORCH_EXPORT #else // !_WIN32 #define AOTI_TORCH_EXPORT #endif // _WIN32