-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathrocm-rocfft.spec
169 lines (125 loc) · 4.28 KB
/
rocm-rocfft.spec
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
%undefine _auto_set_build_flags
%define _build_id_links none
%global pkgname rocm-rocfft
%global pkgver %{ROCM_MAJOR_VERSION}.%{ROCM_MINOR_VERSION}.%{ROCM_PATCH_VERSION}.%{ROCM_LIBPATCH_VERSION}
%global builddir %{_builddir}/%{pkgname}-%{pkgver}
%global ROCM_MAJOR_VERSION 5
%global ROCM_MINOR_VERSION 2
%global ROCM_PATCH_VERSION 3
%global ROCM_MAGIC_VERSION 109
%global ROCM_INSTALL_DIR /opt/rocm-%{ROCM_MAJOR_VERSION}.%{ROCM_MINOR_VERSION}.%{ROCM_PATCH_VERSION}
%global ROCM_GLOBAL_DIR /opt/rocm
%global ROCM_LIBPATCH_VERSION 50203
%global ROCM_GIT_DIR %{builddir}/rocm-build/git
%global ROCM_GIT_TAG rocm-5.2.x
%global ROCM_BUILD_DIR %{builddir}/rocm-build/build
%global ROCM_PATCH_DIR %{builddir}/rocm-build/patch
%global ROCM_GIT_URL_1 https://github.com/ROCmSoftwarePlatform/rocFFT
%global ROCM_GIT_REL_TAG "release/rocm-rel-5.2"
%global toolchain clang
BuildRequires: binutils-devel
BuildRequires: clang
BuildRequires: cmake
BuildRequires: gcc
BuildRequires: gcc-c++
BuildRequires: gnupg2
BuildRequires: libedit-devel
BuildRequires: libffi-devel
BuildRequires: multilib-rpm-config
BuildRequires: ncurses-devel
BuildRequires: ninja-build
BuildRequires: python3-devel
BuildRequires: python3-psutil
BuildRequires: python3-recommonmark
BuildRequires: python3-setuptools
BuildRequires: python3-sphinx
BuildRequires: valgrind-devel
BuildRequires: zlib-devel
BuildRequires: clang
BuildRequires: cmake
BuildRequires: doxygen
BuildRequires: elfutils-libelf
BuildRequires: elfutils-libelf-devel
BuildRequires: gcc-plugin-devel
BuildRequires: git
BuildRequires: rocm-hsa-devel
BuildRequires: rocm-hsakmt-roct-devel
BuildRequires: libdrm
BuildRequires: libdrm-devel
BuildRequires: libglvnd-devel
BuildRequires: ninja-build
BuildRequires: numactl
BuildRequires: numactl-devel
BuildRequires: perl
BuildRequires: python3
BuildRequires: python3-devel
BuildRequires: rocm-cmake
BuildRequires: rocm-comgr-devel
BuildRequires: rocm-core
BuildRequires: rocm-device-libs
BuildRequires: rocm-hip-runtime
BuildRequires: rocm-hip-devel
BuildRequires: rocm-llvm
#BuildRequires: rocminfo
BuildRequires: wget
BuildArch: x86_64
Name: %{pkgname}
Version: %{pkgver}
Release: copr%{?dist}
License: MIT
Group: System Environment/Libraries
Summary: Radeon Open Compute - FFT implementation
%description
Radeon Open Compute - FFT implementation
%package runtime
Provides: rocfft
Provides: rocfft(x86-64)
Requires: rocm-hip-runtime
Summary: Radeon Open Compute - FFT implementation
%package devel
Provides: rocfft-devel
Provides: rocfft-devel(x86-64)
Requires: rocm-hip-runtime
Requires: rocfft
Summary: Radeon Open Compute - FFT development kit
%description runtime
Radeon Open Compute - FFT implementation
%description devel
Radeon Open Compute - FFT development kit
%build
# Make basic structure
mkdir -p %{ROCM_GIT_DIR}
mkdir -p %{ROCM_BUILD_DIR}
mkdir -p %{ROCM_PATCH_DIR}
# Level 1 : Sources
cd %{ROCM_GIT_DIR}
git clone -b %{ROCM_GIT_REL_TAG} %{ROCM_GIT_URL_1}
# Level 2 : Build
mkdir -p %{ROCM_BUILD_DIR}/%{pkgname}
cd %{ROCM_BUILD_DIR}/%{pkgname}
export HIP_CXXFLAGS='-D_GNU_SOURCE -isystem /usr/include/c++/12 -isystem /usr/include/c++/12/x86_64-redhat-linux'
export HIP_CFLAGS='-D_GNU_SOURCE -isystem /usr/include/c++/12 -isystem /usr/include/c++/12/x86_64-redhat-linux'
export CXX=%{ROCM_GLOBAL_DIR}/bin/hipcc
export CC=%{ROCM_GLOBAL_DIR}/bin/hipcc
export AMDGPU_TARGETS=gfx803
cmake -GNinja -S "%{ROCM_GIT_DIR}/rocFFT-rocm" \
-DCMAKE_INSTALL_PREFIX="%{ROCM_INSTALL_DIR}" \
-DAMDGPU_TARGETS="$AMDGPU_TARGETS" \
-DCMAKE_BUILD_WITH_INSTALL_RPATH=ON
ninja -j$(nproc)
# Level 3 : Package
DESTDIR="%{buildroot}" ninja -j$(nproc) install
mkdir -p %{buildroot}/etc/ld.so.conf.d
touch %{buildroot}/etc/ld.so.conf.d/10-rocm-rocfft.conf
echo "%{ROCM_GLOBAL_DIR}/rocfft/lib" > %{buildroot}/etc/ld.so.conf.d/10-rocm-rocfft.conf
%files runtime
/etc/ld.so.conf.d/*
%{ROCM_INSTALL_DIR}/share/doc/rocfft/LICENSE*
%{ROCM_INSTALL_DIR}/lib/librocfft*
%{ROCM_INSTALL_DIR}/bin/rocfft_rtc_helper
%files devel
%{ROCM_INSTALL_DIR}/rocfft/lib/cmake/rocfft*
%{ROCM_INSTALL_DIR}/rocfft/lib/librocfft*
%{ROCM_INSTALL_DIR}/lib/cmake/rocfft/rocfft*
%{ROCM_INSTALL_DIR}}/include/rocfft/rocfft*
%{ROCM_INSTALL_DIR}/include/rocfft*