Installing the NIST*Lattice Web Software


The program name NIST*Lattice is used to refer to two different programs. One is a search program for the NIST Crystal Data Database. This web page gives information about installing a web form that allows access to some of the computations in the second program, which performs various computations on lattices: NIST*LATTICE, "A Program to Analyze Lattice Relationships" (Version of Spring, 1991) by Vicky Lynn Karen and Alan D. Mighell, National Institute of Standards and Technology, Materials Science and Engineering Laboratory, Gaithersburg, Maryland 20899. [V. L. Karen and A. D. Mighell, NIST Technical Note 1290 (1991)].

The NIST Center for Neutron Research has developed software for accessing this program via a web page for our own research efforts. The capabilities of this web page are relatively primitive currently, it is hoped they can be expanded in the future. While the software has been written in a fairly platform-independent manner, the details of compilation and implementation of web scripts varies between platforms. This document details the steps needed to install this software on a Linux web server that can be accessed only within NIST.

Software Distribution

The software is contained in file ftp://ftp.ncnr.nist.gov/pub/cryst/powdersuite/cdsearch.tar.gz.

Software Compilation

Here are the steps involved in compiling the software. The examples are what I used for a Linux machine:
Download the software (say to /tmp/)
Create a directory to place the software
mkdir ~/crystaldata; cd ~/crystaldata
Unpack the software
tar xvzf /tmp/cdsearch.tar.gz
Modify file Make.inc
The definitions included here are:
FC
Defines the FORTRAN compiler (typically "f77" or "g77")
CC
ignored for NIST*LATTICE
F2CLIB
No longer used
DBG
may be ignored, unless debugging options are needed
NAMEOPTION
ignored for NIST*LATTICE
CFLAGS
ignored for NIST*LATTICE
FFLAGS
defines flags needed by Fortran compiler (-c is always used)
Here is my example (same as that used for the Crystal Data search program)
  FC = g77 
  CC = gcc 
  F2CLIB =
# use next line for debugging only
#  DBG= -g -Wall

# options for C <-> Fortran naming
NAMEOPTION = -DTWOSCORE -DBIT32

CFLAGS = $(DBG) $(NAMEOPTION)
FFLAGS = $(DBG)
Compile the program
cd nistlattice
make
make clean
cd ..

Web Installation

There are four things that need to be accomplished here: 1) the Web page used in searching must be placed in an area that can be read by the web server 2) a file must be created to invoke the cgi script 3) the lattice.html script must be modified to access the cgi script. 4) misc customization
  1. I used
    cp html/lattice.html /var/www/html/xtal
    to put the web page where they can be read.

  2. Create a file to execute the runlattice.cgi script
    [root@charlotte cgi-bin]# cat > /var/www/cgi-bin/runlattice.cgi
    #!/bin/sh
    ulimit -c 0 -t 30 -f 10
    /home/toby/crystaldata/cgi/runlattice.cgi
    ^D
    [root@charlotte cgi-bin]# chown root.apache /var/www/cgi-bin/runlattice.cgi
    [root@charlotte cgi-bin]# chmod 650 /var/www/cgi-bin/runlattice.cgi 
    [root@charlotte cgi-bin]# ls -l /var/www/cgi-bin/runlattice.cgi
    -rw-r-x---    1 root     apache         52 Feb  5 12:02 /var/www/cgi-bin/runlattice.cgi
    

  3. I changed the "FORM METHOD=POST ACTION=" line to reference "/cgi-bin/runlattice.cgi" so that file /var/www/cgi-bin/runlattice.cgi would be used in lattice.html.

  4. Customization/Fixes
    • Other: fix reference to background image Change reference to image file: see line with Background="/xtal/images/bkground.jpg" in cgi/runlattice.cgi
    • you may want to change the line in cd-search.script [look for variable conf(inetlist)] that determines the web addresses allowed to access the database.

The web interface described here was written by Brian Toby, NIST Center for Neutron Research, with help from Vicky Lynn Karen, Ceramic Division. NIST*LATTICE, "A Program to Analyze Lattice Relationships" is written by Vicky Lynn Karen and Alan D. Mighell [V. L. Karen and A. D. Mighell, NIST Technical Note 1290 (1991)]. This software is not subject to copyright -- it may be modified and distributed by anyone. (Please send additions and corrections to Brian Toby so that others may also benefit from your efforts.)

This software is supplied "as is" and without support. It is the policy of the NCNR to provide our internally-developed software to the scientific community at large and to our facility's users, specifically. However, we cannot promise support if the software fails to work properly. Neither the U.S. Government nor the authors make any warranty, expressed or implied, or assume any liability or responsibility for the use of this software. Brand names cited here are used for identification purposes and do not consitute an endorsement by NIST.

Brian Toby (Brian.Toby@NIST.GOV)
$Revision: $ $Date: $