In this appendix you will find a extended compilation guide. The appendix describe the different ways to get your project working using osgVP libraries. Compilation Requirements ------------------------ Once you have dowloaded the libraries of (https://gvsig.org/web/projects/gvsig-commons/osgvp) there are several tools that you must have installed in your system. They are: 1. Subversion (Only to get development Version): * Linux: Depending on your distribution there are several ways to install subversion. For Ubuntu or Debian based distributions #apt-get install subversion. * Windows: download and install subversion command line version or TortoiseSVN from http://tortoisesvn.net * Mac osX: For Leopard install Developer tools from Leopard installation CD's. For Tiger download the command line version. 2. C++ Compiler: * Linux: Download and install g++. You can do it via apt if you use a Debian based Distribution. #apt-get install g++. * Windows: begginning from Visual Studio 2003 on, you can compile native packages of osgVP libraries. * Mac osX: Once you have installed developer tools, you are able tu compile osgVP native libraries with g++ or XCode. 3. CMake: * Linux: On debian based distributions #apt-get install cmake. Or download and install latest stable version from http://www.cmake.org * Windows: Download latest stable version from the same link than above. * Mac osX: Download latest stable version from the same link than above. 5. Java JDK: If you plan to use osgVP inside gvSIG you must install jdk 5.0 , but if your project is independent of gvSIG you are able to use jdk 6.0. * Linux: Download and install Java JDK. #apt-get install sun-javaX-jdk, where X are 5 or 6 depending on your project. * Windows: Download and install Java JDK from http://java.sun.com * Mac osX: Java JDK is installed with your mac osX Developer Tools packages. 6. Maven: * Linux: If you are using a debian based distribution like Ubuntu #apt-get install maven2. If not you must download the packages from http://maven.apache.org * Windows: Download and install maven from the link of above. * Mac osX: Maven comes with Developer Tools packages. 7. Ant: * Linux: If you are using a debian based distribution like Ubuntu #apt-get install ant. * Windows: Download and install ant from http://ant.apache.org. * Mac osX: ant comes with the basic packages of Developer Tools 8. Python (Only if you want assisted compilation and precompiled dependency management): * Linux: #apt-get install python * Windows: download and install python from http://www.python.org * Mac osX: python comes with clean installation of osX. Stable Version Build Guide (osgVP-2.1.7) ---------------------------------------- The osgVP has a range of dependencies which could be managed automatically or by user. So there are two ways to compile source code, with or without assisted compilation. Compiling with assisted compilation =================================== Build Manager (BuildMan) is a set of extensible Python scripts that helps in the management of binary dependencies and automated build systems. Experts readers could ask themselves if ANT and MaVen exits why not use it? 1. Ant is a really good choice, but you need to have Java installed. 2. Ant is extensible too, but you need to do it in Java, and this implies to compile. We want quick development, and only define a simple config file or create a python script that only is installed on buildman plugins path or $HOME/.buildman/plugins. 3. Maven is useful to manage dependencies, but only for Java, and Maven is created for the same reason.. Ant is powerful but to dispatch tasks, not to manage complex dependency systems. Working with buildman should be very easy, the procedure is: 1. Download sources from Downloads page 2. Enter to the directory osgVP 3. Execute $ant inside the directory osgVP There are two more options to execute ANT, you should use it instead of the default if you meet the requirements: * "ant ati" This option should be used if you are under a Linux OS and using the ATI restricted driver. * "ant vs8" This option should be used if you are under a Windows OS and want to compile with Visual Studio 8. The previous command execute buildman to download required native dependencies from ai2 servers, then executes CMake and prepares the Makefiles ready to compile with gcc (in Linux and Mac OS X), or prepares the projects to compile with Visual Studio 7 (in Windows. The use of VS7 is a requirement of the gvSIG project, so it tries to use the VS7 Generator with CMake) . It also prepares the Java projects that can be imported with Eclipse. Executing with assited compilation ================================== 1. Once finished compilation, check if inside osgVP/binaries/{platform}/{lib/bin} directory you have the native libraries (.so or .dll or .jnilib/.dylib). 2. Open Eclipse and select as workspace the directory osgVP. 3. Import projects with eclipse assistant from the osgVP directory. 4. Open the launcher assistant with Open Run Dialog inside Run Menu or Run As bar button 5. Create a new Java Application Launcher: * Name: ExamplesLauncher * Project: osgvp-examples * Main Class: org.gvsig.ExamplesLauncher Before Launch, go to the Environment Tab Button and add a new Environment Variable: * Windows: :: PATH=${workspace_loc}\binaries\win32\bin; C:\documents and Settings\{username}\depman\bin * Linux: :: LD_LIBRARY_PATH=${workspace_loc}/binaries/linux32/lib: /home/{username}/.depman/lib * MacOsX: :: DYLD_LIBRARY_PATH=${workspace_loc}/binaries/mac/lib: /Developer/DepMan/lib Run the application, and if all is ok you should see the examples framework. Compile without assisted compilation ==================================== If you rather work without assisted compilation, you must set up your project with native dependencies installed correctly. A priori, the libraries you need are: OpenSceneGraph-2.2, jogl and gdal. 1. Download sources from Downloads page. 2. Enter to the directory osgVP/libosgvp/libjni-osgvp 3. Execute CMake and solve native dependencies stuff. Cmake will ask you for them. 4. Compile calling install target (make install or in VS/XCode selecting INSTALL to compile) 5. Once finished compilation, check if inside osgVP/binaries/{platform}/{lib/bin} directory you have the native libraries (.so or .dll or .jnilib/.dylib). 6. Enter to the directory osgVP/ 7. Prepare eclipse workspace and eclipse projects: * $ mvn install -Dmaven.test.skip=true * $ mvn eclipse:eclipse * $ mvn eclipse:add-maven-repo -Declipse.workspace="." 8. To Develop with Eclipse Plugins: * $ cd eclipse-plugins * $ mvn eclipse:eclipse 9. To Develop with Eclipse RCPs: * $ cd applications/eclipse-applications * $ mvn eclipse:eclipse Executing without assited compilation ====================================== Configure de launcher exactly equals to assited compilation except for environment variables, where OSG_DIR is the path to your compiled version of OpenSceneGraph-2.2.0, GDAL_DIR is the path to your installation of GDAL (required by OSG) and finally JOGL_DIR is the installation path of jogl. * Windows: :: PATH=${workspace_loc}\binaries\win32\bin; %OSG_DIR%\bin:%GDAL_DIR}%\bin:%JOGL_DIR%\bin * Linux: :: LD_LIBRARY_PATH=${workspace_loc}/binaries/linux32/lib: ${OSG_DIR}/lib:${GDAL_DIR}/lib:${JOGL_DIR}/lib * MacOsX: :: DYLD_LIBRARY_PATH=${workspace_loc}/binaries/mac/lib: ${OSG_DIR}/lib:${GDAL_DIR}/lib:${JOGL_DIR}/lib Run the application, and if all is ok you should see the examples framework.