-
Notifications
You must be signed in to change notification settings - Fork 183
/
OpenBLAS.spec
49 lines (43 loc) · 1.52 KB
/
OpenBLAS.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
### RPM external OpenBLAS 0.3.27
## INCLUDE compilation_flags
## INCLUDE microarch_flags
Source: https://github.com/xianyi/OpenBLAS/archive/v%{realversion}.tar.gz
%prep
%setup -n %{n}-%{realversion}
%build
%ifarch x86_64
XTARGETS="sse3=CORE2"
for t in nehalem sandybridge haswell ; do
XTARGETS="${XTARGETS} $t=$(echo $t | tr 'a-z' 'A-Z')"
done
XTARGETS="${XTARGETS} skylake-avx512=SKYLAKEX"
XTARGETS="${XTARGETS} x86-64-v2=NEHALEM"
XTARGETS="${XTARGETS} x86-64-v3=HASWELL"
XTARGETS="${XTARGETS} x86-64-v4=SKYLAKEX"
STARGET=$(echo %{selected_microarch} | sed 's|^-m||;s|^arch=||')
TARGET_ARCH=$(echo ${XTARGETS} | tr ' ' '\n' | grep "^${STARGET}=" | sed "s|^${STARGET}=||")
if [ "${TARGET_ARCH}" == "" ] ; then
echo "ERROR: Unable to match OpenBlas build target '${STARGET}'. Available build targets are"
echo "${XTARGETS}" | tr ' ' '\n' | sed 's|=.*||'
echo "Please use one of the supported targets or add support for $%{STARGET}'"
exit 1
fi
%endif
# PRESCOTT is a generic x86-64 target https://github.com/xianyi/OpenBLAS/issues/685
%define build_opts FC=gfortran BINARY=64 NUM_THREADS=256 DYNAMIC_ARCH=0 MAKE_NB_JOBS=%{compiling_processes}
%ifarch x86_64
make %{build_opts} TARGET=${TARGET_ARCH}
%endif
%ifarch aarch64
make %{build_opts} TARGET=ARMV8 CFLAGS="%{arch_build_flags}"
%endif
%ifarch ppc64le
make %{build_opts} CFLAGS="%{arch_build_flags}"
%endif
%ifarch riscv64
make %{build_opts} TARGET=RISCV64_GENERIC shared
%endif
%install
make install PREFIX=%i MAKE_NB_JOBS=%{compiling_processes}
%post
%relocateConfigAll lib/cmake *.cmake