Skip to content

Commit 44b7cc2

Browse files
authored
Jingxu10/cppsdk 20 (#1461)
* refine cppsdk * rename installer.sh to run
1 parent 860ce51 commit 44b7cc2

File tree

3 files changed

+24
-4
lines changed

3 files changed

+24
-4
lines changed
Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,8 @@
33
#
44
# Finds the Torch IPEX library
55
#
6-
# This will define the following variables:
6+
# This will define the following variables. The last 3 are appended to the
7+
# TORCH counterpart variables respectively.
78
#
89
# IPEX_FOUND -- True if the system has the Torch IPEX library
910
# IPEX_INCLUDE_DIRS -- The include directories for torch
@@ -17,6 +18,8 @@
1718

1819
include(FindPackageHandleStandardArgs)
1920

21+
FIND_PACKAGE(Torch REQUIRED)
22+
2023
if(DEFINED ENV{IPEX_INSTALL_PREFIX})
2124
set(IPEX_INSTALL_PREFIX $ENV{IPEX_INSTALL_PREFIX})
2225
else()
@@ -28,17 +31,20 @@ endif()
2831
# Include directories.
2932
if(EXISTS "${IPEX_INSTALL_PREFIX}/include")
3033
set(IPEX_INCLUDE_DIRS ${IPEX_INSTALL_PREFIX}/include)
34+
list(APPEND TORCH_INCLUDE_DIRS ${IPEX_INCLUDE_DIRS})
3135
endif()
3236

3337
# Library dependencies.
3438
if(@BUILD_WITH_CPU@)
3539
find_library(IPEX_CPU_CORE_LIBRARY intel-ext-pt-cpu PATHS "${IPEX_INSTALL_PREFIX}/lib")
3640
set(IPEX_LIBRARIES ${IPEX_CPU_CORE_LIBRARY})
41+
list(APPEND TORCH_LIBRARIES ${IPEX_CPU_CORE_LIBRARY})
3742
endif()
3843

3944
if(@BUILD_WITH_XPU@)
4045
find_library(IPEX_GPU_CORE_LIBRARY intel-ext-pt-gpu PATHS "${IPEX_INSTALL_PREFIX}/lib")
4146
list(APPEND IPEX_LIBRARIES ${IPEX_GPU_CORE_LIBRARY})
47+
list(APPEND TORCH_LIBRARIES ${IPEX_GPU_CORE_LIBRARY})
4248
endif()
4349

4450
find_package_handle_standard_args(IPEX DEFAULT_MSG IPEX_LIBRARIES IPEX_INCLUDE_DIRS)

cmake/cppsdk/libintel-ext-pt.installer.sh.in

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,20 @@ elif [[ ${COMMAND} == "uninstall" ]]; then
118118
fi
119119
done
120120

121+
if [ -f ${LIBTORCH_PATH}/lib/libintel-ext-pt-cpu.so ]; then
122+
rm -rf ${LIBTORCH_PATH}/lib/libintel-ext-pt-cpu.so
123+
fi
124+
if [ -f ${LIBTORCH_PATH}/lib/libintel-ext-pt-gpu.so ]; then
125+
rm -rf ${LIBTORCH_PATH}/lib/libintel-ext-pt-gpu.so
126+
fi
127+
128+
if [ -f ${LIBTORCH_PATH}/include/ipex.h ]; then
129+
rm -rf ${LIBTORCH_PATH}/include/ipex.h
130+
fi
131+
if [ -d ${LIBTORCH_PATH}/include/xpu ]; then
132+
rm -rf ${LIBTORCH_PATH}/include/xpu
133+
fi
134+
121135
if [ -d ${LIBTORCH_PATH}/share/cmake/IPEX ]; then
122136
rm -rf ${LIBTORCH_PATH}/share/cmake/IPEX
123137
fi

csrc/CMakeLists.txt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ set(LIBIPEX_COMP_LIST)
1414
include(CMakePackageConfigHelpers)
1515
# CMake config file for the external project.
1616
configure_package_config_file(
17-
${IPEX_ROOT_DIR}/cmake/IPEXConfig.cmake.in
17+
${IPEX_ROOT_DIR}/cmake/cppsdk/IPEXConfig.cmake.in
1818
${PROJECT_BINARY_DIR}/IPEXConfig.cmake
1919
INSTALL_DESTINATION share/cmake/IPEX)
2020

@@ -71,9 +71,9 @@ if(BUILD_MODULE_TYPE STREQUAL "CPPSDK")
7171

7272
include(CPack)
7373

74-
set(INSTALL_SCRIPT "libintel-ext-pt-${CMAKE_PROJECT_VERSION}.installer.sh")
74+
set(INSTALL_SCRIPT "libintel-ext-pt-${CMAKE_PROJECT_VERSION}.run")
7575
if(GLIBCXX_USE_CXX11_ABI)
76-
set(INSTALL_SCRIPT "libintel-ext-pt-cxx11-abi-${CMAKE_PROJECT_VERSION}.installer.sh")
76+
set(INSTALL_SCRIPT "libintel-ext-pt-cxx11-abi-${CMAKE_PROJECT_VERSION}.run")
7777
endif()
7878
configure_package_config_file(
7979
${IPEX_ROOT_DIR}/cmake/cppsdk/libintel-ext-pt.installer.sh.in

0 commit comments

Comments
 (0)