openblas-vl.spec 27 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902
  1. # Version of bundled lapack
  2. %global lapackver 3.8.0
  3. %global lapacke 1
  4. # Build 64-bit interface binaries?
  5. %ifarch %{ix86}
  6. %global build64 0
  7. %global libblas libblas.so.3 libcblas.so.3
  8. %global liblapack liblapack.so.3 liblapacke.so.3
  9. %endif
  10. %ifarch x86_64
  11. %global build64 1
  12. %global libblas libblas.so.3()(64bit) libcblas.so.3()(64bit)
  13. %global liblapack liblapack.so.3()(64bit) liblapacke.so.3()(64bit)
  14. %endif
  15. Summary: An optimized BLAS library based on GotoBLAS2
  16. Name: openblas
  17. Version: 0.3.13
  18. Release: 1%{?_dist_release}
  19. Group: system
  20. License: BSD
  21. URL: https://github.com/xianyi/OpenBLAS/
  22. # Source0: https://github.com/xianyi/OpenBLAS/archive/v%{version}.tar.gz
  23. Source0: https://github.com/xianyi/OpenBLAS/archive/v%{version}.tar.gz#/OpenBLAS-%{version}.tar.gz
  24. # pkg-config file (modoified)
  25. Source11: blas.pc.in
  26. Source12: cblas.pc.in
  27. Source13: lapack.pc.in
  28. Source14: lapacke.pc.in
  29. # Drop extra p from threaded library name
  30. Patch1: openblas-0.2.5-libname.patch
  31. # # Supply the proper flags to the test makefile
  32. # Patch2: openblas-0.2.19-tests.patch
  33. # # Disable CPU affinity, from upstream
  34. # Patch3: https://patch-diff.githubusercontent.com/raw/xianyi/OpenBLAS/pull/1495.patch
  35. BuildRoot: %{_tmppath}/%{name}-%{version}-root
  36. BuildRequires: gcc-gfortran
  37. Provides: blas lapack = %{lapackver} %{libblas} %{liblapack}
  38. ExclusiveArch: x86_64 %{ix86}
  39. %global base_description \
  40. OpenBLAS is an optimized BLAS library based on GotoBLAS2 1.13 BSD \
  41. version. The project is supported by the Lab of Parallel Software and \
  42. Computational Science, ISCAS. http://www.rdcps.ac.cn
  43. %description
  44. %{base_description}
  45. %package Rblas
  46. Summary: A version of OpenBLAS for R to use as libRblas
  47. Group: system
  48. %description Rblas
  49. %{base_description}
  50. %package openmp
  51. Summary: An optimized BLAS library based on GotoBLAS2, OpenMP version
  52. Group: system
  53. Provides: blas lapack = %{lapackver} %{libblas} %{liblapack}
  54. %description openmp
  55. %{base_description}
  56. This package contains the library compiled with OpenMP support.
  57. %package threads
  58. Summary: An optimized BLAS library based on GotoBLAS2, pthreads version
  59. Group: system
  60. Provides: blas lapack = %{lapackver} %{libblas} %{liblapack}
  61. %description threads
  62. %{base_description}
  63. This package contains the library compiled with threading support.
  64. %if %build64
  65. %package serial64
  66. Summary: An optimized BLAS library based on GotoBLAS2, serial version
  67. Group: system
  68. Provides: blas64 lapack64 = %{lapackver}
  69. %description serial64
  70. %{base_description}
  71. This package contains the sequential library compiled with a 64-bit
  72. interface.
  73. %package serial64_
  74. Summary: An optimized BLAS library based on GotoBLAS2, serial version
  75. Group: system
  76. Provides: blas64 lapack64 = %{lapackver}
  77. %description serial64_
  78. %{base_description}
  79. This package contains the sequential library compiled with a 64-bit
  80. interface and a symbol name suffix.
  81. %package openmp64
  82. Summary: An optimized BLAS library based on GotoBLAS2, OpenMP version
  83. Group: system
  84. Provides: blas64 lapack64 = %{lapackver}
  85. %description openmp64
  86. %{base_description}
  87. This package contains the library compiled with OpenMP support and
  88. 64-bit interface.
  89. %package openmp64_
  90. Summary: An optimized BLAS library based on GotoBLAS2, OpenMP version
  91. Group: system
  92. Provides: blas64 lapack64 = %{lapackver}
  93. %description openmp64_
  94. %{base_description}
  95. This package contains the library compiled with OpenMP support and
  96. 64-bit interface and a symbol name suffix.
  97. %package threads64
  98. Summary: An optimized BLAS library based on GotoBLAS2, pthreads version
  99. Group: system
  100. Provides: blas64 lapack64 = %{lapackver}
  101. %description threads64
  102. %{base_description}
  103. This package contains the library compiled with threading support and
  104. 64-bit interface.
  105. %package threads64_
  106. Summary: An optimized BLAS library based on GotoBLAS2, pthreads version
  107. Group: system
  108. Provides: blas64 lapack64 = %{lapackver}
  109. %description threads64_
  110. %{base_description}
  111. This package contains the library compiled with threading support and
  112. 64-bit interface and a symbol name suffix.
  113. %endif
  114. %package devel
  115. Summary: Development headers and libraries for OpenBLAS
  116. Group: programming
  117. Requires: %{name} = %{version}-%{release}
  118. Requires: %{name}-openmp = %{version}-%{release}
  119. Requires: %{name}-threads = %{version}-%{release}
  120. %description devel
  121. %{base_description}
  122. This package contains the development headers and libraries.
  123. %package static
  124. Summary: Static version of OpenBLAS
  125. Group: programming
  126. Requires: %{name}-devel = %{version}-%{release}
  127. %description static
  128. %{base_description}
  129. This package contains the static libraries.
  130. %if %build64
  131. %package -n %{name}64-devel
  132. Summary: Development headers and libraries for OpenBLAS (64bit)
  133. Group: programming
  134. Requires: %{name}-openmp64 = %{version}-%{release}
  135. Requires: %{name}-threads64 = %{version}-%{release}
  136. Requires: %{name}-serial64 = %{version}-%{release}
  137. Requires: %{name}-openmp64_ = %{version}-%{release}
  138. Requires: %{name}-threads64_ = %{version}-%{release}
  139. Requires: %{name}-serial64_ = %{version}-%{release}
  140. Requires: %{name}-devel = %{version}-%{release}
  141. %description -n %{name}64-devel
  142. %{base_description}
  143. This package contains the development headers and libraries
  144. compiled with a 64-bit interface.
  145. %package -n %{name}64-static
  146. Summary: Static version of OpenBLAS (64bit)
  147. Group: programming
  148. Requires: %{name}64-devel = %{version}-%{release}
  149. %description -n %{name}64-static
  150. %{base_description}
  151. This package contains the static libraries
  152. compiled with a 64-bit interface.
  153. %endif
  154. %debug_package
  155. %prep
  156. %setup -q -c -T
  157. # Untar source
  158. tar zxf %{SOURCE0}
  159. cd OpenBLAS-%{version}
  160. %patch1 -p1 -b .libname
  161. # %patch2 -p1 -b .tests
  162. # %patch3 -p1 -b .affinity
  163. # Fix source permissions
  164. find -name \*.f -exec chmod 644 {} \;
  165. # Make serial, threaded and OpenMP versions; as well as 64-bit versions
  166. # Also make an libRblas.so
  167. cd ..
  168. cp -ar OpenBLAS-%{version} openmp
  169. cp -ar OpenBLAS-%{version} threaded
  170. %if %build64
  171. for d in {serial,threaded,openmp}64{,_}; do
  172. cp -ar OpenBLAS-%{version} $d
  173. done
  174. %endif
  175. cp -ar OpenBLAS-%{version} Rblas
  176. mv OpenBLAS-%{version} serial
  177. # Hackup Rblas Makefiles
  178. sed -i 's|.so.$(MAJOR_VERSION)|.so|g' Rblas/Makefile
  179. sed -i 's|.so.$(MAJOR_VERSION)|.so|g' Rblas/exports/Makefile
  180. sed -i 's|@ln -fs $(LIBSONAME) $(LIBPREFIX).so|#@ln -fs $(LIBSONAME) $(LIBPREFIX).so|g' Rblas/Makefile
  181. %build
  182. # Maximum possible amount of processors
  183. NMAX="NUM_THREADS=128"
  184. TARGET="TARGET=CORE2 DYNAMIC_ARCH=1"
  185. export AVX="NO_AVX2=1"
  186. FCOMMON="%{optflags} -fPIC -frecursive"
  187. make -C Rblas $TARGET USE_THREAD=0 USEOPENMP=0 FC=gfortran CC=gcc COMMON_OPT="$COMMON" FCOMMON_OPT="$FCOMMON" $NMAX LIBPREFIX="libRblas" LIBSONAME="libRblas.so" $AVX $LAPACKE INTERFACE64=0
  188. # Declare some necessary build flags
  189. COMMON="%{optflags} -fPIC"
  190. FCOMMON="$COMMON -frecursive"
  191. make -C serial $TARGET USE_THREAD=0 USE_OPENMP=0 FC=gfortran CC=gcc COMMON_OPT="$COMMON" FCOMMON_OPT="$FCOMMON" $NMAX LIBPREFIX="libopenblas" $AVX $LAPACKE INTERFACE64=0
  192. make -C threaded $TARGET USE_THREAD=1 USE_OPENMP=0 FC=gfortran CC=gcc COMMON_OPT="$COMMON" FCOMMON_OPT="$FCOMMON" $NMAX LIBPREFIX="libopenblasp" $AVX $LAPACKE INTERFACE64=0
  193. # USE_THREAD determines use of SMP, not of pthreads
  194. COMMON="%{optflags} -fPIC -fopenmp -pthread"
  195. FCOMMON="$COMMON -frecursive"
  196. make -C openmp $TARGET USE_THREAD=1 USE_OPENMP=1 FC=gfortran CC=gcc COMMON_OPT="$COMMON" FCOMMON_OPT="$FCOMMON" $NMAX LIBPREFIX="libopenblaso" $AVX $LAPACKE INTERFACE64=0
  197. %if %build64
  198. COMMON="%{optflags} -fPIC"
  199. FCOMMON="$COMMON -frecursive -fdefault-integer-8"
  200. make -C serial64 $TARGET USE_THREAD=0 USE_OPENMP=0 FC=gfortran CC=gcc COMMON_OPT="$COMMON" FCOMMON_OPT="$FCOMMON" $NMAX LIBPREFIX="libopenblas64" $AVX $LAPACKE INTERFACE64=1
  201. make -C threaded64 $TARGET USE_THREAD=1 USE_OPENMP=0 FC=gfortran CC=gcc COMMON_OPT="$COMMON" FCOMMON_OPT="$FCOMMON" $NMAX LIBPREFIX="libopenblasp64" $AVX $LAPACKE INTERFACE64=1
  202. COMMON="%{optflags} -fPIC -fopenmp -pthread"
  203. FCOMMON="$COMMON -frecursive -fdefault-integer-8"
  204. make -C openmp64 $TARGET USE_THREAD=1 USE_OPENMP=1 FC=gfortran CC=gcc COMMON_OPT="$COMMON" FCOMMON_OPT="$FCOMMON" $NMAX LIBPREFIX="libopenblaso64" $AVX $LAPACKE INTERFACE64=1
  205. COMMON="%{optflags} -fPIC"
  206. FCOMMON="$COMMON -frecursive -fdefault-integer-8"
  207. make -C serial64_ $TARGET USE_THREAD=0 USE_OPENMP=0 FC=gfortran CC=gcc COMMON_OPT="$COMMON" FCOMMON_OPT="$FCOMMON" $NMAX LIBPREFIX="libopenblas64_" $AVX $LAPACKE INTERFACE64=1 SYMBOLSUFFIX=64_
  208. make -C threaded64_ $TARGET USE_THREAD=1 USE_OPENMP=0 FC=gfortran CC=gcc COMMON_OPT="$COMMON" FCOMMON_OPT="$FCOMMON" $NMAX LIBPREFIX="libopenblasp64_" $AVX $LAPACKE INTERFACE64=1 SYMBOLSUFFIX=64_
  209. COMMON="%{optflags} -fPIC -fopenmp -pthread"
  210. FCOMMON="$COMMON -frecursive -fdefault-integer-8"
  211. make -C openmp64_ $TARGET USE_THREAD=1 USE_OPENMP=1 FC=gfortran CC=gcc COMMON_OPT="$COMMON" FCOMMON_OPT="$FCOMMON" $NMAX LIBPREFIX="libopenblaso64_" $AVX $LAPACKE INTERFACE64=1 SYMBOLSUFFIX=64_
  212. %endif
  213. %install
  214. rm -rf %{buildroot}
  215. # Install serial library and headers
  216. make -C serial USE_THREAD=0 PREFIX=%{buildroot} OPENBLAS_LIBRARY_DIR=%{buildroot}%{_libdir}/ OPENBLAS_INCLUDE_DIR=%{buildroot}%{_includedir}/%{name} OPENBLAS_BINARY_DIR=%{buildroot}%{_bindir} OPENBLAS_CMAKE_DIR=%{buildroot}%{_libdir}/cmake install
  217. slibname=`basename %{buildroot}%{_libdir}/libopenblas${suffix}-*.so .so`
  218. mv %{buildroot}%{_libdir}/${slibname}.a \
  219. %{buildroot}%{_libdir}/lib%{name}.a
  220. if [[ "$suffix" != "" ]]; then
  221. sname=$(echo $slibname | sed "s|$suffix||g")
  222. mv %{buildroot}%{_libdir}/${slibname}.so \
  223. %{buildroot}%{_libdir}/${sname}.so
  224. else
  225. sname=${slibname}
  226. fi
  227. # Install the Rblas library
  228. mkdir -p %{buildroot}%{_libdir}/R/lib/
  229. install -p -m 755 Rblas/libRblas.so %{buildroot}%{_libdir}/R/lib/
  230. # Install the OpenMP library
  231. olibname=`echo ${slibname} | sed "s|lib%{name}|lib%{name}o|g"`
  232. install -D -p -m 644 openmp/${olibname}.a \
  233. %{buildroot}%{_libdir}/lib%{name}o.a
  234. if [[ "$suffix" != "" ]]; then
  235. oname=$(echo $olibname | sed "s|$suffix||g")
  236. else
  237. oname=${olibname}
  238. fi
  239. install -D -p -m 755 openmp/${olibname}.so \
  240. %{buildroot}%{_libdir}/${oname}.so
  241. # Install the threaded library
  242. plibname=`echo ${slibname} | sed "s|lib%{name}|lib%{name}p|g"`
  243. install -D -p -m 644 threaded/${plibname}.a \
  244. %{buildroot}%{_libdir}/lib%{name}p.a
  245. if [[ "$suffix" != "" ]]; then
  246. pname=$(echo $plibname | sed "s|$suffix||g")
  247. else
  248. pname=${plibname}
  249. fi
  250. install -D -p -m 755 threaded/${plibname}.so \
  251. %{buildroot}%{_libdir}/${pname}.so
  252. # Install the 64-bit interface libraries
  253. %if %build64
  254. slibname64=`echo ${slibname} | sed "s|lib%{name}|lib%{name}64|g"`
  255. install -D -p -m 644 serial64/${slibname64}.a \
  256. %{buildroot}%{_libdir}/lib%{name}64.a
  257. slibname64_=`echo ${slibname} | sed "s|lib%{name}|lib%{name}64_|g"`
  258. install -D -p -m 644 serial64_/${slibname64_}.a \
  259. %{buildroot}%{_libdir}/lib%{name}64_.a
  260. if [[ "$suffix" != "" ]]; then
  261. sname64=$(echo ${slibname64} | sed "s|$suffix||g")
  262. sname64_=$(echo ${slibname64_} | sed "s|$suffix||g")
  263. else
  264. sname64=${slibname64}
  265. sname64_=${slibname64_}
  266. fi
  267. install -D -p -m 755 serial64/${slibname64}.so \
  268. %{buildroot}%{_libdir}/${sname64}.so
  269. install -D -p -m 755 serial64_/${slibname64_}.so \
  270. %{buildroot}%{_libdir}/${sname64_}.so
  271. olibname64=`echo ${slibname} | sed "s|lib%{name}|lib%{name}o64|g"`
  272. install -D -p -m 644 openmp64/${olibname64}.a \
  273. %{buildroot}%{_libdir}/lib%{name}o64.a
  274. olibname64_=`echo ${slibname} | sed "s|lib%{name}|lib%{name}o64_|g"`
  275. install -D -p -m 644 openmp64_/${olibname64_}.a \
  276. %{buildroot}%{_libdir}/lib%{name}o64_.a
  277. if [[ "$suffix" != "" ]]; then
  278. oname64=$(echo ${olibname64} | sed "s|$suffix||g")
  279. oname64_=$(echo ${olibname64_} | sed "s|$suffix||g")
  280. else
  281. oname64=${olibname64}
  282. oname64_=${olibname64_}
  283. fi
  284. install -D -p -m 755 openmp64/${olibname64}.so \
  285. %{buildroot}%{_libdir}/${oname64}.so
  286. install -D -p -m 755 openmp64_/${olibname64_}.so \
  287. %{buildroot}%{_libdir}/${oname64_}.so
  288. plibname64=`echo ${slibname} | sed "s|lib%{name}|lib%{name}p64|g"`
  289. install -D -p -m 644 threaded64/${plibname64}.a \
  290. %{buildroot}%{_libdir}/lib%{name}p64.a
  291. plibname64_=`echo ${slibname} | sed "s|lib%{name}|lib%{name}p64_|g"`
  292. install -D -p -m 644 threaded64_/${plibname64_}.a \
  293. %{buildroot}%{_libdir}/lib%{name}p64_.a
  294. if [[ "$suffix" != "" ]]; then
  295. pname64=$(echo $plibname64 | sed "s|$suffix||g")
  296. pname64_=$(echo $plibname64_ | sed "s|$suffix||g")
  297. else
  298. pname64=${plibname64}
  299. pname64_=${plibname64_}
  300. fi
  301. install -D -p -m 755 threaded64/${plibname64}.so \
  302. %{buildroot}%{_libdir}/${pname64}.so
  303. install -D -p -m 755 threaded64_/${plibname64_}.so \
  304. %{buildroot}%{_libdir}/${pname64_}.so
  305. %endif
  306. # Fix symlinks
  307. pushd %{buildroot}%{_libdir}
  308. # Serial libraries
  309. ln -sf ${sname}.so lib%{name}.so
  310. ln -sf ${sname}.so lib%{name}.so.0
  311. # OpenMP libraries
  312. ln -sf ${oname}.so lib%{name}o.so
  313. ln -sf ${oname}.so lib%{name}o.so.0
  314. # Threaded libraries
  315. ln -sf ${pname}.so lib%{name}p.so
  316. ln -sf ${pname}.so lib%{name}p.so.0
  317. %if %build64
  318. # Serial libraries
  319. ln -sf ${sname64}.so lib%{name}64.so
  320. ln -sf ${sname64}.so lib%{name}64.so.0
  321. ln -sf ${sname64_}.so lib%{name}64_.so
  322. ln -sf ${sname64_}.so lib%{name}64_.so.0
  323. # OpenMP libraries
  324. ln -sf ${oname64}.so lib%{name}o64.so
  325. ln -sf ${oname64}.so lib%{name}o64.so.0
  326. ln -sf ${oname64_}.so lib%{name}o64_.so
  327. ln -sf ${oname64_}.so lib%{name}o64_.so.0
  328. # Threaded libraries
  329. ln -sf ${pname64}.so lib%{name}p64.so
  330. ln -sf ${pname64}.so lib%{name}p64.so.0
  331. ln -sf ${pname64_}.so lib%{name}p64_.so
  332. ln -sf ${pname64_}.so lib%{name}p64_.so.0
  333. %endif
  334. popd
  335. # Get rid of generated CMake config
  336. rm -rf %{buildroot}%{_libdir}/cmake
  337. # pkg-config
  338. # fix libdir/includedir in openblas.pc
  339. pushd %{buildroot}%{_libdir}/pkgconfig
  340. mv openblas.pc tmp
  341. echo "libdir=%{_libdir}" > openblas.pc
  342. echo "includedir=%{_includedir}/%{name}" >> openblas.pc
  343. sed -e "1,2d" tmp >> openblas.pc
  344. rm -f tmp
  345. sed "s/-lopenblas/-lopenblaso/" openblas.pc >> openblaso.pc
  346. sed "s/-lopenblas/-lopenblasp/" openblas.pc >> openblasp.pc
  347. %if %build64
  348. sed "s/-lopenblas/-lopenblas64/" openblas.pc >> openblas64.pc
  349. sed "s/-lopenblas/-lopenblaso64/" openblas.pc >> openblaso64.pc
  350. sed "s/-lopenblas/-lopenblasp64/" openblas.pc >> openblasp64.pc
  351. sed "s/-lopenblas/-lopenblas64_/" openblas.pc >> openblas64_.pc
  352. sed "s/-lopenblas/-lopenblaso64_/" openblas.pc >> openblaso64_.pc
  353. sed "s/-lopenblas/-lopenblasp64_/" openblas.pc >> openblasp64_.pc
  354. %endif
  355. popd
  356. # blas/lapack
  357. mkdir -p %{buildroot}%{_libdir}/%{name}
  358. pushd %{buildroot}%{_libdir}/%{name}
  359. cp %{SOURCE11} blas.pc
  360. cp %{SOURCE12} cblas.pc
  361. cp %{SOURCE13} lapack.pc
  362. cp %{SOURCE14} lapacke.pc
  363. # blas
  364. sed -i 's|@libdir@|%{_libdir}|g' blas.pc
  365. sed -i 's|@LAPACK_VERSION@|%{version}|g' blas.pc
  366. # cblas
  367. sed -i 's|@libdir@|%{_libdir}|g' cblas.pc
  368. sed -i 's|@includedir@|%{_includedir}/%{name}|g' cblas.pc
  369. sed -i 's|@LAPACK_VERSION@|%{version}|g' cblas.pc
  370. # lapack
  371. sed -i 's|@libdir@|%{_libdir}|g' lapack.pc
  372. sed -i 's|@LAPACK_VERSION@|%{version}|g' lapack.pc
  373. # lapacke
  374. sed -i 's|@libdir@|%{_libdir}|g' lapacke.pc
  375. sed -i 's|@includedir@|%{_includedir}/%{name}|g' lapacke.pc
  376. sed -i 's|@LAPACK_VERSION@|%{version}|g' lapacke.pc
  377. %if %build64
  378. sed 's/-lblas/-blas64_/g' blas.pc > blas64.pc
  379. sed 's/-lcblas/-cblas64_/g' cblas.pc > cblas64.pc
  380. sed 's/-llapack/-llapack64_/g' lapack.pc > lapack64.pc
  381. sed 's/-llapacke/-llapacke64_/g' lapacke.pc > lapacke64.pc
  382. %endif
  383. popd
  384. %post
  385. update-alternatives \
  386. --install %{_libdir}/libblas.so.3 libblas.so.3 \
  387. %{_libdir}/libopenblas.so.0 40 \
  388. --slave %{_libdir}/libcblas.so.3 libcblas.so.3 \
  389. %{_libdir}/libopenblas.so.0
  390. update-alternatives \
  391. --install %{_libdir}/liblapack.so.3 liblapack.so.3 \
  392. %{_libdir}/libopenblas.so.0 40 \
  393. --slave %{_libdir}/liblapacke.so.3 liblapacke.so.3 \
  394. %{_libdir}/libopenblas.so.0
  395. /sbin/ldconfig
  396. %preun
  397. if [ "$1" = "0" ]
  398. then
  399. update-alternatives \
  400. --remove libblas.so.3 %{_libdir}/libopenblas.so.0
  401. update-alternatives \
  402. --remove liblapack.so.3 %{_libdir}/libopenblas.so.0
  403. fi
  404. %postun -p /sbin/ldconfig
  405. %post openmp
  406. update-alternatives \
  407. --install %{_libdir}/libblas.so.3 libblas.so.3 \
  408. %{_libdir}/libopenblaso.so.0 42 \
  409. --slave %{_libdir}/libcblas.so.3 libcblas.so.3 \
  410. %{_libdir}/libopenblaso.so.0
  411. update-alternatives \
  412. --install %{_libdir}/liblapack.so.3 liblapack.so.3 \
  413. %{_libdir}/libopenblaso.so.0 42 \
  414. --slave %{_libdir}/liblapacke.so.3 liblapacke.so.3 \
  415. %{_libdir}/libopenblaso.so.0
  416. /sbin/ldconfig
  417. %preun openmp
  418. if [ "$1" = "0" ]
  419. then
  420. update-alternatives \
  421. --remove libblas.so.3 %{_libdir}/libopenblaso.so.0
  422. update-alternatives \
  423. --remove liblapack.so.3 %{_libdir}/libopenblaso.so.0
  424. fi
  425. %postun openmp -p /sbin/ldconfig
  426. %post threads
  427. update-alternatives \
  428. --install %{_libdir}/libblas.so.3 libblas.so.3 \
  429. %{_libdir}/libopenblasp.so.0 45 \
  430. --slave %{_libdir}/libcblas.so.3 libcblas.so.3 \
  431. %{_libdir}/libopenblasp.so.0
  432. update-alternatives \
  433. --install %{_libdir}/liblapack.so.3 liblapack.so.3 \
  434. %{_libdir}/libopenblasp.so.0 45 \
  435. --slave %{_libdir}/liblapacke.so.3 liblapacke.so.3 \
  436. %{_libdir}/libopenblasp.so.0
  437. /sbin/ldconfig
  438. %preun threads
  439. if [ "$1" = "0" ]
  440. then
  441. update-alternatives \
  442. --remove libblas.so.3 %{_libdir}/libopenblasp.so.0
  443. update-alternatives \
  444. --remove liblapack.so.3 %{_libdir}/libopenblasp.so.0
  445. fi
  446. %postun threads -p /sbin/ldconfig
  447. %if %build64
  448. %post serial64 -p /sbin/ldconfig
  449. %postun serial64 -p /sbin/ldconfig
  450. %post openmp64 -p /sbin/ldconfig
  451. %postun openmp64 -p /sbin/ldconfig
  452. %post threads64 -p /sbin/ldconfig
  453. %postun threads64 -p /sbin/ldconfig
  454. %post serial64_
  455. update-alternatives \
  456. --install %{_libdir}/libblas64_.so.3 libblas64_.so.3 \
  457. %{_libdir}/libopenblas64_.so.0 40 \
  458. --slave %{_libdir}/libcblas64_.so.3 libcblas64_.so.3 \
  459. %{_libdir}/libopenblas64_.so.0
  460. update-alternatives \
  461. --install %{_libdir}/liblapack64_.so.3 liblapack64_.so.3 \
  462. %{_libdir}/libopenblas64_.so.0 40
  463. update-alternatives \
  464. --install %{_libdir}/liblapacke64_.so.3 liblapacke64_.so.3 \
  465. %{_libdir}/libopenblas64_.so.0 40
  466. /sbin/ldconfig
  467. %preun serial64_
  468. if [ "$1" = "0" ]
  469. then
  470. update-alternatives \
  471. --remove libblas64_.so.3 %{_libdir}/libopenblas64_.so.0
  472. update-alternatives \
  473. --remove liblapack64_.so.3 %{_libdir}/libopenblas64_.so.0
  474. update-alternatives \
  475. --remove liblapacke64_.so.3 %{_libdir}/libopenblas64_.so.0
  476. fi
  477. %postun serial64_ -p /sbin/ldconfig
  478. %post openmp64_
  479. update-alternatives \
  480. --install %{_libdir}/libblas64_.so.3 libblas64_.so.3 \
  481. %{_libdir}/libopenblaso64_.so.0 42 \
  482. --slave %{_libdir}/libcblas64_.so.3 libcblas64_.so.3 \
  483. %{_libdir}/libopenblaso64_.so.0
  484. update-alternatives \
  485. --install %{_libdir}/liblapack64_.so.3 liblapack64_.so.3 \
  486. %{_libdir}/libopenblaso64_.so.0 42
  487. update-alternatives \
  488. --install %{_libdir}/liblapacke64_.so.3 liblapacke64_.so.3 \
  489. %{_libdir}/libopenblaso64_.so.0 42
  490. /sbin/ldconfig
  491. %preun openmp64_
  492. if [ "$1" = "0" ]
  493. then
  494. update-alternatives \
  495. --remove libblas64_.so.3 %{_libdir}/libopenblaso64_.so.0
  496. update-alternatives \
  497. --remove liblapack64_.so.3 %{_libdir}/libopenblaso64_.so.0
  498. update-alternatives \
  499. --remove liblapacke64_.so.3 %{_libdir}/libopenblaso64_.so.0
  500. fi
  501. %postun openmp64_ -p /sbin/ldconfig
  502. %post threads64_
  503. update-alternatives \
  504. --install %{_libdir}/libblas64_.so.3 libblas64_.so.3 \
  505. %{_libdir}/libopenblasp64_.so.0 45 \
  506. --slave %{_libdir}/libcblas64_.so.3 libcblas64_.so.3 \
  507. %{_libdir}/libopenblasp64_.so.0
  508. update-alternatives \
  509. --install %{_libdir}/liblapack64_.so.3 liblapack64_.so.3 \
  510. %{_libdir}/libopenblasp64_.so.0 45
  511. update-alternatives \
  512. --install %{_libdir}/liblapacke64_.so.3 liblapacke64_.so.3 \
  513. %{_libdir}/libopenblasp64_.so.0 45
  514. /sbin/ldconfig
  515. %preun threads64_
  516. if [ "$1" = "0" ]
  517. then
  518. update-alternatives \
  519. --remove libblas64_.so.3 %{_libdir}/libopenblasp64_.so.0
  520. update-alternatives \
  521. --remove liblapack64_.so.3 %{_libdir}/libopenblasp64_.so.0
  522. update-alternatives \
  523. --remove liblapacke64_.so.3 %{_libdir}/libopenblasp64_.so.0
  524. fi
  525. %postun threads64_ -p /sbin/ldconfig
  526. %endif
  527. %post devel
  528. update-alternatives \
  529. --install %{_libdir}/libblas.so libblas.so \
  530. %{_libdir}/libopenblas.so 40 \
  531. --slave %{_libdir}/libcblas.so libcblas.so \
  532. %{_libdir}/libopenblas.so \
  533. --slave %{_libdir}/pkgconfig/blas.pc blas.pc \
  534. %{_libdir}/%{name}/blas.pc \
  535. --slave %{_libdir}/pkgconfig/cblas.pc cblas.pc \
  536. %{_libdir}/%{name}/cblas.pc
  537. update-alternatives \
  538. --install %{_libdir}/liblapack.so liblapack.so \
  539. %{_libdir}/libopenblas.so 40 \
  540. --slave %{_libdir}/liblapacke.so liblapacke.so \
  541. %{_libdir}/libopenblas.so \
  542. --slave %{_libdir}/pkgconfig/lapack.pc lapack.pc \
  543. %{_libdir}/%{name}/lapack.pc \
  544. --slave %{_libdir}/pkgconfig/lapacke.pc lapacke.pc \
  545. %{_libdir}/%{name}/lapacke.pc
  546. /sbin/ldconfig
  547. %preun devel
  548. if [ "$1" = "0" ]
  549. then
  550. update-alternatives \
  551. --remove libblas.so %{_libdir}/libopenblas.so
  552. update-alternatives \
  553. --remove liblapack.so %{_libdir}/libopenblas.so
  554. fi
  555. %postun devel -p /sbin/ldconfig
  556. %if %build64
  557. %post -n %{name}64-devel
  558. update-alternatives \
  559. --install %{_libdir}/libblas64_.so libblas64_.so \
  560. %{_libdir}/libopenblas64_.so 40 \
  561. --slave %{_libdir}/libcblas64_.so libcblas64_.so \
  562. %{_libdir}/libopenblas64_.so \
  563. --slave %{_libdir}/pkgconfig/blas64.pc blas64.pc \
  564. %{_libdir}/%{name}/blas64.pc \
  565. --slave %{_libdir}/pkgconfig/cblas64.pc cblas64.pc \
  566. %{_libdir}/%{name}/cblas64.pc
  567. update-alternatives \
  568. --install %{_libdir}/liblapack64_.so liblapack64_.so \
  569. %{_libdir}/libopenblas64_.so 40 \
  570. --slave %{_libdir}/pkgconfig/lapack64.pc lapack64.pc \
  571. %{_libdir}/%{name}/lapack64.pc
  572. update-alternatives \
  573. --install %{_libdir}/liblapacke64_.so liblapacke64_.so \
  574. %{_libdir}/libopenblas64_.so 40 \
  575. --slave %{_libdir}/pkgconfig/lapacke64.pc lapacke64.pc \
  576. %{_libdir}/%{name}/lapacke64.pc
  577. /sbin/ldconfig
  578. %preun -n %{name}64-devel
  579. if [ "$1" = "0" ]
  580. then
  581. update-alternatives \
  582. --remove libblas64_.so %{_libdir}/libopenblas64_.so
  583. update-alternatives \
  584. --remove liblapack64_.so %{_libdir}/libopenblas64_.so
  585. update-alternatives \
  586. --remove liblapacke64_.so %{_libdir}/libopenblas64_.so
  587. fi
  588. %postun -n %{name}64-devel -p /sbin/ldconfig
  589. %endif
  590. %post static
  591. update-alternatives \
  592. --install %{_libdir}/libblas.a libblas.a \
  593. %{_libdir}/libopenblas.a 40 \
  594. --slave %{_libdir}/libcblas.a libcblas.a \
  595. %{_libdir}/libopenblas.a
  596. update-alternatives \
  597. --install %{_libdir}/liblapack.a liblapack.a \
  598. %{_libdir}/libopenblas.a 40 \
  599. --slave %{_libdir}/liblapacke.a liblapacke.a \
  600. %{_libdir}/libopenblas.a
  601. %preun static
  602. if [ "$1" = "0" ]
  603. then
  604. update-alternatives \
  605. --remove libblas.a %{_libdir}/libopenblas.a
  606. update-alternatives \
  607. --remove liblapack.a %{_libdir}/libopenblas.a
  608. fi
  609. %if %build64
  610. %post -n %{name}64-static
  611. update-alternatives \
  612. --install %{_libdir}/libblas64_.a libblas64_.a \
  613. %{_libdir}/libopenblas64_.a 40 \
  614. --slave %{_libdir}/libcblas64_.a libcblas64_.a \
  615. %{_libdir}/libopenblas64_.a
  616. update-alternatives \
  617. --install %{_libdir}/liblapack64_.a liblapack64_.a \
  618. %{_libdir}/libopenblas64_.a 40
  619. update-alternatives \
  620. --install %{_libdir}/liblapacke64_.a liblapacke64_.a \
  621. %{_libdir}/libopenblas64_.a 40
  622. %preun -n %{name}64-static
  623. if [ "$1" = "0" ]
  624. then
  625. update-alternatives \
  626. --remove libblas64_.a %{_libdir}/libopenblas64_.a
  627. update-alternatives \
  628. --remove liblapack64_.a %{_libdir}/libopenblas64_.a
  629. update-alternatives \
  630. --remove liblapacke64_.a %{_libdir}/libopenblas64_.a
  631. fi
  632. %endif
  633. %post Rblas -p /sbin/ldconfig
  634. %postun Rblas -p /sbin/ldconfig
  635. %clean
  636. rm -rf %{buildroot}
  637. %files
  638. %doc serial/Changelog.txt serial/GotoBLAS* serial/LICENSE
  639. %{_libdir}/lib%{name}-*.so
  640. %{_libdir}/lib%{name}.so.*
  641. %files openmp
  642. %doc openmp/Changelog.txt openmp/GotoBLAS* openmp/LICENSE
  643. %{_libdir}/lib%{name}o-*.so
  644. %{_libdir}/lib%{name}o.so.*
  645. %files threads
  646. %doc threaded/Changelog.txt threaded/GotoBLAS* threaded/LICENSE
  647. %{_libdir}/lib%{name}p-*.so
  648. %{_libdir}/lib%{name}p.so.*
  649. %if %build64
  650. %files serial64
  651. %doc serial64/Changelog.txt serial64/GotoBLAS* serial64/LICENSE
  652. %{_libdir}/lib%{name}64-*.so
  653. %{_libdir}/lib%{name}64.so.*
  654. %files serial64_
  655. %doc serial64_/Changelog.txt serial64_/GotoBLAS* serial64_/LICENSE
  656. %{_libdir}/lib%{name}64_-*.so
  657. %{_libdir}/lib%{name}64_.so.*
  658. %files openmp64
  659. %doc openmp64/Changelog.txt openmp64/GotoBLAS* openmp64/LICENSE
  660. %{_libdir}/lib%{name}o64-*.so
  661. %{_libdir}/lib%{name}o64.so.*
  662. %files openmp64_
  663. %doc openmp64_/Changelog.txt openmp64_/GotoBLAS* openmp64_/LICENSE
  664. %{_libdir}/lib%{name}o64_-*.so
  665. %{_libdir}/lib%{name}o64_.so.*
  666. %files threads64
  667. %doc threaded64/Changelog.txt threaded64/GotoBLAS* threaded64/LICENSE
  668. %{_libdir}/lib%{name}p64-*.so
  669. %{_libdir}/lib%{name}p64.so.*
  670. %files threads64_
  671. %doc threaded64_/Changelog.txt threaded64_/GotoBLAS* threaded64_/LICENSE
  672. %{_libdir}/lib%{name}p64_-*.so
  673. %{_libdir}/lib%{name}p64_.so.*
  674. %endif
  675. %files Rblas
  676. %dir %{_libdir}/R/lib
  677. %{_libdir}/R/lib/libRblas.so
  678. %files devel
  679. %{_includedir}/%{name}/
  680. %{_libdir}/lib%{name}.so
  681. %{_libdir}/lib%{name}o.so
  682. %{_libdir}/lib%{name}p.so
  683. %{_libdir}/pkgconfig/openblas.pc
  684. %{_libdir}/pkgconfig/openblaso.pc
  685. %{_libdir}/pkgconfig/openblasp.pc
  686. %dir %{_libdir}/%{name}
  687. %{_libdir}/%{name}/blas.pc
  688. %{_libdir}/%{name}/cblas.pc
  689. %{_libdir}/%{name}/lapack.pc
  690. %{_libdir}/%{name}/lapacke.pc
  691. %files static
  692. %{_libdir}/lib%{name}.a
  693. %{_libdir}/lib%{name}o.a
  694. %{_libdir}/lib%{name}p.a
  695. %if %build64
  696. %files -n %{name}64-devel
  697. %{_libdir}/lib%{name}64.so
  698. %{_libdir}/lib%{name}o64.so
  699. %{_libdir}/lib%{name}p64.so
  700. %{_libdir}/lib%{name}64_.so
  701. %{_libdir}/lib%{name}o64_.so
  702. %{_libdir}/lib%{name}p64_.so
  703. %{_libdir}/pkgconfig/*64.pc
  704. %{_libdir}/pkgconfig/*64_.pc
  705. %dir %{_libdir}/%{name}
  706. %{_libdir}/%{name}/*64*.pc
  707. %files -n %{name}64-static
  708. %{_libdir}/lib%{name}64.a
  709. %{_libdir}/lib%{name}o64.a
  710. %{_libdir}/lib%{name}p64.a
  711. %{_libdir}/lib%{name}64_.a
  712. %{_libdir}/lib%{name}o64_.a
  713. %{_libdir}/lib%{name}p64_.a
  714. %endif
  715. %changelog
  716. * Sun Feb 28 2021 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> 0.3.13-1
  717. - new upstream release.
  718. * Mon Oct 14 2019 Toshiaki Ara <ara_t@384.jp> 0.3.7-1
  719. - update to 0.3.7
  720. * Fri Jan 25 2019 Toshiaki Ara <ara_t@384.jp> 0.3.3-2
  721. - rebuild with gfortran-8.2.0
  722. * Sat Oct 06 2018 Toshiaki Ara <ara_t@384.jp> 0.3.3-1
  723. - update to 0.3.3
  724. - drop Patch2 and 3
  725. * Mon Jul 02 2018 Toshiaki Ara <ara_t@384.jp> 0.2.20-2
  726. - divide subpackages: openblas64-devel openblas64-static
  727. - fix wrong Provides
  728. * Wed Jun 27 2018 Toshiaki Ara <ara_t@384.jp> 0.2.20-1
  729. - initial build for Vine Linux (only x86_64 and %%{ix86})