Scale Compiler Environmental Variables

This page documents the environmental variables used when constructing the Scale compile and when running the Scale compiler regression tests. This document assumes a Unix environment and the examples use the csh shell. Variables specified in red are provided by the user. The other variables should be derived from them.

Building Scale

CVSROOT
This is the absolute pathname of the cvs repository for the Scale compiler.
SCALE
Specifies the absolute pathname to the directory for your Scale compiler development. It would normally be something like ~/scale.
SCALEHOME
Specifies the absolute pathname to the directory for a common Scale compiler development repository. The existance of this repository allows developers to check out only the parts of the Scale compiler that they wish to work on. The class files, binaries, and libraries for the other parts are found through this path. If you are the sole developer at your site, SCALEHOME can have the same value as SCALE.
SCALEHOSTTYPE
Specifies the type of system upon which the Scale compiler will be executed. We are currently set up for the following options:
SCALEHOSTNAME
Specifies the name of the host system. It can be the same as SCALEHOSTTYPE if you do not wish to keep separate executable and libraries for differnt systems of the same type.
SCALETARGETTYPE
Specifies the target architecture for which the Scale compiler will generate code. We are currently set up for the following options:
SCALETARGETNAME
Not currently used.
SCALEHOSTOS
Not currently used.
SCALETARGETOS
Not currently used.
SCALELIB
This is usually set to $SCALE/$SCALERELEASE/$SCALEHOSTNAME/lib.
SCALEHOMELIB
This is usually set to $SCALEHOME/$SCALERELEASE/$SCALEHOSTNAME/lib.
SCALEBIN
This is usually set to $SCALE/$SCALERELEASE/$SCALEHOSTNAME/bin.
SCALEHOMEBIN
This is usually set to $SCALEHOME/$SCALERELEASE/$SCALEHOSTNAME/bin.
LD_LIBRARY_PATH
This must specify the pathnames for the libraries needed by the native C compilers, etc. It should include $SCALELIB and $SCALEHOMELIB.
CC
Specifies the native compiler to use when compiling the parts of Scale that are written in C.
CFLAGS
Specifies any compiler switches, such as -g to use when compiling the parts of Scale that are written in C.
AR
Specifies the library archival tool - normal ar is used.
MAKE
Specifies the GNU make utility. You must use GNU make.
JAVAHOME
Specifies the absolute pathname to the Java® jdk.
JNI_INCLUDES
Specifies the absolute pathname to the Java jni include files. Normally, this would be "-I$JAVAHOME/include -I$JAVAHOME/include/xxx" where xxx is solaris, alpha, or linux.
CLASSDEST
Specifies where to place the Scale compiler classes produced by the Java® compiler. This is usually set to $SCALE/$SCALERELEASE/classes.
CLASSPATH
Specifies where to find the class files of the Scale compiler. We do not currently use a Java® jar file for this. This is usually set to "${CLASSPATH}:${SCALE}/${SCALERELEASE}:${SCALE}/${SCALERELEASE}/classes:${SCALEHOME}/${SCALERELEASE}:${SCALEHOME}/${SCALERELEASE}/classes".
EDGCPSRC
Specifies the absolute pathname to your checked out copies of the source files of the EDG® C frontend. If you are not modifying the frontend, you do not need this environmental variable. It is normally set to "$SCALE/$SCALERELEASE/tools/edgcpfe_2.43/src".
EDGCPSRCHOME
Specifies the absolute pathname to your sites checked out copies of the source files of the EDG® C frontend. If your site is not modifying the frontend, you do not need this environmental variable. It is normally set to "$SCALEHOME/$SCALERELEASE/tools/edgcpfe_2.43/src".
EDGCP_INCLUDES
Specifies where to find the .h files for the frontend. This is usually set to "-I$EDGCPSRC -I$EDGCPSRCHOME".
EDGFSRC
Specifies the absolute pathname to your checked out copies of the source files of the EDG® F77 frontend. If you are not modifying the frontend, you do not need this environmental variable. It is normally set to "$SCALE/$SCALERELEASE/tools/edgffe_1.03/src".
EDGFSRCHOME
Specifies the absolute pathname to your sites checked out copies of the source files of the EDG® F77 frontend. If your site is not modifying the frontend, you do not need this environmental variable. It is normally set to "$SCALEHOME/$SCALERELEASE/tools/edgffe_1.03/src".
EDGF_INCLUDES
Specifies where to find the .h files for the frontend. This is usually set to "-I$EDGFSRC -I$EDGFSRCHOME".
JAVA
Specifies where to find the Java® JVM. This is usually set to "$JAVAHOME/bin/java".
JAVAC
Specifies where to find the Java® compiler. This is usually set to "$JAVAHOME/bin/javac".
JAVACFLAGS
This is usually set to "-J-Xmx32m -d $CLASSDEST -g".
JAVAD
Specifies where to find the Java® javadoc tool. This is usually set to "${JAVAHOME/bin/javadoc".
JAVADFLAGS
This is usually set to "-J-Xmx128m -J-Xms32m".
JAVADDEST
Specifies where to place the javadoc generated documentation. This is usually set to $SCALE/$SCALERELEASE/doc/html.

