add gromacs install example script
This commit is contained in:
10
compile_gromacs_2018.8_bookworm.patch
Normal file
10
compile_gromacs_2018.8_bookworm.patch
Normal file
@ -0,0 +1,10 @@
|
||||
--- gromacs-2018.8/src/gromacs/utility/arrayref.h 2019-10-04 08:39:25.000000000 +0200
|
||||
+++ gromacs-2018.8-fixed/src/gromacs/utility/arrayref.h 2025-05-23 14:54:03.458763669 +0200
|
||||
@@ -46,6 +46,7 @@
|
||||
#include <cstddef>
|
||||
|
||||
#include <array>
|
||||
+#include <limits>
|
||||
#include <iterator>
|
||||
#include <stdexcept>
|
||||
#include <utility>
|
52
install_gromacs_2018.8_bookworm.sh
Executable file
52
install_gromacs_2018.8_bookworm.sh
Executable file
@ -0,0 +1,52 @@
|
||||
#!/bin/bash
|
||||
|
||||
#set -x
|
||||
GMX_VERSION=2018.8
|
||||
|
||||
WORKDIR=$PWD
|
||||
CMAKE_PARAMETERS="-DCMAKE_INSTALL_PREFIX=/usr/local/gromacs-${GMX_VERSION} -DGMX_HWLOC=off"
|
||||
|
||||
if [ -f /var/lib/install_gromacs-${GMX_VERSION} ]; then
|
||||
CMAKE_PARAMTERS_OLD=$(</var/lib/install_gromacs-${GMX_VERSION})
|
||||
if [ "$CMAKE_PARAMETERS" == "$CMAKE_PARAMTERS_OLD" ]; then
|
||||
NO_CHANGE=true
|
||||
echo "No change detected"
|
||||
else
|
||||
NO_CHANGE=false
|
||||
echo "Change detected"
|
||||
fi
|
||||
else
|
||||
NO_CHANGE=false
|
||||
echo "Change detected, /var/lib/install_gromacs-${GMX_VERSION} not found"
|
||||
fi
|
||||
|
||||
|
||||
# if the former cmake parameters are the same
|
||||
if [ -d /usr/local/gromacs-${GMX_VERSION} -a $NO_CHANGE = true ]; then
|
||||
echo "Assume $GMX_VERSION is installed"
|
||||
exit 0
|
||||
else
|
||||
cd /tmp
|
||||
curl --fail https://ftp.gromacs.org/gromacs/gromacs-${GMX_VERSION}.tar.gz \
|
||||
--output gromacs-${GMX_VERSION}.tar.gz \
|
||||
--silent || echo "Version not found: gromacs-${GMX_VERSION}"
|
||||
tar xfz gromacs-${GMX_VERSION}.tar.gz
|
||||
rm gromacs-${GMX_VERSION}.tar.gz
|
||||
mkdir -p gromacs-${GMX_VERSION}/build
|
||||
# this patch is need because 2018.8 is *really* old by now
|
||||
if [ $GMX_VERSION==2018.8 ]; then
|
||||
pushd gromacs-${GMX_VERSION}
|
||||
patch --verbose -p1 < $WORKDIR/compile_gromacs_2018.8_bookworm.patch
|
||||
fi
|
||||
popd
|
||||
pushd gromacs-${GMX_VERSION}/build
|
||||
cmake .. $CMAKE_PARAMETERS
|
||||
make -j $(nproc)
|
||||
make install -j $(nproc)
|
||||
popd
|
||||
rm -rf gromacs-${GMX_VERSION}
|
||||
# save parameters of installation
|
||||
echo $CMAKE_PARAMETERS > /var/lib/install_gromacs-${GMX_VERSION}
|
||||
fi
|
||||
echo "Run the following command to set the LD_LIBRARY_PATH in order to compile pygmx:"
|
||||
echo "source /usr/local/gromacs-${GMX_VERSION}/bin/GMXRC"
|
Reference in New Issue
Block a user