Blob Blame History Raw
Name:           CheMPS2
Version:        1.8.3
Release:        1%{?dist}
Summary:        A spin-adapted implementation of DMRG for ab initio quantum chemistry

License:        GPLv2+
URL:            https://github.com/SebWouters/CheMPS2
Source0:        https://github.com/SebWouters/CheMPS2/archive/v%{version}.tar.gz

BuildRequires:  atlas-devel 
BuildRequires:  cmake 
BuildRequires:  hdf5-devel 
BuildRequires:  python2-devel 
BuildRequires:  numpy 
BuildRequires:  Cython
BuildRequires:  zlib-devel

%description    
The CheMPS2 library provides a free open-source spin-adapted 
implementation of the density matrix renormalization group (DMRG) for ab initio 
quantum chemistry. This method allows to obtain numerical accuracy in active 
spaces beyond the capabilities of full configuration interaction. For the 
input Hamiltonian and targeted symmetry sector, the library performs successive 
DMRG sweeps according to a user-defined convergence scheme. As output, the 
library returns the minimal encountered energy as well as the 2-RDM of the 
active space. The latter allows to calculate various properties, as well as 
the gradient and Hessian for orbital rotations or nuclear displacements.


%package        devel
Summary:        Development files for %{name}
Requires:       %{name}%{?_isa} = %{version}-%{release}
# For directory ownership
Requires:       cmake

%description    devel
The %{name}-devel package contains libraries and header files for
developing applications that use %{name}.

%package        python
Summary:        Python bindings for %{name}
Requires:       %{name}%{?_isa} = %{version}-%{release}

%description    python
The %{name}-python package contains the python interface for %{name}.

%prep
%setup -q

%build
mkdir build
cd build
export CXXFLAGS="%{optflags} -Wl,--as-needed"
%cmake .. -DMKL=OFF -DLAPACK_INTERJECT="-L%{_libdir}/atlas -ltatlas" -DENABLE_XHOST=OFF -DSHARED_ONLY=ON
make %{?_smp_mflags} VERBOSE=1
cd ../PyCheMPS2
export CPATH=../CheMPS2/include
%{__python2} setup.py build_ext -L ../build/CheMPS2

%install
make -C build install DESTDIR=%{buildroot}
install -D -p -m 644 chemps2.1 %{buildroot}%{_mandir}/man1/chemps2.1
cd PyCheMPS2
%{__python2} setup.py install -O1 --skip-build --root %{buildroot}
find %{buildroot} -name '*.la' -exec rm -f {} ';'
find %{buildroot} -name '*.a' -exec rm -f {} ';'

%check
echo "running python tests"
cd PyCheMPS2/tests
for i in test*[358].py; do 
  export LD_LIBRARY_PATH=../../build/CheMPS2 
  export PYTHONPATH=`find .. -name lib.*`  
  %{__python2} $i || { echo 'tests failed' ; exit 1; }
done

%post -p /sbin/ldconfig

%postun -p /sbin/ldconfig

%files
%doc README.md CHANGELOG.md FILES.md
%license LICENSE
%{_libdir}/libchemps2.so.*
%{_bindir}/chemps2
%{_mandir}/man1/chemps2.1.*

%files devel
%{_datadir}/cmake/CheMPS2/
%{_includedir}/chemps2/
%{_libdir}/libchemps2.so

%files python
%{python2_sitearch}/CheMPS2-%{version}-py*.egg-info
%{python2_sitearch}/PyCheMPS2.so

%changelog
* Sun Feb 05 2017 Susi Lehtola <jussilehtola@fedoraproject.org> - 1.8.3-1
- Update to 1.8.3.

* Mon Aug 29 2016 Matt Chan <talcite@gmail.com> - 1.8-1
- Updated to 1.8, Updated patches, build shared only
* Tue Jul 19 2016 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.7.3-2
- https://fedoraproject.org/wiki/Changes/Automatic_Provides_for_Python_RPM_Packages
* Thu Jul 14 2016 Matt Chan <talcite@gmail.com> - 1.7.3-1
- Updated to 1.7.3
* Wed Jun 15 2016 Matt Chan <talcite@gmail.com> - 1.7.2-1
- Updated to 1.7.2
* Wed Jun 15 2016 Matt Chan <talcite@gmail.com> - 1.7-4
- Added patch, cleaned up specfile 
* Wed Jun 15 2016 Matt Chan <talcite@gmail.com> - 1.7-3
- Changed CXX flags, changed BR
* Tue Jun 14 2016 Matt Chan <talcite@gmail.com> - 1.7-2
- Changed to follow packaging guidelines
- Added zlib for RHEL6 compatibility
* Sat Jun 11 2016 Matt Chan <talcite@gmail.com> - 1.7-1
- Initial build