forked from pool/lammps
Compare commits
4 Commits
| Author | SHA256 | Date | |
|---|---|---|---|
| 3f71cbd684 | |||
| 7d2303a7a8 | |||
| e26405e0a9 | |||
| ee8991ba8a |
58
lammps-allow-system-gtest.patch
Normal file
58
lammps-allow-system-gtest.patch
Normal file
@@ -0,0 +1,58 @@
|
||||
---
|
||||
unittest/CMakeLists.txt | 41 +++++++++++++++++++++++++----------------
|
||||
1 file changed, 25 insertions(+), 16 deletions(-)
|
||||
|
||||
Index: lammps-stable_29Aug2024_update2/unittest/CMakeLists.txt
|
||||
===================================================================
|
||||
--- lammps-stable_29Aug2024_update2.orig/unittest/CMakeLists.txt
|
||||
+++ lammps-stable_29Aug2024_update2/unittest/CMakeLists.txt
|
||||
@@ -9,24 +9,33 @@ if((CMAKE_CXX_COMPILER_ID STREQUAL "GNU"
|
||||
message(FATAL_ERROR "Need GNU C++ compiler version 6.x or later for unit testing")
|
||||
endif()
|
||||
|
||||
-message(STATUS "Downloading and building googletest framework")
|
||||
-set(GTEST_URL "https://github.com/google/googletest/archive/release-1.12.1.tar.gz" CACHE STRING "URL of googletest source")
|
||||
-set(GTEST_MD5 "e82199374acdfda3f425331028eb4e2a" CACHE STRING "MD5 sum for googletest source")
|
||||
-mark_as_advanced(GTEST_URL)
|
||||
-mark_as_advanced(GTEST_MD5)
|
||||
-set(gtest_force_shared_crt ON CACHE BOOL "" FORCE)
|
||||
+set(EXTERNAL_GTEST OFF CACHE BOOL "Use system gtest")
|
||||
+if (EXTERNAL_GTEST)
|
||||
+ find_package(GTest REQUIRED)
|
||||
+ add_library(GTest::GTest ALIAS GTest::gtest)
|
||||
+ add_library(GTest::GMock ALIAS GTest::gmock)
|
||||
+ add_library(GTest::GTestMain ALIAS GTest::gtest_main)
|
||||
+ add_library(GTest::GMockMain ALIAS GTest::gmock_main)
|
||||
+else()
|
||||
+ message(STATUS "Downloading and building googletest framework")
|
||||
+ set(GTEST_URL "https://github.com/google/googletest/archive/release-1.12.1.tar.gz" CACHE STRING "URL of googletest source")
|
||||
+ set(GTEST_MD5 "e82199374acdfda3f425331028eb4e2a" CACHE STRING "MD5 sum for googletest source")
|
||||
+ mark_as_advanced(GTEST_URL)
|
||||
+ mark_as_advanced(GTEST_MD5)
|
||||
+ set(gtest_force_shared_crt ON CACHE BOOL "" FORCE)
|
||||
|
||||
-include(ExternalCMakeProject)
|
||||
-if(CMAKE_CXX_COMPILER_ID STREQUAL "IntelLLVM")
|
||||
- set(cxx_strict_flags "-Wno-error -Wno-unused-command-line-argument")
|
||||
+ include(ExternalCMakeProject)
|
||||
+ if(CMAKE_CXX_COMPILER_ID STREQUAL "IntelLLVM")
|
||||
+ set(cxx_strict_flags "-Wno-error -Wno-unused-command-line-argument")
|
||||
+ endif()
|
||||
+ set(INSTALL_GTEST OFF CACHE BOOL "" FORCE)
|
||||
+ set(INSTALL_GMOCK OFF CACHE BOOL "" FORCE)
|
||||
+ ExternalCMakeProject(googletest ${GTEST_URL} ${GTEST_MD5} googletest . "")
|
||||
+ add_library(GTest::GTest ALIAS gtest)
|
||||
+ add_library(GTest::GMock ALIAS gmock)
|
||||
+ add_library(GTest::GTestMain ALIAS gtest_main)
|
||||
+ add_library(GTest::GMockMain ALIAS gmock_main)
|
||||
endif()
|
||||
-set(INSTALL_GTEST OFF CACHE BOOL "" FORCE)
|
||||
-set(INSTALL_GMOCK OFF CACHE BOOL "" FORCE)
|
||||
-ExternalCMakeProject(googletest ${GTEST_URL} ${GTEST_MD5} googletest . "")
|
||||
-add_library(GTest::GTest ALIAS gtest)
|
||||
-add_library(GTest::GMock ALIAS gmock)
|
||||
-add_library(GTest::GTestMain ALIAS gtest_main)
|
||||
-add_library(GTest::GMockMain ALIAS gmock_main)
|
||||
|
||||
option(SKIP_DEATH_TESTS "Do not run 'death tests' to reduce false positives in valgrind" OFF)
|
||||
mark_as_advanced(SKIP_DEATH_TESTS)
|
||||
@@ -1,3 +0,0 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:3d347f6b512bc360505019d1c6183c969a2e1da402e31a1e26577daf5e419d95
|
||||
size 127070542
|
||||
3
lammps-stable_29Aug2024_update2.tar.gz
Normal file
3
lammps-stable_29Aug2024_update2.tar.gz
Normal file
@@ -0,0 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:f8ca3f021a819ced8658055f7750e235c51b4937ddb621cf1bd7bee08e0b6266
|
||||
size 142223423
|
||||
@@ -1,3 +1,40 @@
|
||||
-------------------------------------------------------------------
|
||||
Tue May 6 08:04:18 UTC 2025 - Atri Bhattacharya <badshah400@gmail.com>
|
||||
|
||||
- Do not let minor tolerance issues in tests on non-x86_64 archs
|
||||
abort builds (gh#lammps/lammps#2383, gh#lammps/lammps#2978).
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Mon May 5 16:47:47 UTC 2025 - Atri Bhattacharya <badshah400@gmail.com>
|
||||
|
||||
- Adapt package version to reflect upstream releases; example:
|
||||
the current version 20240829.02 reflects upstream's (weirdly but
|
||||
consistently named) stable_29Aug2024_update2 tag.
|
||||
- Implement python packaging using python rpm macros (for now
|
||||
default python3-* only).
|
||||
- Enable a few non-expensive modules (in terms of build
|
||||
dependencies): compress (depends on gzip, libzstd), manybody,
|
||||
molecule (needed for python tests), extra-molecule, and lepton.
|
||||
- Drop a few unnecessary build dependencies: intel-opencl-devel,
|
||||
armnn-opencl-devel.
|
||||
- Add lammps-allow-system-gtest.patch to allow using system
|
||||
installed gtest/gmock for tests. Note that upstream seems to be
|
||||
reticent about this (gh#lammps/lammps#3540), but we have no
|
||||
choice if we want to run tests. So, mark our patch as
|
||||
PATCH-FEATURE-OPENSUSE for now.
|
||||
- Use pkgconfig based BuildRequires wherever possible.
|
||||
- Use ninja for build.
|
||||
- Define and use macro for shared library name consistency.
|
||||
- Disable MPI on i586 to resolve builds (missing
|
||||
openmpi-macros-devel).
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Tue Mar 18 16:37:36 UTC 2025 - Matej Cepl <mcepl@cepl.eu>
|
||||
|
||||
- Update to stable_29Aug2024_update2:
|
||||
* Too many changes to list, see
|
||||
<https://github.com/lammps/lammps/releases/tag/stable_29Aug2024>
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Mon May 15 01:02:12 UTC 2023 - Christoph Junghans <junghans@votca.org>
|
||||
|
||||
|
||||
189
lammps.spec
189
lammps.spec
@@ -1,7 +1,7 @@
|
||||
#
|
||||
# spec file for package lammps
|
||||
#
|
||||
# Copyright (c) 2022 SUSE LLC
|
||||
# Copyright (c) 2025 SUSE LLC
|
||||
# Copyright (c) 2017-2020 Christoph Junghans
|
||||
#
|
||||
# All modifications and additions to the file contributed by third parties
|
||||
@@ -17,40 +17,75 @@
|
||||
#
|
||||
|
||||
|
||||
# kokkos >= 4.3.01 required
|
||||
%bcond_with kokkos
|
||||
%bcond_without test
|
||||
%ifarch %ix86
|
||||
# Missing openmpi-macros-devel on i586
|
||||
%bcond_with mpi
|
||||
%else
|
||||
%bcond_without mpi
|
||||
%endif
|
||||
%define shlib lib%{name}0
|
||||
%define pythons python3
|
||||
%define __builder ninja
|
||||
%define uversion stable_29Aug2024_update2
|
||||
Name: lammps
|
||||
Version: 20201029
|
||||
Version: 20240829.02
|
||||
Release: 0
|
||||
%define uversion patch_29Oct2020
|
||||
Summary: Molecular Dynamics Simulator
|
||||
License: GPL-2.0-only AND GPL-3.0-or-later
|
||||
Group: Productivity/Scientific/Chemistry
|
||||
URL: https://lammps.sandia.gov
|
||||
Source0: https://github.com/lammps/lammps/archive/%{uversion}.tar.gz#/%{name}-%{uversion}.tar.gz
|
||||
Source1: https://github.com/google/googletest/archive/release-1.10.0.tar.gz
|
||||
Source0: https://github.com/lammps/lammps/archive/refs/tags/%{uversion}.tar.gz#/%{name}-%{uversion}.tar.gz
|
||||
# PATCH-FEATURE-OPENSUSE lammps-allow-system-gtest.patch badshah400@gmail.com -- Look for system installed gtest/gmock before trying to download
|
||||
Patch0: lammps-allow-system-gtest.patch
|
||||
BuildRequires: clang
|
||||
BuildRequires: cmake
|
||||
BuildRequires: fftw3-devel
|
||||
BuildRequires: fdupes
|
||||
BuildRequires: gcc-c++
|
||||
BuildRequires: gcc-fortran
|
||||
BuildRequires: gsl-devel
|
||||
BuildRequires: gzip
|
||||
BuildRequires: kim-api-devel >= 2.1
|
||||
BuildRequires: openmpi-macros-devel
|
||||
BuildRequires: readline-devel
|
||||
# for testing
|
||||
BuildRequires: kim-api-examples
|
||||
BuildRequires: libjpeg-devel
|
||||
BuildRequires: libpng-devel
|
||||
BuildRequires: ocl-icd-devel
|
||||
BuildRequires: opencl-headers
|
||||
BuildRequires: python3-devel
|
||||
BuildRequires: python3-build
|
||||
BuildRequires: python3-pip
|
||||
BuildRequires: python3-setuptools
|
||||
BuildRequires: python3-wheel
|
||||
BuildRequires: voro++-devel
|
||||
BuildRequires: zlib-devel
|
||||
# disable kokkos support until
|
||||
# kokkos-4 is supported
|
||||
# ifnarch ppc64 %ix86 %{arm}
|
||||
# global with_kokkos 1
|
||||
# BuildRequires: kokkos-devel >= 3.2
|
||||
# endif
|
||||
BuildRequires: pkgconfig(OpenCL)
|
||||
BuildRequires: pkgconfig(OpenCL-CLHPP)
|
||||
BuildRequires: pkgconfig(OpenCL-Headers)
|
||||
BuildRequires: pkgconfig(clBLAS)
|
||||
BuildRequires: pkgconfig(fftw3)
|
||||
BuildRequires: pkgconfig(gsl)
|
||||
BuildRequires: pkgconfig(lapack)
|
||||
BuildRequires: pkgconfig(libjpeg)
|
||||
BuildRequires: pkgconfig(libpng)
|
||||
BuildRequires: pkgconfig(libzstd)
|
||||
BuildRequires: pkgconfig(ocl-icd)
|
||||
BuildRequires: pkgconfig(python3)
|
||||
BuildRequires: pkgconfig(readline)
|
||||
BuildRequires: pkgconfig(tbb)
|
||||
BuildRequires: pkgconfig(yaml-0.1)
|
||||
BuildRequires: pkgconfig(zlib)
|
||||
Requires: %{name}-data
|
||||
%if "%{?__builder}" == "ninja"
|
||||
BuildRequires: ninja
|
||||
%endif
|
||||
%if %{with kokkos}
|
||||
BuildRequires: kokkos-devel >= 3.2
|
||||
%endif
|
||||
%if %{with mpi}
|
||||
BuildRequires: openmpi-macros-devel
|
||||
%endif
|
||||
%if %{with test}
|
||||
BuildRequires: kim-api-examples
|
||||
BuildRequires: valgrind
|
||||
BuildRequires: pkgconfig(gmock)
|
||||
BuildRequires: pkgconfig(gmock_main)
|
||||
BuildRequires: pkgconfig(gtest)
|
||||
BuildRequires: pkgconfig(gtest_main)
|
||||
%endif
|
||||
|
||||
%description
|
||||
LAMMPS is a classical molecular dynamics code, and an acronym for Large-scale
|
||||
@@ -65,8 +100,8 @@ 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
|
||||
%package -n %{shlib}
|
||||
Summary: A molecular dynamics simulator library
|
||||
Group: System/Libraries
|
||||
|
||||
%description -n liblammps0
|
||||
@@ -88,7 +123,7 @@ This package contains the library of LAMMPS package.
|
||||
Summary: Development headers and libraries for LAMMPS
|
||||
Group: Development/Libraries/C and C++
|
||||
Requires: %{name} = %{version}
|
||||
Requires: liblammps0 = %{version}
|
||||
Requires: %{shlib} = %{version}
|
||||
|
||||
%description devel
|
||||
LAMMPS is a classical molecular dynamics code, and an acronym for Large-scale
|
||||
@@ -105,15 +140,16 @@ designed to be easy to modify or extend with new functionality.
|
||||
|
||||
This package contains development headers and libraries for LAMMPS.
|
||||
|
||||
%package -n python3-%{name}
|
||||
%package -n %{pythons}-%{name}
|
||||
Summary: LAMMPS python module
|
||||
Group: Development/Languages/Python
|
||||
Requires: liblammps0 = %{version}
|
||||
Requires: %{shlib} = %{version}
|
||||
BuildArch: noarch
|
||||
# File conflict, old package contained python3 module
|
||||
Conflicts: python-%{name} <= %{version}
|
||||
Provides: python-%{name}:%{python3_sitearch}/%{name}.py
|
||||
|
||||
%description -n python3-%{name}
|
||||
%description -n %{pythons}-%{name}
|
||||
LAMMPS is a classical molecular dynamics code, and an acronym for Large-scale
|
||||
Atomic/Molecular Massively Parallel Simulator.
|
||||
|
||||
@@ -149,64 +185,96 @@ designed to be easy to modify or extend with new functionality.
|
||||
This subpackage contains LAMMPS's potential files
|
||||
|
||||
%prep
|
||||
%setup -a 1 -q -n %{name}-%{uversion}
|
||||
%autosetup -p1 -n %{name}-%{uversion}
|
||||
|
||||
%build
|
||||
%if %{with mpi}
|
||||
%setup_openmpi
|
||||
%endif
|
||||
|
||||
%{cmake} \
|
||||
-C ../cmake/presets/all_on.cmake \
|
||||
-C ../cmake/presets/nolib.cmake \
|
||||
pushd cmake
|
||||
%cmake \
|
||||
-DCMAKE_INSTALL_SYSCONFDIR=%{_sysconfdir} \
|
||||
-DCMAKE_TUNE_FLAGS='%{?tune_flags}' \
|
||||
-DBUILD_TOOLS=ON \
|
||||
-DBUILD_LAMMPS_SHELL=$(pkg-config readline && echo ON) \
|
||||
-DBUILD_MPI=%{?with_mpi:ON}%{!?with_mpi:OFF} \
|
||||
-DBUILD_OMP=ON \
|
||||
%{?with_kokkos:-DPKG_KOKKOS=ON -DEXTERNAL_KOKKOS=ON} \
|
||||
-DBUILD_MPI=ON \
|
||||
-DPKG_PYTHON=ON \
|
||||
-DPKG_KIM=ON \
|
||||
-DPKG_VORONOI=ON \
|
||||
-DPKG_GPU=ON -DGPU_API=OpenCL \
|
||||
-DDOWNLOAD_POTENTIALS=OFF \
|
||||
-DENABLE_TESTING:BOOL=%{?with_test:ON}%{!?with_test:OFF} \
|
||||
-DEXTERNAL_GTEST:BOOL=ON \
|
||||
-DFFT=FFTW3 \
|
||||
-DPYTHON_INSTDIR=%{python3_sitearch} \
|
||||
-DCMAKE_INSTALL_SYSCONFDIR=/etc \
|
||||
%ifnarch x86_64 %ix86
|
||||
-DPKG_USER-INTEL=OFF \
|
||||
%endif
|
||||
-DENABLE_TESTING=ON \
|
||||
-DGTEST_URL=%{S:1} \
|
||||
../cmake
|
||||
-DGPU_API=OpenCL \
|
||||
-DPKG_COMPRESS=ON \
|
||||
-DPKG_EXTRA-MOLECULE=ON \
|
||||
-DPKG_GPU=ON \
|
||||
-DPKG_KIM=ON \
|
||||
-DPKG_KSPACE=OFF \
|
||||
-DPKG_LEPTON=ON \
|
||||
-DPKG_MANYBODY=ON \
|
||||
-DPKG_MOLECULE=ON \
|
||||
-DPKG_PHONON=OFF \
|
||||
-DPKG_PYTHON=ON \
|
||||
-DPKG_VORONOI=ON \
|
||||
-DPYTHON_EXECUTABLE=%{_bindir}/python%{python3_version} \
|
||||
-DUSE_STATIC_OPENCL_LOADER=OFF \
|
||||
-DUSE_SPGLIB:BOOL=OFF \
|
||||
%{?with_kokkos:-DPKG_KOKKOS=ON -DEXTERNAL_KOKKOS=ON} \
|
||||
%{nil}
|
||||
%cmake_build
|
||||
popd
|
||||
cd python
|
||||
%pyproject_wheel
|
||||
|
||||
%install
|
||||
pushd cmake
|
||||
%cmake_install
|
||||
rm -rf %{buildroot}%{_datadir}/{applications,icons}/
|
||||
popd
|
||||
|
||||
pushd python
|
||||
%pyproject_install
|
||||
popd
|
||||
|
||||
%fdupes %{buildroot}%{_datadir}/%{name}/
|
||||
%fdupes %{buildroot}%{python3_sitelib}/%{name}/
|
||||
|
||||
%if %{with test}
|
||||
%check
|
||||
%if %{with mpi}
|
||||
%setup_openmpi
|
||||
%endif
|
||||
|
||||
# https://github.com/lammps/lammps/issues/2383, inject -msse2 on %ix86 to make test pass
|
||||
%ifarch %ix86
|
||||
%ctest --exclude-regex 'AtomStyle|Fortran' || true
|
||||
%ctest --tests-regex 'AtomStyle|Fortran' || true
|
||||
pushd cmake
|
||||
# Do not cause failing tests on non-x86_64 archs to abort builds
|
||||
# as these are due to minor numerical tolerance differences which
|
||||
# upstream does not intend to fix. See, for instance,
|
||||
# * https://github.com/lammps/lammps/issues/2383
|
||||
# * https://github.com/lammps/lammps/issues/2978
|
||||
%ifnarch x86_64
|
||||
%ctest || true
|
||||
%else
|
||||
%ctest
|
||||
%endif
|
||||
popd
|
||||
|
||||
%post -n liblammps0 -p /sbin/ldconfig
|
||||
%postun -n liblammps0 -p /sbin/ldconfig
|
||||
%endif
|
||||
|
||||
%ldconfig_scriptlets -n %{shlib}
|
||||
|
||||
%files
|
||||
%doc README
|
||||
%license LICENSE
|
||||
%{_bindir}/l{mp,ammps}*
|
||||
%{_mandir}/man1/lmp.1.*
|
||||
%{_mandir}/man1/lmp.1%{?ext_man}
|
||||
%{_bindir}/msi2lmp
|
||||
%{_mandir}/man1/msi2lmp.1.*
|
||||
%{_mandir}/man1/msi2lmp.1%{?ext_man}
|
||||
%{_bindir}/binary2txt
|
||||
%{_bindir}/chain.x
|
||||
%{_bindir}/micelle2d.x
|
||||
%{_bindir}/phana
|
||||
%{_bindir}/stl_bin2txt
|
||||
|
||||
%files -n liblammps0
|
||||
%files -n %{shlib}
|
||||
%{_libdir}/liblammps.so.*
|
||||
|
||||
%files devel
|
||||
@@ -216,12 +284,13 @@ rm -rf %{buildroot}%{_datadir}/{applications,icons}/
|
||||
%{_libdir}/pkgconfig/liblammps.pc
|
||||
%{_libdir}/cmake/LAMMPS
|
||||
|
||||
%files -n python3-%{name}
|
||||
%{python3_sitearch}/%{name}.py
|
||||
|
||||
%files data
|
||||
%license LICENSE
|
||||
%{_datadir}/%{name}
|
||||
%config %{_sysconfdir}/profile.d/lammps.*
|
||||
|
||||
%files -n %{pythons}-%{name}
|
||||
%{python3_sitelib}/%{name}/
|
||||
%{python3_sitelib}/%{name}-*.*-info
|
||||
|
||||
%changelog
|
||||
|
||||
@@ -1,3 +0,0 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:9dc9157a9a1551ec7a7e43daea9a694a0bb5fb8bec81235d8a1e6ef64c716dcb
|
||||
size 904349
|
||||
Reference in New Issue
Block a user