Skip to content

Instantly share code, notes, and snippets.

@al42and
Forked from lambdalisue/install_vmd_ubuntu.sh
Last active January 5, 2021 22:56
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save al42and/2c1350191ab273e0777277d12f4bef21 to your computer and use it in GitHub Desktop.
Save al42and/2c1350191ab273e0777277d12f4bef21 to your computer and use it in GitHub Desktop.
An install script of VMD to Ubuntu
#!/bin/bash
#==============================================================================
# An install script which help you to install VMD in Ubuntu 16.04
#
# Authors: Alisue (lambdalisue@hashnote.net). Al42and (al42and@gmail.com)
# License: MIT License
#
# Copyright hashnote.net, 2015, allright reserved.
#==============================================================================
set -euo pipefail
ROOT=$(cd $(dirname $0); pwd)
# CONFIGURE -------------------------------------------------------------------
ARCH="LINUXAMD64"
VERSION="1.9.2"
VMDINSTALLNAME="vmd-$VERSION"
VMDINSTALLBINDIR="/opt/$VMDINSTALLNAME/bin"
VMDINSTALLLIBRARYDIR="/opt/$VMDINSTALLNAME/lib"
TCL_INCLUDE_DIR="/usr/include/tcl8.6"
PYTHON_INCLUDE_DIR="/usr/include/python2.7"
#------------------------------------------------------------------------------
if [[ ! -d "./vmd-$VERSION" ]]; then
if [[ ! -f "./vmd-${VERSION}.src.tar.gz" ]]; then
echo "'vmd-${VERSION}.src.tar.gz' is missing. Download and save it in this directory."
exit 1
fi
tar xvzf "vmd-${VERSION}.src.tar.gz"
fi
echo "************************************************************************"
echo
echo "Compile VMD plugins..."
echo
echo "************************************************************************"
cd plugins
sed -i -e 's/-ltcl8.5/-ltcl8.6/g' ./Make-arch
make clean
make $ARCH TCLINC=-I$TCL_INCLUDE_DIR TCLLIB=-F/usr/lib
make distrib PLUGINDIR=${ROOT}/vmd-${VERSION}/plugins
echo "************************************************************************"
echo
echo "Compile VMD..."
echo
echo "************************************************************************"
export VMDINSTALLNAME
export VMDINSTALLBINDIR
export VMDINSTALLLIBRARYDIR
export TCL_INCLUDE_DIR
export PYTHON_INCLUDE_DIR
cd ../vmd-$VERSION
ln -sf ../plugins plugins
# Create modified configure file
cp ./configure ./configure.mod
sed -i -e 's/-ltk8.5/-ltk8.6/g' ./configure.mod
sed -i -e 's/-ltcl8.5/-ltcl8.6/g' ./configure.mod
sed -i -e 's/-lpython2\.5/-lpython2.7/g' ./configure.mod
sed -i -e 's/\/usr\/local\/encap\/cuda-4\.0\/bin\/nvcc/\/usr\/bin\/nvcc/g' ./configure.mod
sed -i -e '/compute_1[03]/d' ./configure.mod
sed -i -e "s/\(\$arch_nvccflags[ ]\+= \"\)/\1-D_FORCE_INLINES /" ./configure.mod
chmod +x ./configure.mod
echo "Configuring"
./configure.mod \
LINUXAMD64 \
OPENGL \
FLTK \
TK \
IMD \
SILENT \
TCL \
PTHREADS \
NETCDF \
PYTHON \
NUMPY \
CUDA \
LIBTACHYON
# Compile
cd src
make veryclean
make
echo "************************************************************************"
echo
echo "Compile STRIDE..."
echo
echo "************************************************************************"
cd ../lib/stride/
mkdir src
cd src
wget 'ftp://ftp.ebi.ac.uk/pub/software/unix/stride/src/stride.tar.gz'
tar zxf stride.tar.gz
sed -i -e 's/\(MAX_AT_IN_RES \+\)50/\175/' ./stride.h
sed -i -e 's/SUCCESS/0/' ./stride.c
make
cp stride ../stride_$ARCH
echo "************************************************************************"
echo
echo "Compile SURF..."
echo
echo "************************************************************************"
cd ../../surf
mkdir src
cd src
tar axf ../surf.tar.Z
make depend
make
cp surf ../surf_$ARCH
echo "************************************************************************"
echo
echo "Compile TACHYON..."
echo
echo "************************************************************************"
cd ../../tachyon
mkdir src
cd src
wget 'http://jedi.ks.uiuc.edu/~johns/raytracer/files/0.99b6/tachyon-0.99b6.tar.gz'
tar zxf tachyon-0.99b6.tar.gz
cd tachyon/unix
make linux-64-thr
cp ../compile/linux-64-thr/tachyon ../../../tachyon_$ARCH
cd ../../../../../src/
# Install
sudo checkinstall \
--pkgname=vmd \
--pkgversion=$VERSION \
--pkglicense='VMD License' \
--default \
make install
sudo ln -sf $VMDINSTALLBINDIR/$VMDINSTALLNAME /usr/local/bin/vmd
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment