libint2/libint2.spec
2013-07-11 21:09:51 +03:00

197 lines
5.7 KiB
RPMSpec
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# Snapshot revision.
%global hgrel 644
# Do full bootstrapping? (Build compiler and run it to generate library sources)
%global bootstrap 1
%if 0%{?rhel} == 5 || 0%{?rhel} == 6
%global bootstrap 0
%endif
# The source code the libint compiler generates is already very highly
# optimized. Further optimization done by the compiler does not
# increase performance, but it just takes a *lot* longer to compile.
# We use -O2 for the compiler and -O1 for the library (these are given
# in configure). The common flags are
%global commonflags %(echo %{optflags} | sed "s|-O2||g")
%if %bootstrap
%global optflags %commonflags
%else
%global optflags %commonflags -O1
%endif
Name: libint2
Version: 2.0.3
Release: 2.%{hgrel}hg%{?dist}
Summary: A library for efficient evaluation of electron repulsion integrals
Group: System Environment/Libraries
License: GPLv2+
URL: http://sourceforge.net/p/libint
# Compiler sources
Source0: libint2-%{hgrel}hg.tar.xz
# The library sources, which are autogenerated by a compiler, which needs a
# rather recent C++11 compiler to compile. Regardless of the C++
# compiler used, the generated sources are identical. However, EPEL
# doesn't have a recent enough C++ compiler to be able to generate the
# sources. Also, if the sources are generated on the same run,
# debuginfo will turn up missing from the RPM (BZ #9619635). For this
# reason pregenerated sources are used. To generate the sources, run
# the generate-sources.sh script.
Source1: libint-%{version}-%{hgrel}hg.tar.xz
# For building documentation
BuildRequires: tex(latex)
%if 0%{?fedora} >= 18
BuildRequires: tex(appendix.sty)
BuildRequires: tex(framed.sty)
BuildRequires: tex(mathcomp.sty)
BuildRequires: tex(subfigure.sty)
Buildrequires: tex(wrapfig.sty)
BuildRequires: tex-bibtex
BuildRequires: tex(bbding.sty)
BuildRequires: tex(braket.sty)
BuildRequires: tex(sfmath.sty)
%endif
%if %bootstrap
BuildRequires: boost-devel
BuildRequires: gmp-devel
BuildRequires: mpfr-devel
BuildRequires: autoconf
BuildRequires: automake
%endif
BuildRoot: %(mktemp -ud %{_tmppath}/%{name}-%{version}-%{release}-XXXXXX)
# On PPC (at least on EPEL5) the build fails due to a relocation error
ExcludeArch: ppc
%description
LIBINT computes the Coulomb and exchange integrals, which in electronic
structure theory are called electron repulsion integrals (ERIs). This is by
far the most common type of integrals in molecular structure theory.
LIBINT uses recursive schemes that originate in seminal Obara-Saika method and
Head-Gordon and Poples variation thereof. The idea of LIBINT is to optimize
computer implementation of such methods by implementing an optimizing compiler
to generate automatically highly-specialized code that runs well on
super-scalar architectures.
%package devel
Summary: Development headers and libraries for libint
Group: Development/Libraries
Requires: libint2%{?_isa} = %{version}-%{release}
%description devel
This package contains development headers and libraries for libint.
It also contains a programmer's manual.
%prep
%if %bootstrap
%setup -q -n libint2
# Generate configure
aclocal -I lib/autoconf
autoconf
%else
%setup -q -T -b 1 -n libint-%{version}-stable
%endif
%build
export CXX=g++
%if %bootstrap
mkdir objdir-%{_arch}
cd objdir-%{_arch}
ln -s ../configure .
%endif
%configure \
%if %bootstrap
--enable-eri=2 --enable-eri3=2 --enable-eri2=2 \
--with-eri-max-am=7,5,4 --with-eri-opt-am=3 \
--with-eri3-max-am=7 --with-eri2-max-am=7 \
--with-g12-max-am=5 --with-g12-opt-am=3 \
--with-g12dkh-max-am=5 --with-g12dkh-opt-am=3 \
--disable-unrolling --enable-generic-code --enable-contracted-ints \
--with-cxx-optflags="-O2" --with-cxxgen-optflags="-O1" \
%endif
--enable-shared --disable-static
make %{?_smp_mflags}
# Build documentation
make -C doc
%install
rm -rf %{buildroot}
%if %bootstrap
cd objdir-%{_arch}
%endif
make install DESTDIR=%{buildroot}
find %{buildroot} -name *.la -delete
# Make sure libraries are executable (otherwise they are not stripped)
find %{buildroot} -name *.so.*.* -exec chmod 755 {} \;
%clean
rm -rf %{buildroot}
%post -p /sbin/ldconfig
%postun -p /sbin/ldconfig
%if %bootstrap
%check
cd objdir-%{_arch}
export LD_LIBRARY_PATH=`pwd`/lib/.libs/
make check CXXFLAGS="%{optflags} -O2 -std=c++11"
%endif
%files
%defattr(-,root,root,-)
%doc LICENSE COPYING
%{_libdir}/libint*.so.*
%files devel
%defattr(-,root,root,-)
%if %bootstrap
%doc objdir-%{_arch}/doc/progman/progman.pdf
%else
%doc doc/progman.pdf
%endif
%{_includedir}/libint2/
%{_libdir}/*.so
%changelog
* Thu Jul 11 2013 Susi Lehtola <jussilehtola@fedoraproject.org> - 2.0.3-1.644hg
- Use xz to compress tarballs (BZ #979817).
- Update to revision 644.
* Tue May 21 2013 Susi Lehtola <jussilehtola@fedoraproject.org> - 2.0.3-2.641hg
- Reduce maximum angular momentum for derivative ERIs, since 2nd derivatives of
(kk|kk) takes more than 2 GB of RAM.
- Enabled g12 and g12dkh integrals.
* Thu May 16 2013 Susi Lehtola <jussilehtola@fedoraproject.org> - 2.0.3-1.641hg
- Use pregenerated tarballs only on EPEL.
* Sun May 12 2013 Susi Lehtola <jussilehtola@fedoraproject.org> - 2.0.2-2.618hg
- Switch to using a pregenerated tarball of library sources instead of
rerunning compiler for each build, solving BZ #961963.
* Thu May 09 2013 Susi Lehtola <jussilehtola@fedoraproject.org> - 2.0.2-1.615hg
- Update to hg snapshot 615 (version 2.0.2), fixing FTBFS on rawhide.
- Added possibility to run tests, but not by default since running them
takes *eons*.
* Mon May 06 2013 Susi Lehtola <jussilehtola@fedoraproject.org> - 2.0.0-3.607hg
- Explicitly arched requires in -devel package.
* Mon Feb 18 2013 Dominik Mierzejewski <rpm@greysector.net> - 2.0.0-2.607hg
- Add missing tex build dependencies
- Fix devel subpackage dependencies
* Wed Jan 23 2013 Susi Lehtola <jussilehtola@fedoraproject.org> - 2.0.0-1.607hg
- First release.