Running the Scale Regression Tests

When we make a change to the Scale compiler, we run the regression tests to see if the change caused a problem that did not occur before the change. If a test fails, we can use it to track down the bug that was introduced by the change.

There are many separate tests that comprise the regression test suite. Each test is compiled by Scale and compiled by a native compiler. The regression tests compare the output generated from running both versions. If there is any difference, the test failed.

These environmental variables are in addition to the ones described above. They are used when running the regression tests on the compiler. You may or may not be able to run these tests. They are not provided with the normal release of the Scale compiler.

F77
Specifies the native compiler to use when compiling the regresion tests that are written in Fortran 77.
DAVINCIHOME
Specifies where the DaVinci system can locate its machine-specific run-time modules.
F77FLGS
Specifies any compiler switches, such as -g to use when using the native F77 compiler.
CFP95
Specifies where to find the Spec® 95 floating point benchmarks.
CINT95
Specifies where to find the Spec® 95 integer benchmarks.
CFP2000
Specifies where to find the Spec® 2000 floating point benchmarks.
CINT2000
Specifies where to find the Spec® 2000 integer benchmarks.
DISBMK
Specifies where to find the DIS benchmarks.

Example csh Setup Script

#!/bin/csh -f
# This file must be sourced - not executed.

if ($?SCALE == 0) then
  echo SCALE must be set in your environment.  Exiting.
  exit
endif

if ($?SCALERELEASE == 0) then
  echo SCALERELEASE must be set in your environment.  Exiting.
  exit
endif

echo Setting up Scale for developer environment.

setenv SCALEHOME ~scale

if (${?LD_LIBRARY_PATH} == 0) then
  setenv LD_LIBRARY_PATH
endif

setenv SCALEHOSTTYPE "unknown"
if ($MACHINETYPE == "SOLsun") then
  setenv MANPATH /exp/rcf/comm/forte/SUNWspro/man:/usr/man:$MANPATH
  setenv LD_LIBRARY_PATH ".:/exp/rcf/comm/forte/SUNWspro/lib:$LD_LIBRARY_PATH"
  setenv LM_LICENSE_FILE /exp/rcf/comm/forte/SUNWste/license_tools/sunpro.lic,node
  setenv SCALEHOSTTYPE "sparc"
  setenv CC "/exp/rcf/comm/forte/SUNWspro/bin/cc -Xc"
  setenv CFLAGS	"-g -v"
  setenv F77 "/exp/rcf/comm/forte/SUNWspro/bin/f77 -silent"
  setenv AR /usr/ccs/bin/ar
  setenv MAKE /exp/rcf/share/bin/make
  setenv JAVAHOME     /exp/rcf/share/X11R5/j2sdk1_3_0
  setenv JNI_INCLUDES "-I$JAVAHOME/include -I$JAVAHOME/include/solaris"
else if ($MACHINETYPE == "ALPHA") then
  setenv MANPATH /usr/man:$MANPATH
  setenv LD_LIBRARY_PATH .:$LD_LIBRARY_PATH
  setenv SCALEHOSTTYPE "alpha"
  setenv CC  "cc -std"
  setenv CFLAGS	"-g -warnprotos"
  # don't add -msg_disable tags because they aren't portable across cxx versions. -msg_quiet seems to be better
  setenv F77 f77
  setenv AR /usr/ccs/bin/ar
  setenv MAKE /exp/rcf/share/bin/make
  setenv JAVAHOME     /usr/opt/java131
  setenv JNI_INCLUDES "-I$JAVAHOME/include -I$JAVAHOME/include/alpha"
