Dynamo on Linux, Mac

Håkon Åmdal edited this page Oct 4, 2018 · 17 revisions

Dynamo's core can be built and run on OS X and Linux using the Mono runtime. Not all parts of Dynamo are cross-platform - notably Dynamo's WPF UI can not be run on OS X or Linux. @pboyer is the primary developer contact for cross-platform usage of Dynamo.

Getting started

Installing mono

Mono is required to build and run Dynamo on non-windows platforms. The current version of Mono we're using is Mono JIT compiler version 3.2.8. Newer versions should work as well.

Installing Mono on Ubuntu

# sudo apt-get install mono-complete

Installing Mono on OS X

Install homebrew from brew.sh

# brew install mono mono-libgdiplus

Building Dynamo

On any platform:

# xbuild /p:Configuration=Release src/Dynamo.Mono.sln

This builds Dynamo and delivers the dll's to {RepoRoot}/bin/AnyCPU/{Configuration}/. Omitting the /p:Configuration=Release flag will cause Dynamo to be built in Debug.

Guidelines for cross-platform development

  1. Do not introduce platform-specific code without considering where it will be run. Where possible, make the platform explicit.
  2. Write your tests to minimize external dependencies, namely PresentationCore or WindowsBase
  3. Copying operations should use a Copy task. For example, see src/DynamoCore/DynamoCore.csproj.

Making a simple project referencing DynamoCore

Once you've built Dynamo, make a file called Program.cs and put this inside:

using System;
using Dynamo.Models;

public class Program {
  public static void Main(){
    // create a default instance of Dynamo
    var model = DynamoModel.Start();

    // print the current version of Dynamo
    Console.WriteLine( model.Version );

From the command line:

# mcs -r:DynamoCore.dll Program.cs

With the Dynamo dll's in the same directory as Program.exe, use mono to run the executable:

# mono Program.exe
Clone this wiki locally
You can’t perform that action at this time.
You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.
Press h to open a hovercard with more details.