From 1687c336241d681dbe82a33d4a9c7d7e331c5d83 Mon Sep 17 00:00:00 2001 From: Tru Huynh <tru@pasteur.fr> Date: Sun, 23 Mar 2025 17:34:07 +0100 Subject: [PATCH] fix $ expansion --- Dockerfile | 52 ++++++++++++++++++++++++++-------------------------- 1 file changed, 26 insertions(+), 26 deletions(-) diff --git a/Dockerfile b/Dockerfile index 014e5a3..0c436b2 100644 --- a/Dockerfile +++ b/Dockerfile @@ -10,7 +10,7 @@ V=2024.5 CMAKE=cmake ## GROMACS cd /opt -wget -q -O - https://ftp.gromacs.org/gromacs/gromacs-${V}.tar.gz | tar xzvf - +wget -q -O - https://ftp.gromacs.org/gromacs/gromacs-\${V}.tar.gz | tar xzvf - cd gromacs-2024.5 mkdir build cd build @@ -26,42 +26,42 @@ cmake ../ -DCUDA_TOOLKIT_ROOT_DIR=/usr/local/cuda-12.8 -DGMX_GPU=CUDA \ make -j24 CXXFLAGS="-O3" make install -D=/usr/local/gromacs/${V}-openmpi-cuda-12.8.0_570.86.10 +D=/usr/local/gromacs/\${V}-openmpi-cuda-12.8.0_570.86.10 _build_serial() { -if [ $# -eq 1 ]; then +if [ \$# -eq 1 ]; then OPT=$1 else exit 1 fi -mkdir serial-single-precision-${OPT} || : -(cd serial-single-precision-${OPT} && \ +mkdir serial-single-precision-\${OPT} || : +(cd serial-single-precision-\${OPT} && \ dpkg -l > dpkg-l printenv > printenv -${CMAKE} .. \ +\${CMAKE} .. \ -DGMX_BUILD_OWN_FFTW=ON \ -DREGRESSIONTEST_DOWNLOAD=ON \ --DGMX_SIMD=${OPT} \ --DCMAKE_INSTALL_PREFIX=${D}/serial/single-precision-${OPT} +-DGMX_SIMD=\${OPT} \ +-DCMAKE_INSTALL_PREFIX=\${D}/serial/single-precision-\${OPT} nice make -j 16 make check || : make install -) 2>&1 | tee -a serial-single-precision-${OPT}.`date '+%Y-%m-%d_%H%M'` +) 2>&1 | tee -a serial-single-precision-\${OPT}.`date '+%Y-%m-%d_%H%M'` } _build_mdrun() { -if [ $# -eq 1 ]; then -OPT=$1 +if [ \$# -eq 1 ]; then +OPT=\$1 else exit 1 fi -mkdir mdrun-only-single-precision-openmpi-cuda-12.8.0_570.86.10-${OPT} || : -(cd mdrun-only-single-precision-openmpi-cuda-12.8.0_570.86.10-${OPT} && \ +mkdir mdrun-only-single-precision-openmpi-cuda-12.8.0_570.86.10-\${OPT} || : +(cd mdrun-only-single-precision-openmpi-cuda-12.8.0_570.86.10-\${OPT} && \ export CUDACXX=/usr/local/cuda-12.8/bin/nvcc dpkg -l > dpkg-l printenv > printenv -${CMAKE} .. \ +\${CMAKE} .. \ -DCMAKE_CXX_COMPILER=mpicxx -DCMAKE_C_COMPILER=mpicc \ -DGMX_OPENMP=ON -DGMX_MPI=ON -DGMX_THREAD_MPI=OFF \ -DBUILD_SHARED_LIBS=ON \ @@ -69,20 +69,20 @@ ${CMAKE} .. \ -DCUDA_TOOLKIT_ROOT_DIR=/usr/local/cuda-12.8 \ -DGMX_BUILD_MDRUN_ONLY=ON \ -DGMX_GPU=CUDA \ --DGMX_SIMD=${OPT} \ --DCMAKE_INSTALL_PREFIX=${D}/mdrun-only/single-precision-openmpi-cuda-12.8.0_570.86.10-${OPT} +-DGMX_SIMD=\${OPT} \ +-DCMAKE_INSTALL_PREFIX=\${D}/mdrun-only/single-precision-openmpi-cuda-12.8.0_570.86.10-\${OPT} nice make -j 16 && \ make install -) 2>&1 | tee -a single-precision-openmpi-cuda-12.8.0_570.86.10-${OPT}.`date '+%Y-%m-%d_%H%M'` +) 2>&1 | tee -a single-precision-openmpi-cuda-12.8.0_570.86.10-\${OPT}.`date '+%Y-%m-%d_%H%M'` } _default_build() { for i in SSE4.1 AVX_256 AVX2_256 AVX_512 do -_build_serial $i -_build_mdrun $i +_build_serial \$i +_build_mdrun \$i done } @@ -101,20 +101,20 @@ apt-get clean # echo first argument must be one of # echo native # echo or -# (cd /usr/local/gromacs/${V}-openmpi-cuda-12.8.0_570.86.10/ && /bin/ls -1d */*) +# (cd /usr/local/gromacs/\${V}-openmpi-cuda-12.8.0_570.86.10/ && /bin/ls -1d */*) # exit 1 # } -# if [ $# -ge 1 ]; then -# if [ "$1" = "native" ]; then +# if [ \$# -ge 1 ]; then +# if [ "\$1" = "native" ]; then # . /usr/local/gromacs-2024.5-openmpi-cuda12.8-native/bin/GMXRC.bash # else -# if [ ! -d /usr/local/gromacs/${V}-openmpi-cuda-12.8.0_570.86.10/$1 ] ; then +# if [ ! -d /usr/local/gromacs/\${V}-openmpi-cuda-12.8.0_570.86.10/\$1 ] ; then # _usage # fi -# ls -l /usr/local/gromacs/${V}-openmpi-cuda-12.8.0_570.86.10/$1/bin/GMXRC.bash -# . /usr/local/gromacs/${V}-openmpi-cuda-12.8.0_570.86.10/$1/bin/GMXRC.bash +# ls -l /usr/local/gromacs/\${V}-openmpi-cuda-12.8.0_570.86.10/\$1/bin/GMXRC.bash +# . /usr/local/gromacs/\${V}-openmpi-cuda-12.8.0_570.86.10/\$1/bin/GMXRC.bash # fi # shift -# eval "$@" +# eval "\$@" # fi EOF -- GitLab