# Copyright (c) 2016 Dave Love, Liverpool University # MIT licence, per Fedora policy. %global summ Pole EXpansion and Selected Inversion for electronic structure Name: pexsi Version: 0.10.1 Release: 1%{?dist} Summary: %summ License: BSD URL: https://math.berkeley.edu/~linlin/pexsi/ Source0: https://math.berkeley.edu/~linlin/pexsi/download/pexsi_v%version.tar.gz Source1: pexsi-make.inc BuildRequires: superlu_dist-openmpi-devel openmpi-devel openblas-devel BuildRequires: ptscotch-openmpi-devel-parmetis metis-devel BuildRequires: %{?el6:devtoolset-6-}gcc-c++ # for library soname %global major 0 %global minor 0 %global sover %major.%minor %global desc \ The Pole EXpansion and Selected Inversion (PEXSI) method is a fast\ method for electronic structure calculation based on Kohn-Sham density\ functional theory. It efficiently evaluates certain selected elements\ of matrix functions, e.g., the Fermi-Dirac function of the KS\ Hamiltonian, which yields a density matrix. It can be used as an\ alternative to diagonalization methods for obtaining the density,\ energy and forces in electronic structure calculations. The PEXSI\ library is written in C++, and uses message passing interface (MPI) to\ parallelize the computation on distributed memory computing systems\ and achieve scalability on more than 10,000 processors.\ \ From numerical linear algebra perspective, the PEXSI library can be\ used as a general tool for evaluating certain selected elements of a\ matrix function, and therefore has application beyond electronic\ structure calculation as well. %description %desc %package openmpi Summary: %summ - openmpi Requires: openmpi%{_isa} %description openmpi %desc This is the openmpi version. %package openmpi-devel Summary: Development files for %name Requires: %name%{?_isa} = %version-%release Requires: openmpi-devel%{?_isa} %description openmpi-devel Development files for %name %prep %setup -q -n pexsi_v%version cp %SOURCE1 make.inc %build %{?el6:. /opt/rh/devtoolset-6/enable} %_openmpi_load make %{?_smp_mflags} PEXSI_DIR="$(pwd)" PAR_ND_LIBRARY=ptscotch SEQ_ND_LIBRARY=scotch mkdir so pushd so ar x ../src/libpexsi_linux_v%version.a mpicc -shared -Wl,-soname=libpexsi.so.%sover -o ../libpexsi.so.%sover *.o \ -lsuperlu_dist -lopenblas popd #ln -s libpexsi.so.%sover libpexsi.so #LD_LIBRARY_PATH=$(pwd):$LD_LIBRARY_PATH \ make %{?_smp_mflags} PEXSI_DIR="$(pwd)" -C examples %install %_openmpi_load make install finstall PEXSI_BUILD_DIR=%{buildroot} PEXSI_DIR="$(pwd)" mkdir -p %buildroot$MPI_INCLUDE %buildroot$MPI_LIB mv %buildroot/include %buildroot$MPI_INCLUDE rm -r %buildroot/lib mv libpexsi.so* %buildroot$MPI_LIB ln -s libpexsi.so.%sover %buildroot$MPI_LIB/libpexsi.so ln -s libpexsi.so.%sover %buildroot$MPI_LIB/libpexsi.so.%major %check %_openmpi_load cd examples mpirun -n 4 driver_ksdft_linux_v%version %{!?_licensedir:%global license %doc} %files openmpi %license LICENSE %_libdir/openmpi/lib/libpexsi.so.* %files openmpi-devel %doc doc/* examples %_includedir/openmpi-%_arch/* %_libdir/openmpi/lib/libpexsi.so %changelog * Thu Nov 17 2016 Dave Love - 0.10.1-1 - New version with support for superlu_dist 5 * Tue Oct 18 2016 Dave Love - 0.9.2-1 - Initial packaging