Building Flightgear - CentOS: Difference between revisions

m
no edit summary
(Initial version)
 
mNo edit summary
 
(10 intermediate revisions by the same user not shown)
Line 16: Line 16:
     libXrandr-devel.x86_64 libXinerama-devel.x86_64 zlib-devel.x86_64 expat-devel.x86_64 boost.x86_64 openal-soft-devel.x86_64 cmake.x86_64 \
     libXrandr-devel.x86_64 libXinerama-devel.x86_64 zlib-devel.x86_64 expat-devel.x86_64 boost.x86_64 openal-soft-devel.x86_64 cmake.x86_64 \
     mesa-libEGL-devel.x86_64 jasper-devel.x86_64 gstreamer1-devel.x86_64 SDL2-devel.x86_64 poppler-glib-devel.x86_64 lua-devel.x86_64 fltk-devel.x86_64 boost-devel.x86_64 \
     mesa-libEGL-devel.x86_64 jasper-devel.x86_64 gstreamer1-devel.x86_64 SDL2-devel.x86_64 poppler-glib-devel.x86_64 lua-devel.x86_64 fltk-devel.x86_64 boost-devel.x86_64 \
     dbus-devel.x86_64 libevent-devel.x86_64 glew-devel.x86_64
     dbus-devel.x86_64 libevent-devel.x86_64 glew-devel.x86_64 qt5-qtdeclarative-devel.x86_64 qt5-qtsvg-devel.x86_64 qt5-linguist.x86_64 qt5-qttools-devel.x86_64 qt5-qtwebsockets-devel.x86_64 \
    qt5-qtbase-private-devel.x86_64


The <code>plib</code> package is not available for CentOS 8. The package from CentOS 7 can be used instead. After downloading the following packages:
The <code>plib</code> package is not available for CentOS 8. The package from CentOS 7 can be used instead. After downloading the following packages:
Line 29: Line 30:
= Definitions =
= Definitions =
The following environment variables must be set because they will be used in shell commands:
The following environment variables must be set because they will be used in shell commands:
* <code>NR_JOBS</code>: Number of jobs for parallel compilation. For example: <code>NR_JOBS=$(/usr/bin/nproc)</code>
* <code>NR_JOBS</code>: Number of jobs for parallel compilation. For example: <code>NR_JOBS=$(/usr/bin/nproc)</code>.
* <code>FGFS_PREFIX</code>: Prefix of the Flightgear installation. For example: <code>FGFS_PREFIX=${HOME}/Flightgear</code>
* <code>FGFS_PREFIX</code>: Prefix of the Flightgear installation. For example: <code>FGFS_PREFIX=${HOME}/Flightgear</code>. All the source code must be located under the directory <code>${FGFS_PREFIX}/src</code> and the installation will be done under the directory <code>${FGFS_PREFIX}</code> as <code>${FGFS_PREFIX}/bin</code>, <code>${FGFS_PREFIX}/include</code>, <code>${FGFS_PREFIX}/lib64</code>,...
* <code>OPENSCENEGRAPH_VERSION</code>: Version of OpenSceneGraph. For example: <code>OPENSCENEGRAPH_VERSION=3.6.4</code>
* <code>FGFS_PREFIX_LIB=${FGFS_PREFIX}/lib64</code> in the specific case of CentOS.
* <code>OPENSCENEGRAPH_VERSION</code>: Version of OpenSceneGraph. For example: <code>OPENSCENEGRAPH_VERSION=3.6.5</code>.


= OpenSceneGraph =
= OpenSceneGraph =
OpenSceneGraph is not available as a RPM for CentOS 8 and, for this reason, needs to build from sources. The latest stable version of OpenSceneGraph can be downloaded from [http://www.openscenegraph.org/index.php/download-section/stable-releases here].
OpenSceneGraph is not available as a RPM for CentOS 8 and, for this reason, needs to be build from sources. The latest stable version of OpenSceneGraph can be downloaded from [http://www.openscenegraph.org/index.php/download-section/stable-releases here]. The downloaded file must be placed under the directory <code>${FGFS_PREFIX}/src</code> such that the full path of the file will be <code>${FGFS_PREFIX}/src/OpenSceneGraph-OpenSceneGraph-${OPENSCENEGRAPH_VERSION}</code>.


The following commands can be used to build OpenSceneGraph:
The following commands can be used to build OpenSceneGraph:
Line 49: Line 51:
       -DOSG_USE_LOCAL_LUA_SOURCE:BOOL=OFF \
       -DOSG_USE_LOCAL_LUA_SOURCE:BOOL=OFF \
       -DCMAKE_INSTALL_PREFIX="${FGFS_PREFIX}" \
       -DCMAKE_INSTALL_PREFIX="${FGFS_PREFIX}" \
      -DLIB_POSTFIX=64 \
       -DCMAKE_VERBOSE_MAKEFILE=TRUE
       -DCMAKE_VERBOSE_MAKEFILE=TRUE
  make --jobs=${NR_JOBS}
  make --jobs=${NR_JOBS}
Line 56: Line 59:
  rm -Rf -- "${FGFS_PREFIX}/src/OpenSceneGraph_build/"
  rm -Rf -- "${FGFS_PREFIX}/src/OpenSceneGraph_build/"


= Simgear =
= [[Building FlightGear - Linux#Compiling | Compiling]] =


cd -- "${FGFS_PREFIX}/src/"
= Start Flightgear =
rm -Rf -- "${FGFS_PREFIX}/src/sg_build/"
mkdir -- "${FGFS_PREFIX}/src/sg_build/"
pushd -- "${FGFS_PREFIX}/src/sg_build/"
cmake "${SIMGEAR_SRC}" \
      -DCMAKE_BUILD_TYPE=RelWithDebInfo \
      -DCMAKE_INSTALL_PREFIX="${FGFS_PREFIX}" \
      -DCMAKE_VERBOSE_MAKEFILE=TRUE
make --jobs=${NR_JOBS}
make -- test
make -- install
popd
rm -Rf -- "${FGFS_PREFIX}/src/sg_build/"


= Flightgear =
cd -- "${FGFS_PREFIX}"
export LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:${FGFS_PREFIX}/lib64/
./bin/fgfs


cd -- "${FGFS_PREFIX}/src/"
[[Category:Building from source]]
rm -Rf -- "${FGFS_PREFIX}/src/fg_build/"
mkdir -- "${FGFS_PREFIX}/src/fg_build/"
pushd -- "${FGFS_PREFIX}/src/fg_build/"
cmake "${FLIGHTGEAR_SRC}" \
      -DCMAKE_BUILD_TYPE=RelWithDebInfo \
      -DCMAKE_INSTALL_PREFIX="${FGFS_PREFIX}" \
      -DCMAKE_VERBOSE_MAKEFILE=TRUE
make --jobs=${NR_JOBS}
make -- test
make -- install
popd
rm -Rf -- "${FGFS_PREFIX}/src/fg_build/"
88

edits