Difference between revisions of "OSGInstallKC"

From Immersive Visualization Lab Wiki
Jump to: navigation, search
(New page: Here's the procedure Kevin used to get everything compiled with Visual Studio 2010 (v10): # First compile Coin3D and SoWin. I downloaded https://bitbucket.org/Coin3D/coin/downloads/Coin-...)
 
(Kevin's Installation Instructions with VRML Support)
 
(9 intermediate revisions by one user not shown)
Line 1: Line 1:
Here's the procedure Kevin used to get everything compiled with Visual Studio 2010 (v10):
+
=Kevin's Installation Instructions with VRML Support=
  
# First compile Coin3D and SoWin.  I downloaded https://bitbucket.org/Coin3D/coin/downloads/Coin-3.1.3.zip and https://bitbucket.org/Coin3D/coin/downloads/SoWin-1.5.0.zip.
+
If you want to compile your own version of OpenSceneGraph, here are the steps I used:
 +
 
 +
# First compile Coin3D and SoWin.  I downloaded [https://bitbucket.org/Coin3D/coin/downloads/Coin-3.1.3.zip https://bitbucket.org/Coin3D/coin/downloads/Coin-3.1.3.zip] and [https://bitbucket.org/Coin3D/coin/downloads/SoWin-1.5.0.zip https://bitbucket.org/Coin3D/coin/downloads/SoWin-1.5.0.zip].
 
## Download Coin3D & SoWin, extract files.
 
## Download Coin3D & SoWin, extract files.
## Follow the guide at http://te.ugm.ac.id/~wibirama/tutorial/coin3d/Tutorial_Coin3D_VS2010.pdf and do steps 1-5.  Steps 2 & 3 are important - otherwise, you will not be able to compile SoWin without error.  Step 4 corrects a compile error with VS2010.  I didn't find step 6 necessary.
+
## Follow the guide at [http://te.ugm.ac.id/~wibirama/tutorial/coin3d/Tutorial_Coin3D_VS2010.pdf http://te.ugm.ac.id/~wibirama/tutorial/coin3d/Tutorial_Coin3D_VS2010.pdf] and do steps 1-5.  Steps 2 & 3 are important - otherwise, you will not be able to compile SoWin without error.  Step 4 corrects a compile error with VS2010.  I didn't find step 6 necessary.
 
## Compile SoWin in the same way you did Coin3D.  The build will have an error...
 
## Compile SoWin in the same way you did Coin3D.  The build will have an error...
## Fix the compile error by moving the file SoWin-1.5.0/build/msvc9/src/Inventor/Win/SoWinColorEditor.h to SoWin-1.5.0/build/msvc9/src/Inventor/Win/editors/SoWinColorEditor.h (move it into the editors directory).  This error appears to happen because the build misplaces this file.
+
## Fix the compile error by moving the file SoWin-1.5.0/build/msvc9/src/Inventor/Win/SoWinColorEditor.h to SoWin-1.5.0/build/msvc9/src/Inventor/Win/editors/SoWinColorEditor.h (move it into the editors directory).  This error appears to happen because the build script misplaces the file.
 
## Build SoWin again; it should compile without errors.
 
## Build SoWin again; it should compile without errors.
 
# Now we are ready to compile OpenSceneGraph.  For this portion you can pretty much follow http://www.openscenegraph.org/projects/osg/wiki/Support/PlatformSpecifics/VisualStudio#Initialsetup but I will summarize the steps and include additional instructions that I found were needed.
 
# Now we are ready to compile OpenSceneGraph.  For this portion you can pretty much follow http://www.openscenegraph.org/projects/osg/wiki/Support/PlatformSpecifics/VisualStudio#Initialsetup but I will summarize the steps and include additional instructions that I found were needed.
## Install CMake - http://www.cmake.org/HTML/Download.html.  I'm using 2.8.10.2.
+
## Install CMake - [http://www.cmake.org/HTML/Download.html http://www.cmake.org/HTML/Download.html].  I'm using 2.8.10.2.
## Download necessary files.  For the OpenSceneGraph source code I usedhttp://www.openscenegraph.org/downloads/stable_releases/OpenSceneGraph-3.0.1/source/OpenSceneGraph-3.0.1.zip.  You will also need the third party dependencies, which I got from AlphaPixel at http://openscenegraph.alphapixel.com/osg/downloads/openscenegraph-third-party-library-downloads.  Download the version matching the type of build you're making (by default, it's 32 bit debug).
+
## Download necessary files.  For the OpenSceneGraph source code I used [http://www.openscenegraph.org/downloads/stable_releases/OpenSceneGraph-3.0.1/source/OpenSceneGraph-3.0.1.zip http://www.openscenegraph.org/downloads/stable_releases/OpenSceneGraph-3.0.1/source/OpenSceneGraph-3.0.1.zip].  You will also need the third party dependencies, which I got from AlphaPixel at [http://openscenegraph.alphapixel.com/osg/downloads/openscenegraph-third-party-library-downloads http://openscenegraph.alphapixel.com/osg/downloads/openscenegraph-third-party-library-downloads].  Download the version matching the type of build you're making (by default, it's 32 bit debug).  
 
## Extract the OpenSceneGraph code.  Extract the contents of the third party depedencies 7z you downloaded to a new directory named 3rdparty in the same location as the OpenSceneGraph-3.0.1 directory.
 
## Extract the OpenSceneGraph code.  Extract the contents of the third party depedencies 7z you downloaded to a new directory named 3rdparty in the same location as the OpenSceneGraph-3.0.1 directory.
 
## Close any instances of Visual Studio you have open - otherwise, CMake will complain.
 
## Close any instances of Visual Studio you have open - otherwise, CMake will complain.
 
## Open cmake-gui and enter the path to OpenSceneGraph-3.0.1 for both "Where is the source code" and "Where to build the binaries."
 
## Open cmake-gui and enter the path to OpenSceneGraph-3.0.1 for both "Where is the source code" and "Where to build the binaries."
 
## Click the Configure button and use Visual Studio 10 as the generator and default native compilers.
 
## Click the Configure button and use Visual Studio 10 as the generator and default native compilers.
## CMake will run configuration.  Assuming that Coin3D was compiled and installed into COINDIR correctly, the Inventor plugin will be configured and enabled automatically.  After it's done, all of the values will be red.  Click Configure again to update the red values.  Click Generate and the solution files will be created.
+
## CMake will run configuration.  Assuming that Coin3D was compiled and installed into COINDIR correctly, the Inventor plugin will be configured and enabled automatically.  After it's done, all of the values will be red.  Click Configure again to update the red values.
## You may have noticed that CMake couldn't find the TIFF or PNG libraries, despite being included in the 3rdparty directoryThe version of OpenSceneGraph we're about to compile probably won't have support for TIFF or PNG images (JPEG seems to work fine).
+
## Some values may not have been set correctlyHere is a list of values to check and correct (check the Advanced box to see them all):
 +
### Set JPEG_LIBRARY to match JPEG_LIBRARY_DEBUG
 +
### Set ZLIB_LIBRARY to match ZLIB_LIBRARY_DEBUG
 +
### Set TIFF_LIBRARY and TIFF_LIBRARY_DEBUG to the full path to 3rdParty/lib/libtiffD.lib or 3rdParty/lib/libtiff.lib
 +
### Set PNG_LIBRARY to match PNG_LIBRARY_DEBUG
 +
### Set PNG_PNG_INCLUDE_DIR to match PNG_INCLUDE_DIR
 +
## Click Generate and the solution files will be created.
 
## Open the solution and build.  This will take a while.  There shouldn't be any errors.
 
## Open the solution and build.  This will take a while.  There shouldn't be any errors.
 
## Build the INSTALL project.  This will place the compiled binaries and other files into C:\Program Files (x86)\OpenSceneGraph.  You should be able to change this location via the CMAKE_INSTALL_PREFIX value.
 
## Build the INSTALL project.  This will place the compiled binaries and other files into C:\Program Files (x86)\OpenSceneGraph.  You should be able to change this location via the CMAKE_INSTALL_PREFIX value.
# Now we have a compiled version of OpenSceneGraph with the Inventor (iv) plugin.  One last step is to copy the Coin3D binaries into the same location as the OpenSceneGraph binaries - otherwise there will be errors at run time.  Copy all the directories in your COINDIR to C:\Program Files (x86)\OpenSceneGraph (or whatever your CMAKE_INSTALL_PREFIX is).
+
# Now we have a compiled version of OpenSceneGraph with the Inventor (iv) plugin.  The last step is to copy the Coin3D and 3rdParty binaries into the same location as the OpenSceneGraph binaries - otherwise there will be errors at run time.  Copy all the directories in your COINDIR to C:\Program Files (x86)\OpenSceneGraph (or whatever your CMAKE_INSTALL_PREFIX is).  Copy all the files in 3rdParty\bin to C:\Program Files (x86)\OpenSceneGraph\bin.
# You can test VRML support using the osgviewer.exe or osgviewerd.exe (debug).  Run the program on the command line with a path to a wrl file and it should be displayed.  Loading the wrl and starting the viewer takes a few seconds for me, but that may be because I compiled in debug mode.
+
# You can test VRML support using osgviewer.exe or osgviewerd.exe (debug).  Run the program on the command line with a path to a wrl file and it should be displayed.

Latest revision as of 19:53, 13 January 2015

Kevin's Installation Instructions with VRML Support

If you want to compile your own version of OpenSceneGraph, here are the steps I used:

  1. First compile Coin3D and SoWin. I downloaded https://bitbucket.org/Coin3D/coin/downloads/Coin-3.1.3.zip and https://bitbucket.org/Coin3D/coin/downloads/SoWin-1.5.0.zip.
    1. Download Coin3D & SoWin, extract files.
    2. Follow the guide at http://te.ugm.ac.id/~wibirama/tutorial/coin3d/Tutorial_Coin3D_VS2010.pdf and do steps 1-5. Steps 2 & 3 are important - otherwise, you will not be able to compile SoWin without error. Step 4 corrects a compile error with VS2010. I didn't find step 6 necessary.
    3. Compile SoWin in the same way you did Coin3D. The build will have an error...
    4. Fix the compile error by moving the file SoWin-1.5.0/build/msvc9/src/Inventor/Win/SoWinColorEditor.h to SoWin-1.5.0/build/msvc9/src/Inventor/Win/editors/SoWinColorEditor.h (move it into the editors directory). This error appears to happen because the build script misplaces the file.
    5. Build SoWin again; it should compile without errors.
  2. Now we are ready to compile OpenSceneGraph. For this portion you can pretty much follow http://www.openscenegraph.org/projects/osg/wiki/Support/PlatformSpecifics/VisualStudio#Initialsetup but I will summarize the steps and include additional instructions that I found were needed.
    1. Install CMake - http://www.cmake.org/HTML/Download.html. I'm using 2.8.10.2.
    2. Download necessary files. For the OpenSceneGraph source code I used http://www.openscenegraph.org/downloads/stable_releases/OpenSceneGraph-3.0.1/source/OpenSceneGraph-3.0.1.zip. You will also need the third party dependencies, which I got from AlphaPixel at http://openscenegraph.alphapixel.com/osg/downloads/openscenegraph-third-party-library-downloads. Download the version matching the type of build you're making (by default, it's 32 bit debug).
    3. Extract the OpenSceneGraph code. Extract the contents of the third party depedencies 7z you downloaded to a new directory named 3rdparty in the same location as the OpenSceneGraph-3.0.1 directory.
    4. Close any instances of Visual Studio you have open - otherwise, CMake will complain.
    5. Open cmake-gui and enter the path to OpenSceneGraph-3.0.1 for both "Where is the source code" and "Where to build the binaries."
    6. Click the Configure button and use Visual Studio 10 as the generator and default native compilers.
    7. CMake will run configuration. Assuming that Coin3D was compiled and installed into COINDIR correctly, the Inventor plugin will be configured and enabled automatically. After it's done, all of the values will be red. Click Configure again to update the red values.
    8. Some values may not have been set correctly. Here is a list of values to check and correct (check the Advanced box to see them all):
      1. Set JPEG_LIBRARY to match JPEG_LIBRARY_DEBUG
      2. Set ZLIB_LIBRARY to match ZLIB_LIBRARY_DEBUG
      3. Set TIFF_LIBRARY and TIFF_LIBRARY_DEBUG to the full path to 3rdParty/lib/libtiffD.lib or 3rdParty/lib/libtiff.lib
      4. Set PNG_LIBRARY to match PNG_LIBRARY_DEBUG
      5. Set PNG_PNG_INCLUDE_DIR to match PNG_INCLUDE_DIR
    9. Click Generate and the solution files will be created.
    10. Open the solution and build. This will take a while. There shouldn't be any errors.
    11. Build the INSTALL project. This will place the compiled binaries and other files into C:\Program Files (x86)\OpenSceneGraph. You should be able to change this location via the CMAKE_INSTALL_PREFIX value.
  3. Now we have a compiled version of OpenSceneGraph with the Inventor (iv) plugin. The last step is to copy the Coin3D and 3rdParty binaries into the same location as the OpenSceneGraph binaries - otherwise there will be errors at run time. Copy all the directories in your COINDIR to C:\Program Files (x86)\OpenSceneGraph (or whatever your CMAKE_INSTALL_PREFIX is). Copy all the files in 3rdParty\bin to C:\Program Files (x86)\OpenSceneGraph\bin.
  4. You can test VRML support using osgviewer.exe or osgviewerd.exe (debug). Run the program on the command line with a path to a wrl file and it should be displayed.