It is currently Sat Nov 18, 2017 2:56 am


All times are UTC - 8 hours [ DST ]




Post new topic Reply to topic  [ 16 posts ]  Go to page 1, 2  Next
Author Message
 Post subject: FYI: Compiling Mumps V1 on Mac OS X 10.6/10.7 using Xcode
PostPosted: Sat Jan 07, 2012 1:11 am 

Joined: Tue Dec 07, 2010 3:45 am
Posts: 26
Real Name: Sam Habiel
Began Programming in MUMPS: 02 Dec 2006
Before starting, get and untar the source code for mumps v1 (see the other post on compiling on the Mac).

When you open Xcode, you will be greeted with the Welcome Screen. Pick the first option to create a new project.
Attachment:
CreateProject.png
CreateProject.png [ 185.7 KiB | Viewed 10701 times ]

In the next dialog, choose a Mac OS X application on the left hand side, then command line tool as a template.
Attachment:
ChooseProjType.png
ChooseProjType.png [ 197.21 KiB | Viewed 10701 times ]

Name the project. This will also the name of the exe (but you can change that later if you wish).
Attachment:
Screen shot 2012-01-06 at 10.44.36 PM.png
Screen shot 2012-01-06 at 10.44.36 PM.png [ 204.83 KiB | Viewed 10701 times ]

Continued in the next post...


Top
Offline Profile  
 
 Post subject: Re: FYI: Compiling Mumps V1 on Mac OS X 10.6/10.7 using Xcod
PostPosted: Sat Jan 07, 2012 1:15 am 

Joined: Tue Dec 07, 2010 3:45 am
Posts: 26
Real Name: Sam Habiel
Began Programming in MUMPS: 02 Dec 2006
Next, delete the source files that are added by default. You should permanently delete them. Multi Select the files, right-click and then delete.
Attachment:
Screen shot 2012-01-06 at 10.47.48 PM.png
Screen shot 2012-01-06 at 10.47.48 PM.png [ 75.39 KiB | Viewed 10700 times ]

Attachment:
Screen shot 2012-01-06 at 10.48.39 PM.png
Screen shot 2012-01-06 at 10.48.39 PM.png [ 46.19 KiB | Viewed 10700 times ]

Now add the Mumps V1 source code. Right click on the mumpsv1 folder.
Attachment:
Screen shot 2012-01-06 at 10.49.40 PM.png
Screen shot 2012-01-06 at 10.49.40 PM.png [ 56.77 KiB | Viewed 10700 times ]


Top
Offline Profile  
 
 Post subject: Re: FYI: Compiling Mumps V1 on Mac OS X 10.6/10.7 using Xcod
PostPosted: Sat Jan 07, 2012 1:56 am 

Joined: Tue Dec 07, 2010 3:45 am
Posts: 26
Real Name: Sam Habiel
Began Programming in MUMPS: 02 Dec 2006
Interlude... don't have time to finish this now; I will finish it when I come back in a couple of weeks.


Top
Offline Profile  
 
 Post subject: Re: FYI: Compiling Mumps V1 on Mac OS X 10.6/10.7 using Xcod
PostPosted: Sun Jan 15, 2012 8:18 am 

Joined: Tue Dec 07, 2010 3:45 am
Posts: 26
Real Name: Sam Habiel
Began Programming in MUMPS: 02 Dec 2006
I am back.

Add the files as below. Make sure to check the destination box to copy the files over.
Attachment:
Screen shot 2012-01-06 at 11.07.11 PM.png
Screen shot 2012-01-06 at 11.07.11 PM.png [ 148.79 KiB | Viewed 10596 times ]

Now, this is what your Xcode window will look like. If not, make sure you click the project name on the top left.
Attachment:
Screen shot 2012-01-06 at 11.15.17 PM.png
Screen shot 2012-01-06 at 11.15.17 PM.png [ 209.79 KiB | Viewed 10596 times ]

Now, in the second column, click on the mumpsv1 project.
Attachment:
Screen shot 2012-01-06 at 11.15.52 PM.png
Screen shot 2012-01-06 at 11.15.52 PM.png [ 57.64 KiB | Viewed 10596 times ]


Top
Offline Profile  
 
 Post subject: Re: FYI: Compiling Mumps V1 on Mac OS X 10.6/10.7 using Xcod
PostPosted: Sun Jan 15, 2012 8:25 am 

Joined: Tue Dec 07, 2010 3:45 am
Posts: 26
Real Name: Sam Habiel
Began Programming in MUMPS: 02 Dec 2006
On the top bar, choose Build Settings.
Attachment:
Screen shot 2012-01-06 at 11.16.29 PM.png
Screen shot 2012-01-06 at 11.16.29 PM.png [ 10.01 KiB | Viewed 10595 times ]

On the subbar, choose All/Combined for the view into Build Settings.
Attachment:
Screen shot 2012-01-06 at 11.16.50 PM.png
Screen shot 2012-01-06 at 11.16.50 PM.png [ 10.55 KiB | Viewed 10595 times ]

Now this is what you are going to see.
Attachment:
CompleteBuildSettings.png
CompleteBuildSettings.png [ 140.69 KiB | Viewed 10595 times ]


Top
Offline Profile  
 
 Post subject: Re: FYI: Compiling Mumps V1 on Mac OS X 10.6/10.7 using Xcod
PostPosted: Sun Jan 15, 2012 8:32 am 

