Skip to content

Build Instructions

Nick Sharp edited this page Sep 27, 2017 · 1 revision

Getting the code

We will be distributing Scotty3D with git. You can find the repository for this assignment at https://github.com/cmu462/Scotty3D. If you are unfamiliar with git, here is what you need to do to get the starter code:

$ git clone https://github.com/cmu462/Scotty3D.git

This will create a folder with all the source files.

Building the project

In order to ease the process of running on different platforms, we will be using CMake for Scotty3D. You will need a CMake installation of version 2.8+ to build the code. It should also be relatively easy to build the project and work locally on your OSX or 64-bit version of Linux. Building locally on Windows is in beta support (explained below), or the project can alternately be run by SSH'ing to a Linux system using MobaXterm.

OS X/Linux Build Instructions

If you are working on OS X and do not have CMake installed, we recommend installing it through Homebrew: $ brew install cmake. You (may) also need the freetype package $ brew install freetype.

If you are working on Linux, you should be able to install dependencies with your system's package manager as needed (you may need cmake and freetype, and possibly others).

To build your code for this assignment:

$ cd Scotty3D && mkdir build && cd build
$ cmake ..
$ make

These steps (1) create an out-of-source build directory, (2) configure the project using CMake, and (3) compile the project. If all goes well, you should see an executable scotty3D in the build directory. As you work, simply typing make in the build directory will recompile the project.

To test run the software, try ./scotty3d ../media/meshedit/cube.dae.

Windows Build Instructions

We have a beta build support for Windows systems. You need to install the latest version of CMake and install Visual Studio 2015. CMU users may access this software from the CMU Dreamspark web store. After installing these programs, you can run runcmake_win.bat by double-clicking on it. This should create a build directory with a Visual Studio solution file in it named scotty3D.sln. You can double-click this file to open the solution in Visual Studio.

If you plan on using Visual Studio to debug your program, you can set the scotty3D project in the Solution Explorer as the startup project by right-clicking on it and selecting Set as StartUp Project. You can also set the commandline arguments to the project by right-clicking scotty3D project again, selecting Properties, going into the Debugging tab, and setting the value in Command Arguments. If you want to run the program with the basic input, you can set this command argument to ../../media/meshedit/cube.dae, or any of the other included sample inputs. After setting all these, you can hit F5 to build your program and run it with the debugger.

If you feel that your program is running slowly, you can also change the build mode to Release from Debug by clicking the Solution Configurations drop down menu on the top menu bar. Note that you will have to set Command Arguments again if you change the build mode.

Clone this wiki locally