Board index FlightGear Support Compiling

Telling the script NOT to use system's OSG  Topic is solved

Building FlightGear from source, and in the need for help?

Telling the script NOT to use system's OSG

Postby Amarildojr » Wed Jan 13, 2016 8:38 pm

Since openscenegraph on Arch's repos is out-of-date, I decided not to install it.

Using the script for Linux, I did:

./download_and_compile.sh -s OSG
./download_and_compile.sh -s SIMGEAR
./download_and_compile.sh -s FGFS
./download_and_compile.sh -s DATA
./download_and_compile.sh -s ALL
./download_and_compile.sh -s FGRUN

But it appears the script is trying to pull openscenegraph libraries from my OS uping compiling FGRUN, which I don't want it doing.
Code: Select all
-- Could NOT find osgText (missing:  OSGTEXT_LIBRARY OSGTEXT_INCLUDE_DIR)
-- Could NOT find osgDB (missing:  OSGDB_LIBRARY OSGDB_INCLUDE_DIR)
-- Could NOT find osgParticle (missing:  OSGPARTICLE_LIBRARY OSGPARTICLE_INCLUDE_DIR)
-- Could NOT find osgUtil (missing:  OSGUTIL_LIBRARY OSGUTIL_INCLUDE_DIR)
-- Could NOT find osgViewer (missing:  OSGVIEWER_LIBRARY OSGVIEWER_INCLUDE_DIR)
-- Could NOT find osgGA (missing:  OSGGA_LIBRARY OSGGA_INCLUDE_DIR)
-- Could NOT find osg (missing:  OSG_LIBRARY OSG_INCLUDE_DIR)
-- Could NOT find OpenThreads (missing:  OPENTHREADS_LIBRARY OPENTHREADS_INCLUDE_DIR)
CMake Error at /usr/share/cmake-3.4/Modules/FindPackageHandleStandardArgs.cmake:148 (message):
  Could NOT find OpenSceneGraph (missing: OPENSCENEGRAPH_LIBRARIES
  OPENSCENEGRAPH_INCLUDE_DIR OSGTEXT_FOUND OSGDB_FOUND OSGPARTICLE_FOUND
  OSGUTIL_FOUND OSGVIEWER_FOUND OSGGA_FOUND OSG_FOUND OPENTHREADS_FOUND)
  (Required is at least version "2.8.1")
Call Stack (most recent call first):
  /usr/share/cmake-3.4/Modules/FindPackageHandleStandardArgs.cmake:388 (_FPHSA_FAILURE_MESSAGE)
  /usr/share/cmake-3.4/Modules/FindOpenSceneGraph.cmake:234 (FIND_PACKAGE_HANDLE_STANDARD_ARGS)
  CMakeLists.txt:144 (find_package)


-- Configuring incomplete, errors occurred!
See also "/home/amarildo/Documents/Jogos/FlightGear/Compile/build/fgrun/CMakeFiles/CMakeOutput.log".
make: *** No targets specified and no makefile found.  Stop.
make: *** No rule to make target 'install'.  Stop.


To confirm this, I installed openscenegraph, re-ran the script, and everything worked fine.

Is there a way to tell the script NOT to look for OSG on a system-wide level, but on the compiling folder instead?
Last edited by Amarildojr on Thu Jan 14, 2016 5:19 pm, edited 2 times in total.
Amarildojr
 
Posts: 94
Joined: Sat Jan 02, 2016 10:32 pm
Location: Basil
Callsign: TAM91
OS: Arch Linux

Re: Telling the script NOT to use system's openscenegraph

Postby tikibar » Wed Jan 13, 2016 8:46 pm

If you set an environment variable $OSG_DIR to point to the installation you want to use, cmake should find it there.
Boeing 747-8 (rename folder to 747-8i)
Boeing 757-200/300 (rename folder to 757-200)
Boeing 767-300/ER (rename folder to 767-300)
User avatar
tikibar
 
Posts: 530
Joined: Mon Mar 05, 2012 6:05 am
Location: Los Angeles
Callsign: CHT0009
OS: Ubuntu 14.04

Re: Telling the script NOT to use system's openscenegraph

Postby Hooray » Wed Jan 13, 2016 10:22 pm

Setting up -DCMAKE_INSTALL_PREFIX accordingly will also look for dependencies there, see the wiki article for detaisl
Please don't send support requests by PM, instead post your questions on the forum so that all users can contribute and benefit
Thanks & all the best,
Hooray
Help write next month's newsletter !
pui2canvas | MapStructure | Canvas Development | Programming resources
Hooray
 
Posts: 12090
Joined: Tue Mar 25, 2008 8:40 am

Re: Telling the script NOT to use system's openscenegraph

Postby Amarildojr » Thu Jan 14, 2016 2:58 am

The Wiki isn't very clear to non-programers.

I tried this:

