diff --git a/0001-CMakeLists-Set-the-correct-default-version.patch b/0001-CMakeLists-Set-the-correct-default-version.patch index 04f0229..61d4264 100644 --- a/0001-CMakeLists-Set-the-correct-default-version.patch +++ b/0001-CMakeLists-Set-the-correct-default-version.patch @@ -1,28 +1,26 @@ -From e11528552885546a7c420d02599bb1bae01e89ff Mon Sep 17 00:00:00 2001 +From 7caed15e2b9ee7a8ba50331d394aa33a5efc6e83 Mon Sep 17 00:00:00 2001 From: Tom Stellard Date: Thu, 12 Oct 2017 20:50:06 -0700 Subject: [PATCH] CMakeLists: Set the correct default version The default version is used if cmake cannot infer the version from the git tags. --- - CMakeLists.txt | 4 ++-- - 1 file changed, 2 insertions(+), 2 deletions(-) + CMakeLists.txt | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt -index bc8ce50..c1e8726 100644 +index cb2605b..9e5ea51 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt -@@ -35,8 +35,8 @@ list ( APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake_modules" ) +@@ -42,7 +42,7 @@ include ( utils ) + include ( GNUInstallDirs ) - include ( utils ) - --## Get the package version. The defaults to 1.0.0. + ## Setup the package version. -get_version ( "1.0.0" ) -+## Get the package version. +get_version ( "1.0.6" ) set ( BUILD_VERSION_MAJOR ${VERSION_MAJOR} ) set ( BUILD_VERSION_MINOR ${VERSION_MINOR} ) -- -2.13.6 +2.17.0 diff --git a/0001-Fix-build-with-gcc-8.patch b/0001-Fix-build-with-gcc-8.patch deleted file mode 100644 index f1801a4..0000000 --- a/0001-Fix-build-with-gcc-8.patch +++ /dev/null @@ -1,31 +0,0 @@ -From 2f833f3868f30c27e9ad8fd75b5730267d9e17e8 Mon Sep 17 00:00:00 2001 -From: Tom Stellard -Date: Mon, 5 Feb 2018 08:59:51 -0800 -Subject: [PATCH] Fix build with gcc 8 - -src/topology.c:830:3: error: 'strncpy' specified bound 64 equals destination size [-Werror=stringop-truncation] - strncpy((char *)props->AMDName, hsa_gfxip->amd_name, sizeof(props->AMDName)); - ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ---- - src/topology.c | 5 ++++- - 1 file changed, 4 insertions(+), 1 deletion(-) - -diff --git a/src/topology.c b/src/topology.c -index ef330af..2446e1f 100644 ---- a/src/topology.c -+++ b/src/topology.c -@@ -827,7 +827,10 @@ HSAKMT_STATUS topology_sysfs_get_node_props(uint32_t node_id, - } - - /* Retrieve the CAL name of the node */ -- strncpy((char *)props->AMDName, hsa_gfxip->amd_name, sizeof(props->AMDName)); -+ /* FIXME: This could be sizeof(props->AMDName), but we need to use -+ * sizeof(props->AMDName) - 1 to work around a bug in gcc 8.*/ -+ strncpy((char *)props->AMDName, hsa_gfxip->amd_name, sizeof(props->AMDName) - 1); -+ props->AMDName[sizeof(props->AMDName) - 1] = '\0'; - if (props->NumCPUCores) { - /* Is APU node */ - ret = topology_get_cpu_model_name(props, true); --- -2.13.6 - diff --git a/0001-Fix-install-targets.patch b/0001-Fix-install-targets.patch index 3cd4ab0..4426f34 100644 --- a/0001-Fix-install-targets.patch +++ b/0001-Fix-install-targets.patch @@ -1,37 +1,26 @@ -From 7d37d6fb856a49a2927a8e31c949d0da4f9d20ed Mon Sep 17 00:00:00 2001 +From 6d4c181d99e28788727935110df4d1f89a8725e7 Mon Sep 17 00:00:00 2001 From: Tom Stellard Date: Thu, 12 Oct 2017 15:48:49 -0700 Subject: [PATCH] Fix install targets --- - CMakeLists.txt | 14 +++++++------- - 1 file changed, 7 insertions(+), 7 deletions(-) + CMakeLists.txt | 3 +++ + 1 file changed, 3 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt -index bc8ce50..e5e575f 100644 +index 9e5ea51..75cac45 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt -@@ -99,13 +99,13 @@ add_custom_target ( ${HSAKMT_COMPONENT} ALL WORKING_DIRECTORY ${CMAKE_CURRENT_BI - add_custom_target ( ${HSAKMT_COMPONENT}.so-link ALL WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} COMMAND ${CMAKE_COMMAND} -E create_symlink ../${HSAKMT_COMPONENT}/lib/${HSAKMT_COMPONENT}.so ${HSAKMT_COMPONENT}.so-link ) - - ## Set the install targets --install ( TARGETS ${HSAKMT_TARGET} LIBRARY DESTINATION libhsakmt/lib COMPONENT ${HSAKMT_COMPONENT} ) --install ( FILES ${CMAKE_CURRENT_SOURCE_DIR}/LICENSE.md DESTINATION libhsakmt ) --install ( FILES ${CMAKE_CURRENT_SOURCE_DIR}/include/hsakmt.h DESTINATION libhsakmt/include/libhsakmt ) --install ( FILES ${CMAKE_CURRENT_SOURCE_DIR}/include/hsakmttypes.h DESTINATION libhsakmt/include/libhsakmt ) --install ( FILES ${CMAKE_CURRENT_SOURCE_DIR}/include/linux/kfd_ioctl.h DESTINATION libhsakmt/include/libhsakmt/linux ) --install ( FILES ${CMAKE_CURRENT_BINARY_DIR}/${HSAKMT_COMPONENT}-link DESTINATION include RENAME ${HSAKMT_COMPONENT} ) --install ( FILES ${CMAKE_CURRENT_BINARY_DIR}/${HSAKMT_COMPONENT}.so-link DESTINATION lib RENAME ${HSAKMT_COMPONENT}.so ) -+install ( TARGETS ${HSAKMT_TARGET} LIBRARY DESTINATION lib64 COMPONENT ${HSAKMT_COMPONENT} ) -+#install ( FILES ${CMAKE_CURRENT_SOURCE_DIR}/LICENSE.md DESTINATION libhsakmt ) +@@ -140,6 +140,9 @@ add_custom_target ( package-dev DEPENDS build-dev + ## Add the install directives for the runtime library. + install ( TARGETS ${HSAKMT_TARGET} DESTINATION ${CMAKE_INSTALL_LIBDIR} ) + install ( FILES ${SOURCE_DIR}/LICENSE.md DESTINATION libhsakmt ) +install ( FILES ${CMAKE_CURRENT_SOURCE_DIR}/include/hsakmt.h DESTINATION include/libhsakmt ) +install ( FILES ${CMAKE_CURRENT_SOURCE_DIR}/include/hsakmttypes.h DESTINATION include/libhsakmt ) +install ( FILES ${CMAKE_CURRENT_SOURCE_DIR}/include/linux/kfd_ioctl.h DESTINATION include/libhsakmt/linux ) -+#install ( FILES ${CMAKE_CURRENT_BINARY_DIR}/${HSAKMT_COMPONENT}-link DESTINATION include RENAME ${HSAKMT_COMPONENT} ) -+#install ( FILES ${CMAKE_CURRENT_BINARY_DIR}/${HSAKMT_COMPONENT}.so-link DESTINATION lib RENAME ${HSAKMT_COMPONENT}.so ) - ## Packaging directives - set ( CPACK_PACKAGE_NAME "hsakmt-roct-dev" ) + ## Add the packaging directives for the runtime library. + set ( CPACK_PACKAGE_NAME ${HSAKMT_PACKAGE} ) -- -2.13.6 +2.17.0 diff --git a/0001-Use-CFLAGS-and-LDFLAGS-specified-in-environment-vari.patch b/0001-Use-CFLAGS-and-LDFLAGS-specified-in-environment-vari.patch index e183053..1101cc4 100644 --- a/0001-Use-CFLAGS-and-LDFLAGS-specified-in-environment-vari.patch +++ b/0001-Use-CFLAGS-and-LDFLAGS-specified-in-environment-vari.patch @@ -1,4 +1,4 @@ -From c321b9a6640b74980f03b45d9dbd8067d279d3c0 Mon Sep 17 00:00:00 2001 +From 28f2eece4ab087eb03e54864e59d2f2a8711352e Mon Sep 17 00:00:00 2001 From: Tom Stellard Date: Mon, 12 Feb 2018 07:56:20 -0800 Subject: [PATCH] Use CFLAGS and LDFLAGS specified in environment variables @@ -8,24 +8,27 @@ Subject: [PATCH] Use CFLAGS and LDFLAGS specified in environment variables 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt -index bc8ce50..75f5339 100644 +index 75cac45..b41d789 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt -@@ -52,12 +52,12 @@ set ( BUILD_VERSION_STRING "${BUILD_VERSION_MAJOR}.${BUILD_VERSION_MINOR}.${BUIL - set ( CMAKE_VERBOSE_MAKEFILE on ) +@@ -59,7 +59,7 @@ set ( BUILD_VERSION_STRING "${BUILD_VERSION_MAJOR}.${BUILD_VERSION_MINOR}.${BUIL + #set ( CMAKE_VERBOSE_MAKEFILE on ) ## Compiler flags --set ( CMAKE_C_FLAGS "-fPIC -W -Wall -Wextra -Werror -Wno-unused-parameter -Wformat-security -Wswitch-default -Wundef -Wshadow -Wpointer-arith -Wbad-function-cast -Wcast-qual -Wlogical-op -Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations -Wredundant-decls -Wunreachable-code -std=gnu99 -fvisibility=hidden -O2" ) -+set ( CMAKE_C_FLAGS "-fPIC -W -Wall -Wextra -Werror -Wno-unused-parameter -Wformat-security -Wswitch-default -Wundef -Wshadow -Wpointer-arith -Wbad-function-cast -Wcast-qual -Wlogical-op -Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations -Wredundant-decls -Wunreachable-code -std=gnu99 -fvisibility=hidden -O2 $ENV{CFLAGS}" ) - +-set ( CMAKE_C_FLAGS "-fPIC -W -Wall -Wextra -Wno-unused-parameter -Wformat-security -Wswitch-default -Wundef -Wshadow -Wpointer-arith -Wbad-function-cast -Wcast-qual -Wlogical-op -Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations -Wredundant-decls -Wunreachable-code -std=gnu99 -fvisibility=hidden" ) ++set ( CMAKE_C_FLAGS "-fPIC -W -Wall -Wextra -Wno-unused-parameter -Wformat-security -Wswitch-default -Wundef -Wshadow -Wpointer-arith -Wbad-function-cast -Wcast-qual -Wlogical-op -Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations -Wredundant-decls -Wunreachable-code -std=gnu99 -fvisibility=hidden $ENV{CFLAGS}" ) + if ( "${CMAKE_C_COMPILER_VERSION}" STRGREATER "4.8.0") + set ( CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Werror" ) + endif () +@@ -73,7 +73,7 @@ endif () set ( HSAKMT_LINKER_SCRIPT "${CMAKE_CURRENT_SOURCE_DIR}/src/libhsakmt.ver" ) ## Linker Flags --set ( CMAKE_SHARED_LINKER_FLAGS "-Wl,--version-script=${HSAKMT_LINKER_SCRIPT} -Wl,-soname=${HSAKMT_COMPONENT}.so.$(VERSION_MAJOR) -Wl,-z,nodelete" ) -+set ( CMAKE_SHARED_LINKER_FLAGS "-Wl,--version-script=${HSAKMT_LINKER_SCRIPT} -Wl,-soname=${HSAKMT_COMPONENT}.so.$(VERSION_MAJOR) -Wl,-z,nodelete $ENV{LDFLAGS}" ) +-set ( CMAKE_SHARED_LINKER_FLAGS "-Wl,--version-script=${HSAKMT_LINKER_SCRIPT} -Wl,-soname=${HSAKMT_COMPONENT}.so.$(PROJECT_VERSION_MAJOR) -Wl,-z,nodelete -Wl,-no-undefined" ) ++set ( CMAKE_SHARED_LINKER_FLAGS "-Wl,--version-script=${HSAKMT_LINKER_SCRIPT} -Wl,-soname=${HSAKMT_COMPONENT}.so.$(PROJECT_VERSION_MAJOR) -Wl,-z,nodelete -Wl,-no-undefined $ENV{LDFLAGS}" ) ## Source files - set ( HSAKMT_SRC ${HSAKMT_SRC} src/debug.c ) + set ( HSAKMT_SRC "src/debug.c" -- -2.13.6 +2.17.0 diff --git a/hsakmt.spec b/hsakmt.spec index b110229..f7ac82c 100644 --- a/hsakmt.spec +++ b/hsakmt.spec @@ -1,24 +1,22 @@ -%global commit 172d101e103ae1dd6e1ed52aa708b65ba63e386d -%global shortcommit %(c=%{commit}; echo ${c:0:7}) - +%global rocm_version 2.0.0 Name: hsakmt Version: 1.0.6 -Release: 6.20171026git%{shortcommit}%{?dist} +Release: 7.rocm%{rocm_version}%{?dist} Summary: AMD's HSA thunk library License: MIT URL: https://github.com/RadeonOpenCompute/ROCm -Source0: https://github.com/RadeonOpenCompute/ROCT-Thunk-Interface/archive/%{commit}/lib%{name}-%{shortcommit}.tar.gz +Source0: https://github.com/RadeonOpenCompute/ROCT-Thunk-Interface/archive/roc-%{rocm_version}.tar.gz Patch0: 0001-Fix-install-targets.patch Patch1: 0001-CMakeLists-Set-the-correct-default-version.patch -Patch2: 0001-Fix-build-with-gcc-8.patch -Patch3: 0001-Use-CFLAGS-and-LDFLAGS-specified-in-environment-vari.patch +Patch2: 0001-Use-CFLAGS-and-LDFLAGS-specified-in-environment-vari.patch ExclusiveArch: x86_64 aarch64 BuildRequires: gcc BuildRequires: gcc-c++ BuildRequires: cmake BuildRequires: pciutils-devel +BuildRequires: numactl-devel %if 0%{?epel} == 7 # We still the original cmake package on epel, because it provides the @@ -40,7 +38,7 @@ Requires: %{name}%{?_isa} = %{version}-%{release} Development library for hsakmt. %prep -%autosetup -n ROCT-Thunk-Interface-%{commit} -p1 +%autosetup -n ROCT-Thunk-Interface-roc-%{rocm_version} -p1 %build mkdir build @@ -53,6 +51,8 @@ cd build cd build %make_install +rm %{buildroot}/usr/libhsakmt/LICENSE.md + %post -p /sbin/ldconfig %postun -p /sbin/ldconfig @@ -69,6 +69,9 @@ cd build %{_includedir}/libhsakmt/linux/kfd_ioctl.h %changelog +* Tue Jan 15 2019 Tom Stellard - 1.0.6-7.rocm2.0.0 +- ROCm 2.0.0 Release + * Fri Jul 13 2018 Fedora Release Engineering - 1.0.6-6.20171026git172d101 - Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild