Accepting request 106990 from home:scorot

OBS-URL: https://build.opensuse.org/request/show/106990
OBS-URL: https://build.opensuse.org/package/show/science/openblas?expand=0&rev=1
This commit is contained in:
Corot Sebastien 2012-02-26 12:52:52 +00:00 committed by Git OBS Bridge
commit 9fd09ec0f5
8 changed files with 304 additions and 0 deletions

23
.gitattributes vendored Normal file
View File

@ -0,0 +1,23 @@
## Default LFS
*.7z filter=lfs diff=lfs merge=lfs -text
*.bsp filter=lfs diff=lfs merge=lfs -text
*.bz2 filter=lfs diff=lfs merge=lfs -text
*.gem filter=lfs diff=lfs merge=lfs -text
*.gz filter=lfs diff=lfs merge=lfs -text
*.jar filter=lfs diff=lfs merge=lfs -text
*.lz filter=lfs diff=lfs merge=lfs -text
*.lzma filter=lfs diff=lfs merge=lfs -text
*.obscpio filter=lfs diff=lfs merge=lfs -text
*.oxt filter=lfs diff=lfs merge=lfs -text
*.pdf filter=lfs diff=lfs merge=lfs -text
*.png filter=lfs diff=lfs merge=lfs -text
*.rpm filter=lfs diff=lfs merge=lfs -text
*.tbz filter=lfs diff=lfs merge=lfs -text
*.tbz2 filter=lfs diff=lfs merge=lfs -text
*.tgz filter=lfs diff=lfs merge=lfs -text
*.ttf filter=lfs diff=lfs merge=lfs -text
*.txz filter=lfs diff=lfs merge=lfs -text
*.whl filter=lfs diff=lfs merge=lfs -text
*.xz filter=lfs diff=lfs merge=lfs -text
*.zip filter=lfs diff=lfs merge=lfs -text
*.zst filter=lfs diff=lfs merge=lfs -text

1
.gitignore vendored Normal file
View File

@ -0,0 +1 @@
.osc

View File

@ -0,0 +1,12 @@
diff -ur GotoBLAS2-orig/ctest/c_xerbla.c GotoBLAS2/ctest/c_xerbla.c
--- GotoBLAS2-orig/ctest/c_xerbla.c 2009-09-10 23:52:13.000000000 +0200
+++ GotoBLAS2/ctest/c_xerbla.c 2010-11-26 23:37:45.000000000 +0100
@@ -131,7 +131,7 @@
int BLASFUNC(xerbla)(char *name, blasint *info, blasint length) {
F77_xerbla(name, info);
-
+ return 0;
};

3
lapack-3.1.1.tgz Normal file
View File

@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:e4c335b30b4394f9620d60818319ff12af2aea63827515e9f7e62b88dff7a02a
size 10407595

25
openblas-0.1-soname.patch Normal file
View File

@ -0,0 +1,25 @@
diff -ruN xianyi-OpenBLAS-92ba8a7-orig/exports/Makefile xianyi-OpenBLAS-92ba8a7/exports/Makefile
--- xianyi-OpenBLAS-92ba8a7-orig/exports/Makefile 2011-09-18 10:57:28.000000000 +0200
+++ xianyi-OpenBLAS-92ba8a7/exports/Makefile 2011-11-01 00:37:52.193277838 +0100
@@ -97,8 +97,21 @@
so : ../$(LIBSONAME)
+
+ifeq ($(USE_OPENMP), 1)
+SONAME = libopenblaso.so.0
+else
+ifeq ($(USE_THREAD), 1)
+SONAME = libopenblasp.so.0
+else
+SONAME = libopenblas.so.0
+endif
+endif
+
../$(LIBSONAME) : ../$(LIBNAME) linux.def linktest.c
$(CC) $(CFLAGS) -shared -o ../$(LIBSONAME) \
+ -Wl,-z,noexecstack \
+ -Wl,-soname,$(SONAME) \
-Wl,--whole-archive ../$(LIBNAME) -Wl,--no-whole-archive \
-Wl,--retain-symbols-file=linux.def $(EXTRALIB)
$(CC) $(CFLAGS) -w -o linktest linktest.c ../$(LIBSONAME) $(FEXTRALIB) && echo OK.

21
openblas-libs.patch Normal file
View File

