openblas-vl.spec 27 KB

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