This page under construction
Building OpenFrames
NOTE: These instructions were tested under Windows 7
Requirements
- CMake to generate platform specific build system (used 3.5.2 as tested)
- Microsoft Visual Studio to run build and install processes (used VS 2013 Community edition ver 12.0.40629.00 Update 5 as tested)
Note: MVS is freely available, however, one must register with Microsoft and login to the account within MVS to activate the free license
Choice of Git Client such as:
- SourceTree - a GUI git and mercurial client
- Git for Windows - a command line linux style shell and with git support or GUI based (runs over included MINGW)
- OpenSceneGraph: See the [Building OpenSceneGraph in Windows] wiki
- (Optional if you want to build the Winteracter demo) Winteracter Open Motif. Download the latest static library for your architecture (32 or 64-bit) and place it in a convenient location. It is recommended to place it in the Winteracter lib directory (e.g.
lib.ifi64
) next to the existing Winteracter libraries.
Download OpenFrames
- Get the OpenFrames Git repository. See here for the link. When checking out, ensure you have selected the "develop" branch instead of the "Master" branch.
- The root OpenFrames folder will be referred to as [OF_FOLDER] in this page
Setup OpenFrames Build System
In CMake:
- Specify
[OF_FOLDER]
as the Source Code location.
- Specify
[OF_FOLDER]\build
as the Build Binaries location
- Click "Add Entry", and specify the following:
Name
= OSG_DIR
Type
= PATH
Value
= Path to your [OSG_FOLDER]\install
directory
Description
= empty
- (Optional if you want to build the Winteracter example) Click "Add Entry", and specify the following:
Name
= WINTER_ROOT
Type
= PATH
Value
= Path to your Winteracter \wint
directory, e.g. C:\Users\xyz\Documents\wint
Description
= empty
- Press the "Configure" button
- Say "ok" if you are asked to create the 'build' folder
- Verify the default generator choice (Visual Studio 12 2013 in our case) or choose a different one
- Check "Use default native compiler"
- Click "finish"
If you get a CMake error "OpenSceneGraph NOT FOUND", make sure you specified OSG_DIR correctly (Step 3 above).
If you get a CMake warning "Open Motif NOT FOUND", see below to set the path to libXm if you want to build the Winteracter demo.
The configure process sets up build variables that can be modified before generating the actual build system. The variable list can be organized by clicking the "Grouped" button. Set the following variables:
CMAKE_INSTALL_PREFIX
= [OF_FOLDER]\install
- Select
OF_FORTRAN_MODULE
to build the Fortran interface and Winteracter example
- Optional: Use
CMAKE_LIBRARY_PATH
to specify the directory containing Open Motif (libXm) if you are building the Winteracter example. Only needed if you did NOT place libXm next to the installed Winteracter libraries. (see Requirements above)
Finally, create the build system:
- Press the "Configure" button again to enable the variable changes you just made
- Press the "Generate" button to create the build system
- Exit CMake
Build OpenFrames
In Visual Studio:
- File->Open Project and navigate to
[OF_FOLDER]\build
folder. Choose OpenFrames.sln and click "Open".
- The Solution Explorer window will have ALL_BUILD selected
- By default the Debug build solution may be selected. Choose the Release build solution and perform build (Build->Build Solution)
- Once the build is complete perform the installation:
- Within Solution Explorer window, go to CMakePredefinedTargets,
- right-click INSTALL, left-click build
- Confirm that the
ofsplitwindow
executable is in [OF_FOLDER]\install\bin
Test OpenFrames
In System Properties:
- Select the "Advanced" tab on your Windows machine.
- Click on "Environment Variables" button
- Edit
Path
under "User Variables". If Path
doesn't exist, then create it.
- Add
;[OF_FOLDER]\install\bin
at the end of the Path
- Create a new user environment variable named
OSG_FILE_PATH
, and set its value to [OF_FOLDER]\install
. This will allow OpenFrames demos to find their resources (images, models, etc.). If OSG_FILE_PATH
variable already exists, then append the new value to its end using a semicolon (';
')
- Click OK to close the editor dialog
- Click OK to close the Environement Variables dialog
- Open a new terminal (so the above changes take effect), change directory to
[OF_FOLDER]\install\bin
and type ofsplitwindow
. It should bring up a window where the top half has satellites orbiting the Earth, and the bottom half has a 3D time-history plot of one of the satellites.
OpenFrames is now built and installed.
> 7. Confirm that the test1 executable is in [OFFOLDER]\install\bin
I do not have this test1 appearing in my folder. My "ALL_BUILD" for OpenFrames as well as "INSTALL" report sucess for 11 items.
Last edit: Anika Halota 2017-11-09
I updated the demos a while back with more accurate names. test1 -> ofsplitwindow . My mistake for not updating the Wiki, and thanks for pointing it out!
If ALL_BUILD reports all projects compiled successfully, then you are good to go.
This folder doesn't contain anything that would be needed by the demos, just these folders:
bin
Images
Models
osgEarth
Shaders
Stars.
When I try to run ofsplitwindow, I get an error saying it can't find OpenFrames.dll - I found this under [OF_FOLDER]\build\src\Release , so I addded that to the path as well. Once I did that it works.
.
Last edit: Anika Halota 2017-11-09
Thanks for pointing that out Anika. The Path should contain
[OF_FOLDER]\install\bin
, which should contain OpenFrames.dll as well as the demos. You should in general not add parts of the build tree to Path, since that is intended to be a transient folder containing temporary build files.I updated the Test OpenFrames section accordingly, and added mention of the
OSG_FILE_PATH
environment variable that tells OSG & OpenFrames where to find resource files (images, models, star catalog, etc.)This is the contents of my [OF_FOLDER]\install\bin:
It does not contain OpenFrames.dll
Last edit: Anika Halota 2017-11-09
Since we added [OF_FOLDER]\install\bin to the path, it is not necessary to change directories. 'ofsplitwindow' should work in any directory.