Skip to content

Commit 156fd41

Browse files
cpack: align packaging to better handle multiple APIs
Change-Id: Ie9c4762babd44efe6511c5a716b35714514d3a36 Signed-off-by: Artur Harasimiuk <artur.harasimiuk@intel.com>
1 parent 9e33860 commit 156fd41

File tree

4 files changed

+20
-117
lines changed

4 files changed

+20
-117
lines changed

CMakeLists.txt

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -46,9 +46,6 @@ include(GNUInstallDirs)
4646
# define global property where we will collect component list to package
4747
define_property(GLOBAL PROPERTY NEO_COMPONENTS_LIST BRIEF_DOCS "List of components" FULL_DOCS "List of components to create packages")
4848
set(GLOBAL PROPERTY NEO_COMPONENTS_LIST "")
49-
if(NOT DEFINED NEO_BUILD_PACKAGE)
50-
set(NEO_BUILD_PACKAGE TRUE)
51-
endif()
5249

5350
set(BRANCH_TYPE "")
5451
set(BRANCH_DIR_SUFFIX "/${BRANCH_TYPE}")
@@ -149,6 +146,9 @@ set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${NEO_BINARY_DIR}/bin)
149146
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${NEO_BINARY_DIR}/bin)
150147
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${NEO_BINARY_DIR}/lib)
151148

149+
# determine Neo version
150+
include(version.cmake)
151+
152152
# We want to build with the static, multithreaded runtime libraries (as opposed
153153
# to the multithreaded runtime DLLs)
154154
if(MSVC)
@@ -572,9 +572,6 @@ add_definitions(-DGMM_OCL)
572572
# We want to organize our IDE targets into folders
573573
set_property(GLOBAL PROPERTY USE_FOLDERS ON)
574574

575-
# determine Neo version
576-
include(version.cmake)
577-
578575
# Get available platfroms
579576
include(platforms.cmake)
580577

@@ -922,6 +919,4 @@ configure_file(lib_names.h.in ${NEO_BUILD_DIR}/lib_names.h)
922919
hide_subdir(${NEO_RUNTIME_SUB_DIR})
923920
add_subdirectories()
924921

925-
if(NEO_BUILD_PACKAGE)
926-
include(package.cmake)
927-
endif()
922+
include(package.cmake)

level_zero/CMakeLists.txt

Lines changed: 6 additions & 103 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ if(BUILD_WITH_L0 AND "${NEO_BITS}" STREQUAL "64")
2929
endif()
3030
endif()
3131

32-
project(intel-level-zero-gpu VERSION 0.4.1)
32+
project(level-zero-gpu VERSION 0.4.1)
3333
include(cmake/source_tree.cmake)
3434
if(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/cmake/${BRANCH_TYPE}/platforms.cmake AND NOT SKIP_L0_UNIT_TESTS)
3535
include(cmake/${BRANCH_TYPE}/platforms.cmake)
@@ -382,62 +382,10 @@ endif()
382382

383383
add_subdirectories()
384384

385-
if(UNIX AND (NOT NEO_BUILD_PACKAGE))
385+
if(UNIX)
386386
message(STATUS "Building LevelZero package")
387-
if(DEFINED L0_CPACK_GENERATOR)
388-
set(CPACK_GENERATOR ${L0_CPACK_GENERATOR})
389-
else()
390-
# If generators list was not define build native package for current distro
391-
if(EXISTS "/etc/debian_version")
392-
set(CPACK_GENERATOR "DEB")
393-
394-
set(file_path "/etc/lsb-release")
395-
if(EXISTS "${file_path}")
396-
file(STRINGS "${file_path}" data_list REGEX "^(DISTRIB_ID|DISTRIB_CODENAME)=")
397-
398-
# Look for lines like "DISTRIB_ID="..." and DISTRIB_CODENAME="..."
399-
foreach(_var ${data_list})
400-
if("${_var}" MATCHES "^(DISTRIB_ID)=(.*)$")
401-
set(DEB_DISTRIB_ID "${CMAKE_MATCH_2}")
402-
elseif("${_var}" MATCHES "^(DISTRIB_CODENAME)=(.*)$")
403-
set(DEB_DISTRIB_CODENAME "${CMAKE_MATCH_2}")
404-
endif()
405-
endforeach()
406-
endif()
407-
408-
elseif(EXISTS "/etc/redhat-release")
409-
set(CPACK_GENERATOR "RPM")
410-
else()
411-
set(CPACK_GENERATOR "TXZ")
412-
endif()
413-
endif()
414387

