Hilbert Base, SAGBI and SAGBI-Gröbner packages for Maple

Page created: 23 September 2005.
Last updated: 14 March 2006.

Contents

Description

The purpose of this document is to document the background, installation and usage of my Maple packages, collectively called HilbertSagbiSg:

HilbertBase
The HilbertBase package is used for finding the Hilbert basis of a system of linear diophantine equations, i.e. the minimal set of generators for the monoid of nonnegative solutions. The package is just a Maple frontend for (a patched version of) the c-program hb by Dmitrii V. Pasechnik, homepage. hb is included in HilbertSagbiSg.
SAGBI
The SAGBI package contains implementations of the subduction and SAGBI basis construction algorithms. Depends on HilbertBase.
SAGBI-Groebner
The SAGBI-Groebner package contains implementations of the SI-reduction and SAGBI-Gröbner basis construction algorithms. Depends on HilbertBase.

Platforms

OS/Architecture: Linux/x86 Solaris 8/Sparc OSF1/Alpha Windows/x86 MacOs X/PPC
Maple 8 WS WS WS WB NT
Maple 9 WS NT NT WB WB
Maple 9.5 WS NT NT WB WB
Maple 10 WS NT NT WB NT
Legend:
WB The packages Work and a Binary (pre compiled) version of hb for this OS/Architecture/Mapleversion is included in HilbertSagbiSg. Thus no c-compiler is needed to install HilbertSagbiSg for this OS/Architecture/Mapleversion.
WS The packages Work but no binary version of hb for this OS/Architecture/Mapleversion is included in HilbertSagbiSg. Thus a c-compiler is needed to compile hb from Source to install HilbertSagbiSg for this OS/Architecture/Mapleversion.
NTNot Tested

Installation instructions

Overview of the installation process

The installation of HilbertSagbiSg is performed by calling the script install.mpl. This script detects if there exists a pre-compiled version of hb, if not it tries to compile hb from source, then it installs HilbertSagbiSg. An installation log is written to the file install.log.

Linux/UNIX installation instructions

1. Verify the compiler

Make sure you have the “vendor supplied c-compiler” installed, for Linux this is gcc, for Solaris this is Sun Workshop C/C++ compiler, etc. If the command
	    which cc
	  
outputs some path, then the compiler will probably work.

2. Download the source

Download the tarball:

3. Unpack the source

Open a terminal window and cd to the directory containing the tarball HilbertSagbiSg-20060313.tgz then issue the command:
	  gunzip -c HilbertSagbiSg-20060313.tgz | tar xvf -	  
Or if you have GNU tar you can type a few characters less:
	  tar zxvf HilbertSagbiSg-20060313.tgz	  

4. Review the installation location

A complete HilbertSagbiSg installation consists of four files:
	  HilbertSagbiSg.lib
	  HilbertSagbiSg.ind
	  libhb.so
	  .mapleinit
	  
The first three of these can be installed anywhere, but .mapleinit has to be installed someplace where Maple looks for initialization files when starting up, e.g. in the users home directory, $HOME, this is the default installation location for .mapleinit. By default the other three files are installed into the directory $HOME/system/mapleX.Y, where X.Y is the integer and first decimal part of the Maple version used at the installation. If you want the three files to be installed elsewhere, then uncomment and edit the definition of MY_MAPLE_ADD_ON_DIR in the file defs.mpl.

5. Call the installation script

In a terminal window cd to the HilbertSagbiSg-20060313 directory. Then issue the command:
	  maple -s -q install.mpl
	  
The command above will install HilbertSagbiSg just for the Maple version used for the installation, so if you want to be able to use HilbertSagbiSg from more than one Maple version you have to install it once for each version of Maple. If you have set the MY_MAPLE_ADD_ON_DIR variable then you need to change it before installing HilbertSagbiSg for another Maple version, otherwise the previous installation will be overwritten.

6. Installation complete

You are now ready to use HilbertSagbiSg, see Usage.

MacOS X installation instructions

1. Verify the compiler

For Maple 9 and 9.5 on PPC there exists a pre-compiled version of the c-backend. If you are installing HilbertSagbiSg for Maple 9 or 9.5 on a PPC system you can probably use the pre- compiled c-backend, then you will not need a compiler, so you can skip to point 2. If you are installing on some other processor architecture, version of Maple or the pre-compiled c-backend doesn't work, then you need to install at least the following components of Apple's Xcode Tools:
	  Developer Tools Software
	  Mac OS X SDK
	  BSD SDK
      

2. Download the source

Download the tarball:

3. Unpack the source

Open a terminal window and cd to the directory containing the tarball HilbertSagbiSg-20060313.tgz, then issue the command:
	 tar zxvf HilbertSagbiSg-20060313.tgz	

4. Review the installation location

A complete HilbertSagbiSg installation consists of four files:
	  HilbertSagbiSg.lib
	  HilbertSagbiSg.ind
	  libhb.so
	  .mapleinit
	  
The first three of these can be installed anywhere, but .mapleinit has to be installed someplace where Maple looks for initialization files when starting up, e.g. in the users home directory, $HOME, this is the default installation location for .mapleinit. By default the other three files are installed into the directory $HOME/system/mapleX.Y, where X.Y is the integer and first decimal part of the Maple version used at the installation. If you want the three files to be installed elsewhere, then uncomment and edit the definition of MY_MAPLE_ADD_ON_DIR in the file defs.mpl.

5. Call the installation script

