check_env.csh — Diagnostic script to check if AMPAC is set up correctly.
This script was designed as a new diagnostic tool to help identify and solve the most common problems that might prevent AMPAC from running. This tool should be used as the first step in identifying problems and should be run by anyone having trouble running AMPAC. If AMPAC fails to run properly and this script fails to resolve the problem, then the output from this script should be included when contacting Semichem Customer Support.
Prior to performing any tests, check_env.csh displays information about the machine type, operating system, and environment variables.
The check_env.csh script performs the following tests:
These two environment variables are set by the script init_ampac.csh (for csh or tcsh shells) or init_ampac.sh (for sh, ksh, or bash shells). If the appropriate script has not already been sourced, then these two environment variables have not been set and check_env.csh will stop and will report that init_ampac.csh or init_ampac.sh needs to be sourced. (See Chapter 15, Package Administration for more details on how to source these initialization scripts.)
It is essential that the $AMPAC_DIR environment variable points to the base directory into which AMPAC has been installed. The check_env.csh script looks in the directory $AMPAC_DIR for the file init_ampac.csh. If it does not find it, then $AMPAC_DIR is not set correctly and check_env.csh stops with an error message. The appropriate init_ampac.csh or init_ampac.sh file must be edited with the correct directory and sourced again to set those environment variables. (See Chapter 15, Package Administration for more details on how to edit these initialization scripts.) The $AGUI_DIR environment variable is similarly checked. Since the init_ampac scripts automatically set $AGUI_DIR to $AMPAC_DIR/agui, this test should never fail unless $AGUI_DIR is being corrupted elsewhere or the AMPAC installation has been corrupted.
There are a number of executables (such as ampac.exe) and scripts (such as ampac.csh) that must exist and be located in the correct directory for AMPAC to be able to run. If the script reports, "AMPAC has not been configured for 32-bit versus 64-bit executables" (select operating systems only), then this problem can be successfully resolved by the user by executing the config_ampac.csh script as indicated in the error message. Otherwise, unless there is a serious problem in the installation, this test should never report a failure. Please note specifically which executables or scripts are missing and then contact Semichem Customer Support for help in resolving this issue.
The script will also attempt to detect if Gaussian™ is present and available. If a suitable version is identified, the Gaussian version and associated environment variables are printed. If Gaussian is not detected but is available on the system, make sure that the Gaussian installation is properly initialized.
After having already verified the existence of each of the critical executables and scripts, the check_env.csh script will check that each has the required read and/or execute permissions that are needed in order to run. Generally, these permissions are set once and for all just after installation by executing the script Set_File_Protection.csh. If check_env.csh indicates that the permissions have not been set correctly, then have the system administrator run Set_File_Protection.csh to correct this. (See Chapter 15, Package Administration for details.) If that fails to resolve the problem, contact Semichem Customer Support.
For some operating systems, AMPAC is shipped with specific libraries that AMPAC and AGUI need in order to run. These libraries (if any) are found in $AMPAC_DIR/lib and $AGUI_DIR/lib respectively. The user must have read and execute privileges for these libraries in order to run. If not, the user may receive a missing library error at run time even though the libraries are actually there. If running check_env.csh indicates that the permissions are not correct, then have the system administrator run Set_File_Protection.csh to correct this. (See Chapter 15, Package Administration for details.) If that fails to resolve the problem, contact Semichem Customer Support. If the script reports, "AGUI libraries have not been configured for Xft versus no Xft." (select operating systems only), then this problem can be successfully resolved by the user by executing the config_ampac.csh script as indicated in the error message.
The single most common reason for AMPAC not running is that the AMPAC license file (called "ampac.key") does not exist, has the wrong name, or has been placed in the wrong directory. This file does not come with the AMPAC installation but must be obtained directly from Semichem. The file must be named "ampac.key" and placed in the main AMPAC installation directory (i.e. $AMPAC_DIR). (See “License Administration” for details.) The ampac.key file also requires read permissions for any user of AMPAC or AGUI. Since ampac.key is installed separately from the main AMPAC installation, its permissions may not have been properly set. If output from running the check_env.csh script indicates that the permissions are not correct, then have the system administrator run Set_File_Protection.csh to correct this. After checking that the ampac.key file exists and has read permission, the check_env.csh script makes a quick check to verify that ampac.key does indeed appear to be a genuine key. If that test fails, you will be required to contact Semichem Customer Service to get a new key. If all is successful, check_env.csh will call keycleaner.exe -l to output information about the key file. (See keycleaner.exe for details about this output.)
AMPAC and AGUI must be able to load various libraries in order to run. The operating system locates these libraries by looking at a operating system specific run-time load library path variable (such as $LD_LIBRARY_PATH). The run-time load library path variables are modified by the script ld_env.csh, which is automatically sourced by the scripts that actually run AMPAC and AGUI. (It is done this way, so that changes to the run-time environment affect only the shell running AMPAC or AGUI. This avoids cluttering the user's shell environment and helps avoid conflicts with other programs running on the system.) The contents of the library paths are reported in the output to insure that these paths are being set correctly.
The check_env.csh script will attempt to run ldd (or its equivalent) on ampac.exe. (If ldd or its equivalent cannot be found, this test will be skipped.) This will cause a list of needed run-time libraries to be dumped to the screen as well as information about whether the library has been found and if so, where it is located. The exact content and format of the output varies between operating systems. The user should check this output to see if any libraries are listed as missing or if are an older version. In the case of missing libraries, read the operating system specific README file located in $AMPAC_DIR/READMEs for detailed instructions on handling missing libraries. If that fails to resolve the problem, include the output from check_env.csh when contacting Semichem Customer Support.
For diagnostic purposes, check_env.csh will output information about how AMPAC is configured. Which options require configuration depends on the operating system and some machines may have no configuration details to report. Reported configuration details may include: (a) using 64-bit or 32-bit executables; (b) using xft or non-xft dependent libraries; and (c) which version of the CXML library to use (EV4, EV5, EV6, or EV7). These configuration details can be changed by the user using the config_ampac.csh script. See config_ampac.csh for details about each of these configuration options and how to change them.
As a final test, the check_env.csh script will created a small AMPAC input file in the temporary directory, /tmp, and attempt to run it. This is the ultimate test to see if AMPAC is set up correctly. If there are problems with writing to /tmp or other problems, the script will simply give a warning and skip the AMPAC test. If AMPAC runs successfully, then everything is set up correctly. One possible cause for AMPAC to fail after it has passed all of the other tests is if the ampac.key file has been corrupted during the process of emailing or file transferring. This problem can be corrected using the keycleaner.exe utility. A second possible problem is that AMPAC can not find a required library. Look through the output from "ldd" (from test 8, above) to see if it reports any missing libraries. In the case of missing libraries, read the operating system specific README file located in $AMPAC_DIR/READMEs for detailed instructions on handling missing libraries.