415-
set(CPACK_PACKAGE_CONTACT "Intel Corporation")
416-
set(CPACK_PACKAGE_VERSION_MAJOR "${PROJECT_VERSION_MAJOR}")
417-
set(CPACK_PACKAGE_VERSION_MINOR "${PROJECT_VERSION_MINOR}")
418-
set(CPACK_PACKAGE_VERSION_PATCH "${PROJECT_VERSION_PATCH}")
419-
if(NOT DEFINED L0_VERSION_BUILD)
420-
set(L0_VERSION_BUILD 0)
421-
endif()
422-
set(CPACK_PACKAGE_DESCRIPTION_SUMMARY "Level Zero driver written for Intel GPU devices.")
423-
424-
set(CPACK_DEB_COMPONENT_INSTALL ON)
425-
set(CPACK_RPM_COMPONENT_INSTALL ON)
426-
set(CPACK_ARCHIVE_COMPONENT_INSTALL ON)
427-
428-
set(CPACK_DEBIAN_PACKAGE_ARCHITECTURE "amd64")
429-
set(CPACK_DEBIAN_PACKAGE_RELEASE ${L0_VERSION_BUILD})
430-
set(CPACK_DEBIAN_PACKAGE_SHLIBDEPS ON)
431-
432-
set(CPACK_RPM_COMPRESSION_TYPE "xz")
433-
set(CPACK_RPM_PACKAGE_ARCHITECTURE "x86_64")
434-
set(CPACK_RPM_PACKAGE_AUTOREQ OFF)
435-
set(CPACK_RPM_PACKAGE_GROUP "System Environment/Libraries")
436-
set(CPACK_RPM_PACKAGE_LICENSE "MIT")
437-
set(CPACK_RPM_PACKAGE_RELEASE ${L0_VERSION_BUILD})
438-
set(CPACK_RPM_PACKAGE_RELEASE_DIST ON)
439-
440-
set_property(GLOBAL APPEND PROPERTY L0_COMPONENTS_LIST ${PROJECT_NAME})
388+
set_property(GLOBAL APPEND PROPERTY NEO_COMPONENTS_LIST ${PROJECT_NAME})
441389

442390
set(L0_PACKAGE_VERSION_DEB "${CPACK_PACKAGE_VERSION_MAJOR}.${CPACK_PACKAGE_VERSION_MINOR}.${CPACK_PACKAGE_VERSION_PATCH}")
443391
set(L0_PACKAGE_VERSION_RPM "${CPACK_PACKAGE_VERSION_MAJOR}.${CPACK_PACKAGE_VERSION_MINOR}.${CPACK_PACKAGE_VERSION_PATCH}")
@@ -458,23 +406,6 @@ endif()
458406
list(APPEND _external_package_dependencies_rpm "intel-igc-opencl")
459407
endif()
460408

