From mboxrd@z Thu Jan  1 00:00:00 1970
Return-Path: <gentoo-commits+bounces-1589344-garchives=archives.gentoo.org@lists.gentoo.org>
Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80])
	(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
	 key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256)
	(No client certificate requested)
	by finch.gentoo.org (Postfix) with ESMTPS id 4BEC6158451
	for <garchives@archives.gentoo.org>; Thu, 11 Jan 2024 09:12:48 +0000 (UTC)
Received: from pigeon.gentoo.org (localhost [127.0.0.1])
	by pigeon.gentoo.org (Postfix) with SMTP id 91FA7E29CC;
	Thu, 11 Jan 2024 09:12:47 +0000 (UTC)
Received: from smtp.gentoo.org (woodpecker.gentoo.org [140.211.166.183])
	(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
	 key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256)
	(No client certificate requested)
	by pigeon.gentoo.org (Postfix) with ESMTPS id 6A2D1E29CC
	for <gentoo-commits@lists.gentoo.org>; Thu, 11 Jan 2024 09:12:47 +0000 (UTC)
Received: from oystercatcher.gentoo.org (oystercatcher.gentoo.org [148.251.78.52])
	(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
	 key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256)
	(No client certificate requested)
	by smtp.gentoo.org (Postfix) with ESMTPS id 636753431C7
	for <gentoo-commits@lists.gentoo.org>; Thu, 11 Jan 2024 09:12:46 +0000 (UTC)
Received: from localhost.localdomain (localhost [IPv6:::1])
	by oystercatcher.gentoo.org (Postfix) with ESMTP id B358F95D
	for <gentoo-commits@lists.gentoo.org>; Thu, 11 Jan 2024 09:12:44 +0000 (UTC)
From: "Andrew Ammerlaan" <andrewammerlaan@gentoo.org>
To: gentoo-commits@lists.gentoo.org
Content-Transfer-Encoding: 8bit
Content-type: text/plain; charset=UTF-8
Reply-To: gentoo-dev@lists.gentoo.org, "Andrew Ammerlaan" <andrewammerlaan@gentoo.org>
Message-ID: <1704964330.d14803303b4e91fe67b2ab7e813c6e83c2f13eb8.andrewammerlaan@gentoo>
Subject: [gentoo-commits] repo/gentoo:master commit in: sci-physics/lammps/
X-VCS-Repository: repo/gentoo
X-VCS-Files: sci-physics/lammps/lammps-20230802-r1.ebuild sci-physics/lammps/metadata.xml
X-VCS-Directories: sci-physics/lammps/
X-VCS-Committer: andrewammerlaan
X-VCS-Committer-Name: Andrew Ammerlaan
X-VCS-Revision: d14803303b4e91fe67b2ab7e813c6e83c2f13eb8
X-VCS-Branch: master
Date: Thu, 11 Jan 2024 09:12:44 +0000 (UTC)
Precedence: bulk
List-Post: <mailto:gentoo-commits@lists.gentoo.org>
List-Help: <mailto:gentoo-commits+help@lists.gentoo.org>
List-Unsubscribe: <mailto:gentoo-commits+unsubscribe@lists.gentoo.org>
List-Subscribe: <mailto:gentoo-commits+subscribe@lists.gentoo.org>
List-Id: Gentoo Linux mail <gentoo-commits.gentoo.org>
X-BeenThere: gentoo-commits@lists.gentoo.org
X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply
X-Archives-Salt: 1e4d1cd0-410d-4e7e-b248-685071ab906d
X-Archives-Hash: baccd4e39fdd69d897af3f786c014461

commit:     d14803303b4e91fe67b2ab7e813c6e83c2f13eb8
Author:     Denis Strizhkin <strdenis02 <AT> gmail <DOT> com>
AuthorDate: Wed Jan  3 19:27:03 2024 +0000
Commit:     Andrew Ammerlaan <andrewammerlaan <AT> gentoo <DOT> org>
CommitDate: Thu Jan 11 09:12:10 2024 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=d1480330

