Difference between revisions of "Build FieldWorks for Mac"

From LSDevLinux
Jump to: navigation, search
m (Reverted edits by Rossanewalters (Talk) to last revision by Mayhewn)
(update for git fw and new mono repos)
Line 11: Line 11:
 
* Install the latest Mac OS and developer tools
 
* Install the latest Mac OS and developer tools
 
* Install [http://www.macports.org/ MacPorts]
 
* Install [http://www.macports.org/ MacPorts]
* Install the [[Set up Perforce for FieldWorks|Perforce client software]]
 
  
 
For the MacPorts versions of libraries to be used instead of the built-in ones, several environment variables need to be set. This can be done in <code>~/.profile</code> (for use in Terminal) as follows:
 
For the MacPorts versions of libraries to be used instead of the built-in ones, several environment variables need to be set. This can be done in <code>~/.profile</code> (for use in Terminal) as follows:
Line 52: Line 51:
 
* There is a problem with the <code>atlas</code> port, which is a dependency of <code>py26-numpy</code>. It conflicts with <code>libLAPACK.dylib</code> from <code>/System/Library/Frameworks/</code>. If you have installed either of these two ports (<code>py26-numpy</code> and <code>atlas</code>) yourself, they must be uninstalled before building mono.
 
* There is a problem with the <code>atlas</code> port, which is a dependency of <code>py26-numpy</code>. It conflicts with <code>libLAPACK.dylib</code> from <code>/System/Library/Frameworks/</code>. If you have installed either of these two ports (<code>py26-numpy</code> and <code>atlas</code>) yourself, they must be uninstalled before building mono.
  
* The MacPorts version of <code>mono</code> crashes when trying to build <code>mono-basic</code>. However, if the <code>mono</code> subdirectory is already built ''and&#160;installed'', it's possible to build <code>mono-basic</code> with the newly-installed mono compiler. After <code>checkout-and-build-mono</code> has failed, do the following:
+
* The MacPorts version of <code>mono</code> crashes when trying to build <code>mono-basic</code>. However, if the <code>mono</code> subdirectory is already built ''and&#160;installed'', it's possible to build <code>mono-basic</code> with the newly-installed mono compiler. Use the commands at [[Building mono from source#Build_and_install_custom_mono]] to build and install mono before mono-basic.
 
 
for D in {libgdiplus,mono,mono-basic}/fieldworks-*; do
 
  make -C $D && sudo make install -C $D
 
done
 
  
 
==FieldWorks==
 
==FieldWorks==

Revision as of 15:23, 23 October 2012

The port of FieldWorks to Mac is still at an early stage, although we are hopeful that almost all of the work done to port it to Linux will carry over to Mac with very little change.

This page documents the current state of our knowledge about the steps that need to be followed.

Prerequisites

We recommend that needed software packages be installed with MacPorts, whenever possible. This makes it much easier to keep things organized and updated. There is a wide range of ports available, and the versions are usually quite recent.

  • Install the latest Mac OS and developer tools
  • Install MacPorts

For the MacPorts versions of libraries to be used instead of the built-in ones, several environment variables need to be set. This can be done in ~/.profile (for use in Terminal) as follows:

export CPATH=/opt/local/include${CPATH+:}$CPATH
export LIBRARY_PATH=/opt/local/lib${LIBRARY_PATH+:}$LIBRARY_PATH
export DYLD_LIBRARY_PATH=/opt/local/lib${DYLD_LIBRARY_PATH+:}$DYLD_LIBRARY_PATH

It's also possible to set them in ~/.MacOSX/environment.plist, making them applicable to all GUI programs, but this will cause the built-in Mac OS apps to use MacPorts libraries rather than the built-in ones they were developed with, which is not recommended and is likely to cause problems.

Install and build dependencies

Install the following MacPorts packages:

  • autoconf autoconf-archive automake libtool
  • mono nant
  • ImageMagick +wmf +jbig +jpeg2
  • icu
  • gtkmm
  • enchant
  • ossp-uuid
  • pccts
  • quilt

Although some of the packages above (eg autoconf) are already installed on the OS, we typically need the MacPorts ones, which are newer, or are needed by add-ons like autoconf-archive.

There is a Mac-native version of GTK which can be installed by substituting the following lines:

  • sudo port install gtkmm +quartz +atsui +no_x11
  • sudo port install ImageMagick +wmf +jbig +jpeg2 +no_x11

However, the Quartz version is a little less mature and may have a few glitches in it, so we recommend starting out with the X11 version.

Mono

Building and running FieldWorks requires a special version of mono. So you will need to build mono from source.

Currently there are a couple of problems with MacPorts that require workarounds, although hopefully these will be resolved soon:

  • There is a problem with the atlas port, which is a dependency of py26-numpy. It conflicts with libLAPACK.dylib from /System/Library/Frameworks/. If you have installed either of these two ports (py26-numpy and atlas) yourself, they must be uninstalled before building mono.
  • The MacPorts version of mono crashes when trying to build mono-basic. However, if the mono subdirectory is already built and installed, it's possible to build mono-basic with the newly-installed mono compiler. Use the commands at Building mono from source#Build_and_install_custom_mono to build and install mono before mono-basic.

FieldWorks

Currently, building FieldWorks fails on Mac:

[writeregistry] Opening LocalMachine:SOFTWARE\SIL\FieldWorks\7.0\
[writeregistry] Setting RootCodeDir to …/fieldworks/DistFiles

Unhandled Exception: System.InvalidCastException: Cannot cast from source type to destination type.
 at System.Threading.Timer+Scheduler.SchedulerThread () [0x0015e] in
 …/mono-calgary/mono/fieldworks-mono/mcs/class/corlib/System.Threading/Timer.cs:345
 at System.Threading.Thread.StartUnsafe () [0x00016] in
 …/mono-calgary/mono/fieldworks-mono/mcs/class/corlib/System.Threading/Thread.cs:844

However, this error seems to be a crash in nant itself rather than an error in FieldWorks.