Board index FlightGear Support Compiling

building git binary for Local Weather development

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

building git binary for Local Weather development

Postby Hooray » Fri Sep 24, 2010 7:58 am

Code: Select all

mkdir foo
cd foo
make
make plib
make osg
make openal
make simgear
make flightgear



OpenAL still failing?

TODO: add boost to the script, add libjpeg, add libpng
Last edited by Hooray on Fri Sep 24, 2010 3:47 pm, edited 2 times in total.
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: 11292
Joined: Tue Mar 25, 2008 8:40 am

Re: building git binary for Local Weather development

Postby Thorsten » Fri Sep 24, 2010 8:08 am

osg compilation is still running, currently at 49% (my system is fast, but not that fast...)
Thorsten
 
Posts: 10243
Joined: Mon Nov 02, 2009 8:33 am

Re: building git binary for Local Weather development

Postby Hooray » Fri Sep 24, 2010 8:11 am

If OpenAL still fails, try to execute the following SHELL SCRIPT (sh script.sh):
Code: Select all
INSTALL_PREFIX=${HOME}/FG
OAL_BUILD_DIR=BUILD/OpenAL

@echo "Building OpenAL"
cd ${OAL_BUILD_DIR}
                mkdir -p ${OAL_BUILD_DIR}/alut
                cd ${OAL_BUILD_DIR}/alut && pwd  && cmake ../../../openal/alut -DCMAKE_INSTALL_PREFIX=${INSTALL_PREFIX} -DCMAKE_C_FLAGS="-I${INSTALL_PREFIX}/include" && make install


PS: You can safely open another terminal session to execute that in parallel
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: 11292
Joined: Tue Mar 25, 2008 8:40 am

Re: building git binary for Local Weather development

Postby Hooray » Fri Sep 24, 2010 8:14 am

Thorsten wrote:osg compilation is still running, currently at 49% (my system is fast, but not that fast...)


for the future, you can run "make -j n" where n is the number of jobs (i.e. processor cores) to be executed in parallel.
On multi core machines, this can speed up compilation significantly.
But please don't interrupt the build process now ;-)

Next time you could simply run "make -j 2" for example to execute two jobs in parallel.
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: 11292
Joined: Tue Mar 25, 2008 8:40 am

Re: building git binary for Local Weather development

Postby Hooray » Fri Sep 24, 2010 8:17 am

Thorsten wrote:(my system is fast, but not that fast...)


to speed up future builds, you can use "ccache", which is a compiler cache.
It can be used, simply by setting the CXX environment variable to "ccache g++"

That will probably require 2-3 gb of hard disk space when used with FG and all its dependencies, but rebuilding is pretty fast then.

Code: Select all
make CXX="ccache g++"


This can be also combined with parallel builds:

Code: Select all
make CXX="ccache g++" -j 2
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: 11292
Joined: Tue Mar 25, 2008 8:40 am

Re: building git binary for Local Weather development

Postby Thorsten » Fri Sep 24, 2010 8:20 am

This is a 2 year old laptop - it has 2 CPUs, one I can use to compile in the background, the other I need to keep the system working what it should... I'll try the shell script as soon as osg is finished.
Thorsten
 
Posts: 10243
Joined: Mon Nov 02, 2009 8:33 am

Re: building git binary for Local Weather development

Postby Thorsten » Fri Sep 24, 2010 8:34 am

Okay, the script for openal worked. I had to take openal out of the simgear: line in the Makefile and changed that to just

Code: Select all
simgear: simgear.update


because all else should be there. Now I terminate here while trying to build simgear:

Code: Select all
======================================
Now you are ready to run './configure'
======================================
configure: WARNING: unrecognized options: --with-plib
checking for a BSD-compatible install... /usr/bin/install -c
checking for -p flag to install... yes
checking whether build environment is sane... yes
checking for a thread-safe mkdir -p... /bin/mkdir -p
checking for gawk... gawk
checking whether make sets $(MAKE)... yes
checking for headless mode...
checking CXX...
checking CC...
checking whether make sets $(MAKE)... (cached) yes
checking for gcc... gcc
checking for C compiler default output file name... a.out
checking whether the C compiler works... yes
checking whether we are cross compiling... no
checking for suffix of executables...
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking for gcc option to accept ISO C89... none needed
checking for style of include used by make... GNU
checking dependency style of gcc... gcc3
checking how to run the C preprocessor... gcc -E
checking for g++... g++
checking whether we are using the GNU C++ compiler... yes
checking whether g++ accepts -g... yes
checking dependency style of g++... gcc3
checking how to run the C++ preprocessor... g++ -E
checking for ranlib... ranlib
checking for a BSD-compatible install... /usr/bin/install -c -p
checking whether ln -s works... yes
checking for boostlib >= 1.37.0... configure: error: We could not detect the boost libraries (version 1.37 or higher). If you have a staged boost library (still not installed) please specify $BOOST_ROOT in your environment and do not give a PATH to --with-boost option.  If you are sure you have boost installed, then check your version number looking in <boost/version.hpp>. See http://randspringer.de/boost for more documentation.
make: *** [simgear] Error 1


