summaryrefslogtreecommitdiff
path: root/dev-util/rocm-smi/files/rocm-smi-6.0.2-set-soversion.patch
blob: 6d28c7bb8e3ea34afe64667322379ad9fda7e7bb (plain)
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
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
Switch from extracting version with git to version from ebuild filename.
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -33,20 +33,17 @@ set(SHARE_INSTALL_PREFIX
     "share/${ROCM_SMI}"
     CACHE STRING "Tests and Example install directory")
 
-# provide git to utilities
-find_program (GIT NAMES git)
-
-## Setup the package version based on git tags.
-set(PKG_VERSION_GIT_TAG_PREFIX "rsmi_pkg_ver")
-get_package_version_number("7.0.0" ${PKG_VERSION_GIT_TAG_PREFIX} GIT)
-message("Package version: ${PKG_VERSION_STR}")
-set(${ROCM_SMI_LIBS_TARGET}_VERSION_MAJOR "${CPACK_PACKAGE_VERSION_MAJOR}")
-set(${ROCM_SMI_LIBS_TARGET}_VERSION_MINOR "${CPACK_PACKAGE_VERSION_MINOR}")
-set(${ROCM_SMI_LIBS_TARGET}_VERSION_PATCH "${CPACK_PACKAGE_VERSION_PATCH}")
-set(${ROCM_SMI_LIBS_TARGET}_VERSION_BUILD "0")
-set(${ROCM_SMI_LIBS_TARGET}_VERSION_HASH "${PKG_VERSION_HASH}")
-
-set(${ROCM_SMI_LIBS_TARGET}_VERSION_STRING "${${ROCM_SMI_LIBS_TARGET}_VERSION_MAJOR}.${${ROCM_SMI_LIBS_TARGET}_VERSION_MINOR}.${${ROCM_SMI_LIBS_TARGET}_VERSION_PATCH}+${${ROCM_SMI_LIBS_TARGET}_VERSION_HASH}")
+set(VERSION_MAJOR "@VERSION_MAJOR@")
+set(VERSION_MINOR "@VERSION_MINOR@")
+set(VERSION_PATCH "@VERSION_PATCH@")
+set(PKG_VERSION_STR "${VERSION_MAJOR}.${VERSION_MINOR}.${VERSION_PATCH}")
+set(SO_VERSION_STRING "${VERSION_MAJOR}.${VERSION_MINOR}")
+set(CPACK_PACKAGE_VERSION_MAJOR "${VERSION_MAJOR}")
+set(CPACK_PACKAGE_VERSION_MINOR "${VERSION_MINOR}")
+set(CPACK_PACKAGE_VERSION_PATCH "${VERSION_PATCH}")
+set(rocm_smi_VERSION_MAJOR "${VERSION_MAJOR}")
+set(rocm_smi_VERSION_MINOR "${VERSION_MINOR}")
+set(rocm_smi_VERSION_PATCH "${VERSION_PATCH}")
 
 # The following default version values should be updated as appropriate for
 # ABI breaks (update MAJOR and MINOR), and ABI/API additions (update MINOR).
--- a/oam/CMakeLists.txt
+++ b/oam/CMakeLists.txt
@@ -29,17 +29,6 @@ set(OAM_NAME "oam")
 set(OAM_COMPONENT "lib${OAM_NAME}")
 set(OAM_TARGET "${OAM_NAME}")
 
-################# Determine the library version #########################
-set(SO_VERSION_GIT_TAG_PREFIX "oam_so_ver")
-
-# VERSION_* variables should be set by get_version_from_tag
-message("Package version: ${PKG_VERSION_STR}")
-
-# Debian package specific variables
-# Set a default value for the package version
-get_version_from_tag("1.0.0.0" ${SO_VERSION_GIT_TAG_PREFIX} GIT)
-
-# VERSION_* variables should be set by get_version_from_tag
 if ( ${ROCM_PATCH_VERSION} )
     set ( VERSION_PATCH ${ROCM_PATCH_VERSION})
     set(SO_VERSION_STRING "${VERSION_MAJOR}.${VERSION_MINOR}.${VERSION_PATCH}")
--- a/python_smi_tools/rsmiBindings.py
+++ b/python_smi_tools/rsmiBindings.py
@@ -26,17 +26,7 @@ def initRsmiBindings(silent=False):
     if (rocm_smi_lib_path != None):
         path_librocm = rocm_smi_lib_path
     else:
-        path_librocm = os.path.dirname(os.path.realpath(__file__)) + '/../../lib/librocm_smi64.so.7'
-
-    if not os.path.isfile(path_librocm):
-        print_silent('Unable to find %s . Trying /opt/rocm*' % path_librocm)
-        for root, dirs, files in os.walk('/opt', followlinks=True):
-            if 'librocm_smi64.so.7' in files:
-                path_librocm = os.path.join(os.path.realpath(root), 'librocm_smi64.so.7')
-        if os.path.isfile(path_librocm):
-            print_silent('Using lib from %s' % path_librocm)
-        else:
-            print('Unable to find librocm_smi64.so.7')
+        path_librocm = 'librocm_smi64.so'
 
     # ----------> TODO: Support static libs as well as SO
     try:
