First, download mumps v1 source code:
Code:
curl -L -O http://downloads.sourceforge.net/mumps/mumps-1.53-src.tar.gz
Untar it:
Code:
tar -xzvf mumps-1.53-src.tar.gz
Navigate to the directory
Code:
cd mumps
Now make the project. If it fails (which it will) do a make clean. The Makefiles assume that OSTYPE is darwin, but each different version of Macs gives you a different one. We set it manually on the make command:
Code:
make OSTYPE=darwin
Once you compile it, you will get the following causing a failure:
Code:
init/mumps.c:36:66: error: stdio.h: No such file or directory
init/mumps.c:37:61: error: stdlib.h: No such file or directory
init/mumps.c:38:66: error: sys/types.h: No such file or directory
init/mumps.c:39:20: error: string.h: No such file or directory
init/mumps.c:40:19: error: ctype.h: No such file or directory
init/mumps.c:41:37: error: unistd.h: No such file or directory
init/mumps.c:42:62: error: errno.h: No such file or directory
This is because the Makefile is looking for these files in the wrong place.
You can investigate where these are by running the mdfind command (a better version of Linux's locate)
Code:
$ mdfind -name stdio.h
/usr/include/fcgi_stdio.h
/usr/include/c++/4.2.1/tr1/stdio.h
/usr/include/secure/_stdio.h
/usr/include/stdio.h
/usr/include/xlocale/_stdio.h
/opt/local/include/wine/msvcrt/stdio.h
/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator3.2.sdk/usr/include/stdio.h
/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator4.0.sdk/usr/include/stdio.h
/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator4.1.sdk/usr/include/c++/4.2.1/tr1/stdio.h
/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator4.1.sdk/usr/include/stdio.h
/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator4.1.sdk/usr/include/xlocale/_stdio.h
/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator4.1.sdk/usr/include/secure/_stdio.h
/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator4.1.sdk/usr/include/fcgi_stdio.h
/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator4.2.sdk/usr/include/stdio.h
/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator4.2.sdk/usr/include/c++/4.2.1/tr1/stdio.h
/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator4.2.sdk/usr/include/xlocale/_stdio.h
/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator4.2.sdk/usr/include/secure/_stdio.h
/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator4.2.sdk/usr/include/fcgi_stdio.h
/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator4.3.sdk/usr/include/xlocale/_stdio.h
/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator4.3.sdk/usr/include/secure/_stdio.h
/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator4.3.sdk/usr/include/stdio.h
/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator4.3.sdk/usr/include/c++/4.2.1/tr1/stdio.h
/Developer/SDKs/MacOSX10.6.sdk/usr/include/c++/4.2.1/tr1/stdio.h
/Developer/SDKs/MacOSX10.6.sdk/usr/include/fcgi_stdio.h
/Developer/SDKs/MacOSX10.6.sdk/usr/include/secure/_stdio.h
/Developer/SDKs/MacOSX10.6.sdk/usr/include/stdio.h
/Developer/SDKs/MacOSX10.6.sdk/usr/include/xlocale/_stdio.h
/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS4.3.sdk/usr/include/c++/4.2.1/tr1/stdio.h
/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS4.3.sdk/usr/include/stdio.h
/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS4.3.sdk/usr/include/xlocale/_stdio.h
/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS4.3.sdk/usr/include/secure/_stdio.h
/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator3.2.sdk/usr/include/fcgi_stdio.h
/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator3.2.sdk/usr/include/xlocale/_stdio.h
/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator3.2.sdk/usr/include/secure/_stdio.h
/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator4.0.sdk/usr/include/c++/4.2.1/tr1/stdio.h
/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator4.0.sdk/usr/include/fcgi_stdio.h
/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator4.0.sdk/usr/include/xlocale/_stdio.h
/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator4.0.sdk/usr/include/secure/_stdio.h
To fix this, locate this line in the root Makefile:
Code:
ifeq ($(OSTYPE),darwin)
CFLAGS = ${INCLUDES} -L/usr/lib/ -Wall -lm -framework CoreServices -framework DirectoryService -framework Security -mmacosx-version-min=10.5 -isysroot /Developer/SDKs/MacOSX10.5.sdk -arch i386
endif
change this to the version of the SDK you have (corresponding to your OS)
Code:
ifeq ($(OSTYPE),darwin)
CFLAGS = ${INCLUDES} -L/usr/lib/ -Wall -lm -framework CoreServices -framework DirectoryService -framework Security -mmacosx-version-min=10.5 -isysroot /Developer/SDKs/MacOSX10.6.sdk -arch i386
endif
make clean, and make again. Now you should have a mumps executable.
Make sure it works:
Code:
./mumps
----------------------------------------------------
This is MUMPS V1.53 for Darwin i386
Copyright (c) 1999 - 2010
Raymond Douglas Newman. All rights reserved.
To create a database:
> mumps -v volnam -b blocksize -s dbsize database
and optionally -m mapblocksize
volnam is 1 to 8 alphas and sizes are in kbytes
To initialize an environment:
> mumps -j maxjobs -r routinemb -g globalmb database
routinemb and globalmg are optional
To attach to an environment:
> mumps -x command -e environment(uci) database
where both switches are optional
see http://www.mumps.org/
----------------------------------------------------
Create the database:
Code:
./mumps -v VISTA -b 4 -s 100 vistadb.db
Start the daemon process:
Code:
./mumps -j 2 vistadb.db
Attach to the environment:
Code:
./mumps vistadb.db
M> s ^SAM=1
M> w ^SAM
1
In my experience, mumps v1 requires a rather inordinate amount of shared memory compared with GT.M. You will need to adjust your shared memory values depending on how you set-up your daemon processes. This link turns out to be useful:
http://www.spy-hill.com/help/apple/SharedMemory.htmlIn my next post, I will show how you can compile a debug version under Xcode so that you can debug mumps v1.