It seems I cannot get boostlib 1.37.0 from the FC9 repository, just 1.34. Options?
Thorsten
 
Posts: 10243
Joined: Mon Nov 02, 2009 8:33 am

Re: building git binary for Local Weather development

Postby Hooray » Fri Sep 24, 2010 8:36 am

So, I got bored and looked at the other threads in the "compiling" sub forum, and look what I found: viewtopic.php?f=45&t=9572&p=96471#p96220

Someone is planning to add wind shear conditions to FlightGear as part of his graduation project:

Just want to do a simple introduction of myself before I elaborate on my problem. I am currently doing my Final Year Project at my university. The main idea of the project is to incorporate wind shear conditions into Flight Gear for future pilot training and what not.


I told him to check out the local weather project
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: 11292
Joined: Tue Mar 25, 2008 8:40 am

Re: building git binary for Local Weather development

Postby Hooray » Fri Sep 24, 2010 8:44 am

Thorsten wrote:It seems I cannot get boostlib 1.37.0 from the FC9 repository, just 1.34. Options?


Well, you just built osg from source ... so why not also build boost from source, quick & easy :lol:

boost.sh (sh boost.sh)
Code: Select all
wget "http://downloads.sourceforge.net/project/boost/boost/1.44.0/boost_1_44_0.tar.bz2?r=http%3A%2F%2Fsourceforge.net%2Fprojects%2Fboost%2Ffiles%2Fboost%2F1.44.0%2F&ts=1285317474&use_mirror=kent"
tar xjf boost_1_44_0.tar.bz2
cd boost_1_44_0/
sh bootstrap.sh
./bjam



You only need to decide if you want to install it into your $HOME, or in a system-wide place.
Personally, I would just update the system installation - should not be a problem, and you could always install an older version using your distro's package manager.

I guess boost should be added to the Makefile then...
Last edited by Hooray on Fri Sep 24, 2010 8:46 am, edited 1 time in total.
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: 11292
Joined: Tue Mar 25, 2008 8:40 am

Re: building git binary for Local Weather development

Postby Torsten » Fri Sep 24, 2010 8:46 am

You don't need to compile boost, FlightGear uses only some header files and no libraries of boost. Just tell configure where to find your boost tree.
flightgear.org - where development happens.
User avatar
Torsten
 
Posts: 629
Joined: Fri Feb 01, 2008 9:22 pm
Location: near Hamburg, Germany
Callsign: offline
Version: next
OS: Linux

Re: building git binary for Local Weather development

Postby Hooray » Fri Sep 24, 2010 8:48 am

Torsten wrote:You don't need to compile boost, FlightGear uses only some header files and no libraries of boost. Just tell configure where to find your boost tree.



He is apparently using 1.34, and configure checks for >= 1.37
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: 11292
Joined: Tue Mar 25, 2008 8:40 am

Re: building git binary for Local Weather development

Postby Thorsten » Fri Sep 24, 2010 9:01 am

Boost compiles happily...
Thorsten
 
Posts: 10243
Joined: Mon Nov 02, 2009 8:33 am

Re: building git binary for Local Weather development

Postby Thorsten » Fri Sep 24, 2010 9:07 am

...and finished - so how do I install it? It doesn't seem to come with a Makefile such that 'make install' would work?
Thorsten
 
Posts: 10243
Joined: Mon Nov 02, 2009 8:33 am

Re: building git binary for Local Weather development

Postby Hooray » Fri Sep 24, 2010 10:10 am

Like Torsten mentioned already, you don't need to install it, it's just some headers that are needed.
The configure error you posted, contains all the info you need:
If you have a staged boost library (still not installed) please specify $BOOST_ROOT in your environment and do not give a PATH to --with-boost option.

But I agree, simply installing everything is easier than playing around with environment variables:

Code: Select all
sudo ./bjam install


(covered in the documentation, too)
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: 11292
Joined: Tue Mar 25, 2008 8:40 am

Re: building git binary for Local Weather development

Postby Hooray » Fri Sep 24, 2010 12:14 pm

FYI, once you have succeeded building simgear and flightgear, you'll need to modify the environment variable LD_LIBRARY_PATH to point to the $HOME/FG/lib directory, as well as to $HOME/FG/lib/osgPlugins-2.9.9 so that the libraries installed in non-system paths can be picked up:

vars.sh (run "source vars.sh")
Code: Select all
export LD_LIBRARY_PATH=$HOME/FG/lib:$HOME/FG/lib/osgPlugins-2.9.9
export FG_ROOT=your path to fg_root


You can add this to the $HOME/.bashrc file or manually export the paths.
The Makefile can do that automatically if you run "make run", just put add a symlink "fgfs" to BUILD/flightgear/src/Main/fgfs
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: 11292
Joined: Tue Mar 25, 2008 8:40 am

Next

Return to Compiling

Who is online

Users browsing this forum: No registered users and 1 guest