# 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 major 3 %define libatlas libatlas %define libname %mklibname %{name} %{major} Name: atlas Version: 3.8.4 Release: %mkrel 6 Summary: Automatically Tuned Linear Algebra Software Group: Sciences/Mathematics License: BSD URL: http://math-atlas.sourceforge.net/ Source0: http://downloads.sourceforge.net/math-atlas/atlas%{version}.tar.bz2 Source1: http://math-atlas.sourceforge.net/errata.html Source2: http://math-atlas.sourceforge.net/faq.html Source3: http://www.cs.utsa.edu/~whaley/papers.html Patch0: atlas-fedora_shared.patch # http://sourceforge.net/p/math-atlas/patches/59/ Patch1: atlas-3.8.4-melf.patch #remove cpu throttling detection breaking compilation Patch2: atlas-3.8.4-throttling.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. ######################################################################## %if "%{?enable_custom_atlas}" == "1" %define types custom %define mode %(gcc -dumpmachine | perl -e 'if (/^i.86-/) { print 32; } elsif (/[^-]+64-/) { print 64; } else { print 32; }') %package -n %{libname}-custom Summary: Custom ATLAS libraries Group: Development/Other %description -n %{libname}-custom This package contains the ATLAS (Automatically Tuned Linear Algebra Software) libraries compiled with custom optimizations. %files -n %{libname}-custom %dir %{_libdir}/atlas-custom %{_libdir}/atlas-custom/*.so.* %{_sysconfdir}/ld.so.conf.d/atlas-custom.conf %package -n %{libatlas}-custom-devel Summary: Custom development files for ATLAS Group: Development/Other Requires: %{libname}-custom = %{version}-%{release} %description -n %{libatlas}-custom-devel This package contains headers and development libraries of ATLAS (Automatically Tuned Linear Algebra Software) compiled with custom optimizations. %files -n %{libatlas}-custom-devel %doc doc/* %{_libdir}/atlas-custom/*.so %{_libdir}/atlas-custom/*.a %dir %{_includedir}/atlas %{_includedir}/atlas/*.h %{_includedir}/cblas.h %{_includedir}/clapack.h %else # enable_custom_atlas #--##################################################################### %ifarch %{ix86} %define types sse sse2 sse3 %define mode 32 #----################################################################### %package -n %{libname}-sse Summary: ATLAS libraries for SSE extensions (Pentium III) Group: System/Libraries Obsoletes: %{libname}-3dnow < 3.7 Obsoletes: %mklibname %{name}3.0-sse Obsoletes: %mklibname %{name}3.0-3dnow Obsoletes: %mklibname %{name}%{major}-3dnow %description -n %{libname}-sse This package contains the ATLAS (Automatically Tuned Linear Algebra Software) libraries compiled with SSE optimizations (Pentium III). This is a generic binary package. Install the "%{name}" package to build a version tuned for your computer. %files -n %{libname}-sse %dir %{_libdir}/atlas-sse %{_libdir}/atlas-sse/*.so.* %{_sysconfdir}/ld.so.conf.d/atlas-sse.conf #------################################################################# %package -n %{libatlas}-sse-devel Summary: Development files for ATLAS SSE (Pentium III) Group: Development/Other Requires: %{libname}-sse = %{version}-%{release} Obsoletes: %mklibname -d %{name}3.0-sse Obsoletes: %mklibname -d %{name}3.0-3dnow Obsoletes: %mklibname -d %{name}%{major}-3dnow %description -n %{libatlas}-sse-devel This package contains headers and development libraries of ATLAS (Automatically Tuned Linear Algebra Software) compiled with SSE optimizations (Pentium III). %files -n %{libatlas}-sse-devel %doc doc/* %{_libdir}/atlas-sse/*.so %{_libdir}/atlas-sse/*.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 %ifarch x86_64 ppc64 %define mode 64 %else %define mode 32 %endif # x86_64 ppc64 %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 %endif # enable_custom_atlas ######################################################################## %prep %setup -q -n ATLAS %patch0 -p0 -b .shared %patch1 -p1 -b .melf %patch2 -p1 -b .throt cp %{SOURCE1} %{SOURCE2} %{SOURCE3} doc %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 -b %{mode} -D c -DWALL -Fa alg \ '-Wa,--noexecstack -fPIC' \ -Ss f77lib `gfortran --print-file-name=libgfortran.so` \ --prefix=%{buildroot}%{_prefix} \ --incdir=%{buildroot}%{_includedir} \ --libdir=%{buildroot}%{_libdir}/${libname} \ --with-netlib-lapack=%{_libdir}/liblapack_pic.a 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##' Make.inc sed -i 's#-mavx#-msse3#' 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} pushd %{buildroot}%{_usrsrc}/ATLAS patch -p0 < %{PATCH0} popd cat > %{buildroot}%{_usrsrc}/ATLAS/Makefile << EOF all: config libs libs: mkdir -p %{_libdir}/%{name} && \ (cd %{_arch} && make build && cd lib && make shared && make ptshared || :) config: [ -d %{_arch} ] || (mkdir -p %{_arch} && cd %{_arch} && \ ../configure -b %{mode} -D c -DWALL -Fa alg \ '-Wa,--noexecstack -fPIC' \ -Ss f77lib `gfortran --print-file-name=libgfortran.so` \ --prefix=%{_prefix} \ --incdir=%{_includedir}/%{name} \ --libdir=%{_libdir}/%{name} \ --with-netlib-lapack=%{_libdir}/liblapack_pic.a) clean: rm -fr %{_arch} install: (cd %{_arch} && (make install || :) && \ cp -pr lib/*.so* %{_libdir}/%{name} && \ echo "%{_libdir}/%{name}" > %{_sysconfdir}/ld.so.conf.d/%{name}.conf) uninstall: rm -fr %{_libdir}/%{name}/* rm -fr %{_includedir}/%{name}/* rm -f %{_sysconfdir}/ld.so.conf.d/%{name}.conf rm -f %{_includedir}/cblas.h rm -f %{_includedir}/clapack.h EOF cat > %{buildroot}%{_usrsrc}/ATLAS/README.%{_real_vendor} << EOF To build a tuned version of atlas for you computer, as root, run: % cd %{_usrsrc}/ATLAS % make all install The Makefile in this directory uses the same options as the precompiled atlas packages, and uses the same directory layout. You may also prefer to have the files handled by rpm, in which case you need the source rpm, with which you can run: % rpmbuild -D "enable_custom_atlas 1" --rebuild atlas-%{version}-%{release}.src.rpm NOTES o It is advisable to ensure cpu throttling is off. To do this: % urpmi cpufrequtils % cpufreq-set -g performance o The tests during compilation are heavily dependent on cpu load. It is advisable to have as few background processes as possible during compilation, otherwise if timing samples are too much different, the build will fail, in which case, you can run: % cd %{_arch} % make to retry. o Please also consult the files README and INSTALL.txt. Extra documentation is in %{_docdir}/atlas Example: % cd %{_arch} # change to architecture build % make check # check if library produces expected results % make ptcheck # check threaded/smp library (if detected/built) % make time # check if library has the expected performance EOF ######################################################################## %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 * 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 * Thu Dec 09 2010 Oden Eriksson <oeriksson@mandriva.com> 3.8.3-6mdv2011.0 + Revision: 616629 - the mass rebuild of 2010.0 packages * Thu Sep 03 2009 Lev Givon <lev@mandriva.org> 3.8.3-5mdv2010.0 + Revision: 428962 - Incorporate update from rev 1.23 of Fedora spec file. * Tue Apr 28 2009 Paulo Andrade <pcpa@mandriva.com.br> 3.8.3-4mdv2010.0 + Revision: 369122 - Provide libatlas = %%{version}-%%{release} instead of libatlas%%{major} = %%{version}-%%{release}. * Tue Mar 10 2009 Paulo Andrade <pcpa@mandriva.com.br> 3.8.3-3mdv2009.1 + Revision: 353342 - Correct a major typo, where the libname major was "upgraded" instead of the package release. - o Restore/reimplement enable_custom_atlas option, as an alternative to the "from sources" build, so that files are properly managed by rpm, but still built for a single computer. o Add explicit (untested) support for a generic ppc64 build, and assume any other arch is 32 bits. * Mon Mar 09 2009 Paulo Andrade <pcpa@mandriva.com.br> 3.8.3-2mdv2009.1 + Revision: 353292 + rebuild (emptylog) * Sat Mar 07 2009 Paulo Andrade <pcpa@mandriva.com.br> 3.8.3-1mdv2009.1 + Revision: 350722 - Bump release and resubmit. ix86 build failed with message: EE: gcc: unknown error: PIC register 'bx' clobbered in 'asm' (Resubmit to check if same error will again, what could be a bug in how atlas build handle the ix86 build computer). - Update to new upstream release 3.8.3. Atlas is a package that requires being compiled in the computer where it will be used. To achieve this, a "ready to build" setup is available in the main package, and generic precompiled library binaries are also available. The default ones are: o libatlas-sse2 for ix86 This requires a Pentium IV class cpu ("modern" ix86 cpus support sse3, but Celeron and older Pentium IV class cpus support only sse2). o libatlas-x86_64 for x86_64 Generic x86_64 build. Note that the build is dependent on the computer generating the packages, and the threaded/smp libraries will only be generated on builds on a multi core/cpu computer only. * Thu Dec 18 2008 Lev Givon <lev@mandriva.org> 3.6.0-7mdv2009.1 + Revision: 315405 - Rebuild. * Wed Dec 10 2008 Lev Givon <lev@mandriva.org> 3.6.0-6mdv2009.1 + Revision: 312567 - Obsolete libatlas3.0 packages. * Mon Dec 01 2008 Lev Givon <lev@mandriva.org> 3.6.0-5mdv2009.1 + Revision: 308686 - Build against latest lapack libs. Use latest diff file from Debian. + Pixel <pixel@mandriva.com> - do not call ldconfig in %%post/%%postun, it is now handled by filetriggers - no need for explicit Requires(post,postun) on ldconfig (rpm will add it automatically) * Thu Mar 13 2008 Andreas Hasenack <andreas@mandriva.com> 3.6.0-4mdv2008.1 + Revision: 187694 - rebuild for 2008.1 + Olivier Blin <oblin@mandriva.com> - restore BuildRoot * Mon Dec 17 2007 Thierry Vignaud <tv@mandriva.org> 3.6.0-3mdv2008.1 + Revision: 122240 - kill re-definition of %%buildroot on Pixel's request + Lev Givon <lev@mandriva.org> - import atlas * Sun Sep 30 2007 Lev Givon <lev@mandriva.org> 3.6.0-3mdv2007.1 - Adapt Fedora spec file for Mandriva.