CMakeLists & Setup - Updates (#363)

* CMakeLists - Remove OBSOLETES

* Setup - Updates

* Setup - Cleanup

[ROCm/rocdecode commit: 460a49a728]
This commit is contained in:
Kiriti Gowda
2024-06-06 10:24:15 -07:00
committed by GitHub
parent 08f6417565
commit a10f3ed86c
2 changed files with 34 additions and 22 deletions
-4
View File
@@ -246,22 +246,18 @@ if(HIP_FOUND AND Libva_FOUND)
set(CPACK_RPM_RUNTIME_PACKAGE_NAME "${PROJECT_NAME}")
set(CPACK_RPM_RUNTIME_PACKAGE_REQUIRES "rocm-core, ${rocDecode_RPM_PACKAGE_LIST}")
set(CPACK_RPM_RUNTIME_PACKAGE_PROVIDES "${PROJECT_NAME}")
set(CPACK_RPM_RUNTIME_PACKAGE_OBSOLETES "${PROJECT_NAME}")
set(CPACK_RPM_DEV_PACKAGE_NAME "${PROJECT_NAME}-devel")
set(CPACK_RPM_DEV_PACKAGE_REQUIRES "rocm-core, ${PROJECT_NAME}, ${rocDecode_RPM_DEV_PACKAGE_LIST}")
set(CPACK_RPM_DEV_PACKAGE_PROVIDES "${PROJECT_NAME}-devel")
set(CPACK_RPM_DEV_PACKAGE_OBSOLETES "${PROJECT_NAME}-devel")
set(CPACK_RPM_PACKAGE_LICENSE "MIT" )
# RPM package specific variable for ASAN
set(CPACK_RPM_ASAN_PACKAGE_NAME "${PROJECT_NAME}-asan" )
set(CPACK_RPM_ASAN_PACKAGE_REQUIRES "rocm-core-asan, ${rocDecode_RPM_PACKAGE_LIST}" )
set(CPACK_RPM_ASAN_PACKAGE_PROVIDES "${PROJECT_NAME}-asan")
set(CPACK_RPM_ASAN_PACKAGE_OBSOLETES "${PROJECT_NAME}-asan")
# RPM package specific variable for Test
set(CPACK_RPM_TEST_PACKAGE_NAME "${PROJECT_NAME}-test" )
set(CPACK_RPM_TEST_PACKAGE_REQUIRES "rocm-core, ${CPACK_RPM_DEV_PACKAGE_NAME}" )
set(CPACK_RPM_TEST_PACKAGE_PROVIDES "${PROJECT_NAME}-test")
set(CPACK_RPM_TEST_PACKAGE_OBSOLETES "${PROJECT_NAME}-test")
if(NOT ROCM_DEP_ROCMCORE)
string(REGEX REPLACE ",? ?rocm-core," "" CPACK_RPM_RUNTIME_PACKAGE_REQUIRES ${CPACK_RPM_RUNTIME_PACKAGE_REQUIRES})
+34 -18
View File
@@ -87,36 +87,50 @@ else:
if sudoLocation != '/usr/bin/sudo':
status, userName = subprocess.getstatusoutput("whoami")
# check os version
os_info_data = 'NOT Supported'
if os.path.exists('/etc/os-release'):
with open('/etc/os-release', 'r') as os_file:
os_info_data = os_file.read().replace('\n', ' ')
os_info_data = os_info_data.replace('"', '')
# setup for Linux
linuxSystemInstall = ''
linuxCMake = 'cmake'
linuxSystemInstall_check = ''
linuxFlag = ''
sudoValidateOption= '-v'
if "centos" in platfromInfo or "redhat" in platfromInfo or os.path.exists('/usr/bin/yum'):
if "centos" in os_info_data or "redhat" in os_info_data or os.path.exists('/usr/bin/yum'):
linuxSystemInstall = 'yum -y'
linuxSystemInstall_check = '--nogpgcheck'
if "centos-7" in platfromInfo or "redhat-7" in platfromInfo:
print("\nrocDecode Setup on "+platfromInfo+" is unsupported\n")
exit(-1)
if not "centos" in platfromInfo or not "redhat" in platfromInfo:
if "8" in platform.version():
platfromInfo = platfromInfo+'-redhat-8'
if "9" in platform.version():
platfromInfo = platfromInfo+'-redhat-9'
elif "Ubuntu" in platfromInfo or os.path.exists('/usr/bin/apt-get'):
if "VERSION_ID=7" in os_info_data:
linuxCMake = 'cmake3'
platfromInfo = platfromInfo+'-redhat-7'
elif "VERSION_ID=8" in os_info_data:
platfromInfo = platfromInfo+'-redhat-8'
elif "VERSION_ID=9" in os_info_data:
platfromInfo = platfromInfo+'-redhat-9'
else:
platfromInfo = platfromInfo+'-redhat-centos-undefined-version'
elif "Ubuntu" in os_info_data or os.path.exists('/usr/bin/apt-get'):
linuxSystemInstall = 'apt-get -y'
linuxSystemInstall_check = '--allow-unauthenticated'
linuxFlag = '-S'
if not "Ubuntu" in platfromInfo:
platfromInfo = platfromInfo+'-Ubuntu'
elif os.path.exists('/usr/bin/zypper'):
if "VERSION_ID=20" in os_info_data:
platfromInfo = platfromInfo+'-Ubuntu-20'
elif "VERSION_ID=22" in os_info_data:
platfromInfo = platfromInfo+'-Ubuntu-22'
elif "VERSION_ID=24" in os_info_data:
platfromInfo = platfromInfo+'-Ubuntu-24'
else:
platfromInfo = platfromInfo+'-Ubuntu-undefined-version'
elif "SLES" in os_info_data or os.path.exists('/usr/bin/zypper'):
linuxSystemInstall = 'zypper -n'
linuxSystemInstall_check = '--no-gpg-checks'
platfromInfo = platfromInfo+'-SLES'
else:
print("\nrocDecode Setup on "+platfromInfo+" is unsupported\n")
print("\nrocDecode Setup Supported on: Ubuntu 20/22, RedHat 8/9, & SLES 15 SP4\n")
print("\nrocDecode Setup Supported on: Ubuntu 20/22, RedHat 8/9, & SLES 15\n")
exit(-1)
# rocDecode Setup
@@ -172,6 +186,9 @@ coreRPMPackages = [
'libva-utils'
]
# update
ERROR_CHECK(os.system('sudo '+linuxFlag+' '+linuxSystemInstall +' '+linuxSystemInstall_check+' update'))
# common packages
ERROR_CHECK(os.system('sudo '+sudoValidateOption))
for i in range(len(commonPackages)):
@@ -184,10 +201,9 @@ if "Ubuntu" in platfromInfo:
for i in range(len(coreDebianPackages)):
ERROR_CHECK(os.system('sudo '+linuxFlag+' '+linuxSystemInstall +
' '+linuxSystemInstall_check+' install '+ coreDebianPackages[i]))
with open('/etc/os-release') as f:
if '22' in f.read():
for i in range(len(coreDebianU22Packages)):
ERROR_CHECK(os.system('sudo '+linuxFlag+' '+linuxSystemInstall +
if "VERSION_ID=22" in os_info_data:
for i in range(len(coreDebianU22Packages)):
ERROR_CHECK(os.system('sudo '+linuxFlag+' '+linuxSystemInstall +
' '+linuxSystemInstall_check+' install '+ coreDebianU22Packages[i]))
else:
for i in range(len(coreRPMPackages)):