Sophie

Sophie

distrib > Mageia > 6 > armv5tl > media > core-release-src > by-pkgid > 4684a85c5574a646e620be60b150b70c > files > 16

atlas-3.10.2-9.mga6.src.rpm

# Update from 3.6.0 to 3.8.3 is based on Fedora atlas package. See
# http://cvs.fedoraproject.org/viewvc/rpms/atlas/devel/atlas.spec?revision=1.23

%define enable_native_atlas 0

%define major		3
%define libatlas	libatlas
%define libname		%mklibname %{name} %{major}

Name:		atlas
Version:	3.10.2
Release:	%mkrel 9
Summary:        Automatically Tuned Linear Algebra Software
Group:          Sciences/Mathematics
License:        BSD
URL:            http://math-atlas.sourceforge.net/
Source0:        http://downloads.sourceforge.net/math-atlas/%{name}%{version}.tar.bz2
Source21:	http://math-atlas.sourceforge.net/errata.html
Source22:	http://math-atlas.sourceforge.net/faq.html
Source23:	http://www.cs.utsa.edu/~whaley/papers.html
Source30:	Makefile
Source31:	README.%{_real_vendor}
# Obtained by editing flags in the tarball from the sources with
# grep -r fpu | cut -d: -f 1 | sort -u | xargs sed -i -e 's,-mcpu=cortex-a8,-march=armv7-a,' -e 's,-mfpu=vfpv3,-mfpu=vfpv3-d16,' -e 's,-mtune=cortex-a8,,'
Source32:	ARMv732.tar.bz2

# Fedora patches:
Patch2:		atlas-fedora-arm.patch
# Properly pass -melf_* to the linker with -Wl, fixes FTBFS bug 817552
# https://sourceforge.net/tracker/?func=detail&atid=379484&aid=3555789&group_id=23725
Patch3:		atlas-melf.patch
Patch4:         atlas-throttling.patch
#credits Lukas Slebodnik
Patch5:		atlas-shared_libraries.patch
Patch6:		atlas-affinity.patch

Patch7:		atlas-aarch64port.patch
Patch8:		atlas-genparse.patch

# Unbundle LAPACK (BZ #1181369)
Patch9:		atlas.3.10.1-unbundle.patch

# for ppc64 ppc64le
# https://bugzilla.redhat.com/show_bug.cgi?id=1080073#c40
Patch95:        getdoublearr.stripwhite.patch
Patch96:        initialize_malloc_memory.invtrsm.wms.oct23.patch
Patch97:        atlas.3.10.2-ppc64le_abiv2.patch
Patch98:        atlas-new_archdef_for_ppc64le.patch
Patch99:        atlas.3.10.2-add_power8_cpu.patch

# for ppc64le
Patch100:       atlas.3.10.2-ppc64le_do_not_use_files_with_lvx.patch

Requires:	gcc-gfortran liblapack-devel
BuildRequires:	gcc-gfortran
BuildRequires:  liblapack-devel

%description
The ATLAS (Automatically Tuned Linear Algebra Software) project is an
ongoing research effort focusing on applying empirical techniques in
order to provide portable performance. At present, it provides C and
Fortran77 interfaces to a portably efficient BLAS implementation, as
well as a few routines from LAPACK.

The performance improvements in ATLAS are obtained largely via
compile-time optimizations and tend to be specific to a given hardware
configuration. In order to package ATLAS some compromises
are necessary so that good performance can be obtained on a variety
of hardware. This set of ATLAS binary packages is therefore not
necessarily optimal for any specific hardware configuration.  However,
the source package can be used to compile customized ATLAS packages;
see the documentation for information.

########################################################################

#--#####################################################################
%ifarch %{ix86}
%define types base sse2 sse3

#----###################################################################
%package	-n %{libname}-base
Summary:	ATLAS libraries for SSE3 extensions (Pentium IV)
Group:		System/Libraries

%description	-n %{libname}-base
This package contains the ATLAS (Automatically Tuned Linear Algebra
Software) libraries compiled with base optimizations.
This is a generic binary package. Install the "%{name}" package
to build a version tuned for your computer.

