56.11 Installing the NQ Package

The NQ is written in C and the package can only be installed under UNIX. It has been tested on DECstation running Ultrix, a NeXTstation running NeXT-Step 3.0, and SUNs running SunOS. It requires the GNU multiple precision arithmetic. Make sure that this library is installed before trying to install the NQ.

If you got a complete binary and source distribution for your machine, nothing has to be done if you want to use the NQ for a single architecture. If you want to use the NQ for machines with different architectures skip the extraction and compilation part of this section and proceed with the creation of shell scripts described below.

If you got a complete source distribution, skip the extraction part of this section and proceed with the compilation part below.

In the example we will assume that you, as user gap, are installing the NQ package for use by several users on a network of two DECstations, called bert and tiffy, and a NeXTstation, called bjerun. We assume that GAP is also installed on these machines following the instructions given in Installation of GAP for UNIX.

Note that certain parts of the output in the examples should only be taken as rough outline, especially file sizes and file dates are not to be taken literally.

First of all you have to get the file nq.zoo (see Getting GAP). Then you must locate the GAP directories containing lib/ and doc/, this is usually gap3r4p0 where 0 is to be be replaced by the patch level.

    gap@tiffy:~ > ls -l
    drwxr-xr-x  11 gap      gap          1024 Nov  8  1991 gap3r4p0
    -rw-r--r--   1 gap      gap        106307 Jan 24 15:16 nq.zoo
    gap@tiffy:~ > ls -l
    drwxr-xr-x   2 gap      gap          3072 Nov 26 11:53 doc
    drwxr-xr-x   2 gap      gap          1024 Nov  8  1991 grp
    drwxr-xr-x   2 gap      gap          2048 Nov 26 09:42 lib
    drwxr-xr-x   2 gap      gap          2048 Nov 26 09:42 src
    drwxr-xr-x   2 gap      gap          1024 Nov 26 09:42 tst

Unpack the package using unzoo (see Installation of GAP for UNIX). Note that you must be in the directory containing gap3r4p0 to unpack the files. After you have unpacked the source you may remove the archive-file.

    gap@tiffy:~ > unzoo x nq.zoo
    gap@tiffy:~ > ls -l gap3r4p0/pkg/nq
    drwxr-xr-x   2 gap    gap      1024 Jan 24 21:00 bin
    drwxr-xr-x   2 gap    gap      1024 Jan 19 11:33 examples
    drwxr-xr-x   2 gap    gap      1024 Jan 24 21:03 gap
    lrwxrwxrwx   1 gap    gap         8 Jan 19 11:33 init.g
    drwxr-xr-x   2 gap    gap      1024 Jan 24 21:04 src
    -rwxr--r--   1 gap    gap       144 Dec 28 15:08 testNq 

Switch into the directory src/ and type make to compile the NQ. If the header files for the GNU multiple precision arithmetic are not in /usr/local/include you must set GNUINC to the correct directory. If the library for the GNU multiple precision arithmetic is not /usr/local/lib/libmp.a you must set GNULIB. In your case we first compile the DECstation version. If your operating system does not provide a function getrusage start make with COPTS=-DNO_GETRUSAGE.

    gap@tiffy:~ > cd gap3r4p0/pkg/nq/src
    gap@tiffy:../src > make GNUINC=/usr/gnu/include \
                            GNULIB=/usr/gnu/lib/libmp.a
    
# you will see a lot of messages

Now it is possible to test the standalone.

    gap@tiffy:../src > cd ..
    gap@tiffy:../nq > testNq 

If testNq reports a difference others then machine name, runtime or size, check the GNU multiple precision arithmetic and warnings generated by make. If testNq succeeded , move the executable to the bin/ directory.

gap@tiffy:../nq > mv src/nq bin/nq-dec-mips-ultrix

Now repeat the compilation for the NeXTstation. Do not forget to clean up.

    gap@tiffy:../nq > rlogin bjerun
    gap@bjerun:~ > cd gap3r4p0/pkg/nq/src
    gap@bjerun:../src > make clean
    gap@bjerun:../src > make
    
#
 you will see a lot of messages
    gap@bjerun:../src > mv nq ../bin/nq-next-m68k-mach
    gap@bjerun:../src > exit
    gap@tiffy:../src > 

Switch into the subdirectory bin/ and create a script which will call the correct binary for each machine. A skeleton shell script is provided in bin/nq.sh.

    gap@tiffy:../src > cd ..
    gap@tiffy:../nq > cat > bin/nq
    
#
!/bin/csh
    switch ( `hostname` )
      case 'bert':
      case 'tiffy':
        exec $0-dec-mips-ultrix $* ;
        breaksw ;
      case 'bjerun':
        exec $0-next-m68k-mach $* ;
        breaksw ;
      default:
        echo "nq: sorry, no executable exists for this machine" ;
        breaksw ;
    endsw
    
ctr-D
    gap@tiffy:../nq > chmod 755 bin/nq

Now it is time to test the package. Assuming that testNq worked the following will test the link to GAP.

    gap@tiffy:../nq > gap -b
    gap> RequirePackage( "nq" );
    gap> ReadTest( "gap/nq.tst" );
    gap> 

Previous Up Top Next
Index

GAP 3.4.4
April 1997