Showing posts with label Moltemplate. Show all posts
Showing posts with label Moltemplate. Show all posts

Sep 20, 2016

How to compile in Cygwin console

To compile in Cygwin console, additional installation is often required.
For example, gfortran is required to compile (build) Packmol.
However, default cygwin installation process does not include compilers (e.g., gcc, gfortran).

When installing Cygwin, we need to select necessary packages.
In a package search window, type "gcc" and then gcc packages will appear.
Change the default option into "install" or we can select particular packages in a subfolder.

In this way, other packages can be installed.
For example, to prepare MD simulation environment on Windows OS system, we will need:
required package of cygwin + python (for Moltemplate) + gcc (for Packmol) + make (for Packmol)
(gcc package includes gfortran)

Dec 16, 2015

How to use Moltemplate on Windows OS systems

Moltemplate (http://www.moltemplate.org/) is a powerful tool for configuring molecules and assigning force field parameters.
However, its use on Windows OS is somewhat tricky.

1. Install Cygwin (https://cygwin.com/install.html).  Installation of required packages + python should be good enough.

2. Copy all Moltemplate files to C:\cygwin64\home\moltemplate

3. Open "C:\cygwin64\home\username\.bash_profile" in a text editor.  Add a new PATH (in yellow) to a section "# Set PATH so it includes user's private bin if it exists".  For example,

# Set PATH so it includes user's private bin if it exists
# if [ -d "${HOME}/bin" ] ; then
   PATH="/bin/:/home/moltemplate/"
# fi

In Cygwin console (terminal), we can check if the PATH is correctly set by typing "echo $PATH"

5. Place examples (http://www.moltemplate.org/) in C:\cygwin64\home\moltemplate\examples

6. In Cygwin command window (console or teminal), navigate an example folder
(e.g., cd /home/moltemplate/examples/all_atom_examples/force_field_explicit/waterSPCE+Na+Cl/moltemplate_files)

7. In Cygwin command window, type:

moltemplate.sh  -atomstyle "full"  system.lt
or
moltemplate.sh  -xyz  system.xyz  -atomstyle "full"  system.lt
(This will use a premade xyz configuration of system, e.g., system.xyz).

LAMMPS input and data files will be created.  (e.g., system.in and system.data)