%files		-n %{libname}-base
%dir %{_libdir}/atlas-base
%{_libdir}/atlas-base/*.so.*
%{_sysconfdir}/ld.so.conf.d/atlas-base.conf

#------#################################################################
%package	-n %{libatlas}-base-devel
Summary:	Development files for ATLAS SSE3 (Pentium IV)
Group:		Development/Other
Requires:	%{libname}-base = %{version}-%{release}

%description	-n %{libatlas}-base-devel
This package contains headers and development libraries of ATLAS
(Automatically Tuned Linear Algebra Software) compiled with base
optimizations.

%files		-n %{libatlas}-base-devel
%doc doc/*
%{_libdir}/atlas-base/*.so
%{_libdir}/atlas-base/*.a
%dir %{_includedir}/atlas
%{_includedir}/atlas/*.h
%{_includedir}/cblas.h
%{_includedir}/clapack.h

#----###################################################################
%package	-n %{libname}-sse2
Summary:	ATLAS libraries for SSE2 extensions (Pentium IV)
Group:		System/Libraries
Obsoletes:	%mklibname %{name}3.0-sse2
Provides:	%{libatlas} = %{version}-%{release}

%description	-n %{libname}-sse2
This package contains the ATLAS (Automatically Tuned Linear Algebra
Software) libraries compiled with SSE2 optimizations (Pentium IV).
This is a generic binary package. Install the "%{name}" package
to build a version tuned for your computer.

%files		-n %{libname}-sse2
%dir %{_libdir}/atlas
%{_libdir}/atlas/*.so.*
%{_sysconfdir}/ld.so.conf.d/atlas.conf

#------#################################################################
%package	-n %{libatlas}-sse2-devel
Summary:	Development files for ATLAS SSE2 (Pentium IV)
Group:		Development/Other
Requires:	%{libname}-sse2 = %{version}-%{release}
Provides:	%{libatlas}-devel = %{version}-%{release}

%description	-n %{libatlas}-sse2-devel
This package contains headers and development libraries of ATLAS
(Automatically Tuned Linear Algebra Software) compiled with SSE2
optimizations (Pentium IV).

%files		-n %{libatlas}-sse2-devel
%doc doc/*
%{_libdir}/atlas/*.so
%{_libdir}/atlas/*.a
%dir %{_includedir}/atlas
%{_includedir}/atlas/*.h
%{_includedir}/cblas.h
%{_includedir}/clapack.h

#----###################################################################
%package	-n %{libname}-sse3
Summary:	ATLAS libraries for SSE3 extensions (Pentium IV)
Group:		System/Libraries

%description	-n %{libname}-sse3
This package contains the ATLAS (Automatically Tuned Linear Algebra
Software) libraries compiled with SS3 optimizations (Pentium IV).
This is a generic binary package. Install the "%{name}" package
to build a version tuned for your computer.

%files		-n %{libname}-sse3
%dir %{_libdir}/atlas-sse3
%{_libdir}/atlas-sse3/*.so.*
%{_sysconfdir}/ld.so.conf.d/atlas-sse3.conf

#------#################################################################
%package	-n %{libatlas}-sse3-devel
Summary:	Development files for ATLAS SSE3 (Pentium IV)
Group:		Development/Other
Requires:	%{libname}-sse3 = %{version}-%{release}

%description	-n %{libatlas}-sse3-devel
This package contains headers and development libraries of ATLAS
(Automatically Tuned Linear Algebra Software) compiled with SSE3
optimizations (Pentium IV).

%files		-n %{libatlas}-sse3-devel
%doc doc/*
%{_libdir}/atlas-sse3/*.so
%{_libdir}/atlas-sse3/*.a
%dir %{_includedir}/atlas
%{_includedir}/atlas/*.h
%{_includedir}/cblas.h
%{_includedir}/clapack.h

#--#####################################################################
%else

%define types	%{_arch}

#----###################################################################
%package	-n %{libname}-%{_arch}
Summary:	ATLAS libraries for %{_arch}
Group:		System/Libraries
Provides:	%{libatlas} = %{version}-%{release}

%description	-n %{libname}-%{_arch}
This package contains the ATLAS (Automatically Tuned Linear Algebra
Software) libraries compiled with %{_arch} optimizations.
This is a generic binary package. Install the "%{name}" package
to build a version tuned for your computer.

%files		-n %{libname}-%{_arch}
%dir %{_libdir}/atlas
%{_libdir}/atlas/*.so.*
%{_sysconfdir}/ld.so.conf.d/atlas.conf

#------#################################################################
%package	-n %{libatlas}-%{_arch}-devel
Summary:	Development files for ATLAS for %{_arch}
Group:		Development/Other
Requires:	%{libname}-%{_arch} = %{version}-%{release}
Provides:	%{libatlas}-devel = %{version}-%{release}

%description	-n %{libatlas}-%{_arch}-devel
This package contains headers and development libraries of ATLAS
(Automatically Tuned Linear Algebra Software) compiled with %{_arch}
optimizations.

%files		-n %{libatlas}-%{_arch}-devel
%doc doc/*
%{_libdir}/atlas/*.so
%{_libdir}/atlas/*.a
%dir %{_includedir}/atlas
%{_includedir}/atlas/*.h
%{_includedir}/cblas.h
%{_includedir}/clapack.h

%endif	# ix86

%ifarch %{arm}
%define threads_option -t 2
%global mode %{nil}
%ifarch armv7hl
%global armflags -DATL_ARM_HARDFP=1
%else
%global armflags %{nil}
%endif
%else
%global mode -b %{__isa_bits}
%global armflags %{nil}
%if "%{?enable_native_atlas}" == "0"
%define threads_option -t 4 
%endif
%endif
 
%prep
%setup -q -n ATLAS
%patch3 -p1 -b .melf
%patch4 -p1 -b .thrott
%patch5 -p2 -b .sharedlib
#affinity crashes with fewer processors than the builder but increases performance of locally builded library
%if "%{?enable_native_atlas}" == "0"
%patch6 -p1 -b .affinity
%endif
%ifarch aarch64
%patch7 -p1 -b .aarch64
%endif
%patch8 -p1 -b .genparse
%patch9 -p1 -b .unbundle

cp %{SOURCE21} %{SOURCE22} %{SOURCE23} doc
cp -f %{SOURCE32} CONFIG/ARCHS/

%ifarch %{arm}
%ifarch armv7hl
# Set arm flags in atlcomp.txt
sed -i -e 's,-mfloat-abi=softfp,-mfloat-abi=hard,' CONFIG/src/atlcomp.txt
sed -i -e 's,-mcpu=cortex-a8,-march=armv7-a,' CONFIG/src/atlcomp.txt
sed -i -e 's,-mtune=cortex-a8,,' CONFIG/src/atlcomp.txt
sed -i -e 's,-mfpu=vfpv3,-mfpu=vfpv3-d16,' CONFIG/src/atlcomp.txt
%endif
# Some extra arm flags not needed
sed -i -e 's,-mfpu=vfpv3,,' tune/blas/gemm/CASES/*.flg
%endif

%build
for type in %{types}; do
    case $type in
	sse2|%{_arch})	libname=%{name}		;;
	*)		libname=%{name}-$type	;;
    esac
    mkdir -p %{_arch}_${type}
    pushd %{_arch}_${type}
	../configure  %{mode} %{?threads_option} %{?arch_option} -D c -DWALL -Fa alg '%{armflags} -g -Wa,--noexecstack -fPIC'\
	    --prefix=%{buildroot}%{_prefix}				\
	    --incdir=%{buildroot}%{_includedir}				\
	    --libdir=%{buildroot}%{_libdir}/${libname}	
	    
	if [ "$type" = "sse" ]; then
	     	sed -i 's#ARCH =.*#ARCH = PIII32SSE1#' Make.inc
		sed -i 's#-DATL_SSE3#-DATL_SSE1#' Make.inc 
		sed -i 's#-msse3#-msse#' Make.inc 
	elif [ "$type" = "sse2" ]; then
	        sed -i 's#ARCH =.*#ARCH = x86SSE232SSE2#' Make.inc
		sed -i 's#-DATL_SSE3#-DATL_SSE2#' Make.inc 
		sed -i 's#-msse3#-msse2#' Make.inc
	elif [ "$type" = "sse3" ]; then
	        sed -i 's#ARCH =.*#ARCH = P4E32SSE3#' Make.inc		
	elif [ "$type" = "x86_64" ]; then
	        sed -i 's#ARCH =.*#ARCH = HAMMER64SSE3#' Make.inc
                sed -i 's#-DATL_AVX\w*##g' Make.inc
                sed -i 's#-mavx\w*#-msse3#g' Make.inc
                sed -i 's#-mfma\w*#-msse3#g' Make.inc
	fi
	make build
	cd lib
	make shared
	make ptshared
    popd
done

%install
for type in %{types}; do
    case $type in
	sse2|%{_arch})	dirname=%{name}		;;
	*)		dirname=%{name}-$type	;;
    esac
    pushd %{_arch}_${type}
	make DESTDIR=%{buildroot} install || :
	mkdir -p %{buildroot}%{_libdir}/${dirname}
	cp -pr lib/*.so* %{buildroot}%{_libdir}/${dirname}/
    popd
    mkdir -p %{buildroot}%{_sysconfdir}/ld.so.conf.d
    echo "%{_libdir}/${dirname}"				\
	> %{buildroot}%{_sysconfdir}/ld.so.conf.d/${dirname}.conf
done

mkdir -p %{buildroot}%{_libdir}/%{name}
mkdir -p %{buildroot}%{_usrsrc}
tar jxf %{SOURCE0} -C %{buildroot}%{_usrsrc}

for i in Makefile README.%{_real_vendor}; do
   for s in _arch _includedir _libdir _sysconfdir name; do
      sed -e 's!%%{_arch}!%{_arch}!g' \
          -e 's!%%{_docdir}!%{_docdir}!g' \
          -e 's!%%{_includedir}!%{_includedir}!g' \
          -e 's!%%{_libdir}!%{_libdir}!g' \
          -e 's!%%{mode}!%{mode}!g' \
          -e 's!%%{name}!%{name}!g' \
          -e 's!%%{_prefix}!%{_prefix}!g' \
          -e 's!%%{release}!%{release}!g' \
          -e 's!%%{_sysconfdir}!%{_sysconfdir}!g' \
          -e 's!%%{_usrsrc}!%{_usrsrc}!g' \
          -e 's!%%{version}!%{version}!g' \
      < %{_sourcedir}/$i > %{buildroot}%{_usrsrc}/ATLAS/$i
   done
done
echo %{buildroot}%{_usrsrc}/ATLAS/$i

%check
# Run make check but don't fail the build on these arches
%ifarch s390 aarch64
for type in %{types}; do
	pushd %{_arch}_${type}
	make check ptcheck  || :
	popd
done
%else
for type in %{types}; do
	pushd %{_arch}_${type}
	make check ptcheck
	popd
done
%endif

%post
echo "

  Please check %{_usrsrc}/ATLAS/README.%{_real_vendor} for build instructions.

"

%files
%dir %{_usrsrc}/ATLAS
%{_usrsrc}/ATLAS/*
%dir %{_includedir}/%{name}
%dir %{_libdir}/%{name}
%doc doc/*


%changelog
* Tue Jun 27 2017 pterjan <pterjan> 3.10.2-9.mga6
+ Revision: 1108586
- Get the package to build for armv7 without neon
- Drop NEON config tarball, now included upstream and we don't use neon, and improve flags for armv7

* Sat Jun 17 2017 pterjan <pterjan> 3.10.2-8.mga6
+ Revision: 1107866
- Fix flags for armv5
- Do not enable neon on arm, our build machines do not support it, and only set hard float on v7

* Fri Jun 16 2017 pterjan <pterjan> 3.10.2-7.mga6
+ Revision: 1107807
- Improve arch flag overrides on x86_64 to prevent build failure on machines supporting avx2 (like autobuild)

* Thu Sep 22 2016 tv <tv> 3.10.2-6.mga6
+ Revision: 1055223
- set more flags for arm
- we use hard fp on armv7

* Wed Jul 20 2016 neoclust <neoclust> 3.10.2-5.mga6
+ Revision: 1042924
- Try to rebuild on arm

  + pterjan <pterjan>
    - Define enable_native_atlas
    - Use hardflot on armv7hl

* Wed May 25 2016 pterjan <pterjan> 3.10.2-4.mga6
+ Revision: 1018429
- Fix build on CPU >= Corei3

* Sun May 22 2016 shlomif <shlomif> 3.10.2-3.mga6
+ Revision: 1017521
- Hopefully fix the i586 build - 10x to david_david

  + tv <tv>
    - drop sse package (uncompilable)
    - mgarepo sync failed to add those :-(
    - drop support for custom build (broken/simpler)
    - do not inline big files in spec, package them as sources
     (as such, the Makefile we provide is now undependant of gcc version)
    - add %%check
    - configure like FC does
    - sync description with FC
    - sync patches with FC
    - new release + sync patches with FC

  + umeabot <umeabot>
    - Mageia 6 Mass Rebuild

* Wed Oct 15 2014 umeabot <umeabot> 3.8.4-6.mga5
+ Revision: 743315
- Second Mageia 5 Mass Rebuild
- Mageia 5 Mass Rebuild

* Sun Nov 17 2013 eatdirt <eatdirt> 3.8.4-4.mga4
+ Revision: 551659
- Removing detection of machine specific optimization (mga#11619)

* Sat Oct 19 2013 umeabot <umeabot> 3.8.4-3.mga4
+ Revision: 523186
- Mageia 4 Mass Rebuild

* Wed Mar 27 2013 mitya <mitya> 3.8.4-2.mga3
+ Revision: 405436
- Fix build for recent GCC, see RedHat Bug #817552

  + umeabot <umeabot>
    - Mass Rebuild - https://wiki.mageia.org/en/Feature:Mageia3MassRebuild

  + tv <tv>
    - new release

* Tue May 10 2011 ahmad <ahmad> 3.8.3-7.mga1
+ Revision: 96864
- Drop old/unneeded scriptlets
- Drop buildroot declaration
- User the %%{_real_vendor} macro in the REAMDE.* file name
- imported package atlas