Building CentOS7 GCC7.3.1 External Dependencies - acidrainstudios/TrueReality GitHub Wiki

Building External Dependencies

True Reality v0.2-Dev Dependencies List

For best results, build the dependencies in the order they are listed. Some of them depend on the ones that were build before them.

First, Setup all the TR Environmental Variables

Note:

  • Install CentOS 7 with Development and Creative Workstation profile, with all options selected.
  • To get your CentOS to use GCC 7.3.1, you need to install DevToolset-7
    After installing DevToolset, to have it permanently enabled add the following lines to your /home/<username>/.bashrc

    #Source devtoolset-7
    if [ -f /opt/rh/devtoolset-7/enable ]; then
      . /opt/rh/devtoolset-7/enable
    fi

  • Make sure you download tar or gz files for all dependencies not Zip. Linux does not know how to handle certain line endings after unziping code files from a Zip archive and introduces build errors.
  • Build Debug libraries before Release because some projects will build separate debug and release libs but still overwrite software and tool files from one binary build to another, and it's preferable to have those in Release builds over Debug
  • My Ext folder is on /home/maximserebrennik/Desktop/Development/Ext Yours will be somewhere else, so you need to adjust your path accordingly.
  • We suggest placing the Ext folder in your TR directory, the same place where you are pointing with $TR_ROOT. This document will assume you placed the Ext folder in $TR_ROOT/Ext.
  • Every time you open a terminal for a build, before running CMake run the following export commands with your Ext folder path:

    export PATH=$TR_ROOT/Ext:$TR_ROOT/Ext/bin:$TR_ROOT/Ext/include:$TR_ROOT/Ext/lib:$TR_ROOT/Ext/lib64:$PATH

    export LD_LIBRARY_PATH=$TR_ROOT/Ext/lib:$TR_ROOT/Ext/lib64:$LD_LIBRARY_PATH

