Chapter 33
NCAlgebra and NCGB Installation

This chapter gives more detail on some aspects of Installation and running NCGB, SYStems, OldMmaGB. These are kind of random remarks we wanted to hang onto but which are probably not too important.

33.1 Running NCAlgebra

See Chapter ?? for the basics. We have nothing to add to that here.

33.2 Running NCGB

See Chapter ?? for the basics. We remind the reader here:  A UNIX session begins by

Getting in the NC directory, entering Mathematica and typing
In[1] :=<<SetNCPath.m

Then the file NCGB.m is used to load all necessary files into Mathematica. The command is:

       In[2]:= Get["NCGB.m"]

There are two configurations of this file; it can load either NCAlgebra.m or shortNCAlgebra.m, depending on the user’s needs. The file shortNCAlgebra.m loads a smaller segment of the complete package.

33.3 Running SYStems

First edit the SYStems.m file, whose function is to load in the raw material for your problem. Make sure it loads in what you need. The file SYStems.m is in the NCAlgebra directory. The first thing that the SYStems.m file does is to read in the NCAlgebra.m file and NCAlgebra should NOT be loaded either before or after getting the file SYStems.m. Thus a session begins by

Getting in the NC directory, entering Mathematica and typing
<<SetNCPath.m
<<SYStems.m

33.4 Running OldMmaGB (which we do not support)

The file OldMmaGB.m loads in old commands which we do not actively support as well as new untested ventures which may not work reliably and whose documentation, in NCOLDDOC, contains few complete english sentences.

A session begins by

Getting in the NC directory, entering Mathematica and typing
<<SetNCPath.m
<<OldMmaGB.m

Incidentally OldMmaGB.m is a file in the NC/NCAlgebra directory whose function is to load files found mostly in the    NC/NCAlgebra/OldMmaGB    directory.

33.5 Environment Settings

All variables beginning with the four characters $NC$ are reserved for use by the NCAlgebra and NCGB development teams.

The user may set an $NC$ variable to accomodate his/her needs. If the user does not assign a value to a $NC$ variable, then it has no value until that variable is to be actually used. At that time, the code changes the value of the variable to a default.

33.5.1 NCAlgebra $NC$ Variables

$NC$Loaded$NCAlgebra$ is used to ensure that NCAlgebra.m is not loaded twice. Every $NC$Loaded$*$ file will be used to avoid duplicate file Get’s. This is similar to the #ifndef #define #endif scheme used in C++.

$NC$isCatching$ is reserved to attempt to do Mathematica exception handling via the Mathematica commands Catch and Throw. This is not implemented and is held for future development.

33.5.2 NCGB $NC$ Variables

The $NC$ variables which are presently part of NCGB are those that are part of NCAlgebra (see section 33.5.1) and the following variables.

$NC$Loaded$NCGB$  
$NC$LongLoadTime$  
$NC$Binary$Dir$  
$NC$Binary$Name$

$NC$Loaded$NCGB$ is used to ensure that NCGB.m is not loaded twice. Every $NC$Loaded$*$ file will be used to avoid duplicate file Get’s. This is similar to the #ifndef #define #endif scheme used in C++.

The $NC$LongLoadTime$ variable is True by default which means that all of NCAlgebra.m will be read in when NCGB.m is read in. If one sets it to False, before loading either NCAlgebra.m or NCGB.m then only part of NCAlgebra.m will be read in.

The variables $NC$Binary$Dir$ and $NC$Binary$Name$ are used to specify which C++ executable file one is using. If one does not assign a value to either variable, then the value will be set in accordance with the variable $NCDir$ which is set in the file SetNCPath.m. The file SetNCPath.m was modified appropriately during installation.

33.6 How to set up if someone else compiled the code — UNIX

It is easy to bum off of a friend who is running NC on the same system.

33.6.1 When your system administrator installed the code

When your system administrator installed the code, he had several choices.

The first thing you should try is to start Mathematica by typing math and then type <<SetNCPath.m. If there are no error messages, then type <<NCAlgebra.m. Mathematica should respond with a sequence of statements indicating that various files are being loaded.

If Mathematica responds with Get::noopen: Cannot open SetNCPath.m, then additional steps are required as described below.

