Skip to content

Commit

Permalink
feat: instalação do gromacs pulada se já instalado
Browse files Browse the repository at this point in the history
  • Loading branch information
ivopr committed Mar 21, 2022
1 parent 4d6f42b commit 9288a70
Show file tree
Hide file tree
Showing 2 changed files with 90 additions and 40 deletions.
89 changes: 89 additions & 0 deletions compile-and-install-gromacs-2018.sh
Original file line number Diff line number Diff line change
@@ -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
41 changes: 1 addition & 40 deletions install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 9288a70

Please sign in to comment.