@ -0,0 +1,21 @@
diff -up xianyi-OpenBLAS-92ba8a7/exports/Makefile.orig xianyi-OpenBLAS-92ba8a7/exports/Makefile
--- xianyi-OpenBLAS-92ba8a7/exports/Makefile.orig 2011-09-18 11:57:28.000000000 +0300
+++ xianyi-OpenBLAS-92ba8a7/exports/Makefile 2011-09-18 18:12:39.348157211 +0300
@@ -10,17 +10,9 @@ ifndef NO_CBLAS
NO_CBLAS = 0
endif
-ifeq ($(OSNAME), WINNT)
ifeq ($(F_COMPILER), GFORTRAN)
EXTRALIB += -lgfortran
endif
-endif
-
-ifeq ($(OSNAME), CYGWIN_NT)
-ifeq ($(F_COMPILER), GFORTRAN)
-EXTRALIB += -lgfortran
-endif
-endif
all::

216
openblas.spec Normal file
View File

@ -0,0 +1,216 @@
%define alpha 2.4
Name: openblas
Version: 0.1.alpha2.4
Release: 0
Summary: An optimized BLAS library based on GotoBLAS2
Group: System/Libraries
License: BSD
URL: https://github.com/xianyi/OpenBLAS/
# Tarball gotten from
# https://github.com/xianyi/OpenBLAS/tarball/v%{version}alpha%{alpha}
Source0: xianyi-OpenBLAS-v0.1alpha2.4-0-gfe7a932.tar.gz
# LAPACK
Source1: http://www.netlib.org/lapack/lapack-3.1.1.tgz
# Link against libgfortran
Patch0: openblas-libs.patch
Patch1: c_xerbla_no-void-return.patch
Patch2: openblas-0.1-soname.patch
BuildRoot: %{_tmppath}/%{name}-%{version}-build
BuildRequires: gcc-fortran
# For execstack
# BuildRequires: prelink
%description
OpenBLAS is an optimized BLAS library based on GotoBLAS2 1.13 BSD version. The
project is supported by the Lab of Parallel Software and Computational Science,
ISCAS. http://www.rdcps.ac.cn
%package -n libopenblas0
Summary: An optimized BLAS library based on GotoBLAS2, serial version
Group: System/Libraries
%description -n libopenblas0
OpenBLAS is an optimized BLAS library based on GotoBLAS2 1.13 BSD version. The
project is supported by the Lab of Parallel Software and Computational Science,
ISCAS. http://www.rdcps.ac.cn
%package -n libopenblaso0
Summary: An optimized BLAS library based on GotoBLAS2, OpenMP version
Group: System/Libraries
%description -n libopenblaso0
OpenBLAS is an optimized BLAS library based on GotoBLAS2 1.13 BSD version. The
project is supported by the Lab of Parallel Software and Computational Science,
ISCAS. http://www.rdcps.ac.cn
This package contains the library compiled with OpenMP support.
%package -n libopenblasp0
Summary: An optimized BLAS library based on GotoBLAS2, pthreads version
Group: System/Libraries
%description -n libopenblasp0
OpenBLAS is an optimized BLAS library based on GotoBLAS2 1.13 BSD version. The
project is supported by the Lab of Parallel Software and Computational Science,
ISCAS. http://www.rdcps.ac.cn
This package contains the library compiled with threading support.
%package devel
Summary: Development headers and libraries for OpenBLAS
Group: Development/Libraries/C and C++
Requires: lib%{name}0 = %{version}-%{release}
Requires: lib%{name}o0 = %{version}-%{release}
Requires: lib%{name}p0 = %{version}-%{release}
%description devel
OpenBLAS is an optimized BLAS library based on GotoBLAS2 1.13 BSD version. The
project is supported by the Lab of Parallel Software and Computational Science,
ISCAS. http://www.rdcps.ac.cn
This package contains the development headers and libraries.
%package devel-static
Summary: Static version of OpenBLAS
Group: Development/Libraries/C and C++
Requires: %{name}-devel = %{version}-%{release}
%description devel-static
OpenBLAS is an optimized BLAS library based on GotoBLAS2 1.13 BSD version. The
project is supported by the Lab of Parallel Software and Computational Science,
ISCAS. http://www.rdcps.ac.cn
This package contains the static libraries.
%prep
%setup -q -c -T
# Untar source
tar zxf %{SOURCE0}
mv xianyi-OpenBLAS-*/ xianyi-OpenBLAS
cd xianyi-OpenBLAS
%patch0 -p1
%patch1 -p1
%patch2 -p1
cd ..
# Make serial, threaded and OpenMP versions
cp -ar xianyi-OpenBLAS openmp
cp -ar xianyi-OpenBLAS threaded
mv xianyi-OpenBLAS serial
# Copy LAPACK sources
for dir in openmp threaded serial; do
cp %{SOURCE1} $dir
done
%build
make -C serial DYNAMIC_ARCH=1 USE_THREAD=0 USE_OPENMP=0 \
FC=gfortran CC=gcc COMMON_OPT="%{optflags}" NUM_THREADS=32
make -C openmp DYNAMIC_ARCH=1 USE_THREAD=0 USE_OPENMP=1 \
FC=gfortran CC=gcc COMMON_OPT="%{optflags}" NUM_THREADS=32
make -C threaded DYNAMIC_ARCH=1 USE_THREAD=1 USE_OPENMP=0 \
FC=gfortran CC=gcc COMMON_OPT="%{optflags}" NUM_THREADS=32
%install
rm -rf %{buildroot}
# Install serial library and headers
make -C serial USE_THREAD=0 PREFIX=%{buildroot}%{_usr} install
# Move include files to package specific directory, so that they don't clash with reference BLAS and LAPACK
mkdir %{buildroot}%{_includedir}/%{name}
mv %{buildroot}%{_includedir}/*.h %{buildroot}%{_includedir}/%{name}
# Put libraries in correct location
mkdir -p %{buildroot}%{_libdir}
%ifarch x86_64
mv %{buildroot}/usr/lib/libopen* %{buildroot}%{_libdir}
%endif
slibname=`basename %{buildroot}%{_libdir}/libopenblas-*.so .so`
# Fix name library
mv %{buildroot}%{_libdir}/${slibname}.so %{buildroot}%{_libdir}/lib%{name}.so.0
mv %{buildroot}%{_libdir}/${slibname}.a %{buildroot}%{_libdir}/lib%{name}.a
# Install the OpenMP library
# olibname=`echo ${slibname} | sed "s|lib%{name}|lib%{name}o|g"`
install -D -p -m 755 openmp/${slibname}.so %{buildroot}%{_libdir}/lib%{name}o.so.0
install -D -p -m 644 openmp/${slibname}.a %{buildroot}%{_libdir}/lib%{name}o.a
# Install the threaded library
plibname=`echo ${slibname} | sed "s|lib%{name}|lib%{name}p|g"`
install -D -p -m 755 threaded/${plibname}.so %{buildroot}%{_libdir}/lib%{name}p.so.0
install -D -p -m 644 threaded/${plibname}.a %{buildroot}%{_libdir}/lib%{name}p.a
# Fix source permissions (also applies to LAPACK)
find -name \*.f -exec chmod 644 {} \;
# Fix symlinks
pushd %{buildroot}%{_libdir}
# Serial libraries
ln -sf lib%{name}.so.0 lib%{name}.so
# OpenMP libraries
ln -sf lib%{name}o.so.0 lib%{name}o.so
# Threaded libraries
ln -sf lib%{name}p.so.0 lib%{name}p.so
# Get rid of executable stacks
# for lib in %{buildroot}%{_libdir}/libopenblas{,o,p}-*.so; do
# execstack -c $lib
# done
%post -n libopenblas0 -p /sbin/ldconfig
%postun -n libopenblas0 -p /sbin/ldconfig
%post -n libopenblaso0 -p /sbin/ldconfig
%postun -n libopenblaso0 -p /sbin/ldconfig
%post -n libopenblasp0 -p /sbin/ldconfig
%postun -n libopenblasp0 -p /sbin/ldconfig
%clean
rm -rf %{buildroot}
%files -n libopenblas0
%defattr(-,root,root,-)
%doc serial/Changelog.txt serial/GotoBLAS* serial/LICENSE serial/README
%{_libdir}/lib%{name}.so.0
%files -n libopenblaso0
%defattr(-,root,root,-)
%{_libdir}/lib%{name}o.so.0
%files -n libopenblasp0
%defattr(-,root,root,-)
%{_libdir}/lib%{name}p.so.0
%files devel
%defattr(-,root,root,-)
%{_includedir}/%{name}
%{_libdir}/lib%{name}.so
%{_libdir}/lib%{name}o.so
%{_libdir}/lib%{name}p.so
%files devel-static
%defattr(-,root,root,-)
%{_libdir}/lib%{name}.a
%{_libdir}/lib%{name}o.a
%{_libdir}/lib%{name}p.a
%changelog
* Thu Nov 13 2011 scorot@gtt.fr
- fix symlink target of the serial version library
* Thu Nov 03 2011 scorot@gtt.fr
- fix description of libopenblas0 package
- fix devel package requirements
* Wed Nov 02 2011 scorot@gtt.fr
- rename library packages to suit the shared libs package name policy
* Tue Nov 01 2011 scorot@gtt.fr
- add patch in order to fix soname and executable stack rpmlint warning
* Mon Oct 31 2011 scorot@gtt.fr
- initial package based on spec file made by Jussi Lehtola for fedora
- add patch1 in order to fix return-in-non-void-function

View File

@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:95e0beab5cede658c075e32ec7ad10fa7e1c4cbdf69b03743e54bd67e27766c7
size 3077836