File lammps.spec of Package lammps

#
# spec file for package lammps
#
# Copyright (c) 2013 SUSE LINUX Products GmbH, Nuernberg, Germany.
# Copyright (c) 2017-2018 Christoph Junghans
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.

# Please submit bugfixes or comments via http://bugs.opensuse.org/
#

Name:           lammps
Version:        20180316
%define         uversion stable_16Mar2018
Release:        0
Summary:        Molecular Dynamics Simulator
License:        GPL-2.0 and GPL-3.0+
Group:          Productivity/Scientific/Chemistry
Url:            http://lammps.sandia.gov
Source0:        https://github.com/lammps/lammps/archive/%{uversion}.tar.gz#/%{name}-%{uversion}.tar.gz
# PATCH-FIX-UPSTREAM 858.patch, https://github.com/lammps/lammps/pull/858 - fix return value on ppc64
Patch0:         https://github.com/lammps/lammps/pull/858.patch
BuildRequires:  fftw3-devel
BuildRequires:  gcc-c++
BuildRequires:  gcc-fortran
BuildRequires:  libpng-devel
BuildRequires:  libjpeg-devel
BuildRequires:  openmpi-devel
BuildRequires:  python-devel
BuildRequires:  fftw3-devel
BuildRequires:  voro++-devel
BuildRequires:  zlib-devel
BuildRequires:  gsl-devel
BuildRequires:  cmake
BuildRequires:  opencl-headers
BuildRequires:  ocl-icd-devel
BuildRoot:      %{_tmppath}/%{name}-%{version}-build

%description
LAMMPS is a classical molecular dynamics code, and an acronym for Large-scale 
Atomic/Molecular Massively Parallel Simulator.

LAMMPS has potentials for soft materials (biomolecules, polymers) and 
solid-state materials (metals, semiconductors) and coarse-grained or 
mesoscopic systems. It can be used to model atoms or, more generically, as a 
parallel particle simulator at the atomic, meso, or continuum scale.

LAMMPS runs on single processors or in parallel using message-passing 
techniques and a spatial-decomposition of the simulation domain. The code is 
designed to be easy to modify or extend with new functionality.

%package -n liblammps0
Summary:        LAMMPS library
Group:          System/Libraries

%description -n liblammps0
LAMMPS is a classical molecular dynamics code, and an acronym for Large-scale 
Atomic/Molecular Massively Parallel Simulator.

LAMMPS has potentials for soft materials (biomolecules, polymers) and 
solid-state materials (metals, semiconductors) and coarse-grained or 
mesoscopic systems. It can be used to model atoms or, more generically, as a 
parallel particle simulator at the atomic, meso, or continuum scale.

LAMMPS runs on single processors or in parallel using message-passing 
techniques and a spatial-decomposition of the simulation domain. The code is 
designed to be easy to modify or extend with new functionality.

This package contains the library of LAMMPS package.

%package devel
Summary:    Development headers and libraries for LAMMPS
Group:      Development/Libraries/C and C++
Requires:   liblammps0 = %{version}
Requires:   %{name} = %{version}

%description devel
LAMMPS is a classical molecular dynamics code, and an acronym for Large-scale 
Atomic/Molecular Massively Parallel Simulator.

LAMMPS has potentials for soft materials (biomolecules, polymers) and 
solid-state materials (metals, semiconductors) and coarse-grained or 
mesoscopic systems. It can be used to model atoms or, more generically, as a 
parallel particle simulator at the atomic, meso, or continuum scale.

LAMMPS runs on single processors or in parallel using message-passing 
techniques and a spatial-decomposition of the simulation domain. The code is 
designed to be easy to modify or extend with new functionality.

This package contains development headers and libraries for LAMMPS.

%package -n python-%{name}
Summary:    LAMMPS python module
Group:      Development/Languages/Python
Requires:   liblammps0 = %{version}

%description -n python-%{name}
LAMMPS is a classical molecular dynamics code, and an acronym for Large-scale 
Atomic/Molecular Massively Parallel Simulator.

LAMMPS has potentials for soft materials (biomolecules, polymers) and 
solid-state materials (metals, semiconductors) and coarse-grained or 
mesoscopic systems. It can be used to model atoms or, more generically, as a 
parallel particle simulator at the atomic, meso, or continuum scale.

LAMMPS runs on single processors or in parallel using message-passing 
techniques and a spatial-decomposition of the simulation domain. The code is 
designed to be easy to modify or extend with new functionality.

This subpackage contains LAMMPS's Python module.

%prep
%setup -q -n %{name}-%{uversion}
%patch0 -p1

%build
source %{_libdir}/mpi/gcc/openmpi/bin/mpivars.sh

%{cmake} -DENABLE_ALL=ON -DENABLE_MPI=ON -DENABLE_PYTHON=ON -DENABLE_TESTING=ON -DENABLE_VORONOI=ON -DENABLE_GPU=ON -DGPU_API=OpenCL -DFFT=FFTW3 -DPYTHON_INSTDIR=%{python_sitearch} ../cmake
make %{?_smp_mflags}

%install
%cmake_install

%check
LD_LIBRARY_PATH='%{buildroot}/%{_libdir}:%{_libdir}/mpi/gcc/openmpi/%{_lib}' make -C build %{?_smp_mflags} test ARGS=-V

%post -n liblammps0 -p /sbin/ldconfig
%postun -n liblammps0 -p /sbin/ldconfig

%files
%defattr(-,root,root)
%doc LICENSE README
%{_bindir}/lmp

%files -n liblammps0
%defattr(-,root,root,-)
%{_libdir}/liblammps.so.*

%files devel
%defattr(-,root,root)
%doc LICENSE
%{_includedir}/%{name}
%{_libdir}/liblammps.so
%{_libdir}/pkgconfig/liblammps.pc

%files -n python-%{name}
%defattr(-,root,root,-)
%{python_sitearch}/%{name}.py

%changelog
openSUSE Build Service is sponsored by