openblas-vl.spec 27 KB

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