
Dec 20, 2025

-------------------------------
DO NOT RUN configure / make,
-------------------------------

You need to run provided scripts that will invoke configure and make in order 
to use the correct build parameters.

The main supported version of the interpreter and compiler is the one that uses
the Sqlite3 database. This is the default and the only installer provided
on the web sites. The old native installer, however, is still present.

If you have an old or incompatible version, you may need to remove
it prior to installing the new version with one of the commands:

  sudo dpkg --remove mumps-sqlite3 or
  sudo dpkg --remove mumps-native-single-user

Next acquire an installer. The Sqlite3 version installer can be downloaded
from the web page. Both installers can also be built from source code
(see below).

To install the correct package using:

  sudo dpkg --install mumps-sqlite3-amd64.deb
  sudo dpkg --install mumps-native-single-user-amd64.deb

Then use:  

  sudo apt install -f  

to fix any missing packages. This command installs packages needed by
Mumps which were not found. The graphical installer gdebi does this
automatically. Once done, this command will probably not be needed
again.

If you use the Sqlite3 version, be sure to take note of the database
creation script noted below.

---

If you want to compile and build the system yourself, you need to first 
install any system libraries you may be missing then configure and
compile the code. Do the following:

    sudo get-software.script

This downloads any needed software from Linux repositories.

Next, configure, compile, and build an installer by typing:

    build-mumps.script

Alternatively, if you want to build the legacy native system, type:

    build-mumps.script native
    build-mumps.script memory

All forms of the build script created an installer. See the beginning of this
page for information on how to run the installer.

the first form above creates a version that uses a disk based Sqlite3 database
(named mumps.sqlite by default).

The scond form creates a verion that uses the native b-tree database (in files
named key.dat and data.dat).

The third form creates a version that uses a memory based Sqlite3 database 
(transient - the databas is deleted when the program connecting to it ends).

The native data base is fastest followed by the memort resident Sqlite3 database
followed by the disk based Sqlite3 database.

For comaprison, in a test involving extended database activity, the native database 
version took 4-9 seconds; the memory based Sqlite3 database version took 1364 seconds; 
and the disk based Sqlite3 database version took 11,060 seconds.

The disk based Sqlite3 version is ACID compliant while the others are not.

---

After you have installed the system, you need to create a Sqlite3 database 
if you are using the Sqlite3 version. The database will be automatically
created if you are using the legacy native version.

Create a Sqlite3 database with the command: 

  mumps-sqlite3-amd64.deb

This will create the file mumps.sqlite in the current directory. This is 
the database.

The mumps.sqlite database or a symbolic link to it MUST be present in the
directory from which you run mumps. 

The database may be moved to other directories and you may create symbolic 
links to it.

Multiple instances of mumps may access the same sqlite database (or symbolic
link to same) concurrently.

---------------

Running Mumps

If you arew using the Sqlite3 version, you must create a Sqlite3 database before
running Mumps. To do this, type:

	mumps-sql-db-create

The installer should remove any iold copy of mumps-sql-db-create.script which
you may have. That version is obsolete. You can remove it manually with:

sudo rm /usr/bin/mumps-sql-db-create.script

to a terminal window. The maximum number of indices permitted in a global array
reference is determined by this database setup. By default, this is normall
8. The value is set in the build-mumps.script.

The database will automatically be created in the nativer version.

From a terminal window:

	To run mumps type

		mumps

	This runs the interpreter. You will get a mumps prompt to which
	you may type mumps commands. To exit, hit control-D, control-C or
	type halt.

	To compile a mumps program type

		mumpsc pgm.mps

	This will create an executable named "pgm" which may be invoked in the
	usual manner.

	To compile an MDH program type

		mumpsc mdhpgm.cpp

	This will create an executable named "pgm" which may be invoked in the
	usual manner.

	A file of mumps code can be made executable by including the first line:

		#!/usr/bin/mumps
	
	and making the file executable:

		chmod u+x pgm.mps

	now, if you type the full filename (pgm.mps) to a command prompt, the
	interpreter will be invoked and the file executed.

---------------

SQL Access to the mumps database with sqlite3

Sqlite3 comes with a command line app that permits access to a Sqlite3 database.

A mumps.sqlite database may be opened with Sqlite3 with the command:

    sqlite3 mumps.sqlite

From which you may inspect or retrieve data from the mumps table with standard SQL
commands. These may be used to search, alter, or modify the mumps database.

By default, mumps builds a table called "mumps" with 10 columns named a1 through a10.

By default, the global array names are in column a1. The indices of the
global array are stored in columns a2 through a9 and any data stored
is in column a10. So, in a global array created with:

for i=1:1:10000 set ^a(i)=i

the SQL commands to see and format the data from array elements ^a(9000) 
to ^a(9010) would be:

sqlite> .separator " "
sqlite> select "^",a1,"(",a2,") =",a10 from mumps where
        cast (a2 as integer) >= 9000 and
        cast (a2 as integer) <= 9010;
^ a ( 9000 ) = 9000
^ a ( 9001 ) = 9001
^ a ( 9002 ) = 9002
^ a ( 9003 ) = 9003
^ a ( 9004 ) = 9004
^ a ( 9005 ) = 9005
^ a ( 9006 ) = 9006
^ a ( 9007 ) = 9007
^ a ( 9008 ) = 9008
^ a ( 9009 ) = 9009
^ a ( 9010 ) = 9010
sqlite>

Note: By default, this version of mumps stores numbers as character strings
so conversion by SQL cast or function will be necessary when numeric ranges 
are used. 

In the above, the Sqlite3 command ".separator" changes the default separator from | 
to blank. The quoted fields are for output table decoration.

---

