File tree Expand file tree Collapse file tree 3 files changed +10
-8
lines changed Expand file tree Collapse file tree 3 files changed +10
-8
lines changed Original file line number Diff line number Diff line change @@ -13,6 +13,9 @@ set(CMAKE_BUILD_WITH_INSTALL_RPATH TRUE)
1313set (CMAKE_INSTALL_RPATH "${RPATH_VALUE} /lib/:${RPATH_VALUE} /" )
1414set (CMAKE_INSTALL_RPATH_USE_LINK_PATH FALSE )
1515set (CMAKE_LIBRARY_OUTPUT_DIRECTORY ${IPEX_INSTALL_LIBDIR} )
16+ SET (CMAKE_CXX_FLAGS_RELWITHDEBINFO "-O2 -g" )
17+ SET (CMAKE_CXX_FLAGS_RELEASE "-O2" )
18+ SET (CMAKE_CXX_FLAGS_DEBUG "-O0 -g" )
1619
1720set (DPCPP_ROOT "${PROJECT_SOURCE_DIR} /torch_ipex/csrc" )
1821set (DPCPP_THIRD_PARTY_ROOT "${PROJECT_SOURCE_DIR} /third_party" )
Original file line number Diff line number Diff line change @@ -31,13 +31,13 @@ ENDIF()
3131# Define build type
3232IF (CMAKE_BUILD_TYPE MATCHES Debug)
3333 message ("Debug build." )
34- set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -O0 -g - D_DEBUG" )
34+ set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -D_DEBUG" )
3535ELSEIF (CMAKE_BUILD_TYPE MATCHES RelWithDebInfo)
3636 message ("RelWithDebInfo build" )
37- set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -O2 -g - DNDEBUG" )
37+ set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DNDEBUG" )
3838ELSE ()
3939 message ("Release build." )
40- set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -O2 - DNDEBUG" )
40+ set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DNDEBUG" )
4141ENDIF ()
4242
4343IF ("${IPEX_DISP_OP} " STREQUAL "1" )
@@ -156,8 +156,6 @@ include_directories(${DPCPP_THIRD_PARTY_ROOT}/llga/third_party/oneDNN/include)
156156# include_directories(${PROJECT_SOURCE_DIR}/build/third_party/mkl-dnn/include)
157157# include_directories(${DPCPP_THIRD_PARTY_ROOT}/mkl-dnn/include)
158158
159-
160-
161159# Set installed PyTorch dir
162160if (DEFINED PYTORCH_INSTALL_DIR)
163161 include_directories (${PYTORCH_INSTALL_DIR} /include )
Original file line number Diff line number Diff line change @@ -269,14 +269,15 @@ def run(self):
269269 Path (output_lib_path ).mkdir (parents = True , exist_ok = True )
270270
271271 cmake_args = [
272+ '-DCMAKE_CXX_FLAGS=-D_GLIBCXX_USE_CXX11_ABI=' + str (int (torch ._C ._GLIBCXX_USE_CXX11_ABI )),
272273 '-DCMAKE_BUILD_TYPE=' + get_build_type (),
273- '-DPYTORCH_INSTALL_DIR=' + pytorch_install_dir ,
274- '-DPYTHON_EXECUTABLE=' + sys .executable ,
275- '-DIPEX_INSTALL_LIBDIR=' + os .path .abspath (output_lib_path ),
276274 '-DCMAKE_INSTALL_PREFIX=' + os .path .abspath (output_lib_path ),
277275 '-DCMAKE_LIBRARY_OUTPUT_DIRECTORY=' + os .path .abspath (output_lib_path ),
278276 '-DCMAKE_ARCHIVE_OUTPUT_DIRECTORY=' + os .path .abspath (output_lib_path ),
277+ '-DIPEX_INSTALL_LIBDIR=' + os .path .abspath (output_lib_path ),
279278 '-DPYTHON_INCLUDE_DIR=' + python_include_dir ,
279+ '-DPYTHON_EXECUTABLE=' + sys .executable ,
280+ '-DPYTORCH_INSTALL_DIR=' + pytorch_install_dir ,
280281 '-DPYTORCH_INCLUDE_DIRS=' + pytorch_install_dir + "/include" ,
281282 '-DPYTORCH_LIBRARY_DIRS=' + pytorch_install_dir + "/lib" ]
282283
You can’t perform that action at this time.
0 commit comments