-
Notifications
You must be signed in to change notification settings - Fork 184
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #8371 from fwyzard/IB/CMSSW_13_0_X/master_repackag…
…e_rocm Package the HIP/ROCm and ROCrand libraries [13.0.x]
- Loading branch information
Showing
7 changed files
with
129 additions
and
84 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
### RPM external rocm-rocrand 5.4.3 | ||
## NOCOMPILER | ||
|
||
%if "%{rhel}" == "7" | ||
# allow rpm2cpio dependency on the bootstrap bundle | ||
%undefine drop_bootstrap_lib | ||
%define drop_bootstrap_lib true | ||
%define repository repo.radeon.com/rocm/yum | ||
%else | ||
%define repository repo.radeon.com/rocm/rhel%{rhel} | ||
%endif | ||
|
||
Source0: https://%{repository}/%{realversion}/main/rocrand-2.10.9.50403-121.el%{rhel}.%{_arch}.rpm | ||
Source1: https://%{repository}/%{realversion}/main/rocrand-devel-2.10.9.50403-121.el%{rhel}.%{_arch}.rpm | ||
Requires: rocm | ||
|
||
%prep | ||
|
||
%build | ||
rpm2cpio %{SOURCE0} | cpio -idmv | ||
rpm2cpio %{SOURCE1} | cpio -idmv | ||
|
||
%install | ||
rmdir %{i} | ||
mv opt/rocm-%{realversion} %{i} | ||
rm -rf opt | ||
rm -rf usr | ||
|
||
%post |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,79 +1,77 @@ | ||
### RPM external rocm 5.4.3 | ||
## NOCOMPILER | ||
Source: none | ||
Provides: libamd_comgr.so.2()(64bit) | ||
Provides: libhsa-runtime64.so.1()(64bit) | ||
Provides: librocm-core.so.1()(64bit) | ||
Provides: librocm_smi64.so.5()(64bit) | ||
Provides: libamdhip64.so.5()(64bit) | ||
Provides: libamdhip64.so.5(hip_4.2)(64bit) | ||
|
||
# This rpm packages only symlinks to an installation that is already on CVMFS. | ||
# Configure pkgtools to keep the static libraries, to avoid actually trying to | ||
# delete them from CVMFS. | ||
%define keep_archives true | ||
%if "%{rhel}" == "7" | ||
# allow rpm2cpio dependency on the bootstrap bundle | ||
%undefine drop_bootstrap_lib | ||
%define drop_bootstrap_lib true | ||
%define repository repo.radeon.com/rocm/yum | ||
%else | ||
%define repository repo.radeon.com/rocm/rhel%{rhel} | ||
%endif | ||
|
||
Source0: https://%{repository}/%{realversion}/main/comgr-2.4.0.50403-121.el%{rhel}.%{_arch}.rpm | ||
Source1: https://%{repository}/%{realversion}/main/hip-devel-5.4.22804.50403-121.el%{rhel}.%{_arch}.rpm | ||
Source2: https://%{repository}/%{realversion}/main/hip-runtime-amd-5.4.22804.50403-121.el%{rhel}.%{_arch}.rpm | ||
Source3: https://%{repository}/%{realversion}/main/hsa-rocr-1.7.0.50403-121.el%{rhel}.%{_arch}.rpm | ||
Source4: https://%{repository}/%{realversion}/main/rocm-core-5.4.3.50403-121.el%{rhel}.%{_arch}.rpm | ||
Source5: https://%{repository}/%{realversion}/main/rocm-dbgapi-0.68.0.50403-121.el%{rhel}.%{_arch}.rpm | ||
Source6: https://%{repository}/%{realversion}/main/rocm-device-libs-1.0.0.50403-121.el%{rhel}.%{_arch}.rpm | ||
Source7: https://%{repository}/%{realversion}/main/rocm-llvm-15.0.0.23045.50403-121.el%{rhel}.%{_arch}.rpm | ||
Source8: https://%{repository}/%{realversion}/main/rocm-smi-lib-5.0.0.50403-121.el%{rhel}.%{_arch}.rpm | ||
Source9: https://%{repository}/%{realversion}/main/rocminfo-1.0.0.50403-121.el%{rhel}.%{_arch}.rpm | ||
Requires: numactl | ||
Requires: python3 | ||
|
||
%prep | ||
|
||
%build | ||
rpm2cpio %{SOURCE0} | cpio -idmv | ||
rpm2cpio %{SOURCE1} | cpio -idmv | ||
rpm2cpio %{SOURCE2} | cpio -idmv | ||
rpm2cpio %{SOURCE3} | cpio -idmv | ||
rpm2cpio %{SOURCE4} | cpio -idmv | ||
rpm2cpio %{SOURCE5} | cpio -idmv | ||
rpm2cpio %{SOURCE6} | cpio -idmv | ||
rpm2cpio %{SOURCE7} | cpio -idmv | ||
rpm2cpio %{SOURCE8} | cpio -idmv | ||
rpm2cpio %{SOURCE9} | cpio -idmv | ||
|
||
%install | ||
OSDIR=/cvmfs/patatrack.cern.ch/externals/%{_arch}/rhel%{rhel} | ||
if ! [ -d $OSDIR ]; then | ||
OSDIR=/cvmfs/patatrack.cern.ch/externals/%{_arch}/unknown | ||
fi | ||
BASEDIR=${OSDIR}/amd/%{n}-%{realversion} | ||
|
||
# Symlink individual files from ${BASEDIR}/bin/ | ||
mkdir %{i}/bin | ||
test -d ${BASEDIR}/bin | ||
test -e ${BASEDIR}/bin/hipcc | ||
ln -s ${BASEDIR}/bin/* %{i}/bin/ | ||
# Remove the OpenCL extra files | ||
rm -f %{i}/bin/{clang-ocl,clinfo} | ||
# Remove the OpenMP extra files | ||
rm -f %{i}/bin/{aompcc,mygpu,mymcpu} | ||
# Remove the Fortran files | ||
rm -f %{i}/bin/hipfc | ||
# Remove the MI tools | ||
rm -f %{i}/bin/{MIOpenDriver,migraphx-driver,runvx} | ||
# Remove the datacenter tools and validation suite binaries | ||
rm -f %{i}/bin/{rdcd,rdci,rvs} | ||
# Remove some of the prebuilt samples | ||
rm -f %{i}/bin/{sgemmv,simple_dlrm,simple_gemm} | ||
|
||
# ROCm/HIP core tools | ||
DIRECTORIES="amdgcn hip hsa hsa-amd-aqlprofile include lib libexec llvm share" | ||
|
||
# rocm-smi | ||
DIRECTORIES+=" oam rocm_smi" | ||
|
||
# ROCm Tracer Callback/Activity Library (rocTRACER) and profiler library (ROC-profiler) | ||
DIRECTORIES+=" rocprofiler roctracer" | ||
|
||
# Asynchronous Task and Memory Interface (ATMI) | ||
#DIRECTORIES+=" atmi" | ||
|
||
# OpenCL support | ||
#DIRECTORIES+=" opencl tests" | ||
|
||
# ROCm Communication Collectives Library (RCCL) | ||
#DIRECTORIES+=" rccl" | ||
|
||
# Machine Intelligence Libraries | ||
#DIRECTORIES+=" miopen miopengemm" | ||
|
||
# HIP Fortran interface (hipfort) | ||
#DIRECTORIES+=" hipfort" | ||
|
||
# ROCm Data Center Tool (RDC) | ||
#DIRECTORIES+=" rdc" | ||
|
||
# ROCm Validation Suite (RVS) | ||
#DIRECTORIES+=" rvs" | ||
|
||
# symlink the other directories from ${BASEDIR}/ | ||
for D in ${DIRECTORIES}; do | ||
ln -s ${BASEDIR}/${D} %{i}/ | ||
test -L %{i}/${D} | ||
done | ||
rmdir %{i} | ||
mv opt/rocm-%{realversion} %{i} | ||
rm -rf opt | ||
rm -rf usr | ||
|
||
# the hip directory is deprecated in favour of the main directory | ||
rm -r -f %{i}/hip/ | ||
|
||
# hip-devel postinstall | ||
ln -s -f amd_detail %{i}/include/hip/hcc_detail | ||
ln -s -f nvidia_detail %{i}/include/hip/nvcc_detail | ||
# deprecated | ||
#ln -s -f amd_detail %{i}/hip/include/hip/hcc_detail | ||
#ln -s -f nvidia_detail %{i}/hip/include/hip/nvcc_detail | ||
|
||
# hip-runtime-amd postinstall | ||
# deprecated | ||
#mkdir -p %{i}/hip/lib/cmake/hip | ||
#mkdir -p %{i}/hip/lib/cmake/hip-lang | ||
#ln -r -s -f %{i}/lib/cmake/hip/hip-targets* %{i}/hip/lib/cmake/hip/ | ||
#ln -r -s -f %{i}/lib/cmake/hip-lang/hip-lang-targets* %{i}/hip/lib/cmake/hip-lang/ | ||
|
||
# rocm-llvm postinstall | ||
mkdir -p %{i}/bin | ||
ln -r -s -f %{i}/llvm/bin/amdclang %{i}/bin/ | ||
ln -r -s -f %{i}/llvm/bin/amdclang++ %{i}/bin/ | ||
ln -r -s -f %{i}/llvm/bin/amdclang-cl %{i}/bin/ | ||
ln -r -s -f %{i}/llvm/bin/amdclang-cpp %{i}/bin/ | ||
ln -r -s -f %{i}/llvm/bin/amdflang %{i}/bin/ | ||
ln -r -s -f %{i}/llvm/bin/amdlld %{i}/bin/ | ||
|
||
# replace '/usr/libexec/platform-python' with '/usr/bin/env python3' | ||
find %{i}/bin/ %{i}/libexec/ %{i}/llvm/bin/ %{i}/llvm/lib/ -type f | xargs -r \ | ||
grep '#! */usr/libexec/platform-python' -l | xargs -r \ | ||
sed -e'1 s|#! */usr/libexec/platform-python|#!/usr/bin/env python3|' -s -i | ||
|
||
%post |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
<tool name="rocm-rocrand" version="@TOOL_VERSION@"> | ||
<info url="https://github.com/ROCmSoftwarePlatform/rocRAND"/> | ||
<use name="rocm"/> | ||
<lib name="hiprand"/> | ||
<lib name="rocrand"/> | ||
<client> | ||
<environment name="ROCM_ROCRAND_BASE" default="@TOOL_ROOT@"/> | ||
<environment name="LIBDIR" default="$ROCM_ROCRAND_BASE/lib"/> | ||
<environment name="INCLUDE" default="$ROCM_ROCRAND_BASE/include"/> | ||
</client> | ||
<!-- use -isystem instead of -I to silence warnings in the HIP/ROCm headers --> | ||
<flags SYSTEM_INCLUDE="1"/> | ||
<runtime name="ROOT_INCLUDE_PATH" value="$INCLUDE" type="path" join="1"/> | ||
</tool> |
This file was deleted.
Oops, something went wrong.