Code: Select all
  if [ "$RECONFIGURE" = "y" ]; then
    cd "$CBD"
    mkdir -p build/fgrun
    cd "$CBD"/build/fgrun
    rm -f CMakeCache.txt
    cmake -DCMAKE_BUILD_TYPE="Release" \
          -DCMAKE_INSTALL_PREFIX:PATH="$INSTALL_DIR_FGRUN" \
          -DCMAKE_PREFIX_PATH="$INSTALL_DIR_SIMGEAR" \
          -DCMAKE_INSTALL_PREFIX:PATH="/home/amarildo/Documents/Jogos/FlightGear/Sim/install/openscenegraph/lib64/" /home/amarildo/Documents/Jogos/FlightGear/Sim/fgrun/
          ../../fgrun/ 2>&1 | tee -a $LOGFILE
  fi


Still nothing.
Amarildojr
 
Posts: 94
Joined: Sat Jan 02, 2016 10:32 pm
Location: Basil
Callsign: TAM91
OS: Arch Linux

Re: Telling the script NOT to use system's openscenegraph

Postby Amarildojr » Thu Jan 14, 2016 2:59 am

tikibar wrote in Wed Jan 13, 2016 8:46 pm:If you set an environment variable $OSG_DIR to point to the installation you want to use, cmake should find it there.

I'll try this. I don't know exactly where to put it, but I'll try many different places for it.
Amarildojr
 
Posts: 94
Joined: Sat Jan 02, 2016 10:32 pm
Location: Basil
Callsign: TAM91
OS: Arch Linux

Re: Telling the script NOT to use system's openscenegraph

Postby Amarildojr » Thu Jan 14, 2016 3:05 am

Oh, done :D :D

Code: Select all
  if [ "$RECONFIGURE" = "y" ]; then
    cd "$CBD"
    mkdir -p build/fgrun
    cd "$CBD"/build/fgrun
    rm -f CMakeCache.txt
    cmake -DCMAKE_BUILD_TYPE="Release" \
          -DCMAKE_INSTALL_PREFIX:PATH="$INSTALL_DIR_FGRUN" \
          -DCMAKE_PREFIX_PATH="$INSTALL_DIR_SIMGEAR" \
          -DCMAKE_INSTALL_PREFIX:PATH="$INSTALL_DIR_OSG" \
          ../../fgrun/ 2>&1 | tee -a $LOGFILE
  fi

Not that hard afterall.
Amarildojr
 
Posts: 94
Joined: Sat Jan 02, 2016 10:32 pm
Location: Basil
Callsign: TAM91
OS: Arch Linux

Re: Telling the script NOT to use system's OSG

Postby Hooray » Thu Jan 14, 2016 5:41 pm

feel free to update the wiki accordingly
Please don't send support requests by PM, instead post your questions on the forum so that all users can contribute and benefit
Thanks & all the best,
Hooray
Help write next month's newsletter !
pui2canvas | MapStructure | Canvas Development | Programming resources
Hooray
 
Posts: 12090
Joined: Tue Mar 25, 2008 8:40 am

Re: Telling the script NOT to use system's OSG

Postby Amarildojr » Thu Jan 14, 2016 5:43 pm

Sorry to bother you again, people, but today I realized FGRUN compiled it's libraries on OSG's directory. How could I specify the script to compile FGRUN on it's own directory? The only thing I added to the script was this:

Code: Select all
-DCMAKE_INSTALL_PREFIX:PATH="$INSTALL_DIR_OSG" \


FGRUN's script sector:
Code: Select all
#######################################################
# FGRUN
#######################################################
FGRUN_INSTALL_DIR=fgrun
INSTALL_DIR_FGRUN=$INSTALL_DIR/$FGRUN_INSTALL_DIR
cd "$CBD"
if [[ "$(declare -p WHATTOBUILD)" =~ '['([0-9]+)']="FGRUN"' ]]; then
  echo "****************************************" | tee -a $LOGFILE
  echo "**************** FGRUN *****************" | tee -a $LOGFILE
  echo "****************************************" | tee -a $LOGFILE

  mkdir -p "fgrun"
  cd "$CBD"/fgrun
  _gitDownload git://git.code.sf.net/p/flightgear/fgrun
  _gitUpdate $FGVERSION

  if [ "$RECONFIGURE" = "y" ]; then
    cd "$CBD"
    mkdir -p build/fgrun
    cd "$CBD"/build/fgrun
    rm -f CMakeCache.txt
    cmake -DCMAKE_BUILD_TYPE="Release" \
          -DCMAKE_INSTALL_PREFIX:PATH="$INSTALL_DIR_FGRUN" \
          -DCMAKE_PREFIX_PATH="$INSTALL_DIR_OSG" \
          -DCMAKE_PREFIX_PATH="$INSTALL_DIR_SIMGEAR" \
          ../../fgrun/ 2>&1 | tee -a $LOGFILE
  fi
   
  _make fgrun

  cd "$CBD"

  SCRIPT=run_fgrun.sh
  echo "#!/bin/sh" > $SCRIPT
  echo "cd \$(dirname \$0)" >> $SCRIPT
  echo "cd $SUB_INSTALL_DIR/$FGRUN_INSTALL_DIR/bin" >> $SCRIPT
  echo "export LD_LIBRARY_PATH=$INSTALL_DIR_SIMGEAR/lib" >> $SCRIPT
  echo "./fgrun --fg-exe=\$PWD/../../$FGFS_INSTALL_DIR/bin/fgfs --fg-root=\$PWD/../../$FGFS_INSTALL_DIR/fgdata   \$@" >> $SCRIPT
  chmod 755 $SCRIPT
