summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
author Giancarlo Dessi <slack@giand.it>2024-04-16 06:55:50 +0700
committer Willy Sudiarto Raharjo <willysr@slackbuilds.org>2024-04-16 14:09:55 +0700
commit7c78ee423406e87878c5c01c6f60f613a8ae5b8b (patch)
tree606c2b8c8547c0945bd7e0df36f42bd0f61a8fa8
parent9ce3865175bf71642e8d7d44824dbeb74c683f9c (diff)
downloadslackbuilds-7c78ee423406e87878c5c01c6f60f613a8ae5b8b.tar.gz
slackbuilds-7c78ee423406e87878c5c01c6f60f613a8ae5b8b.tar.xz
academic/lammps: Updated for version 2023.08.02_update3.
Signed-off-by: Willy Sudiarto Raharjo <willysr@slackbuilds.org>
-rw-r--r--academic/lammps/README.SBo12
-rw-r--r--academic/lammps/doinst.sh12
-rw-r--r--academic/lammps/lammps.SlackBuild138
-rw-r--r--academic/lammps/lammps.info20
4 files changed, 113 insertions, 69 deletions
diff --git a/academic/lammps/README.SBo b/academic/lammps/README.SBo
index 07a8c3d1d2..b74f864a25 100644
--- a/academic/lammps/README.SBo
+++ b/academic/lammps/README.SBo
@@ -128,8 +128,7 @@ REACTION ; REACTION ; ;
REAXFF ; REAXFF ; ;
REPLICA ; REPLICA ; ;
RIGID ; RIGID ; ;
-SCAFACOS ; SCAFACOS ; ; download extrasource \
- openmpi/mpich (needed)
+SCAFACOS ; SCAFACOS ; ; scafacos
SHOCK ; SHOCK ; ;
SMTBQ ; SMTBQ ; ;
SPH ; SPH ; ;
@@ -137,7 +136,6 @@ SPIN ; SPIN ; ;
SRD ; SRD ; ;
TALLY ; TALLY ; ;
UEF ; UEF ; ;
-VORONOI ; VORONOI ; ; voro++
YAFF ; YAFF ; ;
-----------------------------------------------------------------------
@@ -147,7 +145,7 @@ Some packages, available in the source, are not supported in this
slackbuild for various reasons. These are:
- ADIOS: requires a library not available in Slackware or SBo.
- KIM: requires the download of extrasource during the compilation
- which cannot prevented by a predownload.
+ which cannot be prevented by a predownload.
- ML-QUIP: the version for non-commercial uses can be downloaded only
during the compilation. A preventive download is allowed
only via git.
@@ -161,6 +159,10 @@ slackbuild for various reasons. These are:
source but the anonymous download is not permitted.
- QMMM: requires a library that can be built and installed from source
downloaded after registration
+- VORONOI: since the required dependency available in this repository
+ can be build as static library, this package is not compatible
+ when lammps is built enabling shared libraries, so support to
+ it is disabled
- VTK: not available at the moment because the build fails. It is
possible that this is caused by the VTK built in my system: the
issue is a conflict with the support of VTK to openmpi in my
@@ -193,7 +195,7 @@ configuration using Intel compilers and hardware it should work also
with other with reduced performances. If detected, the build takes
advantage of the parallelism (MPI and tbb, for example).
-KOKKOS is another package that enhance the functionality of LAMMPS
+KOKKOS is another package that enhances the functionality of LAMMPS
taking advandage of the parallel computation. Since its build requires
resources and a build with a single core seems very long, I set the
enabling by default only for 64-bit architectures because I do not know
diff --git a/academic/lammps/doinst.sh b/academic/lammps/doinst.sh
new file mode 100644
index 0000000000..e841b031e5
--- /dev/null
+++ b/academic/lammps/doinst.sh
@@ -0,0 +1,12 @@
+config() {
+ NEW="$1"
+ OLD="$(dirname $NEW)/$(basename $NEW .new)"
+ if [ ! -r $OLD ]; then
+ mv $NEW $OLD
+ elif [ "$(cat $OLD | md5sum)" = "$(cat $NEW | md5sum)" ]; then
+ rm $NEW
+ fi
+}
+
+config etc/profile.d/lammps.sh.new
+config etc/profile.d/lammps.csh.new
diff --git a/academic/lammps/lammps.SlackBuild b/academic/lammps/lammps.SlackBuild
index 87ca1fe027..0ecea585ff 100644
--- a/academic/lammps/lammps.SlackBuild
+++ b/academic/lammps/lammps.SlackBuild
@@ -2,7 +2,7 @@
# Slackware build script for lammps
-# Copyright 2023 Giancarlo Dessi, Cagliari, IT
+# Copyright 2023-2024 Giancarlo Dessi, Cagliari, IT
# All rights reserved.
#
# Redistribution and use of this script, with or without modification, is
@@ -25,12 +25,16 @@
cd $(dirname $0) ; CWD=$(pwd)
PRGNAM=lammps
-VERSION=${VERSION:-2023.08.02}
+VERSION=${VERSION:-2023.08.02_update3}
BUILD=${BUILD:-1}
TAG=${TAG:-_SBo}
PKGTYPE=${PKGTYPE:-tgz}
SRCNAM=lammps-stable
-SRCVERSION=${SRCVERSION:-2Aug2023}
+SRCVERSION=${SRCVERSION:-2Aug2023_update3}
+PACEVERSION=v.2023.10.04
+MDIVERSION=1.4.26
+N2P2VERSION=2.2.0
+OCLLVERSION=2022.01.04
if [ -z "$ARCH" ]; then
case "$( uname -m )" in
@@ -45,21 +49,49 @@ if [ ! -z "${PRINT_PACKAGE_NAME}" ]; then
exit 0
fi
-# First detect if openmpi or mpich are installed, so we can build LAMMPS with the
+# First detect if openmpi or mpich are installed, so we can build LAMMPS with the
# parallel computing and enable some packages
MP=""
mpi=""
-if pkg-config --exists ompi; then
- MP="openmpi";
+if pkg-config --exists ompi; then
+ MP="openmpi";
mpi="-DBUILD_OMP=yes "
fi
-if pkg-config --exists mpich; then
- MP="mpich";
+if pkg-config --exists mpich; then
+ MP="mpich";
mpi="-DBUILD_MPI=yes "
fi
+# Detect if some dependencies are installed or extrafile download.
+# These are needed conditions to prevent the download of extrafiles
+# during the build
+scafacos=""
+mdi=""
+mlpace=""
+# External ScaFaCos must be installed in the system
+if pkg-config --exists scafacos; then
+ scafacos="-DPKG_SCAFACOS=yes -DDOWNLOAD_SCAFACOS=OFF "
+fi
+# lammps-user-pace must be downloaded in $CWD
+PACETARBALL=$CWD/lammps-user-pace-$PACEVERSION.tar.gz
+if [ -f $PACETARBALL ]; then
+ mlpace="" ; [ "${MLPACE:-yes}" = "yes" ] && mlpace="-DPKG_ML-PACE=yes "
+fi
+# MDI_Library must be downloaded in $CWD. Installation of this library
+# in the system does not work
+MDITARBALL=$CWD/MDI_Library-$MDIVERSION.tar.gz
+if [ -f $MDITARBALL ]; then
+ mdi="" ; [ "${MDI:-yes}" = "yes" ] && mdi="-DPKG_MDI=yes -DDOWNLOAD_MDI=ON "
+fi
+# N2P2 must be downloaded in $CWD
+N2P2=$CWD/n2p2-$N2P2VERSION.tar.gz
+if [ -f $MDITARBALL ]; then
+ mlhdnnp="" ; [ "${MLHDNNP:-yes}" = "yes" ] && mlhdnnp="-DPKG_ML-HDNNP=yes "
+fi
+
+
# These internal packages are enabled by default.
-# If you do not require some of them you have to edit the conditions in this block
+# If you do not require some of them you have to edit the conditions in this block
# otherwise pass the respective environment variables set to "no" to the script
# for each package not desired
# (for example: AMOEBA=no ASPHERE=no ./lammps.SlackBuild)
@@ -104,14 +136,10 @@ machdyn="" ; [ "${MACHDYN:-yes}" = "yes" ] && machdyn="-DPKG_MACHDYN=yes "
manifold="" ; [ "${MANIFOLD:-yes}" = "yes" ] && manifold="-DPKG_MANIFOLD=yes "
manybody="" ; [ "${MANYBODY:-yes}" = "yes" ] && manybody="-DPKG_MANYBODY=yes "
mc="" ; [ "${MC:-yes}" = "yes" ] && mc="-DPKG_MC=yes "
-mdi="" ; [ "${MDI:-yes}" = "yes" ] && mdi="-DPKG_MDI=yes -DDOWNLOAD_MDI=yes "
meam="" ; [ "${MEAM:-yes}" = "yes" ] && meam="-DPKG_MEAM=yes "
mesont="" ; [ "${MESONT:-yes}" = "yes" ] && mesont="-DPKG_MESONT=yes "
mgpt="" ; [ "${MGPT:-yes}" = "yes" ] && mgpt="-DPKG_MGPT=yes "
misc="" ; [ "${MISC:-yes}" = "yes" ] && misc="-DPKG_MISC=yes "
-mlhdnnp="" ; [ "${MLHDNNP:-yes}" = "yes" ] && mlhdnnp="-DPKG_ML-HDNNP=yes "
-mliap="" ; [ "${MLIAP:-yes}" = "yes" ] && mliap="-DPKG_ML-IAP=yes -DMLIAP_ENABLE_PYTHON=autodetected "
-mlpace="" ; [ "${MLPACE:-yes}" = "yes" ] && mlpace="-DPKG_ML-PACE=yes "
mlpod="" ; [ "${MLPOD:-yes}" = "yes" ] && mlpod="-DPKG_ML-POD=yes "
mlrann="" ; [ "${MLRANN:-yes}" = "yes" ] && mlrann="-DPKG_ML-RANN=yes "
mlsnap="" ; [ "${MLSNAP:-yes}" = "yes" ] && mlsnap="-DPKG_ML-SNAP=yes "
@@ -143,13 +171,18 @@ yaff="" ; [ "${YAFF:-yes}" = "yes" ] && yaff="-DPKG_YAFF=yes "
# otherwise a bundled linear algebra is used. To force the use of internal
# linear algebra edit the CMake flag setting "-DUSE_INTERNAL_LINALG=yes "
if [ "$electrode" = "-DPKG_ELECTRODE=yes " ]; then
- if pkg-config --exists openblas; then
+ if pkg-config --exists openblas; then
electrode=$electrode"-DUSE_INTERNAL_LINALG=no "
fi
fi
if [ "${PYTHON:-yes}" = "yes" ]; then
python="-DPKG_PYTHON=yes "
+ if [ -d /usr/doc/python3-numpy* ]; then
+ mliap="" ; [ "${MLIAP:-yes}" = "yes" ] && mliap="-DPKG_ML-IAP=yes -DMLIAP_ENABLE_PYTHON=autodetected "
+ else
+ mliap=""
+ fi
else
python=""
mliap=""
@@ -158,34 +191,31 @@ fi
# The GPU package requires some basic settings that may be customized through environment
# variables. For advanced options requiring specific hardware configurations (GPU) see the
# documentation in lammps.org
-# This package causes many issues depending on the hardware/software configuration (build
+# This package causes many issues depending on the hardware/software configuration (build
# failure or segmentation fault) that require additional settings to be solved, so it is
-# disabled by default.
+# disabled by default.
if [ "${GPU:-no}" = "yes" ]; then
# by default the GPU package is enabled using bundled OpenCL ICD loader library/headers
# but users may prefer the local opencl installed in the system
opencl_loader="yes" ; [ "${STATIC_OCL:-no}" = "no" ] && opencl_loader="no"
gpu="-DPKG_GPU=yes -DGPU_API=opencl -DUSE_STATIC_OPENCL_LOADER=${opencl_loader} "
else
- opencl_loader=""
+ opencl_loader=""
gpu=""
-fi
+fi
# Following conditions enable by default all packages that require dependencies if these
-# are installed in the system
+# are installed in the system
latboltz=""
openmp=""
-scafacos=""
-if [ "$MP" = "openmpi" ]; then
+if [ "$MP" = "openmpi" ]; then
latboltz="" ; [ "${LATBOLTZ:-yes}" = "yes" ] && latboltz="-DPKG_LATBOLTZ=yes "
openmp="" ; [ "${OPENMP:-yes}" = "yes" ] && openmp="-DPKG_OPENMP=yes "
- scafacos="" ; [ "${SCAFACOS:-yes}" = "yes" ] && scafacos="-DPKG_SCAFACOS=yes "
fi
if [ "$MP" = "mpich" ]; then
latboltz="" ; [ "${LATBOLTZ:-yes}" = "yes" ] && latboltz="-DPKG_LATBOLTZ=yes "
- scafacos="" ; [ "${SCAFACOS:-yes}" = "yes" ] && scafacos="-DPKG_SCAFACOS=yes "
fi
if pkg-config --exists plumed; then
@@ -195,29 +225,24 @@ else
fi
netcdf=""
-if pkg-config --exists netcdf; then
+if pkg-config --exists netcdf; then
netcdf="" ; [ "${NETCDF:-yes}" = "yes" ] && netcdf="-DPKG_NETCDF=yes "
fi
-voronoi=""
-if [ -f /usr/bin/voro++ ]; then
- voronoi="" ; [ "${VORONOI:-yes}" = "yes" ] && voronoi="-DPKG_VORONOI=yes "
-fi
-
h5md=""
if [ -f /usr/bin/h5cc ]; then
h5md="" ; [ "${H5MD:-yes}" = "yes" ] && h5md="-DPKG_H5MD=yes "
fi
-# This shouldn't need in 32-bit architectures, however it significantly extends the build times
+# This shouldn't need in 32-bit architectures, however it significantly extends the build times
# and absorbs many resources. Openmpi is strictly required.
kokkos=""
if [ "$ARCH" = "x86_64" ]; then
if [ "${KOKKOS:-yes}" = "yes" ] ; then
kokkos="-DPKG_KOKKOS=yes -DKokkos_ARCH_NATIVE=yes -DKokkos_ENABLE_OPENMP=yes "
fi
- if [ "$MP" != "openmpi" ]; then
- kokkos=""
+ if [ "$MP" != "openmpi" ]; then
+ kokkos=""
fi
fi
@@ -226,9 +251,9 @@ packages=$amoeba$asphere$atc$awpmd$bocs$body$bpm$brownian$cgdna$cgspica$class2$c
$colvars$compress$coreshell$dielectric$diffraction$dipole$dpdbasic$dpdmeso$dpdreact\
$dpdsmooth$drude$eff$electrode$extracompute$extradump$extrafix$extramolecule$extrapair\
$fep$gpu$granular$h5md$intel$interlayer$kokkos$kspace$latboltz$lepton$machdyn$manifold\
-$manybody$mc$mdi$meam$mesont$mgpt$misc$mlhdnnp$mliap$mlpace$mlpod$mlrann$mlsnap$mofff\
-$molecule$netcdf$openmp$opt$orient$peri$phonon$plugin$plumed$poems$ptm$qeq$qtb$reaction\
-$reaxff$replica$rigid$scafacos$shock$smtbq$sph$spin$srd$tally$uef$voronoi$yaff
+$manybody$mc$mdi$meam$mesont$mgpt$misc$mlhdnnp$mliap$mlpod$mlrann$mlsnap$mofff$molecule\
+$netcdf$openmp$opt$orient$peri$phonon$plugin$plumed$poems$ptm$qeq$qtb$reaction\
+$reaxff$replica$rigid$shock$smtbq$sph$spin$srd$tally$uef$yaff
TMP=${TMP:-/tmp/SBo}
PKG=$TMP/package-$PRGNAM
@@ -241,7 +266,7 @@ elif [ "$ARCH" = "i686" ]; then
SLKCFLAGS="-O2 -march=i686 -mtune=i686"
LIBDIRSUFFIX=""
elif [ "$ARCH" = "x86_64" ]; then
- SLKCFLAGS="-O2 -fPIC"
+ SLKCFLAGS="-O2"
LIBDIRSUFFIX="64"
else
SLKCFLAGS="-O2"
@@ -257,12 +282,6 @@ rm -rf ${SRCNAM}_${SRCVERSION}
tar xvf $CWD/${SRCNAM}_${SRCVERSION}.tar.gz
cd ${SRCNAM}_${SRCVERSION}
-echo -e "\nFLAGS FOR PACKAGES ENABLED:\n "$packages"\n"
-
-echo -e "FLAGS FOR PYTHON:\n "$python
-
-echo -e "\nFLAGS FOR MPI:\n "$mpi
-
if [ "$mesont" != "" ]; then
cp -a $CWD/C_10_10.mesocnt ./potentials
if [ "$molecule" = "" ]; then
@@ -279,7 +298,7 @@ if [ "$MP" = "" ]; then
echo " the build and installation of LAMMPS, but some "
echo " packages cannot be enabled and other may work "
echo " not optimally. "
- echo -e "\n*************************************************\n\033[0m"
+ echo -e "\n*************************************************\n\033[0m"
fi
# Prepare directories to move the extrafiles needed to build some packages
@@ -287,27 +306,35 @@ mkdir -p cmake/build
if [ "$opencl_loader" = "yes" ]; then
mkdir -p cmake/build/_deps
- cp -a $CWD/opencl-loader-2022.01.04.tar.gz cmake/build/_deps
+ cp -a $CWD/opencl-loader-$OCLLVERSION.tar.gz cmake/build/_deps
fi
if [ "$mdi" != "" ]; then
mkdir -p cmake/build/mdi_build_ext/src/
- cp -a $CWD/MDI_Library-1.4.16.tar.gz cmake/build/mdi_build_ext/src/v1.4.16.tar.gz
+ cp -a $CWD/MDI_Library-$MDIVERSION.tar.gz cmake/build/mdi_build_ext/src/v$MDIVERSION.tar.gz
fi
+
if [ "$mlhdnnp" != "" ]; then
mkdir -p cmake/build/n2p2_build-prefix/src/
- cp -a $CWD/n2p2-2.2.0.tar.gz cmake/build/n2p2_build-prefix/src/v2.2.0.tar.gz
+ cp -a $CWD/n2p2-$N2P2VERSION.tar.gz cmake/build/n2p2_build-prefix/src/v$N2P2VERSION.tar.gz
fi
if [ "$mlpace" != "" ]; then
- cp -a $CWD/lammps-user-pace-v.2023.01.3.fix.tar.gz cmake/build/libpace.tar.gz
+ cp -a $CWD/lammps-user-pace-$PACEVERSION.tar.gz cmake/build/libpace.tar.gz
fi
-if [ "$scafacos" != "" ]; then
- mkdir -p cmake/build/scafacos_build-prefix/src
- cp -a $CWD/scafacos-1.0.1.tar.gz cmake/build/scafacos_build-prefix/src
-fi
+echo -e "\nFLAGS FOR PACKAGES ENABLED:\n "$packages"\n"
+
+echo -e "FLAGS FOR PYTHON:\n "$python
+
+echo -e "\nFLAGS FOR MPI:\n "$mpi
+
+echo -e "\nFLAGS FOR SCAFACOS:\n "$scafacos
+
+echo -e "\nFLAGS FOR ML-PACE:\n "$mlpace
+
+echo ""
chown -R root:root .
find -L . \
@@ -315,8 +342,8 @@ find -L . \
-o -perm 511 \) -exec chmod 755 {} \; -o \
\( -perm 666 -o -perm 664 -o -perm 640 -o -perm 600 -o -perm 444 \
-o -perm 440 -o -perm 400 \) -exec chmod 644 {} \;
-
-# The Source has not a CMakeLists.txt file in the root directory we
+
+# The Source has not a CMakeLists.txt file in the root directory we
# need to change in the cmake directory
cd cmake
cd build
@@ -325,8 +352,12 @@ cd build
-DCMAKE_CXX_FLAGS:STRING="$SLKCFLAGS" \
-DCMAKE_INSTALL_PREFIX=/usr \
-DCMAKE_BUILD_TYPE=Release \
+ -DBUILD_SHARED_LIBS=ON \
$mpi \
+ $scafacos \
+ $mdi \
$python \
+ $mlpace \
$packages \
..
make
@@ -353,6 +384,7 @@ cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild
mkdir -p $PKG/install
cat $CWD/slack-desc > $PKG/install/slack-desc
+cat $CWD/doinst.sh > $PKG/install/doinst.sh
cd $PKG
/sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE
diff --git a/academic/lammps/lammps.info b/academic/lammps/lammps.info
index f5375a9bc5..8583388823 100644
--- a/academic/lammps/lammps.info
+++ b/academic/lammps/lammps.info
@@ -1,22 +1,20 @@
PRGNAM="lammps"
-VERSION="2023.08.02"
+VERSION="2023.08.02_update3"
HOMEPAGE="https://www.lammps.org"
-DOWNLOAD="https://github.com/lammps/lammps/archive/stable_2Aug2023/lammps-stable_2Aug2023.tar.gz \
+DOWNLOAD="https://github.com/lammps/lammps/archive/stable_2Aug2023_update3/lammps-stable_2Aug2023_update3.tar.gz \
https://download.lammps.org/potentials/C_10_10.mesocnt \
https://download.lammps.org/thirdparty/opencl-loader-2022.01.04.tar.gz \
- https://github.com/MolSSI-MDI/MDI_Library/archive/v1.4.16.tar.gz \
- https://github.com/CompPhysVienna/n2p2/archive/v2.2.0.tar.gz \
- https://github.com/ICAMS/lammps-user-pace/archive/v.2023.01.3.fix.tar.gz \
- https://github.com/scafacos/scafacos/releases/download/v1.0.1/scafacos-1.0.1.tar.gz"
-MD5SUM="276af48be230518d8a281387838d6efd \
+ https://github.com/MolSSI-MDI/MDI_Library/archive/v1.4.26/MDI_Library-1.4.26.tar.gz \
+ https://github.com/CompPhysVienna/n2p2/archive/v2.2.0/n2p2-2.2.0.tar.gz \
+ https://github.com/ICAMS/lammps-user-pace/archive/v.2023.10.04.tar.gz"
+MD5SUM="a68cd5d9f70822da73092457bc3ccede \
68b5ca26283968fd9889aa0a37f7b7fb \
8d3a801e87a2c6653bf0e27707063914 \
- 407db44e2d79447ab5c1233af1965f65 \
+ 3124bb85259471e2a53a891f04bf697a \
a2d9ab7f676b3a74a324fc1eda0a911d \
- 4f0b3b5b14456fe9a73b447de3765caa \
- bd46d74e3296bd8a444d731bb10c1738"
+ 70ff79f4e59af175e55d24f3243ad1ff"
DOWNLOAD_x86_64=""
MD5SUM_x86_64=""
-REQUIRES="openmpi"
+REQUIRES="openmpi scafacos"
MAINTAINER="Giancarlo Dessi"
EMAIL="slack@giand.it"