From 9288a70e174714b42ae8b81157195f84a4e37119 Mon Sep 17 00:00:00 2001 From: Ivo Date: Mon, 21 Mar 2022 11:05:41 -0400 Subject: [PATCH] =?UTF-8?q?feat:=20instala=C3=A7=C3=A3o=20do=20gromacs=20p?= =?UTF-8?q?ulada=20se=20j=C3=A1=20instalado?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- compile-and-install-gromacs-2018.sh | 89 +++++++++++++++++++++++++++++ install.sh | 41 +------------ 2 files changed, 90 insertions(+), 40 deletions(-) create mode 100644 compile-and-install-gromacs-2018.sh diff --git a/compile-and-install-gromacs-2018.sh b/compile-and-install-gromacs-2018.sh new file mode 100644 index 00000000..4f5dda30 --- /dev/null +++ b/compile-and-install-gromacs-2018.sh @@ -0,0 +1,89 @@ +if [ -f "/etc/arch-release" ]; then + if pacman -Qi paru > /dev/null; then + echo ">>> GROMACS já instalado" + else + # Enter working dir + cd libs/gromacs + + # Unzip GROMACS source code + unzip gromacs.zip + + # Make and prepare GROMACS build folder + mkdir -p build + cd build + cmake ../gromacs-2018/ \ + -DCMAKE_INSTALL_PREFIX=/usr/ \ + -DCMAKE_INSTALL_LIBDIR=lib \ + -DGMX_BUILD_OWN_FFTW=off \ + -DGMX_HWLOC=off + + # Build GROMACS + make -j$(nproc) + + # Then check our build + make check + + # Install our package + sudo make install + + # Append GMXRC to our .zshrc or .bash_profile + if [ -f ~/.zshrc ]; then + if ! grep -Fxq "source /usr/bin/GMXRC" ~/.zshrc; then + # Not written, so write + echo "source /usr/bin/GMXRC" >> ~/.zshrc + fi + else + if ! grep -Fxq "source /usr/local/gromacs/bin/GMXRC" ~/.bash_profile; then + # Not written, so write + echo "source /usr/local/gromacs/bin/GMXRC" >> ~/.bash_profile + fi + fi + + # Leave working dir/go back to visualdynamics root + cd ../../.. + fi +else + if dpkg -s gromacs &> /dev/null; then + echo "GROMACS already installed" + else + # Enter working dir + cd libs/gromacs + + # Unzip GROMACS source code + unzip gromacs.zip + + # Make and prepare GROMACS build folder + mkdir -p build + cd build + cmake ../gromacs-2018/ \ + -DCMAKE_INSTALL_PREFIX=/usr/ \ + -DCMAKE_INSTALL_LIBDIR=lib \ + -DGMX_BUILD_OWN_FFTW=off \ + -DGMX_HWLOC=off + + # Build GROMACS + make -j$(nproc) + + # Then check our build + make check + + # Install our package + sudo make install + + # Append GMXRC to our .zshrc or .bash_profile + if [ -f ~/.zshrc ]; then + if ! grep -Fxq "source /usr/bin/GMXRC" ~/.zshrc; then + # Not written, so write + echo "source /usr/bin/GMXRC" >> ~/.zshrc + fi + else + if ! grep -Fxq "source /usr/local/gromacs/bin/GMXRC" ~/.bash_profile; then + # Not written, so write + echo "source /usr/local/gromacs/bin/GMXRC" >> ~/.bash_profile + fi + fi + + # Leave working dir/go back to visualdynamics root + cd ../../.. + fi +fi \ No newline at end of file diff --git a/install.sh b/install.sh index 8dc76d72..77a7f0ce 100755 --- a/install.sh +++ b/install.sh @@ -45,46 +45,7 @@ if [ $resp = 'y' ]; then sudo apt install cmake gcc python3 python3-pip git grace unzip fftw3 -y fi - ## TODO: Install GROMACS 2018 - # Enter working dir - cd libs/gromacs - - # Unzip GROMACS source code - unzip gromacs.zip - - # Make and prepare GROMACS build folder - mkdir -p build - cd build - cmake ../gromacs-2018/ \ - -DCMAKE_INSTALL_PREFIX=/usr/ \ - -DCMAKE_INSTALL_LIBDIR=lib \ - -DGMX_BUILD_OWN_FFTW=off \ - -DGMX_HWLOC=off - - # Build GROMACS - make -j$(nproc) - - # Then check our build - make check - - # Install our package - sudo make install - - # Append GMXRC to our .zshrc or .bash_profile - if [ -f ~/.zshrc ]; then - if ! grep -Fxq "source /usr/bin/GMXRC" ~/.zshrc; then - # Not written, so write - echo "source /usr/bin/GMXRC" >> ~/.zshrc - fi - else - if ! grep -Fxq "source /usr/local/gromacs/bin/GMXRC" ~/.bash_profile; then - # Not written, so write - echo "source /usr/local/gromacs/bin/GMXRC" >> ~/.bash_profile - fi - fi - - # Leave working dir/go back to visualdynamics root - cd ../../.. + source compile-and-install-gromacs-2018.sh # Install and initialize our virtual environment sudo pip3 install virtualenv