Joined: Tue Dec 07, 2010 3:45 am
Posts: 26
Real Name: Sam Habiel
Began Programming in MUMPS: 02 Dec 2006
Change the Architecture to 32-bit. MV1 doesn't work on 64 bit due to structure alignment issues, among other things. More on that later.
Attachment:
Screen shot 2012-01-06 at 11.17.39 PM.png
Screen shot 2012-01-06 at 11.17.39 PM.png [ 38.8 KiB | Viewed 10596 times ]

Change the compiler to GCC 4.2 rather than LLVM.
Attachment:
Screen shot 2012-01-06 at 11.26.13 PM.png
Screen shot 2012-01-06 at 11.26.13 PM.png [ 41.23 KiB | Viewed 10596 times ]

Use the search box to search for "other c flags"
Attachment:
Screen shot 2012-01-06 at 11.27.12 PM.png
Screen shot 2012-01-06 at 11.27.12 PM.png [ 13.27 KiB | Viewed 10596 times ]


Top
Offline Profile  
 
 Post subject: Re: FYI: Compiling Mumps V1 on Mac OS X 10.6/10.7 using Xcod
PostPosted: Sun Jan 15, 2012 8:38 am 

Joined: Tue Dec 07, 2010 3:45 am
Posts: 26
Real Name: Sam Habiel
Began Programming in MUMPS: 02 Dec 2006
Add the flag -fnested-functions to allow nested functions in xcall.c.
Attachment:
Screen shot 2012-01-06 at 11.27.37 PM.png
Screen shot 2012-01-06 at 11.27.37 PM.png [ 36.7 KiB | Viewed 10596 times ]

Now click on target mumpsv1 and then click on Build Settings.
Attachment:
Screen shot 2012-01-06 at 11.29.09 PM.png
Screen shot 2012-01-06 at 11.29.09 PM.png [ 11.87 KiB | Viewed 10596 times ]

Attachment:
Screen shot 2012-01-06 at 11.29.19 PM.png
Screen shot 2012-01-06 at 11.29.19 PM.png [ 11.57 KiB | Viewed 10596 times ]


Top
Offline Profile  
 
 Post subject: Re: FYI: Compiling Mumps V1 on Mac OS X 10.6/10.7 using Xcod
PostPosted: Sun Jan 15, 2012 8:45 am 

Joined: Tue Dec 07, 2010 3:45 am
Posts: 26
Real Name: Sam Habiel
Began Programming in MUMPS: 02 Dec 2006
Correction: Click on Build Phases.
Attachment:
Screen shot 2012-01-06 at 11.29.39 PM.png
Screen shot 2012-01-06 at 11.29.39 PM.png [ 45.53 KiB | Viewed 10596 times ]

Expand the Link Binary with Libraries section.
Attachment:
Screen shot 2012-01-06 at 11.30.27 PM.png
Screen shot 2012-01-06 at 11.30.27 PM.png [ 21.15 KiB | Viewed 10596 times ]

Add DirectoryService.framework.
Attachment:
Screen shot 2012-01-06 at 11.31.01 PM.png
Screen shot 2012-01-06 at 11.31.01 PM.png [ 39.24 KiB | Viewed 10596 times ]


Top
Offline Profile  
 
 Post subject: Re: FYI: Compiling Mumps V1 on Mac OS X 10.6/10.7 using Xcod
PostPosted: Sun Jan 15, 2012 9:13 am 

Joined: Tue Dec 07, 2010 3:45 am
Posts: 26
Real Name: Sam Habiel
Began Programming in MUMPS: 02 Dec 2006
Now go ahead the compile and run the project by pressing on the Run 'Play' symbol. The warnings are okay to ignore. A bunch has to do with the DirectoryService API being deprecated in OS X 10.6; others have to do with the prototypes not meeting the C99 standard.
Attachment:
Screen shot 2012-01-06 at 11.34.13 PM-edit.png
Screen shot 2012-01-06 at 11.34.13 PM-edit.png [ 189.11 KiB | Viewed 10596 times ]

Now since you need command line flags to run MV1, you need to add them as follows: Click on the Product Menu, then choose Edit Scheme.
Attachment:
Screen shot 2012-01-06 at 11.39.53 PM.png
Screen shot 2012-01-06 at 11.39.53 PM.png [ 56.79 KiB | Viewed 10596 times ]

In the following window, choose Run mumpsv1 on the left hand side column, and then choose arguments. Add the arguments using the plus sign in the section shown below. You can have more than one set and choose which one to run.
Attachment:
Screen shot 2012-01-06 at 11.41.21 PM.png
Screen shot 2012-01-06 at 11.41.21 PM.png [ 98.68 KiB | Viewed 10596 times ]


Top
Offline Profile  
 
 Post subject: Re: FYI: Compiling Mumps V1 on Mac OS X 10.6/10.7 using Xcod
PostPosted: Sun Jan 15, 2012 9:15 am 

Joined: Tue Dec 07, 2010 3:45 am
Posts: 26
Real Name: Sam Habiel
Began Programming in MUMPS: 02 Dec 2006
Here is the final result, where I create a database.
Attachment:
Screen shot 2012-01-06 at 11.42.03 PM.png
Screen shot 2012-01-06 at 11.42.03 PM.png [ 46.25 KiB | Viewed 10596 times ]


And that's the end of this write-up.


Top
Offline Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 16 posts ]  Go to page 1, 2  Next

All times are UTC - 8 hours [ DST ]


Who is online

Users browsing this forum: No registered users and 1 guest


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