You need to determine where your system administrator installed NCAlgebra. The easiest way to do this is to ask your system administrator. If that is not easy and/or convenient, then you can type

cd   find / -name
and look at the result. Note that this command will take some time and will access the hard drive quite a bit. If this is done on our system, then the result is the directory
/home/ncalg/NC/NCAlgebra/NCAlgebra.m    .
The location of the installation in this case is /home/ncalg/NC .

Let us suppose that you know the location of the installation of NCAlgebra. Let us suppose that it is located in the directory /usr/local/NC.

Move into the directory where you want to use NCAlgebra (or create such a directory using the mkdir command). Create an init.m file with your favorite editor which contains the following lines:

AppendTo[$Path,"/usr/local/NC/"];  
Get["SetNCPath.m"];

Type math and then type <<NCAlgebra.m. Then Mathematica responds with a sequence of statements indicating that files are being loaded.

33.6.2 When your friend installed the code

Suppose that your friend has installed the code and he is willing to let you use his version of the code (see (6)), then you can follow this procedure:

(1) Have your friend log into his account and change directories into the one which contains the NC code. Suppose for definitiveness that it is located in the directory /home/JoeShmo/NC/. In this case, you would type cd /home/JoeShmo/NC
(2) Type chmod -R uog+r *. This allows all of these files to be read by anyone. (These files are available through the web, so giving permission to read them should be OK with your friend.)
(3) Edit the file SetNCPath.m. Make sure that there is a command
$NCDir$ = "/home/JoeShmo/NC"

(4) Type cd ../
(5) Type chmod u+rx NC. This allows the directory to be readable by anyone. For some reason, some computer systems require that a directory be executable. I don’t know why.
(6) Type cd ..
(7) Type chmod u+rx JoeShmo. This allows the directory to be readable by anyone. For some reason, some computer systems require that an directory be executable. I don’t know why. Your friend may or may not be willing to take this step.

Now, follow the directions in Section 33.6.1.

33.7 Informing TEX about notebook.sty

Read this only if you have trouble with Mma’s TeX conversion of notebooks. This has nothing to do with NCAlgebra, we just include it as a convenience.

Most special NCAlgebra and most special NCGB TEX definitions we use are in the file NCTeXForm.m. also TeXUtilities.m; see the section on TeX.

There is one place in the Mma’s TeX setting in which explicit facts about the operating system are used. “Elusive” file notebook.sty must be in your TeX path. Here is how you find notebook.sty and get it in your path.

(1) Type in math, then type $Path and determine where your system administrator installed your copy of mathematica. When I did this, I got the output as shown below and I determined that mathematica was installed in the directory /opt/mathematica
{euler 190 :/home/ncalg/NC/NCAlgebra} math  
Mathematica 3.0 for Solaris  
Copyright 1988-96 Wolfram Research, Inc.  
 -- Terminal graphics initialized --  
 
In[1]:= $Path  
 
Out[1]= {/home/ncalg/.Mathematica/3.0/Kernel, ., /home/ncalg,  
 
>    /opt/mathematica/AddOns/StandardPackages,  
>    /opt/mathematica/AddOns/StandardPackages/StartUp,  
>    /opt/mathematica/AddOns/Applications,  
>    /opt/mathematica/AddOns/ExtraPackages,  
>    /opt/mathematica/SystemFiles/Graphics/Packages, /home/osiris/ncalg/NCDir}

(2) Now move into that directory. I typed cd /opt/mathematica.
(3) Now find the file notebook.sty. I did this by typing find . -name "notebook.sty" -print When I did this I got ./SystemFiles/IncludeFiles/notebook.sty
(4) Now I changed my .cshrc file to add an entry to my TEXINPUTS UNIX environment variable. My .cshrc file has the line
 setenv TEXINPUTS

 ".:/opt/mathematica/SystemFiles/IncludeFiles:/opt/tex/lib/texmf//"

in it. You may want to discuss this with your system administrator.

To run DoTeX if you really want to; UNIX only

DoTeX is old. We include this instruction for old users who cannot part with it. The file called NCTeX.process should be transfered to the bin directory before you use our TeX setting command DoTeX.