It is currently Thu Mar 28, 2024 9:47 am


All times are UTC - 8 hours [ DST ]




Post new topic Reply to topic  [ 3 posts ] 
Author Message
 Post subject: FYI: Compiling Mumps V1 on Mac OS X 10.6/10.7
PostPosted: Thu Dec 15, 2011 11:40 am 

Joined: Tue Dec 07, 2010 3:45 am
Posts: 26
Real Name: Sam Habiel
Began Programming in MUMPS: 02 Dec 2006
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.html

In my next post, I will show how you can compile a debug version under Xcode so that you can debug mumps v1.


Top
Offline Profile  
 
 Post subject: Re: FYI: Compiling Mumps V1 on Mac OS X 10.6/10.7
PostPosted: Sat Dec 17, 2011 2:29 pm 

Joined: Fri Dec 02, 2011 10:24 am
Posts: 6
Real Name: Arthur Ingram
Began Programming in MUMPS: 12 Feb 2011
thanks for the post and info on Mac


Top
Offline Profile  
 
 Post subject: Re: FYI: Compiling Mumps V1 on Mac OS X 10.6/10.7
PostPosted: Fri Dec 30, 2011 2:56 pm 
User avatar

Joined: Mon Nov 01, 2010 3:33 pm
Posts: 104
Location: Australia
Real Name: Ray Newman
Began Programming in MUMPS: 01 Jul 1976
I don't have any problems compiling under OSX 10.6/7; in fact thats where I develop it.
SDK has to be installed properly though.


Ray Newman


Top
Offline Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 3 posts ] 

All times are UTC - 8 hours [ DST ]


Who is online

Users browsing this forum: No registered users and 8 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
Theme created StylerBB.net