Mumpster
http://mumpster.org/

FYI: Compiling Mumps V1 on Mac OS X 10.6/10.7 using Xcode
http://mumpster.org/viewtopic.php?f=22&t=1679
Page 1 of 2

Author:  shabiel [ Sat Jan 07, 2012 1:11 am ]
Post subject:  FYI: Compiling Mumps V1 on Mac OS X 10.6/10.7 using Xcode

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 17289 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 17289 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 17289 times ]

Continued in the next post...

Author:  shabiel [ Sat Jan 07, 2012 1:15 am ]
Post subject:  Re: FYI: Compiling Mumps V1 on Mac OS X 10.6/10.7 using Xcod

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 17288 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 17288 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 17288 times ]

Author:  shabiel [ Sat Jan 07, 2012 1:56 am ]
Post subject:  Re: FYI: Compiling Mumps V1 on Mac OS X 10.6/10.7 using Xcod

Interlude... don't have time to finish this now; I will finish it when I come back in a couple of weeks.

Author:  shabiel [ Sun Jan 15, 2012 8:18 am ]
Post subject:  Re: FYI: Compiling Mumps V1 on Mac OS X 10.6/10.7 using Xcod

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 17184 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 17184 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 17184 times ]

Author:  shabiel [ Sun Jan 15, 2012 8:25 am ]
Post subject:  Re: FYI: Compiling Mumps V1 on Mac OS X 10.6/10.7 using Xcod

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 17183 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 17183 times ]

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

Author:  shabiel [ Sun Jan 15, 2012 8:32 am ]
Post subject:  Re: FYI: Compiling Mumps V1 on Mac OS X 10.6/10.7 using Xcod

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 17184 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 17184 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 17184 times ]

Author:  shabiel [ Sun Jan 15, 2012 8:38 am ]
Post subject:  Re: FYI: Compiling Mumps V1 on Mac OS X 10.6/10.7 using Xcod

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 17184 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 17184 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 17184 times ]

Author:  shabiel [ Sun Jan 15, 2012 8:45 am ]
Post subject:  Re: FYI: Compiling Mumps V1 on Mac OS X 10.6/10.7 using Xcod

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 17184 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 17184 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 17184 times ]

Author:  shabiel [ Sun Jan 15, 2012 9:13 am ]
Post subject:  Re: FYI: Compiling Mumps V1 on Mac OS X 10.6/10.7 using Xcod

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 17184 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 17184 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 17184 times ]

Author:  shabiel [ Sun Jan 15, 2012 9:15 am ]
Post subject:  Re: FYI: Compiling Mumps V1 on Mac OS X 10.6/10.7 using Xcod

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 17184 times ]


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

Page 1 of 2 All times are UTC - 8 hours [ DST ]
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
http://www.phpbb.com/