else if ($MACHINETYPE == "i686") then
  setenv SCALEHOSTTYPE "i686"
  setenv CC gcc
  setenv AR /usr/bin/ar
  setenv MAKE /usr/bin/gmake
  setenv CFLAGS	-g
  setenv JAVAHOME     /exp/rcf/share/X11R5/jdk1.3
  setenv JNI_INCLUDES "-I$JAVAHOME/include -I$JAVAHOME/include/linux"
endif

setenv SCALEHOSTNAME   `echo $HOST | awk -F. '{print $1}'`
setenv SCALETARGETTYPE $SCALEHOSTTYPE
setenv SCALELIB        ${SCALE}/${SCALERELEASE}/${SCALEHOSTNAME}/lib
setenv SCALEHOMELIB    ${SCALEHOME}/${SCALERELEASE}/${SCALEHOSTNAME}/lib
setenv SCALEBIN        ${SCALE}/${SCALERELEASE}/${SCALEHOSTNAME}/bin
setenv SCALEHOMEBIN    ${SCALEHOME}/${SCALERELEASE}/${SCALEHOSTNAME}/bin

setenv LD_LIBRARY_PATH "${LD_LIBRARY_PATH}:${SCALELIB}:${SCALEHOMELIB}"
set path = ($path $SCALEBIN $SCALEHOMEBIN)
setenv CVSROOT ${SCALEHOME}/cvs

setenv CLASSDEST $SCALE/$SCALERELEASE/classes

if ($?CLASSPATH == 0) then
  setenv CLASSPATH
endif

# the CLASSPATH goes as follows:
# - the development destination directory
# - the root of the development hierarchy (needed for looking up .java files)
# - the main development directory
# - the root of the main development hierarchy (also for .java files)

setenv CLASSPATH ${CLASSPATH}:${SCALE}/${SCALERELEASE}:${SCALE}/${SCALERELEASE}/classes:${SCALEHOME}/${SCALERELEASE}:${SCALEHOME}/${SCALERELEASE}/classes

setenv EDGCPSRC         ${SCALE}/${SCALERELEASE}/tools/edgcpfe_2.43/src
setenv EDGCPSRCHOME     ${SCALEHOME}/${SCALERELEASE}/tools/edgcpfe_2.43/src
setenv EDGCP_INCLUDES   "-I$EDGCPSRC -I$EDGCPSRCHOME"
setenv EDGFSRC          ${SCALE}/${SCALERELEASE}/tools/edgffe_1.03/src
setenv EDGFSRCHOME      ${SCALEHOME/${SCALERELEASE}/tools/edgffe_1.03/src
setenv EDGF_INCLUDES    "-I$EDGFSRC  -I$EDGFSRCHOME"

setenv JAVA             "$JAVAHOME/bin/java"
setenv JAVAC            "$JAVAHOME/bin/javac"
setenv JAVACFLAGS       "-J-Xmx32m -d $CLASSDEST -g"
setenv JAVAD            "${JAVAHOME/bin/javadoc -J-Xmx128m -J-Xms32m"
setenv JAVADFLAGS       "-J-Xmx128m -J-Xms32m"
setenv JAVADDEST        $SCALE/$SCALERELEASE/doc/html
setenv JAVAH            $JAVAHOME/bin/javah

setenv DAVINCIHOME $SCALEHOME/$SCALERELEASE/tools/daVinci/daVinci_V2.1_$MACHINETYPE

setenv CFP95    /exp/rcf/common/pub/spec/benchspec/CFP95
setenv CINT95   /exp/rcf/common/pub/spec/benchspec/CINT95
setenv CFP2000  /exp/rcf/common/pub/spec/benchspec/CFP2000
setenv CINT2000 /exp/rcf/common/pub/spec/benchspec/CINT2000
setenv DISBMK   /exp/rcf/common/pub/DIS/dis

echo SCALE = $SCALE
echo "Compiling on $SCALEHOSTTYPE : $SCALEHOSTNAME for $SCALETARGETTYPE"
echo "Looking for libraries at: $SCALELIB $SCALEHOMELIB"
echo "Looking for binaries at: $SCALEBIN $SCALEHOMEBIN"
echo "Using development directory: $SCALE/$SCALERELEASE"
echo "Using support development directory: $SCALEHOME/$SCALERELEASE"
echo "Generated classes stored at: $CLASSDEST"
echo "Looking for classes at: $CLASSPATH"
echo "Using C compiler: $CC"
echo "Using F77 compiler: $F77"
echo "Scale setup complete."

(Last changed: August 20, 2002.)