%define debug_package %{nil} %define _lapack_pkg lapack-3.1.1 %define _lapack_builddir_static %{_lapack_pkg}_static %define _lapack_builddir_shared %{_lapack_pkg}_shared %define _atlas_pkg ATLAS %define _atlas_builddir_static %{_atlas_pkg}_static %define _atlas_builddir_shared %{_atlas_pkg}_shared %define _soversionmajor 3 %define _soversionminor 0 %ifarch x86_64 %define _bit_width 64 %define _lapack_make_inc make.inc.64 %else %define _bit_width 32 %define _lapack_make_inc make.inc.32 %endif Name: atlas Version: 3.8.0 Release: 1 Summary: Automatically Tuned Linear Algebra Software Group: System Environment/Libraries License: BSD URL: http://math-atlas.sourceforge.net Source: %{name}-%{version}.tar.gz BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) Requires: %{_sysconfdir}/ld.so.conf.d Requires(post): /sbin/ldconfig Requires(postun): /sbin/ldconfig Requires: gawk Requires: grep Requires: coreutils Requires: util-linux BuildRequires: gcc-gfortran gcc %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 for Fedora 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. %package devel Summary: Development libraries for ATLAS Group: Development/Libraries Requires: %{name} = %{version}-%{release} %description devel This package contains the static/dynamic libraries and headers for development with ATLAS (Automatically Tuned Linear Algebra Software). %prep %setup -q -n %{name} %if "%{?_use_prebuilt_binary}" == "1" %build # ... nothing to build, use ATLAS binaries pre-built by user %install rm -rf %{buildroot} mkdir -p %{buildroot} _prebuilt_tarball="%{name}-prebuilt.tar.bz2" if [ -f "${_prebuilt_tarball}" ]; then tar xjf "${_prebuilt_tarball}" -C %{buildroot} else echo "ERROR: Cannot find ${_prebuilt_tarball}. Aborting..." exit 1 fi %else %build # Step 1a - Build LAPACK (for static ATLAS lib) tar xzf %{_lapack_pkg}.tgz mv -f %{_lapack_pkg} %{_lapack_builddir_static} cp -f %{_lapack_make_inc} %{_lapack_builddir_static}/make.inc ( cd %{_lapack_builddir_static}; sed -i -e 's/-fPIC//g' make.inc; make lib ) _cwd=`pwd` _lapack_static_lib="${_cwd}/%{_lapack_builddir_static}/lapack_LINUX.a" # Step 1b - Build LAPACK (for shared ATLAS lib) tar xzf %{_lapack_pkg}.tgz mv -f %{_lapack_pkg} %{_lapack_builddir_shared} cp -f %{_lapack_make_inc} %{_lapack_builddir_shared}/make.inc ( cd %{_lapack_builddir_shared}; make lib ) _cwd=`pwd` _lapack_shared_lib="${_cwd}/%{_lapack_builddir_shared}/lapack_LINUX.a" # Step 2a - Build ATLAS (static lib) tar xjf %{name}%{version}.tar.bz2 patch -p0 < atlas.patch cd ATLAS mkdir -p %{_atlas_builddir_static} ( cd %{_atlas_builddir_static}; ../configure -b %{_bit_width} \ --prefix=%{buildroot} \ --with-netlib-lapack=${_lapack_static_lib}; make build; make check; make time; ) # Step 2b - Build ATLAS (shared lib) mkdir -p %{_atlas_builddir_shared} ( cd %{_atlas_builddir_shared}; ../configure -b %{_bit_width} -Fa alg -fPIC \ --prefix=%{buildroot} \ --with-netlib-lapack=${_lapack_shared_lib}; make build; make check; make time; cd lib; make shared; for lib in libatlas.so liblapack.so libf77blas.so libcblas.so; do mv $lib ${lib}.%{_soversionmajor}.%{_soversionminor} ln -s ${lib}.%{_soversionmajor}.%{_soversionminor} \ ${lib}.%{_soversionmajor} ln -s ${lib}.%{_soversionmajor}.%{_soversionminor} ${lib} done ) %install _arch=`/bin/arch` _vendor_str=`cat /proc/cpuinfo | grep -i vendor_id | head -1 | awk '{print $3}'` _cpu_platform="${_vendor_str}_${_arch}" rm -rf %{buildroot} mkdir -p %{buildroot}%{_sysconfdir}/ld.so.conf.d/%{name} mkdir -p %{buildroot}%{_includedir}/%{name} mkdir -p %{buildroot}%{_libdir}/%{name}_${_cpu_platform} mkdir -p %{buildroot}%{_defaultdocdir}/%{name}-%{version} cd ATLAS cp -a include/*.h %{buildroot}%{_includedir}/%{name} cp -a doc/* %{buildroot}%{_defaultdocdir}/%{name}-%{version} echo "%{_libdir}/%{name}" > %{buildroot}%{_sysconfdir}/ld.so.conf.d/%{name}.conf ( cd %{_atlas_builddir_static}; cp -a lib/*.a %{buildroot}%{_libdir}/%{name}_${_cpu_platform} ) ( cd %{_atlas_builddir_shared}; cp -a lib/*.so* %{buildroot}%{_libdir}/%{name}_${_cpu_platform} ) %endif # %if "%{?_use_prebuilt_binary}" == "1" %files %defattr(-,root,root,-) %dir %{_libdir}/%{name}_* %{_libdir}/%{name}_*/*.so.* %{_sysconfdir}/ld.so.conf.d/%{name}.conf %files devel %defattr(-,root,root,-) %dir %{_libdir}/%{name}_* %{_defaultdocdir}/%{name}-%{version} %{_libdir}/%{name}_*/*.so %{_libdir}/%{name}_*/*.a %{_includedir}/%{name} %post _arch=`/bin/arch` _vendor_str=`cat /proc/cpuinfo | grep -i vendor_id | head -1 | awk '{print $3}'` _cpu_platform="${_vendor_str}_${_arch}" _cpu_libdir="%{_libdir}/%{name}_${_cpu_platform}" if [ -d "${_cpu_libdir}" ]; then ln -s "${_cpu_libdir}" "%{_libdir}/%{name}" fi /sbin/ldconfig %postun _atlas_symlink="%{_libdir}/%{name}" if [ -h "${_atlas_symlink}" ]; then rm -f "${_atlas_symlink}" fi /sbin/ldconfig %clean rm -rf %{buildroot}