Linux

    1. Yasm 1.3.0
      • Run CMake GUI with the projects CmakeLists.txt
      • Add /build on the end of your Build path
      • Click on "Add Entry" and add CMAKE_DEBUG_POSTFIX with type as String and d for the value
      • Press Configure
      • Press Yes
      • Select Unix Makefiles, press Finish
      • Change CMAKE_BUILD_TYPE to Debug
      • Change CMAKE_INSTALL_PREFIX to /home/maximserebrennik/Desktop/Development/Ext (This is where my Ext folder is, you need to point your path to yours.)
      • Press Configure, Press Generate.
      • Exit CMake, go to the /build folder
      • Type >make
      • Type >make install
      • Repeat the build procedure but change CMAKE_BUILD_TYPE to Release to generate release libraries
    1. GLEW 2.1.0
      • Run CMake GUI with CmakeLists.txt in the build\cmake folder.
      • Add /build on the end of your Build path
      • Click on "Add Entry" and add CMAKE_DEBUG_POSTFIX with type as String and d for the value
      • Click on "Add Entry" and add OpenGL_GL_PREFERENCE with type as String and GLVND for the value
      • Press Configure
      • Press Yes
      • Select Unix Makefiles, press Finish
      • Change CMAKE_BUILD_TYPE to Debug
      • Change CMAKE_INSTALL_PREFIX to /home/maximserebrennik/Desktop/Development/Ext (This is where my Ext folder is, you need to point your path to yours.)
      • Press Configure, Press Generate.
      • Exit CMake, go to the /build/cmake folder
      • Type >make
      • Type >make install
      • Repeat the build procedure but change CMAKE_BUILD_TYPE to Release to generate release libraries
    1. Boost 1.70.0
      • If you prefer to use a prepped version of this dependency, it can be downloaded on the release page.
      • If you prefer to build this from scratch:
      • Download the Boost source files, we are using v1.70.0 (boost_1_70_0.tar.gz)
      • Open a terminal in the programs folder
      • Type in >./bootsrap.sh, and press enter.
      • Type in >./b2 tools/bcp and press enter.
      • Type in >./dist/bin/bcp --namespace=bID --scan --boost=. $TR_ROOT/include/trBase/UniqueIdBoost.h $TR_ROOT/Ext/include and press enter.
      • Rename the boost folder that was created in the Ext folder to bID
      • In your favorite text editor (We use Visual Studio) open the bID folder and do a search and replace in all files for boost/ and change it to bID/
      • Next, do a replace on all files searching for BOOST_ and changing it to BID_
    1. JSONCpp 1.8.4
      • Run CMake GUI with the projects CmakeLists.txt
      • Add /build on the end of your Build path
      • Click on "Add Entry" and add CMAKE_DEBUG_POSTFIX with type as String and d for the value
      • Press Configure
      • Press Yes
      • Select Unix Makefiles, press Finish
      • Change CMAKE_BUILD_TYPE to Debug
      • Change CMAKE_INSTALL_PREFIX to /home/maximserebrennik/Desktop/Development/Ext (This is where my Ext folder is, you need to point your path to yours.)
      • In BUILD, select BUILD_SHARED_LIBS and deselect BUILD_STATIC_LIBS
      • In JSONCPP deselect JSONCPP_WITH_TEST, JSONCPP_WITH_POST_BUILD_UNITTEST, JSONCPP_WITH_PKGCONFIG_SUPPORT
      • Press Configure, Press Generate.
      • Exit CMake, go to the /build folder
      • Type >make
      • Type >make install
      • Repeat the build procedure but change CMAKE_BUILD_TYPE to Release to generate release libraries
    1. Google Test 1.8.1
      • Run CMake GUI with the projects CmakeLists.txt
      • Add /build on the end of your Build path
      • Click on "Add Entry" and add CMAKE_DEBUG_POSTFIX with type as String and d for the value
      • Press Configure
      • Press Yes
      • Select Unix Makefiles, press Finish
      • Change CMAKE_BUILD_TYPE to Debug
      • Change CMAKE_INSTALL_PREFIX to /home/maximserebrennik/Desktop/Development/Ext (This is where my Ext folder is, you need to point your path to yours.)
      • Press Configure, Press Generate.
      • Exit CMake, go to the /build folder
      • Type >make
      • Type >make install
      • Repeat the build procedure but change CMAKE_BUILD_TYPE to Release to generate release libraries
    1. Zlib 1.2.11
      • Run CMake GUI with the projects CmakeLists.txt
      • Add /build on the end of your Build path
      • Click on "Add Entry" and add CMAKE_DEBUG_POSTFIX with type as String and d for the value
      • Press Configure
      • Press Yes
      • Select Unix Makefiles, press Finish
      • Change CMAKE_BUILD_TYPE to Debug
      • Change CMAKE_INSTALL_PREFIX to /home/maximserebrennik/Desktop/Development/Ext (This is where my Ext folder is, you need to point your path to yours.)
      • In INSTALL change all paths to point to your Ext folder. /usr/local to /home/maximserebrennik/Desktop/Development/Ext/bin, etc etc
      • Press Configure, Press Generate.
      • Exit CMake, go to the /build folder
      • Type >make
      • Type >make install
      • Repeat the build procedure but change CMAKE_BUILD_TYPE to Release to generate release libraries
    1. FFMpeg 3.4.4
      • Open a terminal in the ffmpeg folder
      • Type >./configure --arch=x86_64 --enable-shared --enable-x86asm --enable-asm --disable-static --enable-ffplay --prefix=/home/maximserebrennik/Desktop/Development/Ext
      • Type >make -jxx (Where xx is the number of cores you have)
      • Type >make install
    1. LibJpeg 9c
      • In the software folder:
      • Type >./configure --prefix=/home/maximserebrennik/Desktop/Development/Ext
      • Type >make
      • Type >make install or >make install-strip if you don't want to have debug symbols
    1. LibPng 1.6.32
      • Run CMake GUI with the projects CmakeLists.txt
      • Add /build on the end of your Build path
      • Click on "Add Entry" and add CMAKE_DEBUG_POSTFIX with type as String and d for the value
      • Press Configure
      • Press Yes
      • Select Unix Makefiles, press Finish
      • Change CMAKE_BUILD_TYPE to Debug
      • Change CMAKE_INSTALL_PREFIX to /home/maximserebrennik/Desktop/Development/Ext (This is where my Ext folder is, you need to point your path to yours.)
      • In PNG uncheck PNG_TESTS
      • In ZLIB fix the path to the ZLib debug library. It might not find it by default.
      • Press Configure, Press Generate.
      • Exit CMake, go to the /build folder
      • Type >make
      • Type >make install
      • Repeat the build procedure but change CMAKE_BUILD_TYPE to Release to generate release libraries
    1. LibTiff 4.0.9
      • Run CMake GUI with the projects CmakeLists.txt
      • Add /build on the end of your Build path
      • Click on "Add Entry" and add CMAKE_DEBUG_POSTFIX with type as String and d for the value
      • Click on "Add Entry" and add OpenGL_GL_PREFERENCE with type as String and GLVND for the value
      • Press Configure
      • Select Unix Makefiles, press Finish
      • Change CMAKE_BUILD_TYPE to Debug
      • Change CMAKE_INSTALL_PREFIX to /home/maximserebrennik/Desktop/Development/Ext (This is where my Ext folder is, you need to point your path to yours.)
      • Press Configure
      • Fix the Jpeg paths
      • Fix the ZLib paths
      • Press Configure, Press Generate.
      • Exit CMake, go to the /build folder
      • Type >make -jxx where xx is the number of cores to use for building.
      • Type >make install
      • Repeat the build procedure but change CMAKE_BUILD_TYPE to Release to generate release libraries
    1. GDAL 2.2.4
      • In the software folder:
      • Type >./configure --prefix=/home/maximserebrennik/Desktop/Development/Ext
      • Type >make -jxx where xx is the number of cores to use for building.
      • Type >make install
    1. FreeType 2.9.1
      • Run CMake GUI with the projects CmakeLists.txt
      • Add /build on the end of your Build path
      • Click on "Add Entry" and add CMAKE_DEBUG_POSTFIX with type as String and d for the value
      • Press Configure
      • Press Yes
      • Select Unix Makefiles, press Finish
      • Change CMAKE_BUILD_TYPE to Debug
      • Change CMAKE_INSTALL_PREFIX to /home/maximserebrennik/Desktop/Development/Ext (This is where my Ext folder is, you need to point your path to yours.)
      • Add -fPIC to CMAKE_C_FLAGS
      • In ZLIB fix the path to the ZLib debug library. It might not find it by default.
      • In PNG fix the path to the PNG Release library (libpng16.so). It might not find the right one by default.
      • Press Configure, Press Generate.
      • Exit CMake, go to the /build folder
      • Type >make -jxx where xx is the number of cores to use for building.
      • Type >make install
      • Repeat the build procedure but change CMAKE_BUILD_TYPE to Release to generate release libraries
    1. OpenSceneGraph 3.6.4
      • Run CMake GUI with the projects CmakeLists.txt
      • Add /build on the end of your Build path
      • Press Configure
      • Press Yes
      • Select Unix Makefiles, press Finish
      • Change CMAKE_BUILD_TYPE to Debug
      • Change CMAKE_INSTALL_PREFIX to /home/maximserebrennik/Desktop/Development/Ext (This is where my Ext folder is, you need to point your path to yours.)
      • Turn off OSG_USE_FLOAT_BOUNDINGBOX and OSG_USE_FLOAT_BOUNDINGSPHERE
      • Fix ZLib paths if needed
      • Fix TIFF paths if needed
      • Fix PNG paths if needed
      • Fix FFMpeg paths if needed
      • Press Configure, Press Generate.
      • Exit CMake, go to the /build folder
      • Type >make -jxx where xx is the number of cores to use for building.
      • Type >make install
      • Repeat the build procedure but change CMAKE_BUILD_TYPE to Release to generate release libraries

Final Edits

Go to your Ext folder and move all files and folders in lib64 to lib. Then delete all folders except bin, lib and include.
Place the Ext folder into your TR repo folder before trying to build and install TR.

⚠️ **GitHub.com Fallback** ⚠️