@@ -44,7 +34,7 @@ def initRsmiBindings(silent=False):
         return CDLL(path_librocm)
     except OSError:
         print('Unable to load the rocm_smi library.\n'\
-              'Set LD_LIBRARY_PATH to the folder containing librocm_smi64.so.7\n'\
+              'Set LD_LIBRARY_PATH to the folder containing librocm_smi64.so\n'\
               '{0}Please refer to https://github.com/'\
               'RadeonOpenCompute/rocm_smi_lib for the installation guide.{1}'\
               .format('\33[33m', '\033[0m'))
--- a/python_smi_tools/rsmiBindings.py.in
+++ b/python_smi_tools/rsmiBindings.py.in
@@ -26,17 +26,7 @@ def initRsmiBindings(silent=False):
     if (rocm_smi_lib_path != None):
         path_librocm = rocm_smi_lib_path
     else:
-        path_librocm = os.path.dirname(os.path.realpath(__file__)) + '/../../@CMAKE_INSTALL_LIBDIR@/librocm_smi64.so.@VERSION_MAJOR@'
-
-    if not os.path.isfile(path_librocm):
-        print_silent('Unable to find %s . Trying /opt/rocm*' % path_librocm)
-        for root, dirs, files in os.walk('/opt', followlinks=True):
-            if 'librocm_smi64.so.@VERSION_MAJOR@' in files:
-                path_librocm = os.path.join(os.path.realpath(root), 'librocm_smi64.so.@VERSION_MAJOR@')
-        if os.path.isfile(path_librocm):
-            print_silent('Using lib from %s' % path_librocm)
-        else:
-            print('Unable to find librocm_smi64.so.@VERSION_MAJOR@')
+        path_librocm = 'librocm_smi64.so'
 
     # ----------> TODO: Support static libs as well as SO
     try:
@@ -44,7 +34,7 @@ def initRsmiBindings(silent=False):
         return CDLL(path_librocm)
     except OSError:
         print('Unable to load the rocm_smi library.\n'\
-              'Set LD_LIBRARY_PATH to the folder containing librocm_smi64.so.@VERSION_MAJOR@\n'\
+              'Set LD_LIBRARY_PATH to the folder containing librocm_smi64.so\n'\
               '{0}Please refer to https://github.com/'\
               'RadeonOpenCompute/rocm_smi_lib for the installation guide.{1}'\
               .format('\33[33m', '\033[0m'))
--- a/python_smi_tools/rsmiBindingsInit.py.in
+++ b/python_smi_tools/rsmiBindingsInit.py.in
@@ -26,17 +26,7 @@ def initRsmiBindings(silent=False):
     if (rocm_smi_lib_path != None):
         path_librocm = rocm_smi_lib_path
     else:
-        path_librocm = os.path.dirname(os.path.realpath(__file__)) + '/../../@CMAKE_INSTALL_LIBDIR@/librocm_smi64.so.@VERSION_MAJOR@'
-
-    if not os.path.isfile(path_librocm):
-        print_silent('Unable to find %s . Trying /opt/rocm*' % path_librocm)
-        for root, dirs, files in os.walk('/opt', followlinks=True):
-            if 'librocm_smi64.so.@VERSION_MAJOR@' in files:
-                path_librocm = os.path.join(os.path.realpath(root), 'librocm_smi64.so.@VERSION_MAJOR@')
-        if os.path.isfile(path_librocm):
-            print_silent('Using lib from %s' % path_librocm)
-        else:
-            print('Unable to find librocm_smi64.so.@VERSION_MAJOR@')
+        path_librocm = 'librocm_smi64.so'
 
     # ----------> TODO: Support static libs as well as SO
     try:
@@ -44,7 +34,7 @@ def initRsmiBindings(silent=False):
         return CDLL(path_librocm)
     except OSError:
         print('Unable to load the rocm_smi library.\n'\
-              'Set LD_LIBRARY_PATH to the folder containing librocm_smi64.so.@VERSION_MAJOR@\n'\
+              'Set LD_LIBRARY_PATH to the folder containing librocm_smi64.so\n'\
               '{0}Please refer to https://github.com/'\
               'RadeonOpenCompute/rocm_smi_lib for the installation guide.{1}'\
               .format('\33[33m', '\033[0m'))
--- a/rocm_smi/CMakeLists.txt
+++ b/rocm_smi/CMakeLists.txt
@@ -31,17 +31,6 @@ set(ROCM_SMI_TARGET "${ROCM_SMI}64")
 ## Include common cmake modules
 include(utils)
 
-################# Determine the library version #########################
-set(SO_VERSION_GIT_TAG_PREFIX "rsmi_so_ver")
-
-# VERSION_* variables should be set by get_version_from_tag
-message("Package version: ${PKG_VERSION_STR}")
-
-# Debian package specific variables
-# Set a default value for the package version
-get_version_from_tag("1.0.0.0" ${SO_VERSION_GIT_TAG_PREFIX} GIT)
-
-# VERSION_* variables should be set by get_version_from_tag
 if ( ${ROCM_PATCH_VERSION} )
     set ( VERSION_PATCH ${ROCM_PATCH_VERSION})
     set(SO_VERSION_STRING "${VERSION_MAJOR}.${VERSION_MINOR}.${VERSION_PATCH}")