diff --git a/0001-CMakeLists-Set-the-correct-default-version.patch b/0001-CMakeLists-Set-the-correct-default-version.patch new file mode 100644 index 0000000..04f0229 --- /dev/null +++ b/0001-CMakeLists-Set-the-correct-default-version.patch @@ -0,0 +1,28 @@ +From e11528552885546a7c420d02599bb1bae01e89ff 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(-) + +diff --git a/CMakeLists.txt b/CMakeLists.txt +index bc8ce50..c1e8726 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -35,8 +35,8 @@ list ( APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake_modules" ) + + include ( utils ) + +-## Get the package version. The defaults to 1.0.0. +-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 + diff --git a/0001-Fix-install-targets.patch b/0001-Fix-install-targets.patch new file mode 100644 index 0000000..3cd4ab0 --- /dev/null +++ b/0001-Fix-install-targets.patch @@ -0,0 +1,37 @@ +From 7d37d6fb856a49a2927a8e31c949d0da4f9d20ed 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(-) + +diff --git a/CMakeLists.txt b/CMakeLists.txt +index bc8ce50..e5e575f 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 ) ++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" ) +-- +2.13.6 + diff --git a/hsakmt.spec b/hsakmt.spec index de63e02..1385083 100644 --- a/hsakmt.spec +++ b/hsakmt.spec @@ -1,57 +1,66 @@ +%global commit 172d101e103ae1dd6e1ed52aa708b65ba63e386d +%global shortcommit %(c=%{commit}; echo ${c:0:7}) + Name: hsakmt -Version: 1.0.0 -Release: 9%{?dist} +Version: 1.0.6 +Release: 1.20171026git%{shortcommit}%{?dist} Summary: AMD's HSA thunk library -Group: System Environment/Libraries -# The entire source code is MIT except auto-generated file ltmain.sh which is GPLv2 -License: MIT and GPLv2 -URL: http://cgit.freedesktop.org/amd/hsakmt/ -Source0: http://xorg.freedesktop.org/archive/individual/lib/hsakmt-%{version}.tar.bz2 -ExcludeArch: %{arm} %{ix86} -BuildRequires: automake autoconf libtool +License: MIT +URL: https://github.com/RadeonOpenCompute/ROCm +Source0: https://github.com/RadeonOpenCompute/ROCT-Thunk-Interface.git/archive/%{commit}/lib%{name}-%{shortcommit}.tar.gz +Patch0: 0001-Fix-install-targets.patch +Patch1: 0001-CMakeLists-Set-the-correct-default-version.patch + +ExclusiveArch: x86_64 +BuildRequires: cmake +BuildRequires: pciutils-devel %description -hsakmt is a thunk library for AMD's HSA Linux kernel driver (amdkfd) +This package includes the libhsakmt (Thunk) libraries +for AMD KFD + %package devel Summary: AMD HSA thunk library development package -Group: Development/Libraries -Requires: %{name}%{?isa} = %{version}-%{release} -Requires: pkgconfig +Requires: %{name}%{?_isa} = %{version}-%{release} %description devel Development library for hsakmt. %prep -%setup -q -n hsakmt-%{version} +%autosetup -n ROCT-Thunk-Interface-%{commit} -p1 %build -%configure \ - --disable-static +mkdir build +cd build -make %{?_smp_mflags} V=1 +%cmake .. -DCMAKE_BUILD_TYPE=RelWithDebInfo +%make_build %install -make install DESTDIR=%{buildroot} - -find %{buildroot} -type f -name "*.la" -delete +cd build +%make_install %post -p /sbin/ldconfig %postun -p /sbin/ldconfig %files -%license COPYING -%{_libdir}/libhsakmt-1*.so.* +%doc README.md +%license LICENSE.md +%{_libdir}/libhsakmt.so.%{version} +%{_libdir}/libhsakmt.so.1 %files devel -%dir %{_includedir}/hsakmt-1 -%{_includedir}/hsakmt-1/hsakmt.h -%{_includedir}/hsakmt-1/hsakmttypes.h -%{_libdir}/libhsakmt-1*.so -%{_libdir}/pkgconfig/hsakmt-1.pc +%{_libdir}/libhsakmt.so +%{_includedir}/libhsakmt/hsakmt.h +%{_includedir}/libhsakmt/hsakmttypes.h +%{_includedir}/libhsakmt/linux/kfd_ioctl.h %changelog +* Thu Oct 26 2017 Tom Stellard - 1.0.6-1.20171026git172d101 +- Update with latest code from https://github.com/RadeonOpenCompute/ROCT-Thunk-Interface + * Wed Aug 02 2017 Fedora Release Engineering - 1.0.0-9 - Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Binutils_Mass_Rebuild @@ -80,3 +89,4 @@ find %{buildroot} -type f -name "*.la" -delete * Sat Oct 24 2015 Oded Gabbay 1.0.0-1 - Initial release of hsakmt, ver. 1.0.0 +