File: 0001-modify-esmi-path.patch

package info (click to toggle)
amdsmi 7.2.0-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 7,876 kB
  • sloc: cpp: 42,479; python: 22,906; ansic: 12,578; sh: 762; makefile: 20
file content (70 lines) | stat: -rw-r--r-- 3,358 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
From: Xuanteng Huang <xuanteng.huang@outlook.com>
Date: Fri, 12 Jul 2024 16:10:11 +0800
Subject: modify esmi path

We've integrate esmi project in `d/esmi_ib_library`, so update `CMakeLists.txt`.

Forwarded: not-needed
---
 CMakeLists.txt | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

Index: amdsmi/CMakeLists.txt
===================================================================
--- amdsmi.orig/CMakeLists.txt
+++ amdsmi/CMakeLists.txt
@@ -121,52 +121,13 @@ if(ENABLE_ESMI_LIB)
     # Supported esmi library version tag
     set(current_esmi_tag "esmi_pkg_ver-4.2")
 
-    if(NOT EXISTS ${PROJECT_SOURCE_DIR}/esmi_ib_library/src)
-        # TODO: use ExternalProject_Add instead or a submodule
-        message(STATUS "Adding esmi_ib_library...")
-        execute_process(COMMAND git clone --depth=1 -b ${current_esmi_tag} https://github.com/amd/esmi_ib_library.git
-                                ${PROJECT_SOURCE_DIR}/esmi_ib_library)
-    else()
-        message(STATUS "esmi_ib_library already installed, checking version...")
-
-        # Grab latest commit and get the tag
-        execute_process(
-            COMMAND git rev-list --tags --max-count=1
-            WORKING_DIRECTORY ${PROJECT_SOURCE_DIR}/esmi_ib_library
-            OUTPUT_VARIABLE latest_commit
-            OUTPUT_STRIP_TRAILING_WHITESPACE)
-        execute_process(
-            COMMAND git describe --tags ${latest_commit} --match "*pkg*"
-            WORKING_DIRECTORY ${PROJECT_SOURCE_DIR}/esmi_ib_library
-            OUTPUT_VARIABLE latest_esmi_tag
-            OUTPUT_STRIP_TRAILING_WHITESPACE)
-
-        # Update to latest tags if not matched
-        if(NOT latest_esmi_tag STREQUAL current_esmi_tag)
-            message(STATUS "Updating esmi_ib_library...")
-            execute_process(
-                COMMAND git clone --depth=1 -b ${current_esmi_tag} https://github.com/amd/esmi_ib_library.git
-                        ${PROJECT_SOURCE_DIR}/esmi_ib_library_temp RESULT_VARIABLE clone_result)
-            if(clone_result EQUAL 0)
-                file(REMOVE_RECURSE ${PROJECT_SOURCE_DIR}/esmi_ib_library)
-                file(RENAME ${PROJECT_SOURCE_DIR}/esmi_ib_library_temp ${PROJECT_SOURCE_DIR}/esmi_ib_library)
-                message(STATUS "Successfully cloned updated esmi_ib_library")
-            else()
-                file(REMOVE_RECURSE ${PROJECT_SOURCE_DIR}/esmi_ib_library_temp)
-                message(FATAL_ERROR "Failed to clone updated esmi_ib_library")
-            endif()
-        else()
-            message(STATUS "esmi_ib_library is the latest version: ${current_esmi_tag}...")
-        endif()
-    endif()
-
     # Make sure to update the amd_hsmp.h file with the corresponding esmi version
     file(COPY "${PROJECT_SOURCE_DIR}/include/amd_smi/impl/amd_hsmp.h"
          DESTINATION "${PROJECT_SOURCE_DIR}/esmi_ib_library/include/asm")
 
     add_definitions("-DENABLE_ESMI_LIB=1")
-    set(ESMI_INC_DIR "${PROJECT_SOURCE_DIR}/esmi_ib_library/include")
-    set(ESMI_SRC_DIR "${PROJECT_SOURCE_DIR}/esmi_ib_library/src")
+    set(ESMI_INC_DIR "${PROJECT_SOURCE_DIR}/debian/esmi_ib_library/include")
+    set(ESMI_SRC_DIR "${PROJECT_SOURCE_DIR}/debian/esmi_ib_library/src")
     # esmi has a lot of write-strings warnings - silence them
     set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-write-strings")
 endif()