Difference between revisions of "BuildWindowsCore"

From Immersive Visualization Lab Wiki
Jump to: navigation, search
(Building the CalVR-Core for Windows)
(Building OpenSceneGraph)
 
(42 intermediate revisions by 2 users not shown)
Line 1: Line 1:
==Building the CalVR-Core for Windows==
+
=Building the CalVR-Core under Windows=
  
===Prerequisits===
+
The following third-party libraries are needed for the installation:
  
There are some requirement that has to be fullfilled for successfully builing the CalVR core. The build of CalVR core-software is done in Visual Studio 2012, therefore you need to install [http://www.cmake.org/download/ Cmake] to get the project solution file. After installing Cmake, make sure you have the latest version of [http://www.openscenegraph.org/index.php/download-section/stable-releases OpenSceneGraph] installed. If you already have a version of OSG you can check the version.number by typing the following in a command prompt:
+
* [http://www.cmake.org/download/ Cmake:] versions 2.8.12.2 and 3.1.0-rc2 have been tested. Use the installer, no source build necessary.
<pre>
+
* [http://www.openscenegraph.org/index.php/download-section/stable-releases OpenSceneGraph:] versions 3.2.0 and 3.2.1 have been tested. For maximum flexibility OSG should be built from source, although binary distributions exist. For build instructions see below.
osgversion
+
* The [http://www.msweet.org/projects.php?Z3 Mini-XML] parser for XML files.
</pre>
+
* Visual Studio: version 12.0 (2013) has been tested
  
===OSG - Installation===
+
We recommend the following directory structure for the Windows install:
  
After downloading the OSG source code, extract the files in a folder under your main directory (in general your C:\ drive). Now start the Cmake gui and enter the directory where you create the OSG-folder in the fields '''"Where is the source code"''' and '''"Where to build the binaries"'''. Click on "configure". Now you can costomize your build. Red lines indicate new variables that can be set or modified. Most of them are optional and some are already set. Pay attention to the following variables that they are set correctly:
+
* All CalVR files and third party libraries go into C:\local
 +
* Libraries go to C:\local\lib
 +
* Binaries go to C:\local\bin
 +
* Include files go to C:\local\include
 +
 
 +
A typical install tree will look like this:
  
 
<pre>
 
<pre>
- OSG_ROOT            C:\osg\OpenSceneGraph-3.2.0
+
C:\local\
- OSG_INCLUDE_PATH    C:\osg\OpenSceneGraph-3.2.0\include
+
        bin
- OSG_BIN_PATH        C:\osg\OpenSceneGraph-3.2.0\bin
+
        boost
- OSG_LIB_PATH        C:\osg\OpenSceneGraph-3.2.0\lib
+
        bullet
 +
        calvr
 +
        calvr_plugins
 +
        GLUT
 +
        include
 +
        lib
 +
        mxml
 +
        OpenSceneGraph
 +
        openvrml
 
</pre>
 
</pre>
  
Also check if your dependencies you have are detected and fill out the variables if neccessary. After setting everything to your needs press again "configure" and all red lines should disappear. In case there are still some unknown variables left, correct them or leave it as it is and press "configure" again. Now press "generate".
+
==Building OpenSceneGraph==
If everathing goes right, you should now see a OpenScenegraph.sln file in the folder you entered in "Where to build binaries". Open it in Visual Studio and select your build type (Debug, Release, RelWithDebugInfo, MinSizeRel). Click on '''build''' --> '''build solution'''. This starts the build process which can take several minutes. In general everything should build correct, so that you are able to right click on the "INSTALL" project and select "build". It is possible that the build will fail because
+
it could not create a folder in C:\Program files(x86). If this happens, create the specified directory manually which should solve the error.
+
  
 +
After downloading the OSG source code, extract the files in a folder under your main directory (normally your C:\ drive). Now run the Cmake GUI and enter the directories "Where is the source code" and "Where to build the binaries". Alternatively, you can drag-and-drop the Cmakelists.txt file from OSG's main directory onto the CMake window.
  
===building CalVR Core===
+
Then click the "Configure" button.
  
Building CalVR under Windows needs much attention on environment variables and the right set up of Visual Studio, otherwise you probably get many errors. The first thing is to copy the source files in a folder directly under your c:\ - drive. Similar to the OSG-Build open the Cmake-GUI and enter the directories where to find the code and where to build the binaries. Press Configure and set the variables to your needs. Most important are the OSG-variables, so have alook that they are correct. Also set the following directories if not already set:
+
Specify the generator. We used "Visual Studio 12 2013 Win64" successfully, along with "Use default native compilers".
  
CALVR_HOME
+
Now you can customize your build. Red lines indicate new variables that can be set or modified. Most of them are optional and some are already set.
CALVR_CONFIG_DIR
+
CALVR_CONFIG_FILE
+
  
dies ist text
+
Recommendations:
 +
* For the ability to load JPEG images, for instance as textures, download the [http://gnuwin32.sourceforge.net/packages/jpeg.htm Jpeg for Windows] Setup Program and install it. Then set the respective JPEG variables in OSG's cmake file. One is for the path of the Jpeg include directory, the other needs the path and the file name of the .lib file.
 +
* [http://sourceforge.net/projects/openvrml/ OpenVRML]: need to build from source
 +
** Requires [http://sourceforge.net/projects/boost/ Boost]: available as pre-compiled binary
  
* aufzaehlung 1
+
After setting everything to your needs press Configure again and all red lines should disappear. In case there are still unknown variables, correct them or leave them as they are and press Configure again.
** unterpunkt
+
 
* aufzaehlung 2
+
Now you can generate the solution file by pressing Generate.  If that goes well, you should now see the OpenScenegraph.sln file in the OSG folder you entered in "Where to build binaries".
* aufzaehlung 3
+
 
 +
Double click OpenScenegraph.sln to open Visual Studio. Select your preferred build type - use Debug if you will be developing your own CalVR apps, otherwise Release. Make sure x64 is selected and not 32 bit. If that's wrong change it in Build->Build Configuration.
 +
 
 +
Then you are ready to click on Build -> Build Solution. This starts the build process, which can take over an hour. If everything builds correctly, you are now able to right click on the "INSTALL" project and select "Build" to copy the files to their install location, as specified in the CMake file. After the build is finished you can check your installation by entering the following command in a command prompt:
 +
 
 +
<tt>osgversion</tt>
 +
 
 +
Finally, to simplify future development, we recommend that you set the following environment variables:
  
 
<pre>
 
<pre>
1        aligned text 1
+
- OSG_ROOT            C:\local\OpenSceneGraph
2 nochmal aligned
+
- OSG_INCLUDE_PATH    C:\local\OpenSceneGraph\include
 +
- OSG_BIN_PATH        C:\local\OpenSceneGraph\bin
 +
- OSG_LIB_PATH        C:\local\OpenSceneGraph\lib
 
</pre>
 
</pre>
  
1        aligned text 1
+
==Building CalVR's Core==
2 nochmal aligned
+
  
 +
Check out the CalVR source code from GitHub and put it in the C:\local\calvr directory.
  
ausprobieren: '''fettgedruckt'''
+
Like with OSG, open the CMake GUI and drag and drop the Cmakelists.txt file on it to set the directories for "Where to find source" and "Where to build the binaries". Press 'c' and set the variables as needed. Press 'c' again to apply the changes and then press 'g'. Now open the generated solution file and build it. If the build is successful the "INSTALL" project can be build. After all is said and done there should be an executable called "CalVR.exe".
 +
 
 +
Before you run CalVR, make sure you set the following environment variables:
 +
 
 +
<pre>
 +
- CALVR_HOME          C:\local\calvr
 +
- CALVR_CONFIG_DIR    C:\local\calvr\config
 +
- CALVR_CONFIG_FILE    config.xml
 +
</pre>
  
Dies ist ein Link zu [http://www.google.com einer Webseite].
+
Before starting CalVR, its XML configuration file must be edited. For more detailed information about the config file see: [[CalVR Config File]]
  
====Unterabschnitt====
+
If you get an error about a header file that could not be found, go to Properties in the project menu. There go to "VC++ - Directories" and adjust the path for the Include directory.

Latest revision as of 17:50, 3 February 2015

Building the CalVR-Core under Windows

The following third-party libraries are needed for the installation:

  • Cmake: versions 2.8.12.2 and 3.1.0-rc2 have been tested. Use the installer, no source build necessary.
  • OpenSceneGraph: versions 3.2.0 and 3.2.1 have been tested. For maximum flexibility OSG should be built from source, although binary distributions exist. For build instructions see below.
  • The Mini-XML parser for XML files.
  • Visual Studio: version 12.0 (2013) has been tested

We recommend the following directory structure for the Windows install:

  • All CalVR files and third party libraries go into C:\local
  • Libraries go to C:\local\lib
  • Binaries go to C:\local\bin
  • Include files go to C:\local\include

A typical install tree will look like this:

C:\local\
         bin
         boost
         bullet
         calvr
         calvr_plugins
         GLUT
         include
         lib
         mxml
         OpenSceneGraph
         openvrml

Building OpenSceneGraph

After downloading the OSG source code, extract the files in a folder under your main directory (normally your C:\ drive). Now run the Cmake GUI and enter the directories "Where is the source code" and "Where to build the binaries". Alternatively, you can drag-and-drop the Cmakelists.txt file from OSG's main directory onto the CMake window.

Then click the "Configure" button.

Specify the generator. We used "Visual Studio 12 2013 Win64" successfully, along with "Use default native compilers".

Now you can customize your build. Red lines indicate new variables that can be set or modified. Most of them are optional and some are already set.

Recommendations:

  • For the ability to load JPEG images, for instance as textures, download the Jpeg for Windows Setup Program and install it. Then set the respective JPEG variables in OSG's cmake file. One is for the path of the Jpeg include directory, the other needs the path and the file name of the .lib file.
  • OpenVRML: need to build from source
    • Requires Boost: available as pre-compiled binary

After setting everything to your needs press Configure again and all red lines should disappear. In case there are still unknown variables, correct them or leave them as they are and press Configure again.

Now you can generate the solution file by pressing Generate. If that goes well, you should now see the OpenScenegraph.sln file in the OSG folder you entered in "Where to build binaries".

Double click OpenScenegraph.sln to open Visual Studio. Select your preferred build type - use Debug if you will be developing your own CalVR apps, otherwise Release. Make sure x64 is selected and not 32 bit. If that's wrong change it in Build->Build Configuration.

Then you are ready to click on Build -> Build Solution. This starts the build process, which can take over an hour. If everything builds correctly, you are now able to right click on the "INSTALL" project and select "Build" to copy the files to their install location, as specified in the CMake file. After the build is finished you can check your installation by entering the following command in a command prompt:

osgversion

Finally, to simplify future development, we recommend that you set the following environment variables:

- OSG_ROOT            C:\local\OpenSceneGraph
- OSG_INCLUDE_PATH    C:\local\OpenSceneGraph\include
- OSG_BIN_PATH        C:\local\OpenSceneGraph\bin
- OSG_LIB_PATH        C:\local\OpenSceneGraph\lib

Building CalVR's Core

Check out the CalVR source code from GitHub and put it in the C:\local\calvr directory.

Like with OSG, open the CMake GUI and drag and drop the Cmakelists.txt file on it to set the directories for "Where to find source" and "Where to build the binaries". Press 'c' and set the variables as needed. Press 'c' again to apply the changes and then press 'g'. Now open the generated solution file and build it. If the build is successful the "INSTALL" project can be build. After all is said and done there should be an executable called "CalVR.exe".

Before you run CalVR, make sure you set the following environment variables:

- CALVR_HOME           C:\local\calvr
- CALVR_CONFIG_DIR     C:\local\calvr\config
- CALVR_CONFIG_FILE    config.xml

Before starting CalVR, its XML configuration file must be edited. For more detailed information about the config file see: CalVR Config File

If you get an error about a header file that could not be found, go to Properties in the project menu. There go to "VC++ - Directories" and adjust the path for the Include directory.