fi
Amarildojr
 
Posts: 94
Joined: Sat Jan 02, 2016 10:32 pm
Location: Basil
Callsign: TAM91
OS: Arch Linux

Re: Telling the script NOT to use system's OSG

Postby Amarildojr » Thu Jan 14, 2016 5:46 pm

Hooray wrote in Thu Jan 14, 2016 5:41 pm:feel free to update the wiki accordingly

I never edited a Wiki before. I'm kind of scared, actually, to do something that could harm others.
Amarildojr
 
Posts: 94
Joined: Sat Jan 02, 2016 10:32 pm
Location: Basil
Callsign: TAM91
OS: Arch Linux

Re: Telling the script NOT to use system's OSG

Postby Hooray » Thu Jan 14, 2016 5:55 pm

don't worry, you don't have any privileges to harm others, and even if you tried to, your account would be temporarily disabled by others.

If you can use the forum, you can also use the wiki - it is akin to editing your own postings, with the difference that you are editing articles written by others
Please don't send support requests by PM, instead post your questions on the forum so that all users can contribute and benefit
Thanks & all the best,
Hooray
Help write next month's newsletter !
pui2canvas | MapStructure | Canvas Development | Programming resources
Hooray
 
Posts: 12090
Joined: Tue Mar 25, 2008 8:40 am

Re: Telling the script NOT to use system's OSG

Postby Amarildojr » Thu Jan 14, 2016 6:04 pm

OK, I'll add the info then :D As soon as I know how to fix this compiling problem.
Amarildojr
 
Posts: 94
Joined: Sat Jan 02, 2016 10:32 pm
Location: Basil
Callsign: TAM91
OS: Arch Linux

Re: Telling the script NOT to use system's OSG

Postby Amarildojr » Thu Jan 14, 2016 11:46 pm

ALMOST DONE! Just added this before everything on FGRUN's structure.

Code: Select all
# OSG/PLIB special directory
export OSG_DIR=/home/amarildo/Documents/Jogos/FlightGear/Sim/install/openscenegraph/


However:
Code: Select all
[amarildo@amarildo Sim]$ ./run_fgrun.sh
./fgrun: error while loading shared libraries: libosgText.so.100: cannot open shared object file: No such file or directory


I tried adding that very same line to ./run_fgrun.sh, with no luck.

I feel like I'm almost there. Just a little push from a more experienced user and I'm done.
Amarildojr
 
Posts: 94
Joined: Sat Jan 02, 2016 10:32 pm
Location: Basil
Callsign: TAM91
OS: Arch Linux

Re: Telling the script NOT to use system's OSG  

Postby tikibar » Thu Jan 14, 2016 11:55 pm

Code: Select all
export LD_LIBRARY_PATH=/home/amarildo/Documents/Jogos/FlightGear/Sim/install/openscenegraph/lib:$LD_LIBRARY_PATH


Put that either in your .bashrc (or .bash_aliases, .bash_profile, whichever your linux is using) or add that at the beginning of the ./run_fgrun.sh script. It may need to be lib64 instead of lib.
Boeing 747-8 (rename folder to 747-8i)
Boeing 757-200/300 (rename folder to 757-200)
Boeing 767-300/ER (rename folder to 767-300)
User avatar
tikibar
 
Posts: 530
Joined: Mon Mar 05, 2012 6:05 am
Location: Los Angeles
Callsign: CHT0009
OS: Ubuntu 14.04

Re: Telling the script NOT to use system's OSG

Postby Amarildojr » Fri Jan 15, 2016 12:09 am

tikibar wrote in Thu Jan 14, 2016 11:55 pm:
Code: Select all
export LD_LIBRARY_PATH=/home/amarildo/Documents/Jogos/FlightGear/Sim/install/openscenegraph/lib:$LD_LIBRARY_PATH


Put that either in your .bashrc (or .bash_aliases, .bash_profile, whichever your linux is using) or add that at the beginning of the ./run_fgrun.sh script. It may need to be lib64 instead of lib.

Worked like a charm :)

I just want to thank all of you :wink: Have a good night, everybody.
Amarildojr
 
Posts: 94
Joined: Sat Jan 02, 2016 10:32 pm
Location: Basil
Callsign: TAM91
OS: Arch Linux


Return to Compiling

Who is online

Users browsing this forum: No registered users and 1 guest