461-
list(APPEND _external_package_dependencies_deb "level-zero")
462-
list(APPEND _external_package_dependencies_rpm "level-zero")
463-
464-
# Consecutive build number
465-
if(NOT DEFINED NEO_VERSION_BUILD)
466-
set(PACKAGE_VERSION_BUILD ${BUILD_VERSION})
467-
else()
468-
set(PACKAGE_VERSION_BUILD ${NEO_VERSION_BUILD})
469-
endif()
470-
471-
set(CPACK_DEBIAN_FILE_NAME "DEB-DEFAULT")
472-
473-
include("os_release_info.cmake")
474-
get_os_release_info(os_name os_version os_codename)
475-
#Pick only first character of os_name
476-
string(SUBSTRING "${os_name}" 0 1 os_name)
477-
478409
find_program(GIT_EXE NAMES "git")
479410
if(GIT_EXE AND EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/.git")
480411
if(MSVC)
@@ -491,44 +422,16 @@ endif()
491422
endif()
492423
string(STRIP "${VERSION_SUFFIX}" VERSION_SUFFIX)
493424

494-
if(NOT DEFINED ${PACKAGE_VERSION_BUILD})
495-
set(PACKAGE_RELEASE_VERSION ${VERSION_SUFFIX})
496-
else()
497-
set(PACKAGE_RELEASE_VERSION ${PACKAGE_VERSION_BUILD})
498-
endif()
499-
500425
string(REPLACE ";" ", " CPACK_DEBIAN_INTEL-LEVEL-ZERO-GPU_PACKAGE_DEPENDS "${_external_package_dependencies_deb}")
501426
string(REPLACE ";" ", " CPACK_RPM_INTEL-LEVEL-ZERO-GPU_PACKAGE_REQUIRES "${_external_package_dependencies_rpm}")
502-
set(CPACK_DEBIAN_INTEL-LEVEL-ZERO-GPU_PACKAGE_DEPENDS ${CPACK_DEBIAN_INTEL-LEVEL-ZERO-GPU_PACKAGE_DEPENDS} PARENT_SCOPE)
503-
set(CPACK_RPM_INTEL-LEVEL-ZERO-GPU_PACKAGE_REQUIRES ${CPACK_RPM_INTEL-LEVEL-ZERO-GPU_PACKAGE_REQUIRES} PARENT_SCOPE)
427+
set(CPACK_DEBIAN_LEVEL-ZERO-GPU_PACKAGE_DEPENDS ${CPACK_DEBIAN_INTEL-LEVEL-ZERO-GPU_PACKAGE_DEPENDS} PARENT_SCOPE)
428+
set(CPACK_RPM_LEVEL-ZERO-GPU_PACKAGE_REQUIRES ${CPACK_RPM_INTEL-LEVEL-ZERO-GPU_PACKAGE_REQUIRES} PARENT_SCOPE)
504429

505-
set(CPACK_DEBIAN_INTEL-LEVEL-ZERO-GPU_PACKAGE_NAME ${PROJECT_NAME})
506-
if("${BUILD_TYPE}" STREQUAL "debug")
507-
set(CPACK_DEBIAN_INTEL-LEVEL-ZERO-GPU_FILE_NAME "${PROJECT_NAME}_${L0_PACKAGE_VERSION_DEB}-${PACKAGE_RELEASE_VERSION}+${os_name}${os_version}-dbg_${CPACK_DEBIAN_PACKAGE_ARCHITECTURE}.deb")
508-
else()
509-
set(CPACK_DEBIAN_INTEL-LEVEL-ZERO-GPU_FILE_NAME "${PROJECT_NAME}_${L0_PACKAGE_VERSION_DEB}-${PACKAGE_RELEASE_VERSION}+${os_name}${os_version}_${CPACK_DEBIAN_PACKAGE_ARCHITECTURE}.deb")
510-
endif()
511-
512-
set(CPACK_RPM_INTEL-LEVEL-ZERO-GPU_PACKAGE_NAME ${PROJECT_NAME})
513-
set(CPACK_RPM_INTEL-LEVEL-ZERO-GPU_FILE_NAME "${PROJECT_NAME}-${L0_PACKAGE_VERSION_RPM}%{?dist}.${CPACK_RPM_PACKAGE_ARCHITECTURE}.rpm")
430+
set(CPACK_RPM_LEVEL-ZERO-GPU_FILE_NAME "intel-level-zero-gpu-${NEO_VERSION_MAJOR}.${NEO_VERSION_MINOR}.${NEO_VERSION_BUILD}-${CPACK_RPM_PACKAGE_RELEASE}%{?dist}.${CPACK_RPM_PACKAGE_ARCHITECTURE}.rpm" PARENT_SCOPE)
514431

515432
if(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/cmake/${BRANCH_TYPE}/cpack.cmake)
516433
include(${CMAKE_CURRENT_SOURCE_DIR}/cmake/${BRANCH_TYPE}/cpack.cmake)
517434
endif()
518435

519-
set(CPACK_SOURCE_GENERATOR "TGZ")
520-
set(CPACK_SOURCE_IGNORE_FILES
521-
/.git/
522-
/.gitignore
523-
/build/
524-
/manifests/
525-
)
526-
set(CPACK_SOURCE_PACKAGE_FILE_NAME "${PROJECT_NAME}_${L0_PACKAGE_VERSION_DEB}-${PACKAGE_RELEASE_VERSION}_${BUILD_TYPE}")
527-
528-
get_property(CPACK_COMPONENTS_ALL GLOBAL PROPERTY L0_COMPONENTS_LIST)
529-
set(CPACK_PROPERTIES_FILE "${NEO_SOURCE_DIR}/package_config.cmake")
530-
set(CPACK_LD_LIBRARY_PATH "${NEO__GMM_LIBRARY_PATH}")
531-
532-
include(CPack)
533436
endif()
534437
endif()

manifests/manifest.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ components:
1414
infra:
1515
branch: infra
1616
dest_dir: infra
17-
revision: b316037d4891fa91568c3c915f4489fb01de4d4a
17+
revision: f11e4c80b26e4a721e1a3111e5cd98030e73ade6
1818
type: git
1919
internal:
2020
branch: master

package.cmake

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ if(UNIX)
5757
set(CPACK_PACKAGE_ARCHITECTURE "x86_64")
5858
set(CPACK_PACKAGE_RELOCATABLE FALSE)
5959
set(CPACK_PACKAGE_NAME "intel")
60-
set(CPACK_PACKAGE_DESCRIPTION_SUMMARY "Intel OpenCL GPU driver")
60+
set(CPACK_PACKAGE_DESCRIPTION_SUMMARY "Intel(R) Graphics Compute Runtime")
6161
set(CPACK_PACKAGE_VENDOR "Intel")
6262
set(CPACK_PACKAGE_VERSION_MAJOR ${NEO_VERSION_MAJOR})
6363
set(CPACK_PACKAGE_VERSION_MINOR ${NEO_VERSION_MINOR})
@@ -93,17 +93,22 @@ if(UNIX)
9393
if(CMAKE_VERSION VERSION_GREATER 3.6 OR CMAKE_VERSION VERSION_EQUAL 3.6)
9494
set(CPACK_DEBIAN_OPENCL_FILE_NAME "intel-opencl_${NEO_VERSION_MAJOR}.${NEO_VERSION_MINOR}.${NEO_VERSION_BUILD}-1~${os_codename}_${CPACK_DEBIAN_PACKAGE_ARCHITECTURE}.deb")
9595
set(CPACK_DEBIAN_OCLOC_FILE_NAME "intel-opencl-ocloc_${NEO_VERSION_MAJOR}.${NEO_VERSION_MINOR}.${NEO_VERSION_BUILD}-1~${os_codename}_${CPACK_DEBIAN_PACKAGE_ARCHITECTURE}.deb")
96+
set(CPACK_DEBIAN_LEVEL-ZERO-GPU_FILE_NAME "intel-level-zero-gpu_${NEO_VERSION_MAJOR}.${NEO_VERSION_MINOR}.${NEO_VERSION_BUILD}-1~${os_codename}_${CPACK_DEBIAN_PACKAGE_ARCHITECTURE}.deb")
97+
9698
set(CPACK_RPM_OPENCL_FILE_NAME "intel-opencl-${NEO_VERSION_MAJOR}.${NEO_VERSION_MINOR}.${NEO_VERSION_BUILD}-${CPACK_RPM_PACKAGE_RELEASE}%{?dist}.${CPACK_RPM_PACKAGE_ARCHITECTURE}.rpm")
9799
set(CPACK_RPM_OCLOC_FILE_NAME "intel-opencl-ocloc-${NEO_VERSION_MAJOR}.${NEO_VERSION_MINOR}.${NEO_VERSION_BUILD}-${CPACK_RPM_PACKAGE_RELEASE}%{?dist}.${CPACK_RPM_PACKAGE_ARCHITECTURE}.rpm")
100+
set(CPACK_RPM_LEVEL-ZERO-GPU_FILE_NAME "intel-level-zero-gpu-${NEO_VERSION_MAJOR}.${NEO_VERSION_MINOR}.${NEO_VERSION_BUILD}-${CPACK_RPM_PACKAGE_RELEASE}%{?dist}.${CPACK_RPM_PACKAGE_ARCHITECTURE}.rpm")
101+
98102
set(CPACK_ARCHIVE_OPENCL_FILE_NAME "intel-opencl-${NEO_VERSION_MAJOR}.${NEO_VERSION_MINOR}.${NEO_VERSION_BUILD}-${CPACK_PACKAGE_ARCHITECTURE}")
99103
set(CPACK_ARCHIVE_OCLOC_FILE_NAME "intel-opencl-ocloc-${NEO_VERSION_MAJOR}.${NEO_VERSION_MINOR}.${NEO_VERSION_BUILD}-${CPACK_PACKAGE_ARCHITECTURE}")
104+
set(CPACK_ARCHIVE_LEVEL-ZERO-GPU_FILE_NAME "intel-level-zero-gpu-${NEO_VERSION_MAJOR}.${NEO_VERSION_MINOR}.${NEO_VERSION_BUILD}-${CPACK_PACKAGE_ARCHITECTURE}")
100105
else()
101106
if(CPACK_GENERATOR STREQUAL "DEB")
102-
set(CPACK_PACKAGE_FILE_NAME "intel-opencl_${NEO_VERSION_MAJOR}.${NEO_VERSION_MINOR}.${NEO_VERSION_BUILD}_${CPACK_DEBIAN_PACKAGE_ARCHITECTURE}")
107+
set(CPACK_PACKAGE_FILE_NAME "intel-compute-runtime_${NEO_VERSION_MAJOR}.${NEO_VERSION_MINOR}.${NEO_VERSION_BUILD}_${CPACK_DEBIAN_PACKAGE_ARCHITECTURE}")
103108
elseif(CPACK_GENERATOR STREQUAL "RPM")
104-
set(CPACK_PACKAGE_FILE_NAME "intel-opencl-${NEO_VERSION_MAJOR}.${NEO_VERSION_MINOR}.${NEO_VERSION_BUILD}-${CPACK_RPM_PACKAGE_RELEASE}%{?dist}.${CPACK_RPM_PACKAGE_ARCHITECTURE}.rpm")
109+
set(CPACK_PACKAGE_FILE_NAME "intel-compute-runtime-${NEO_VERSION_MAJOR}.${NEO_VERSION_MINOR}.${NEO_VERSION_BUILD}-${CPACK_RPM_PACKAGE_RELEASE}%{?dist}.${CPACK_RPM_PACKAGE_ARCHITECTURE}.rpm")
105110
else()
106-
set(CPACK_PACKAGE_FILE_NAME "intel-opencl-${NEO_VERSION_MAJOR}.${NEO_VERSION_MINOR}.${NEO_VERSION_BUILD}-${CPACK_PACKAGE_ARCHITECTURE}")
111+
set(CPACK_PACKAGE_FILE_NAME "intel-compute-runtime-${NEO_VERSION_MAJOR}.${NEO_VERSION_MINOR}.${NEO_VERSION_BUILD}-${CPACK_PACKAGE_ARCHITECTURE}")
107112
endif()
108113
endif()
109114

0 commit comments

Comments
 (0)