sci-physics/lammps: add openmp and extra iuse flags, fix hip configure

Bug: https://bugs.gentoo.org/907713
Signed-off-by: Denis Strizhkin <strdenis02 <AT> gmail.com>
Signed-off-by: Andrew Ammerlaan <andrewammerlaan <AT> gentoo.org>

 sci-physics/lammps/lammps-20230802-r1.ebuild | 175 +++++++++++++++++++++++++++
 sci-physics/lammps/metadata.xml              |   4 +
 2 files changed, 179 insertions(+)

diff --git a/sci-physics/lammps/lammps-20230802-r1.ebuild b/sci-physics/lammps/lammps-20230802-r1.ebuild
new file mode 100644
index 000000000000..3c3d57476605
--- /dev/null
+++ b/sci-physics/lammps/lammps-20230802-r1.ebuild
@@ -0,0 +1,175 @@
+# Copyright 1999-2024 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+PYTHON_COMPAT=( python3_{10..12} )
+DISTUTILS_OPTIONAL=1
+DISTUTILS_USE_PEP517=setuptools
+CMAKE_MAKEFILE_GENERATOR=emake
+# Doc building insists on fetching mathjax
+# DOCS_BUILDER="doxygen"
+# DOCS_DEPEND="
+# 	media-gfx/graphviz
+# 	dev-libs/mathjax
+# "
+
+inherit cmake fortran-2 distutils-r1 # docs
+
+convert_month() {
+	local months=( "" Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec )
+	echo ${months[${1#0}]}
+}
+
+MY_PV="$((10#${PV:6:2}))$(convert_month ${PV:4:2})${PV:0:4}"
+MY_P="${PN}-${MY_PV}"
+
+DESCRIPTION="Large-scale Atomic/Molecular Massively Parallel Simulator"
+HOMEPAGE="https://lammps.sandia.gov/"
+SRC_URI="https://download.lammps.org/tars/${MY_P}.tar.gz"
+S="${WORKDIR}/${MY_P}/cmake"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+IUSE="cuda examples extra gzip hip lammps-memalign mpi opencl openmp python test"
+# Requires write access to /dev/dri/renderD...
+RESTRICT="test"
+
+RDEPEND="
+	app-arch/gzip
+	media-libs/libpng:0
+	sys-libs/zlib
+	mpi? (
+		virtual/mpi
+		sci-libs/hdf5:=[mpi]
+	)
+	python? ( ${PYTHON_DEPS} )
+	sci-libs/voro++
+	virtual/blas
+	virtual/lapack
+	sci-libs/fftw:3.0=
+	sci-libs/netcdf:=
+	cuda? ( >=dev-util/nvidia-cuda-toolkit-4.2.9-r1:= )
+	opencl? ( virtual/opencl )
+	hip? (
+		dev-util/hip:=
+		sci-libs/hipCUB:=
+	)
+	dev-cpp/eigen:3
+	"
+	# Kokkos-3.5 not in tree atm
+	# kokkos? ( dev-cpp/kokkos-3.5.* )
+BDEPEND="${DISTUTILS_DEPS}"
+DEPEND="${RDEPEND}
+	test? (
+		dev-cpp/gtest
+	)
+"
+
+REQUIRED_USE="
+	python? ( ${PYTHON_REQUIRED_USE} )
+	?? ( cuda opencl hip )
+"
+
+src_prepare() {
+	cmake_src_prepare
+	if use python; then
+		pushd ../python || die
+		distutils-r1_src_prepare
+		popd || die
+	fi
+}
+
+src_configure() {
+	local mycmakeargs=(
+		-DCMAKE_INSTALL_SYSCONFDIR="${EPREFIX}/etc"
+		-DBUILD_SHARED_LIBS=ON
+		-DBUILD_MPI=$(usex mpi)
+		-DBUILD_DOC=OFF
+		#-DBUILD_DOC=$(usex doc)
+		-DENABLE_TESTING=$(usex test)
+		-DPKG_ASPHERE=ON
+		-DPKG_BODY=ON
+		-DPKG_CLASS2=ON
+		-DPKG_COLLOID=ON
+		-DPKG_COMPRESS=ON
+		-DPKG_CORESHELL=ON
+		-DPKG_DIPOLE=ON
+		-DPKG_EXTRA-COMPUTE=$(usex extra)
+		-DPKG_EXTRA-DUMP=$(usex extra)
+		-DPKG_EXTRA-FIX=$(usex extra)
+		-DPKG_EXTRA-MOLECULE=$(usex extra)
+		-DPKG_EXTRA-PAIR=$(usex extra)
+		-DPKG_GRANULAR=ON
+		-DPKG_KSPACE=ON
+		-DFFT=FFTW3
+		-DPKG_KOKKOS=OFF
+		#-DPKG_KOKKOS=$(usex kokkos)
+		#$(use kokkos && echo -DEXTERNAL_KOKKOS=ON)
+		-DPKG_MANYBODY=ON
+		-DPKG_MC=ON
+		-DPKG_MEAM=ON
+		-DPKG_MISC=ON
+		-DPKG_MOLECULE=ON
+		-DPKG_OPENMP=$(usex openmp)
+		-DPKG_PERI=ON
+		-DPKG_QEQ=ON
+		-DPKG_REPLICA=ON
+		-DPKG_RIGID=ON
+		-DPKG_SHOCK=ON
+		-DPKG_SRD=ON
+		-DPKG_PYTHON=$(usex python)
+		-DPKG_MPIIO=$(usex mpi)
+		-DPKG_VORONOI=ON
+	)
+	if use cuda || use opencl || use hip; then
+		mycmakeargs+=( -DPKG_GPU=ON )
+		use cuda && mycmakeargs+=( -DGPU_API=cuda )
+		use opencl && mycmakeargs+=( -DGPU_API=opencl -DUSE_STATIC_OPENCL_LOADER=OFF )
+		use hip && mycmakeargs+=( -DGPU_API=hip -DHIP_PATH="${EPREFIX}/usr" )
+	else
+		mycmakeargs+=( -DPKG_GPU=OFF )
+	fi
+	cmake_src_configure
+	if use python; then
+		pushd ../python || die
+		distutils-r1_src_configure
+		popd || die
+	fi
+}
+
+src_compile() {
+	cmake_src_compile
+	if use python; then
+		pushd ../python || die
+		distutils-r1_src_compile
+		popd || die
+	fi
+}
+
+src_test() {
+	cmake_src_test
+	if use python; then
+		pushd ../python || die
+		distutils-r1_src_test
+		popd || die
+	fi
+}
+
+src_install() {
+	cmake_src_install
+	if use python; then
+		pushd ../python || die
+		distutils-r1_src_install
+		popd || die
+	fi
+
+	if use examples; then
+		for d in examples bench; do
+			local LAMMPS_EXAMPLES="/usr/share/${PN}/${d}"
+			insinto "${LAMMPS_EXAMPLES}"
+			doins -r "${S}"/../${d}/*
+		done
+	fi
+}

diff --git a/sci-physics/lammps/metadata.xml b/sci-physics/lammps/metadata.xml
index d44b7b9658ed..8cd9e53aced2 100644
--- a/sci-physics/lammps/metadata.xml
+++ b/sci-physics/lammps/metadata.xml
@@ -20,6 +20,7 @@
 			call instead of malloc() when large chunks or memory are allocated
 			by LAMMPS. Aliengnment is on 16 byte boundaries.</flag>
 		<flag name="hip">Enable hip gpu computing support</flag>
+		<flag name="extra">Additional compute, dump, fix, molecular, pair styles</flag>
 		<!--<flag name="kokkos">Enable kokkos non-bonded kernels</flag>-->
 	</use>
 	<maintainer type="person">
@@ -30,4 +31,7 @@
 		<email>sci-physics@gentoo.org</email>
 		<name>Gentoo Physics Project</name>
 	</maintainer>
+	<upstream>
+		<remote-id type="github">lammps/lammps</remote-id>
+	</upstream>
 </pkgmetadata>