Skip to content

Instantly share code, notes, and snippets.

@lambdalisue
Last active June 17, 2018 17:05
Show Gist options
  • Save lambdalisue/929083f174a7db9915f7 to your computer and use it in GitHub Desktop.
Save lambdalisue/929083f174a7db9915f7 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 15.04
#
# Author: Alisue ([email protected])
# License: MIT License
#
# Copyright hashnote.net, 2015, allright reserved.
#==============================================================================
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
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
chmod +x ./configure.mod
./configure.mod LINUXAMD64 \
OPENGL \
FLTK \
TK \
IMD \
SILENT \
TCL \
PTHREADS \
NETCDF \
PYTHON \
NUMPY
# Compile
cd src
make veryclean
make
# Install
sudo make install
sudo ln -sf $VMDINSTALLBINDIR/$VMDINSTALLNAME $VMDINSTALLBINDIR/vmd
#!/bin/sh
# Place this file into /etc/profile.d/
export PATH="/opt/vmd-1.9.8/bin:$PATH"
@rangsimanketkaew
Copy link

Can I just active the configuration file using ./configure and then use make command to install cd ./src sudo make install ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment