Compiling the DREAM3D_SDK on OS X (10.8, 10.9, 10.10)

In order to compile DREAM.3D the developer will need to install all the dependent libraries that are needed by DREAM.3D. In order to help streamline this process the DREAM.3D development team has created some shell scripts and source archives that enable the developer to quickly generate what we call the DREAM3D_SDK or DREAM.3D Software Development Kit. The developer should be comfortable executing commands from a terminal in order to successfully get everything compiled and installed.

Download the source archives from the DREAM3D website: DREAM3D_SDK_63_OSX.tar.gz. (432 MB) Place this downloaded file into /Users/Shared

Download Qt version 5.5.1 from the download.qt.io website qt-opensource-mac-x64-clang-5.5.1.dmg. It is large at over 679 MB so give this some time. After the download has completed mount the .dmg by double clicking the file. After it mounts, double click the .app file that is within the .dmg file. This will start the Qt 5.5.1 installer. Be sure to set the Installation Folder to the same path that is in the image below. (/Users/Shared/DREAM3D_SDK/Qt5.5.1.) This is critically important to place the installation in this location as the rest of the scripts depend on the installation in this location. The developer can select all the other default selections.

After the installation of Qt-5.5.1, the DREAM3D_SDK folder should look like the following:

Next we will need to clone the DREAM3D repository at http://github.com/dream3d and execute a script through the terminal application located at /Applications/Utilities/Terminal.app. The next set of terminal commands will create a "Workspace" directory that we will use to compile DREAM3D.

    [user] $ cd ~
    [user] $ mkdir Workspace && cd Workspace
    [user] $ git clone -b develop git://github.com/dream3d/DREAM3D.git
    [user] $ cd DREAM3D/Support/Scripts/OSX_Build_Scripts/
    [user] $ sudo ./Build_SDK.sh
    

The last command will proceed to compile and install all the libraries into the DREAM3D_SDK folder. In the next section we will actually compile DREAM.3D itself.

​We are going to use CMake to configure a build system (either Xcode or Makefiles) that will be used to run the compilation of DREAM.3D. Open the CMake.app inside of /Users/Shared/DREAM3D_SDK/cmake-3.4.1-Darwin-x86_64 and set the Source Code and Binary directories to look like the following image (substitute your own username for mjackson):

Next, click on the "Add Entry" button to add the DREAM3D_SDK directory as a CMake variable. Note the image below as the example.

Click the "OK" button to proceed back to the main CMake app window. Next click the "Configure" button, select the type of project files you want to generate, and click "Done". This will then start configuring the build system by testing various compilation options. When CMake finishes, click "Configure" until no more red highlighted rows appears in the CMake Gui.

Once no more red rows appear, then click the "Generate" button. When complete a valid XCode project (DREAM3DProj.xcodeproject) or basic "makefiles" will be generated for you. You can Quit from CMake now. If you generated Makefiles then you will need to open up a Terminal window, navigate to the dream3d-build directory and issue the "make" command.

[user] $ cd ~/Workspace/DREAM3D-build
[user] $ make -j

If you generated an Xcode project, open the project file and proceed to build DREAM3D.

Alternate Terminal Commands to Avoid the CMake.app GUI

Once the SDK is finished compiling, the developer can stay in a terminal window and issue the following commands:

[user] $ export PATH=/Users/Shared/DREAM3D_SDK/cmake-3.3.1-Darwin-x86_64/CMake.app/Contents/bin:$PATH
[user] $ cd ~/Workspace
[user] $ mkdir dream3d-build && cd dream3d-build
[user] $cmake -DDREAM3D_SDK=/Users/Shared/DREAM3D_SDK -DCMAKE_BUILD_TYPE=Release ../DREAM3D
[user] $ make -j8
[user] $ open Bin/DREAM3D.app