The package rpms/cp2k.git has added or updated architecture specific content in its
spec file (ExclusiveArch/ExcludeArch or %ifarch/%ifnarch) in commit(s):
https://src.fedoraproject.org/cgit/rpms/cp2k.git/commit/?id=16e3d0b3be5a6....
Change:
-%ifarch ppc64le
Thanks.
Full change:
============
commit 16e3d0b3be5a620dfb1c115023f5f28ebb634133
Author: Cristian Le <cristian.le(a)mpsd.mpg.de>
Date: Fri Apr 19 13:43:59 2024 +0200
Add packit workflow from upstream
- Droped elpa, metis, etc. requirements
- Follow upstream's Default dependencies
- Split test execution between spec and testing-farm
Signed-off-by: Cristian Le <cristian.le(a)mpsd.mpg.de>
diff --git a/.fmf/version b/.fmf/version
new file mode 100644
index 0000000..d00491f
--- /dev/null
+++ b/.fmf/version
@@ -0,0 +1 @@
+1
diff --git a/.gitignore b/.gitignore
index 10fd2e2..9adf581 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,28 +1 @@
-/cp2k-2_1-branch.tar.gz
-/cp2k-2.3-20120825.tar.bz2
-/cp2k-2.3.tar.bz2
-/cp2k-2.4-20130220.tar.bz2
-/cp2k-2.4-20130418.tar.bz2
-/cp2k-2.5-20131112.tar.bz2
-/cp2k-2.5-20131112.tar.xz
-/cp2k-2.5.0.tar.bz2
-/cp2k-2.5.1.tar.bz2
-/cp2k-2_5-branch_LAST-Linux-x86-64-gfortran-popt.tar.bz2
-/cp2k-2.6.0.tar.bz2
-/cp2k-2_6-branch_LAST-Linux-x86-64-gfortran-popt.tar.bz2
-/cp2k-2.6.1.tar.bz2
-/cp2k-2_6_1-branch_LAST-Linux-x86-64-gfortran-pdbg.tar.bz2
-/cp2k-2.7.0-20150906.tar.xz
-/cp2k-2.7.0-20150908.tar.xz
-/cp2k-2.7.0-20150911.tar.xz
-/cp2k-3.0.tar.bz2
-/cp2k-4.1.tar.bz2
-/cp2k-5.1.tar.bz2
-/cp2k-6.1.tar.bz2
-/cp2k-dbf7a77.tar.gz
-/dbcsr-d2dfe6e.tar.gz
-/cp2k-8.2.tar.bz2
-/cp2k-9.1.tar.bz2
-/cp2k-2023.1.tar.bz2
-/cp2k-61cc8ba.tar.gz
-/cp2k-2024.1.tar.bz2
+*.tar.bz2
diff --git a/.packit.yaml b/.packit.yaml
new file mode 100644
index 0000000..85580a8
--- /dev/null
+++ b/.packit.yaml
@@ -0,0 +1,77 @@
+specfile_path: tools/fedora/cp2k.spec
+files_to_sync:
+ - src: tools/fedora/
+ dest: ./
+ delete: true
+ filters:
+ - "protect .git*"
+ - "protect sources"
+ - "protect changelog"
+ - "- tests/"
+ - src: .fmf/
+ dest: .fmf/
+ - .packit.yaml
+upstream_package_name: cp2k
+downstream_package_name: cp2k
+update_release: false
+upstream_tag_template: v{version}
+
+# Run only smoke tests by default
+test_command:
+ default_identifier: smoke
+
+jobs:
+ - &copr_build
+ job: copr_build
+ trigger: release
+ owner: lecris
+ project: release
+ targets:
+ # TODO: Match F40 release
+ - fedora-development-x86_64
+ - fedora-development-aarch64
+ - fedora-latest-x86_64
+ - fedora-latest-aarch64
+ - <<: *copr_build
+ trigger: commit
+ branch: master
+ project: nightly
+ additional_repos:
+ - copr://@scikit-build/release
+ - &tests
+ job: tests
+ trigger: commit
+ targets:
+ # TODO: Match F40 release
+ - fedora-development-x86_64
+ - fedora-development-aarch64
+ - fedora-latest-x86_64
+ - fedora-latest-aarch64
+ tmt_plan: .*/smoke
+ - <<: *copr_build
+ trigger: pull_request
+ manual_trigger: true
+ project: cp2k
+ update_release: true
+ release_suffix: "{PACKIT_RPMSPEC_RELEASE}"
+ - <<: *tests
+ identifier: smoke
+ trigger: pull_request
+ manual_trigger: true
+ - <<: *tests
+ identifier: full
+ trigger: pull_request
+ manual_trigger: true
+ tmt_plan: .*/full
+ - job: propose_downstream
+ trigger: release
+ dist_git_branches:
+ - fedora-rawhide
+ - job: koji_build
+ trigger: commit
+ dist_git_branches:
+ - fedora-all
+ - job: bodhi_update
+ trigger: commit
+ dist_git_branches:
+ - fedora-branched
diff --git a/cp2k.spec b/cp2k.spec
index 056410d..30f1a5d 100644
--- a/cp2k.spec
+++ b/cp2k.spec
@@ -1,275 +1,265 @@
-# If defined, create a snapshot build
-#global git_date 20231026
-%global commit 61cc8baa641ad31d15ee8cc5fe3072ba50e35778
-%global shortcommit %(c=%{commit}; echo ${c:0:7})
-%global sover 23.1
-%global dbcsr_version 2.6.0
-
-# TODO OpenCL support: -D__ACC -D__DBCSR_ACC -D__OPENCL
-
# No openmpi on i668 with openmpi 5 in Fedora 40+
-%if 0%{?fedora} >= 40
%ifarch %{ix86}
%bcond_with openmpi
%else
%bcond_without openmpi
%endif
+
+%ifarch x86_64
+%bcond_without libxsmm
%else
-%bcond_without openmpi
+# See
https://bugzilla.redhat.com/show_bug.cgi?id=1515404
+%bcond_with libxsmm
%endif
# Disable LTO due to
https://bugzilla.redhat.com/show_bug.cgi?id=2243158
%global _lto_cflags %nil
-# Compile regtests and do a brief smoketest
-%bcond_without check
-# Run full regtest suite - takes a very long time
-%bcond_with check_full
-
-Name: cp2k
-Version: 2024.1%{?git_date:^%{git_date}git%{shortcommit}}
-Release: %autorelease
-Summary: Ab Initio Molecular Dynamics
-License: GPLv2+
-URL:
httsp://www.cp2k.org/
-%if 0%{?git_date}
-Source0:
https://github.com/cp2k/cp2k/archive/%{commit}/%{name}-%{shortcommit}.tar.gz
-%else
-Source0:
https://github.com/cp2k/cp2k/releases/download/v%{version}/cp2k-%{version...
-%endif
+Name: cp2k
+Version: 2024.1
+Release: %autorelease
+Summary: Ab Initio Molecular Dynamics
+License: GPL-2.0-or-later
+URL:
https://www.cp2k.org/
+Source0:
https://github.com/cp2k/cp2k/releases/download/v%{version}/cp2k-%{version...
+
+# Remove testing packages that were previously packaged
+# Can be removed at the end of F40
+# Provides should not be necessary but might as well be thorough
+Provides: cp2k-testing = 2024.1-5
+Obsoletes: cp2k-testing < 2024.1-5
+Provides: cp2k-mpich-testing = 2024.1-5
+Obsoletes: cp2k-mpich-testing < 2024.1-5
+Provides: cp2k-openmpi-testing = 2024.1-5
+Obsoletes: cp2k-openmpi-testing < 2024.1-5
+
+# Flaky MPI issues on s390x, and upstream do not officially support it yet
+#
https://github.com/cp2k/cp2k/issues/3362
+ExcludeArch: s390x
+
# Allow specifying the data install directory
#
https://github.com/cp2k/cp2k/pull/3088
-Patch: cp2k-data.patch
+Patch: cp2k-data.patch
+# Allow testing-farm to run do_regtest.py
+#
https://github.com/cp2k/cp2k/pull/3268
+Patch: fix_regtest.patch
+
+# Build dependencies
+BuildRequires: cmake
+BuildRequires: gcc-gfortran
+BuildRequires: gcc-c++
+BuildRequires: ninja-build
+BuildRequires: python3-fypp
+# Project dependencies
BuildRequires: flexiblas-devel
-# for regtests
-BuildRequires: bc
+BuildRequires: dbcsr-devel >= 2.6.0
BuildRequires: fftw-devel
-BuildRequires: gcc-c++
-BuildRequires: gcc-gfortran
-BuildRequires: glibc-langpack-en
-BuildRequires: dbcsr-devel >= %{dbcsr_version}
-BuildRequires: libint2-devel
-BuildRequires: libxc-devel >= 5.1.0
-%ifarch x86_64
-# See
https://bugzilla.redhat.com/show_bug.cgi?id=1515404
+%if %{with libxsmm}
BuildRequires: libxsmm-devel >= 1.8.1-3
%endif
-BuildRequires: python3-fypp
+BuildRequires: libxc-devel >= 5.1.0
BuildRequires: spglib-devel
-BuildRequires: /usr/bin/hostname
+# Test dependencies
+BuildRequires: python3
+# For pathfix.py
BuildRequires: python3-devel
-# Libint can break the API between releases
-Requires: libint2(api)%{?_isa} = %{_libint2_apiversion}
+Requires: %{name}-common = %{version}-%{release}
-Requires: %{name}-common = %{version}-%{release}
+%global _description %{expand:
+CP2K is a freely available (GPL) program, written in Fortran 95, to
+perform atomistic and molecular simulations of solid state, liquid,
+molecular and biological systems. It provides a general framework for
+different methods such as e.g. density functional theory (DFT) using a
+mixed Gaussian and plane waves approach (GPW), and classical pair and
+many-body potentials.
-%global cp2k_desc_base \
-CP2K is a freely available (GPL) program, written in Fortran 95, to\
-perform atomistic and molecular simulations of solid state, liquid,\
-molecular and biological systems. It provides a general framework for\
-different methods such as e.g. density functional theory (DFT) using a\
-mixed Gaussian and plane waves approach (GPW), and classical pair and\
-many-body potentials.\
-\
-CP2K does not implement Car-Parinello Molecular Dynamics (CPMD).
+CP2K does not implement Car-Parinello Molecular Dynamics (CPMD).}
%description
-%{cp2k_desc_base}
+%{_description}
This package contains the non-MPI single process and multi-threaded versions.
%package common
-Summary: Molecular simulations software - common files
+Summary: Molecular simulations software - common files
+BuildArch: noarch
%description common
-%{cp2k_desc_base}
+%{_description}
This package contains the documentation and the manual.
%package devel
-Summary: Development files for %{name}
-Requires: %{name}%{?_isa} = %{version}-%{release}
+Summary: Development files for %{name}
+
+Requires: %{name}%{?_isa} = %{version}-%{release}
%description devel
The %{name}-devel package contains libraries and header files for
developing applications that use %{name}.
-%package testing
-Summary: Tests for %{name}
-Requires: %{name}%{?_isa} = %{version}-%{release}
-
-%description testing
-The %{name}-testing package contains executables for testing %{name}.
-
%if %{with openmpi}
%package openmpi
-Summary: Molecular simulations software - openmpi version
+Summary: Molecular simulations software - openmpi version
BuildRequires: openmpi-devel
BuildRequires: blacs-openmpi-devel
-BuildRequires: dbcsr-openmpi-devel >= %{dbcsr_version}
-BuildRequires: elpa-openmpi-devel >= 2018.05.001
+BuildRequires: dbcsr-openmpi-devel
BuildRequires: scalapack-openmpi-devel
-Requires: %{name}-common = %{version}-%{release}
-# Libint may have API breakage
-Requires: libint2(api)%{?_isa} = %{_libint2_apiversion}
+
+Requires: %{name}-common = %{version}-%{release}
%description openmpi
-%{cp2k_desc_base}
+%{_description}
This package contains the parallel single- and multi-threaded versions
using OpenMPI.
%package openmpi-devel
-Summary: Development files for %{name}
-Requires: %{name}-openmpi%{?_isa} = %{version}-%{release}
+Summary: Development files for %{name}
+
+Requires: %{name}-openmpi%{?_isa} = %{version}-%{release}
%description openmpi-devel
The %{name}-devel package contains libraries and header files for
developing applications that use %{name}.
-%package openmpi-testing
-Summary: Tests for %{name}
-Requires: %{name}-openmpi%{?_isa} = %{version}-%{release}
-
-%description openmpi-testing
-The %{name}-openmpi-testing package contains executables for testing
-%{name} with OpenMPI.
%endif
%package mpich
-Summary: Molecular simulations software - mpich version
+Summary: Molecular simulations software - mpich version
BuildRequires: mpich-devel
BuildRequires: blacs-mpich-devel
-BuildRequires: dbcsr-mpich-devel >= %{dbcsr_version}
-BuildRequires: elpa-mpich-devel >= 2018.05.001
+BuildRequires: dbcsr-mpich-devel
BuildRequires: scalapack-mpich-devel
-BuildRequires: make
-Requires: %{name}-common = %{version}-%{release}
-# Libint may have API breakage
-Requires: libint2(api)%{?_isa} = %{_libint2_apiversion}
+
+Requires: %{name}-common = %{version}-%{release}
%description mpich
-%{cp2k_desc_base}
+%{_description}
This package contains the parallel single- and multi-threaded versions
using mpich.
%package mpich-devel
-Summary: Development files for %{name}
-Requires: %{name}-mpich%{?_isa} = %{version}-%{release}
+Summary: Development files for %{name}
+
+Requires: %{name}-mpich%{?_isa} = %{version}-%{release}
%description mpich-devel
The %{name}-devel package contains libraries and header files for
developing applications that use %{name}.
-%package mpich-testing
-Summary: Tests for %{name}
-Requires: %{name}-mpich%{?_isa} = %{version}-%{release}
-
-%description mpich-testing
-The %{name}-mpich-testing package contains executables for testing
-%{name} with mpich.
%prep
-%if 0%{?git_date}
-%autosetup -p1 -n %{name}-%{commit}
-echo git:%{shortcommit} > REVISION
-%else
%autosetup -p1
-%endif
rm tools/build_utils/fypp
rm -r exts/dbcsr
+# Fix test files
%{__python3} %{_rpmconfigdir}/redhat/pathfix.py -i "%{__python3} -Es" -p $(find
. -type f -name *.py)
# $MPI_SUFFIX will be evaluated in the loops below, set by mpi modules
%global _vpath_builddir %{_vendor}-%{_target_os}-build${MPI_SUFFIX:-_serial}
+# We are running the module load/unload manually until there is a macro-like way to
expand this
+. /etc/profile.d/modules.sh
-%build
-CMAKE_COMMON="-DCP2K_BLAS_VENDOR=FlexiBLAS
%{?with_check:-DCP2K_ENABLE_REGTESTS=ON}"
-%cmake $CMAKE_COMMON \
- -DCP2K_USE_MPI=OFF \
- -DCMAKE_INSTALL_Fortran_MODULES:PATH=%{_fmoddir}/cp2k
-%cmake_build
+%build
+cmake_common_args=(
+ "-G Ninja"
+ "-DCP2K_DEBUG_MODE:BOOL=OFF"
+ "-DCP2K_BLAS_VENDOR:STRING=FlexiBLAS"
+ "-DCP2K_USE_STATIC_BLAS:BOOL=OFF"
+ # Unit tests are included in REGTESTS
+ # Note: Enabling this will write build files in the source folder :/
+ "-DCP2K_ENABLE_REGTESTS:BOOL=ON"
+ # Dependencies equivalent with Default
+ "-DCP2K_USE_FFTW3:BOOL=ON"
+ "-DCP2K_USE_COSMA:BOOL=OFF" # Not packaged
+ "-DCP2K_USE_LIBXSMM:BOOL=%{?with_libxsmm:ON}%{?without_libxsmm:OFF}"
+ "-DCP2K_USE_LIBXC:BOOL=ON"
+ "-DCP2K_USE_LIBINT2:BOOL=OFF" # Detection is broken
+ "-DCP2K_USE_SPGLIB:BOOL=ON"
+)
+for mpi in '' mpich %{?with_openmpi:openmpi}; do
+ if [ -n "$mpi" ]; then
+ module load mpi/${mpi}-%{_arch}
+ cmake_mpi_args=(
+ "-DCMAKE_INSTALL_PREFIX:PATH=${MPI_HOME}"
+ "-DCMAKE_INSTALL_Fortran_MODULES:PATH=${MPI_FORTRAN_MOD_DIR}/cp2k"
+ "-DCMAKE_INSTALL_LIBDIR:PATH=lib"
+ "-DCP2K_CMAKE_SUFFIX:STRING=${MPI_SUFFIX}"
+ "-DCP2K_DATA_DIR:PATH=%{_datadir}/cp2k/data"
+ "-DCP2K_USE_MPI_F08:BOOL=ON"
+ )
+ else
+ cmake_mpi_args=(
+ "-DCP2K_USE_MPI:BOOL=OFF"
+ "-DCMAKE_INSTALL_Fortran_MODULES:PATH=%{_fmoddir}/cp2k"
+ )
+ fi
-%if %{with openmpi}
-%{_openmpi_load}
-%cmake $CMAKE_COMMON \
- -DCMAKE_PREFIX_PATH:PATH=$MPI_HOME \
- -DCMAKE_INSTALL_PREFIX:PATH=$MPI_HOME \
- -DCMAKE_INSTALL_Fortran_MODULES:PATH=${MPI_FORTRAN_MOD_DIR}/cp2k \
- -DCMAKE_INSTALL_LIBDIR:PATH=lib \
- -DCP2K_CMAKE_SUFFIX=$MPI_SUFFIX \
- -DCP2K_DATA_DIR:PATH=%{_datadir}/cp2k/data \
- -DCP2K_USE_MPI_F08:BOOL=ON
-%cmake_build
-%{_openmpi_unload}
-%endif
+ %cmake \
+ ${cmake_common_args[@]} \
+ ${cmake_mpi_args[@]}
+ %cmake_build
-%{_mpich_load}
-%cmake $CMAKE_COMMON \
- -DCMAKE_PREFIX_PATH:PATH=$MPI_HOME \
- -DCMAKE_INSTALL_PREFIX:PATH=$MPI_HOME \
- -DCMAKE_INSTALL_Fortran_MODULES:PATH=${MPI_FORTRAN_MOD_DIR}/cp2k \
- -DCMAKE_INSTALL_LIBDIR:PATH=lib \
- -DCP2K_CMAKE_SUFFIX=$MPI_SUFFIX \
- -DCP2K_DATA_DIR:PATH=%{_datadir}/cp2k/data \
- -DCP2K_USE_MPI_F08:BOOL=ON
-%cmake_build
-%{_mpich_unload}
+ [ -n "$mpi" ] && module unload mpi/${mpi}-%{_arch}
+done
%install
-%cmake_install
+for mpi in '' mpich %{?with_openmpi:openmpi}; do
+ [ -n "$mpi" ] && module load mpi/${mpi}-%{_arch}
+ %cmake_install
+ [ -n "$mpi" ] && module unload mpi/${mpi}-%{_arch}
+done
+# TODO: Properly separate the installation of unit tests
+rm -f %{_buildrootdir}/**/%{_bindir}/*_unittest.*
%if %{with openmpi}
-%{_openmpi_load}
-%cmake_install
-%{_openmpi_unload}
+rm -f %{_buildrootdir}/**/%{_libdir}/openmpi/bin/*_unittest.*
%endif
+rm -f %{_buildrootdir}/**/%{_libdir}/mpich/bin/*_unittest.*
-%{_mpich_load}
-%cmake_install
-%{_mpich_unload}
-%if %{with check}
-# regtests take ~12 hours on aarch64 and ~48h on s390x
%check
-. /etc/profile.d/modules.sh
export CP2K_DATA_DIR=%{buildroot}%{_datadir}/cp2k/data
-status=0
+# See %%_openmpi_load
+export PRTE_MCA_rmaps_default_mapping_policy=:oversubscribe
+test_common_args=(
+ "--skip_regtests"
+ "--maxtasks 4" # Hard-coding maxtasks to avoid hanging. oversubscription
should not matter
+ "--ompthreads 2"
+)
for mpi in '' mpich %{?with_openmpi:openmpi} ; do
-# A couple tests fail on ppc64le -
https://github.com/cp2k/cp2k/issues/3077
-%ifarch ppc64le
- fail=0
-%else
- # Do not fail for now
- fail=0
-%endif
- # TODO - set maxtasks based on # cores?
if [ -n "$mpi" ]; then
+ # Another module load is done inside the do_regtest.sh. will use that instead
module load mpi/${mpi}-%{_arch}
- libdir=${MPI_LIB}/cp2k
- mpiopts="--maxtasks 4 --mpiranks 2 --ompthreads 2"
- par=p
- suf="-${mpi}"
+ bindir=${MPI_BIN}
+ libdir=${MPI_LIB}
+ export CP2K_STEM=%{buildroot}${MPI_BIN}/cp2k
+ # Note, final position arguments are also here
+ test_mpi_args=(
+ "--mpiranks 2"
+ "local_${mpi}"
+ "psmp"
+ )
else
- libdir=%{_libdir}/cp2k
- mpiopts="--maxtasks 4 --ompthreads 2"
- par=s
- suf=""
- fi
- export LD_LIBRARY_PATH=%{buildroot}${libdir}
- tests/do_regtest.py %{!?with_check_full:--smoketest} --workbasedir %{_builddir}
${mpiopts} \
- local${MPI_SUFFIX} ${par}smp || status=$(( $status + $fail ))
-
- if [ -n "$mpi" ]; then
- module unload mpi/${mpi}-%{_arch}
+ bindir=%{_bindir}
+ libdir=%{_libdir}
+ export CP2K_STEM=%{buildroot}/usr/bin/cp2k
+ test_mpi_args=(
+ "local"
+ "ssmp"
+ )
fi
+ # Run packaged do_regtest.sh with appropriate buildroot runpaths
+ env PATH=%{buildroot}${bindir}:${PATH} \
+ LD_LIBRARY_PATH=%{buildroot}${libdir} \
+ tests/do_regtest.py ${test_common_args[@]} ${test_mpi_args[@]}
+ [ -n "$mpi" ] && module unload mpi/${mpi}-%{_arch}
done
-exit $status
-%endif
%files common
%license LICENSE
@@ -283,7 +273,7 @@ exit $status
%{_bindir}/graph.ssmp
%{_bindir}/grid_miniapp.ssmp
%{_bindir}/xyz2dcd.ssmp
-%{_libdir}/libcp2k.so.%{sover}*
+%{_libdir}/libcp2k.so.*
%files devel
%{_fmoddir}/cp2k/
@@ -292,15 +282,6 @@ exit $status
%{_libdir}/libcp2k.so
%{_libdir}/pkgconfig/libcp2k.pc
-%files testing
-%{_bindir}/dbt_tas_unittest.ssmp
-%{_bindir}/dbt_unittest.ssmp
-%{_bindir}/grid_unittest.ssmp
-%{_bindir}/libcp2k_unittest.ssmp
-%{_bindir}/memory_utilities_unittest.ssmp
-%{_bindir}/nequip_unittest.ssmp
-%{_bindir}/parallel_rng_types_unittest.ssmp
-
%if %{with openmpi}
%files openmpi
%{_libdir}/openmpi/bin/cp2k.psmp
@@ -309,7 +290,7 @@ exit $status
%{_libdir}/openmpi/bin/graph.psmp
%{_libdir}/openmpi/bin/grid_miniapp.psmp
%{_libdir}/openmpi/bin/xyz2dcd.psmp
-%{_libdir}/openmpi/lib/libcp2k.so.%{sover}*
+%{_libdir}/openmpi/lib/libcp2k.so.*
%files openmpi-devel
%{_fmoddir}/openmpi/cp2k/
@@ -317,15 +298,6 @@ exit $status
%{_libdir}/openmpi/lib/cmake/cp2k/
%{_libdir}/openmpi/lib/libcp2k.so
%{_libdir}/openmpi/lib/pkgconfig/libcp2k.pc
-
-%files openmpi-testing
-%{_libdir}/openmpi/bin/dbt_tas_unittest.psmp
-%{_libdir}/openmpi/bin/dbt_unittest.psmp
-%{_libdir}/openmpi/bin/grid_unittest.psmp
-%{_libdir}/openmpi/bin/libcp2k_unittest.psmp
-%{_libdir}/openmpi/bin/memory_utilities_unittest.psmp
-%{_libdir}/openmpi/bin/nequip_unittest.psmp
-%{_libdir}/openmpi/bin/parallel_rng_types_unittest.psmp
%endif
%files mpich
@@ -335,7 +307,7 @@ exit $status
%{_libdir}/mpich/bin/graph.psmp
%{_libdir}/mpich/bin/grid_miniapp.psmp
%{_libdir}/mpich/bin/xyz2dcd.psmp
-%{_libdir}/mpich/lib/libcp2k.so.%{sover}*
+%{_libdir}/mpich/lib/libcp2k.so.*
%files mpich-devel
%{_fmoddir}/mpich/cp2k/
@@ -344,14 +316,5 @@ exit $status
%{_libdir}/mpich/lib/libcp2k.so
%{_libdir}/mpich/lib/pkgconfig/libcp2k.pc
-%files mpich-testing
-%{_libdir}/mpich/bin/dbt_tas_unittest.psmp
-%{_libdir}/mpich/bin/dbt_unittest.psmp
-%{_libdir}/mpich/bin/grid_unittest.psmp
-%{_libdir}/mpich/bin/libcp2k_unittest.psmp
-%{_libdir}/mpich/bin/memory_utilities_unittest.psmp
-%{_libdir}/mpich/bin/nequip_unittest.psmp
-%{_libdir}/mpich/bin/parallel_rng_types_unittest.psmp
-
%changelog
%autochangelog
diff --git a/fix_regtest.patch b/fix_regtest.patch
new file mode 100644
index 0000000..1cba1a9
--- /dev/null
+++ b/fix_regtest.patch
@@ -0,0 +1,99 @@
+Subject: [PATCH] do_regtest: Allow to run regression tests outside of build environment
+do_regtest: allow skipping unit/regression tests
+---
+Index: tests/do_regtest.py
+IDEA additional info:
+Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
+<+>UTF-8
+===================================================================
+diff --git a/tests/do_regtest.py b/tests/do_regtest.py
+--- a/tests/do_regtest.py (revision c674188158356657219ba1c4ca849b56473391ab)
++++ b/tests/do_regtest.py (revision 9ca81403bedc0f274b852150d20eddbb0d715417)
+@@ -42,6 +42,10 @@
+ ]
+
+
++def cp2k_stem() -> str:
++ return os.getenv("CP2K_STEM", "cp2k")
++
++
+ #
======================================================================================
+ async def main() -> None:
+ parser = argparse.ArgumentParser(description="Runs CP2K regression test
suite.")
+@@ -64,6 +68,8 @@
+ parser.add_argument("--restrictdir", action="append")
+ parser.add_argument("--skipdir", action="append")
+ parser.add_argument("--workbasedir", type=Path)
++ parser.add_argument("--skip_unittests", action="store_true")
++ parser.add_argument("--skip_regtests", action="store_true")
+ parser.add_argument("arch")
+ parser.add_argument("version")
+ cfg = Config(parser.parse_args())
+@@ -72,7 +78,9 @@
+ start_time = time.perf_counter()
+
+ # Query CP2K binary for feature flags.
+- version_bytes, _ = await (await cfg.launch_exe("cp2k",
"--version")).communicate()
++ version_bytes, _ = await (
++ await cfg.launch_exe(cp2k_stem(), "--version")
++ ).communicate()
+ version_output = version_bytes.decode("utf8", errors="replace")
+ flags_line = re.search(r" cp2kflags:(.*)\n", version_output)
+ if not flags_line:
+@@ -252,6 +260,8 @@
+ self.max_errors = args.maxerrors
+ self.restrictdirs = args.restrictdir if args.restrictdir else [".*"]
+ self.skipdirs = args.skipdir if args.skipdir else []
++ self.skip_unittests = args.skip_unittests
++ self.skip_regtests = args.skip_regtests
+ datestamp = datetime.now().strftime("%Y-%m-%d_%H-%M-%S")
+ leaf_dir = f"TEST-{args.arch}-{args.version}-{datestamp}"
+ self.work_base_dir = (
+@@ -294,7 +304,13 @@
+ env["CUDA_VISIBLE_DEVICES"] =
",".join(visible_gpu_devices)
+ env["HIP_VISIBLE_DEVICES"] =
",".join(visible_gpu_devices)
+ env["OMP_NUM_THREADS"] = str(self.ompthreads)
+- cmd = [str(self.cp2k_root / "exe" / self.arch /
f"{exe_stem}.{self.version}")]
++ exe_path = Path(f"{exe_stem}.{self.version}")
++ if exe_path.is_absolute():
++ cmd = [str(exe_path)]
++ else:
++ cmd = [
++ str(self.cp2k_root / "exe" / self.arch /
f"{exe_stem}.{self.version}")
++ ]
+ if self.valgrind:
+ cmd = ["valgrind", "--error-exitcode=42",
"--exit-on-first-error=yes"] + cmd
+ if self.use_mpi:
+@@ -430,7 +446,9 @@
+
+ async def start(self) -> None:
+ assert self._child is None
+- self._child = await self.cfg.launch_exe("cp2k", "--shell",
cwd=self.workdir)
++ self._child = await self.cfg.launch_exe(
++ cp2k_stem(), "--shell", cwd=self.workdir
++ )
+ await self.ready()
+ await self.sendline("HARSH") # With harsh mode any error leads to an
abort.
+ await self.ready()
+@@ -496,7 +514,11 @@
+ #
======================================================================================
+ async def run_batch(batch: Batch, cfg: Config) -> BatchResult:
+ async with cfg.workers:
+- results = (await run_unittests(batch, cfg)) + (await run_regtests(batch, cfg))
++ results = []
++ if not cfg.skip_unittests:
++ results += await run_unittests(batch, cfg)
++ if not cfg.skip_regtests:
++ results += await run_regtests(batch, cfg)
+ return BatchResult(batch, results)
+
+
+@@ -571,7 +593,7 @@
+ for test in batch.regtests:
+ start_time = time.perf_counter()
+ start_dirsize = dirsize(batch.workdir)
+- child = await cfg.launch_exe("cp2k", test.inp_fn, cwd=batch.workdir)
++ child = await cfg.launch_exe(cp2k_stem(), test.inp_fn, cwd=batch.workdir)
+ output, returncode, timed_out = await wait_for_child_process(child,
cfg.timeout)
+ test.out_path.write_bytes(output)
+ duration = time.perf_counter() - start_time
diff --git a/plans/main.fmf b/plans/main.fmf
new file mode 100644
index 0000000..8f8b47e
--- /dev/null
+++ b/plans/main.fmf
@@ -0,0 +1,9 @@
+adjust:
+ # TODO: use initiator == fedora-ci instead
+ when: initiator is not defined or initiator != packit
+ discover:
+ how: fmf
+ dist-git-source: true
+ dist-git-extract: cp2k-*/
+ enabled: false
+ because: Temporarily disabled because tests are not in current source
diff --git a/plans/regression.fmf b/plans/regression.fmf
new file mode 100644
index 0000000..4f2bdc3
--- /dev/null
+++ b/plans/regression.fmf
@@ -0,0 +1,20 @@
+summary:
+ Test the bundled tests
+discover+:
+ how: fmf
+execute:
+ how: tmt
+# Currently using testing-farm/artemis which allows setting hardware requirements
+# Virtual and other providers should be available at some point as well
+provision:
+ hardware:
+ cpu:
+ processors: ">=4"
+
+/full:
+ summary+: (Full)
+
+/smoke:
+ summary+: (Smoke)
+ environment:
+ CP2K_SMOKE_ONLY: true
diff --git a/plans/smoke.fmf b/plans/smoke.fmf
new file mode 100644
index 0000000..badde8a
--- /dev/null
+++ b/plans/smoke.fmf
@@ -0,0 +1,10 @@
+/:
+ inherit: false
+
+summary: Temporary smoke test
+description: |
+ Temporary smoke plan to allow tmt plans to pass.
+ Will be replaced with `regression` on next release.
+execute:
+ how: tmt
+ script: cp2k.ssmp --version