Skip to content
Browse files

Adding instructions to compile DREAM.3D on macOS and Windows (#887)

Signed-off-by: Michael Jackson <>
  • Loading branch information...
imikejackson committed Feb 19, 2019
1 parent 2e52ee1 commit efd42b8797f21af3889a96de70ad329cefaf32f2
@@ -1,7 +1,9 @@
Creating A Filter
# Creating A Filter #

<a name="prerequisites">

## Prerequisites ##


These prerequisites will get your system set up with a DREAM.3D SDK and compiling DREAM.3D.
@@ -1,3 +1,71 @@
# Configuring and Building DREAM.3D on Mac OS X #
# macOS Build Instructions #

Follow the instructions to create an SDK here.


Next, download the source code repositories by following the instructions on the [SourceDownload](SourceDownload/index.html) page.

## Setup ##

+ If you are using _Makefiles_ or _Ninja_ as your build system you will need to decide which type of
build you would like: **Debug** or **Release**.
+ You will need to remember where you installed the *DREAM3D_SDK*.

The following example assumes that the DREAM3D_SDK is located in **/Users/[USER-NAME]/DREAM3D_SDK** and you have another directory **/Users/[USER-NAME]/Workspace/** that has the DREAM3D sources:


## Run CMake ##

Invoke CMake with the following command

[user@host] $ cd /Users/[USER-NAME]/Workspace
[user@host] $ mkdir DREAM3D-Builds
[user@host] $ cd DREAM3D-Builds
[user@host] $ mkdir Release
[user@host] $ cd Release
[user@host] $ cmake -G Ninja -DDREAM3D_SDK=/PATH/TO/DREAM3D_SDK -DCMAKE_BUILD_TYPE=Release ../../DREAM3D

This will tell _CMake_ to configure a build (binary) folder (the current folder) and also generate the build files. In this example we are using the **Ninja** build system. Most Linux distributions will need to install this. You can either use your package manager (ninja-build) or download a binary from [GitHub]( An alternate method is to just use the default _Makefiles_ which can be done in the following way:

[user@host] $ cd /Users/[USER-NAME]/Workspace
[user@host] $ mkdir DREAM3D-Builds
[user@host] $ cd DREAM3D-Builds
[user@host] $ mkdir Release
[user@host] $ cd Release
[user@host] $ cmake -DDREAM3D_SDK=/PATH/TO/DREAM3D_SDK -DCMAKE_BUILD_TYPE=Release ../../DREAM3D

Assuming that nothing goes wrong you are now ready to compile DREAM.3D. Using the command prompt again to issue either the _make_ or _ninja_ commands depending on what you using when configuring.

[user@host] $ ninja


[user@host] $ make -j

Once the compilation is complete the DREAM.3D executable will be located in "/Users/[USER-NAME]/Workspace/DREAM3D-Builds/Release/Bin". The user can then just execute the program like usual.

## Packaging ##

If you would like to build a redistributable package then from within the build directory issue the "cpack" command.

[user@host] $ cpack.

When that ends there will be a "DREAM3D_XXXXXXXXX.tar.gz" file in the "/Users/[USER-NAME]/Workspace/DREAM3D-Builds/Release" directory.

@@ -1,3 +1,59 @@
# Configuring and Building DREAM.3D on Windows #

[Windows SDK Instructions](

Next, download the source code repositories by following the instructions on the [SourceDownload](SourceDownload/index.html) page.

## Setup ##

DREAM.3D is built using Visual Studio 2017, either the **Free** community edition or the **Pro** paid version. Both versions will give the exact same results. DREAM.3D is compiled as a **64 Bit** application.

Using _CMake-Gui.exe_ the developer can configure a build directory for DREAM.3D

Launch CMake-Gui.exe and select the DREAM3D source directory as in figure 1:

![Figure 1: Selecting the DREAM3D Source Code Directory](Images/Win_SourceCodePath.png)

Next set the _Binary_ Directory as in figure 2.

![Figure 2: Select the Binary Directory. Note: Do NOT select the same directory.](Images/Win_BuildBinariesDebug.png)

Next add an entry for the location to the DREAM3D_SDK directory (Figure 4) by clicking the "Add Entry" button (Figure 3.)

![Figure 3](Images/Win_AddEntry.png)

![Figure 4: Setting the DREAM3D_SDK CMake variable](Images/Win_CreateCmakeVariable.png)

At this point the CMake-Gui application should look something like the following (Figure 5)

![Figure 5: State of CMake-Gui before configuring the project.](Images/Win_CMakeBeforeConfig.png)

Now click the "Confiugre" button. CMake will ask you which generator to use. Please select the version of Visual Studio that you have installed (VS 15 2017 is the current as of FEB 2019). *Also not that you want the generator that ends with __Win64__*

![Figure 6: Selecting the proper Visual Studio Version.](Images/Win_Generator.png)

After selecting the generator CMake will inspect your system for compilers and then locate all of the
dependent libraries. After that is complete and assuming no CMake errors the state of the CMake-Gui should
look similar to figure 7:

![Figure 7: State of CMake-Gui after configuring](Images/Win_CMakeAfterConfig.png)

Assuming no errors the user can click the **Generate** button to create the Visual Studio Solution files (DREAM3DProj.sln) which the user can open to compile DREAM.3D.

After opening the DREAM.3D Visual Studio solution file, use the drop down menu to select a _Release_ build (see figure 8)

![Figure 8: Visual Studio Release build](Images/Win_VisualStudio.png)

and then proceed to build the entire solution (see figure 9)

![Figure 9: Visual Studio building DREAM.3D](Images/Win_VisualStudioBuild.png)

## Packaging ##

If you want to create a redistributable package for your organization then simply select the _PACKAGE_ target to compile (figure 10)

![Figure 10: Packaging DREAM.3D for redistribution](Images/Win_VisualStudioPackage.png)

At the completion of the PACKAGE phase a ZIPPED archive called will be saved into the Binary directory.

0 comments on commit efd42b8

Please sign in to comment.
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.