Check where the maple binary is installed, for Maple 9.5 this can be something like:
        /Applications/Maple\ 9.5/Maple\ 9.5.app/Contents/MacOS/bin/maple
      
Now call the main installation script in the HilbertSagbiSg-20060313 directory:
         /Applications/Maple\ 9.5/Maple\ 9.5.app/Contents/MacOS/bin/maple -s -q install.mpl
      
The command above will install HilbertSagbiSg just for the Maple version used for the installation, so if you want to be able to use HilbertSagbiSg from more than one Maple version you have to install it once for each version of Maple.

6. Installation complete

You are now ready to use HilbertSagbiSg, see Usage.

Windows installation instructions

1. Verify the compiler

For Maple 8, 9, 9.5 and 10 there exists pre-compiled versions of the c-backend. If you are installing HilbertSagbiSg for one of these versions of Maple you can use the pre- compiled c-backend, then you will not need a compiler, so you can skip to point 2. If you are installing on some other version of Maple or the pre-compiled c-backend doesn't work, then you need to install a command line version of Microsoft's Visual C/C++ compiler. The following versions are tested and known to work:
        Microsoft Visual C++ 2005 Express Edition
        Microsoft Visual C++ Toolkit 2003
      
With these compilers a command prompt is supplied, in this command prompt the necessary environment variables for compilation are automatically set. Thus if you want to compile the c-backend you have to use this command prompt instead of an ordinary DOS window when issuing the installation/compilation command in point 5 below.

2. Download the source

Download the zipfile:

3. Unpack the source

Unpack the zipfile HilbertSagbiSg-20060313.zip into some directory.

4. Review the installation location

A complete HilbertSagbiSg installation consists of four files:
	  HilbertSagbiSg.lib
	  HilbertSagbiSg.ind
	  libhb.dll
	  maple.ini
	  
The first three of these can be installed anywhere, but maple.ini has to be installed someplace where Maple looks for initialization files when starting up. Let MAPLEDIR denote the main directory of the Maple installation, e.g. C:\Program Files\Maple 9\bin.win\maplesys.ini. The four files are typically installed in the following locations:
	  MAPLEDIR\Users\system\mapleX.Y\HilbertSagbiSg.lib
	  MAPLEDIR\Users\system\mapleX.Y\HilbertSagbiSg.ind
	  MAPLEDIR\Users\system\mapleX.Y\libhb.dll
	  MAPLEDIR\Users\maple.ini
	  
or if Maple was installed in Multiple User Mode:
	  MAPLEDIR\Users\USERNAME\system\mapleX.Y\HilbertSagbiSg.lib
	  MAPLEDIR\Users\USERNAME\system\mapleX.Y\HilbertSagbiSg.ind
	  MAPLEDIR\Users\USERNAME\system\mapleX.Y\libhb.dll
	  MAPLEDIR\Users\USERNAME\maple.ini
	  
where X.Y is the integer and first decimal part of the Maple version used at the installation, and USERNAME is the user name of the user performing the installation, issue the command: set USERNAME in a DOS window to see its current value.
If you want the three files HilbertSagbiSg.lib, HilbertSagbiSg.ind and libhb.dll to be installed somewhere else than MAPLEDIR\Users\system\mapleX.Y or MAPLEDIR\Users\USERNAME\system\mapleX.Y then uncomment and edit the definition of MY_MAPLE_ADD_ON_DIR in the file defs.mpl.

5. Call the installation script

Check where the cmaple*.exe binary is installed, for Maple 9 this can be something like:
        C:\Program Files\Maple 9\bin.win\cmaple9.exe
      
Open a DOS window and cd to the directory where you unpacked HilbertSagbiSg-20060313.zip:
      cd C:\path\to\HilbertSagbiSg-20060313      
Now call the main installation script by issuing the command:
         "C:\Program Files\Maple 9\bin.win\cmaple9.exe" -s -q install.mpl
      
Note: if the path contains spaces (as above) then include the quotes " when typing the command above.
The command above will install HilbertSagbiSg just for the Maple version used for the installation, so if you want to be able to use HilbertSagbiSg from more than one Maple version you have to install it once for each version of Maple.

6. Installation complete

You are now ready to use HilbertSagbiSg, see Usage.

Uninstallation instructions

At the end of the execution of install.mpl the program prints what files it has installed. This list of files is also printed to the file install.log.

To uninstall HilbertSagbiSg:

  1. Remove the files listed in install.log except .mapleinit or maple.ini.
  2. From the .mapleinit or maple.ini file, remove everything between the lines:
               # HilbertSagbiSg definitions for Maple X.Y begin.
               # HilbertSagbiSg definitions for Maple X.Y end.
             
    Where X.Y is the integer part and first decimal of the Maple version. If there is nothing outside these lines, then .mapleinit or maple.ini can be removed.

Usage

At the moment no proper Maple help pages are written, so for the moment the only documentation are the examples in the files Examples.mws (or Examples.maple10.mws if you are using Maple 10) and c-src/Test.mws. The brave may also want to check out the source files in the directory mpl-src.

Known issues/Todo


Copyright

The three packages, collectively called HilbertSagbiSg, are Copyright © 2005,2006 by Hans Öfverbeck.

License

HilbertSagbiSg is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. For details, see the file COPYING in the directory HilbertSagbiSg or see The FSF's own site.

Copyright © 2005,2006 Hans Öfverbeck
Last modified: 14 March 2006.