Google Groups

Mono for Native Client now available through the SDK


Elijah Taylor May 4, 2012 1:30 PM
Posted in group: Native-Client-Discuss
Hi everyone,

Versions of Mono for Native Client are now available for download in the SDK.  These are compiled with glibc and the libmono comes as a dynamic library.  Only pepper_19 and above has Mono available.

Note that you must keep your pepper_X and naclmono_X bundles in sync (ie, don't update one without updating the other) or you will probably be unable to run the resulting built nexes.  New versions of Mono that match a given SDK should be available within hours of a new SDK build being available.

Only embedded Mono is supported in Native Client currently (http://www.mono-project.com/Embedding_Mono).

Instructions for trying it out:
1) Update your latest sdk_tools:
$ ./naclsdk update sdk_tools

You can check to make sure you have the right version if you run ./naclsdk list and see this:
Currently installed bundles:
  sdk_tools
    description: Native Client SDK Tools, revision 134553
    stability: stable
    recommended: yes
    version: 1
    revision: 134553

2) Add the NaCl Mono manifest to your SDK:

You can see new bundles available through naclsdk list:
  naclmono_19
    sdk_revision: 129248
    description: Mono for Native Client
    stability: dev
    recommended: no
    version: experimental
    revision: 2
  naclmono_20
    sdk_revision: 134804
    description: Mono for Native Client
    stability: dev
    recommended: no
    version: experimental
    revision: 2

3) Install the packages: (substitute 20 for 19 for the rest of these instructions if you want to use pepper_20)
$ ./naclsdk install pepper_19 naclmono_19 naclmono_samples

You should now have a naclmono_19 directory which contains headers, libraries, and binaries for NaCl Mono, and a naclmono_samples directory with example code and Makefiles.

4) Compile the samples:
--- Linux/Mac ---
$ cd naclmono_samples
$ NACL_MONO_ROOT=/path/to/naclmono_19 NACL_SDK_ROOT=/path/to/pepper_19 make

--- Windows ---
> cd naclmono_samples
> set NACL_MONO_ROOT=C:\path\to\naclmono_19
> set NACL_SDK_ROOT=C:\path\to\pepper_19
> make

There are a couple of warnings you can safely ignore that are normal for the sample build process:
DEBUG MODE ENABLED (bypass acl)
[6159,1026903520:12:57:46.229339] BYPASSING ALL ACL CHECKS

libgcc_s.so: warning: warning: pthread_cancel is not implemented and will always fail


5) Try the samples:
$ python -m SimpleHTTPServer <port>
Load your NaCl enabled browser to localhost:<port> and browse to the html pages in the subfolders for each sample.


Try it out, and have some fun!  Feedback is welcome.

-Elijah