Board index FlightGear Support osgEarth

Initial FlightGear / OsgEarth integration

osgEarth renders the terrain scene by building the textured geometry at runtime from raw source imagery and elevation data. An experimental FlightGear integration is currently available.

Re: Initial FlightGear / OsgEarth integration

Postby Hooray » Mon Dec 22, 2014 6:47 am

Sorry for my guessing then - but obviously, I cannot read your mind.
If you are indeed compiling all dependencies from source and the libraries/versions are matching, I am also surprised seeing those errors.
You say that the function is there and correctly exported - does the name mangling also match ?
If so, I'd suggest to use "ldd" to see how the libraries are resolved - the only thing I could think of, is having multiple conflicting versions around - so that there might be some system-wide dependencies being picked up instead of your locally built/installed libs.

PS: No need to feel offended, I haven't built osgearth in months, but I do remember not having to build gdal et al from source - which is why I'd be surprised to learn if that should be required now.
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: 11375
Joined: Tue Mar 25, 2008 8:40 am

Re: Initial FlightGear / OsgEarth integration

Postby vitos » Mon Dec 22, 2014 9:05 am

Hooray wrote in Mon Dec 22, 2014 6:47 am:No need to feel offended, I haven't built osgearth in months, but I do remember not having to build gdal et al from source - which is why I'd be surprised to learn if that should be required now.


Of course, there's not need to feel anything at all - it's words and numbers only.

At now, after recompiling, and, by the way, "gdal/" additions at HeightField removing, I do have other error:

/usr/bin/ld: CMakeFiles/fgfs.dir/__/Viewer/OsgEarthHeightField.cxx.o: undefined reference to symbol '_ZN11GDALDataset13GetRasterBandEi'
/opt/FlightGear/gdal/lib/libgdal.so.1: error adding symbols: DSO missing from command line
collect2: error: ld returned 1 exit status


At library iself "GDALDataset::GetRasterBand(int)" and "GDALGetRasterBand" calls are presented, by "nm -Ca". Fuction is declared at gdal_priv.h and gdal.h , which are declared at HeightField include definitions - and You may see that it asks local /opt/FlightGear/gdal/lib/libgdal.so excatly; gdal on itself depends on os installed libraries only, so if it wont work is should vent out at compilation of it.

With attempt to build with os gdal it makes next error:

/usr/bin/ld: CMakeFiles/fgfs.dir/__/Viewer/OsgEarthHeightField.cxx.o: undefined reference to symbol 'GDALSetRasterNoDataValue@@GDAL_1.8'
//usr/lib/libgdal.so.1: error adding symbols: DSO missing from command line
collect2: error: ld returned 1 exit status


That's actually why I made attempt to build gdal from scratch.

And about months - that's right what I mean when I so say that I seriously doubt that it would be at release.
Last edited by vitos on Mon Dec 22, 2014 11:18 am, edited 1 time in total.
Waste of time: too unprofitable for work, too exhausting for hobby.
User avatar
vitos
 
Posts: 615
Joined: Sun Jan 25, 2009 8:10 pm
Location: Moscow, Russia
Callsign: vitos
IRC name: vitos
Version: 3.4
OS: Debian

Re: Initial FlightGear / OsgEarth integration

Postby ludomotico » Mon Dec 22, 2014 11:18 am

vitos wrote in Mon Dec 22, 2014 9:05 am:At now, after recompiling, and, by the way, "gdal/" additions at HeightField removing, I do have other error:

/usr/bin/ld: CMakeFiles/fgfs.dir/__/Viewer/OsgEarthHeightField.cxx.o: undefined reference to symbol '_ZN11GDALDataset13GetRasterBandEi'
/opt/FlightGear/gdal/lib/libgdal.so.1: error adding symbols: DSO missing from command line
collect2: error: ld returned 1 exit status


If I understood correctly, you are REMOVING some gdal lines. I hardly see how removing random lines could enhance the simulator, be very careful about that.

The "error adding symbols: DSO missing from command line" usually means a library is referencing another library you are not linking. According to this message:

vitos wrote in Sun Dec 21, 2014 11:31 pm:Tried to make everything to point linker to correct library, cmake command looks as that:


You are heavily overwriting the cmake configuration. My guess is your custom cmake command is not linking to some important library, such as "-lpthread"

As Hooray says, there is no need to recompile gdal and the one provided by your distribution is probably ok. Try NOT over-configuring cmake. In my case, the command is:

Code: Select all
mkdir build
cd build
cmake -D CMAKE_BUILD_TYPE="Release" -DENABLE_FGADMIN=OFF -DENABLE_TESTS=OFF -DENABLE_FLITE=On -DWITH_FGPANEL=OFF -DCMAKE_INSTALL_RPATH="/usr/local/lib64" -DCMAKE_LIBRARY_PATH="/usr/local/lib64" ..
User avatar
ludomotico
 
Posts: 1018
Joined: Tue Apr 24, 2012 1:01 pm
Version: git
OS: Debian GNU/Linux

Re: Initial FlightGear / OsgEarth integration

Postby vitos » Mon Dec 22, 2014 11:21 am

ludomotico wrote in Mon Dec 22, 2014 11:18 am:If I understood correctly, you are REMOVING some gdal lines. I hardly see how removing random lines could enhance the simulator, be very careful about that.


Not, You did not. Reread topic from beginning to comprehend why some changes are needed with rebuilding gdal from scratch. Actually it could not work with preinstalled gdal correctly, too.

ludomotico wrote in Mon Dec 22, 2014 11:18 am:As Hooray says, there is no need to recompile gdal and the one provided by your distribution is probably ok.


Look at previous message addition to check out that's needed.

By the way, compilation attempt at Fedora fails much more earlier, at osgearth compilation. Maybe it could be better just to try other distribution deeply.

Well, after rechecking, at Fedora it fails with erros of

Code: Select all
[ 20%] Built target FGAdminUI
Linking CXX executable fgelev
Linking CXX executable fgpanel
/usr/bin/ld: warning: libosgEarthFeatures.so.0, needed by /opt/FgOsgEarth/OsgEarth/lib64/libosgEarthAnnotation.so, not found (try using -rpath or -rpath-link)
...
/opt/FgOsgEarth/OsgEarth/lib64/libosgEarthUtil.so: undefined reference to `osgText::Text::accept(osg::Drawable::ConstAttributeFunctor&) const'
collect2: error: ld returned 1 exit status
make[2]: *** [utils/fgpanel/fgpanel] Error 1
make[1]: *** [utils/fgpanel/CMakeFiles/fgpanel.dir/all] Error 2


type.

It seems that could compile osg or osgearth without something that later needed at fg compilation, and it could occur at each distro. Plus mistake warnings looks pretty wrong. That library which it could not find, libosgEarthFeatures.so.0, it lays near first one, libosgEarthAnnotation.so, which says it could not see it.

Nah, and I could add that I have older version of fg compiled from scratch at this distribution working, and this compiled way I am trying to compile that one exactly. So problems are osgearth build specific for sure.

Well, that mistake solved by something as that:

Code: Select all
export LD_LIBRARY_PATH=/opt/FgOsgEarth/OpenSceneGraph/lib64:/opt/FgOsgEarth/OsgEarth/lib64:/opt/FgOsgEarth/simgear/lib:/opt/FgOsgEarth/plib/lib:$LD_LIBRARY_PATH[/quote]

prior fg making. Heh, it already sounds as "news from battlefield".

At preinstalled gdal it gives:

[quote]Linking CXX executable fgfs
/usr/bin/ld: CMakeFiles/fgfs.dir/__/Viewer/OsgEarthHeightField.cxx.o: undefined reference to symbol 'VSIFree'
/usr/bin/ld: note: 'VSIFree' is defined in DSO /lib64/libgdal.so.1 so try adding it to the linker command line
/lib64/libgdal.so.1: could not read symbols: Invalid operation
collect2: error: ld returned 1 exit status
make[2]: *** [src/Main/fgfs] Error 1
make[1]: *** [src/Main/CMakeFiles/fgfs.dir/all] Error 2


ldd on that one gives

Code: Select all
ldd /lib64/libgdal.so.1
   linux-vdso.so.1 =>  (0x00007fff761f0000)
   libarmadillo.so.4 => /lib64/libarmadillo.so.4 (0x0000003325a00000)
   libpoppler.so.43 => /lib64/libpoppler.so.43 (0x0000003325000000)
   libfreexl.so.1 => /lib64/libfreexl.so.1 (0x0000003321a00000)
   libgeos_c.so.1 => /lib64/libgeos_c.so.1 (0x0000003323400000)
   libwebp.so.4 => /lib64/libwebp.so.4 (0x0000003f1c600000)
   libodbc.so.2 => /lib64/libodbc.so.2 (0x000000331de00000)
   libodbcinst.so.2 => /lib64/libodbcinst.so.2 (0x000000331da00000)
   libexpat.so.1 => /lib64/libexpat.so.1 (0x0000003ef6000000)
   libxerces-c-3.1.so => /lib64/libxerces-c-3.1.so (0x0000003322200000)
   libjasper.so.1 => /lib64/libjasper.so.1 (0x0000003efe000000)
   libnetcdf.so.7 => /lib64/libnetcdf.so.7 (0x000000331d200000)
   libhdf5.so.8 => /lib64/libhdf5.so.8 (0x000000331c600000)
   libgif.so.4 => /lib64/libgif.so.4 (0x0000003532600000)
   libjpeg.so.62 => /lib64/libjpeg.so.62 (0x0000003f06400000)
   libgeotiff.so.1.2 => /lib64/libgeotiff.so.1.2 (0x000000331c200000)
   libtiff.so.5 => /lib64/libtiff.so.5 (0x000000331ba00000)
   libgta.so.0 => /lib64/libgta.so.0 (0x0000003320400000)
   libpng16.so.16 => /lib64/libpng16.so.16 (0x0000003ef4c00000)
   libcfitsio.so.1 => /lib64/libcfitsio.so.1 (0x000000331f000000)
   libpq.so.5 => /lib64/libpq.so.5 (0x000000331f800000)
   liblzma.so.5 => /lib64/liblzma.so.5 (0x0000003ef1400000)
   librt.so.1 => /lib64/librt.so.1 (0x0000003ef1c00000)
   libdapclient.so.3 => /lib64/libdapclient.so.3 (0x000000331d600000)
   libdapserver.so.7 => /lib64/libdapserver.so.7 (0x0000003323000000)
   libdap.so.11 => /lib64/libdap.so.11 (0x000000331f400000)
   libspatialite.so.5 => /lib64/libspatialite.so.5 (0x0000003322800000)
   libpcre.so.1 => /lib64/libpcre.so.1 (0x0000003ef2000000)
   libcurl.so.4 => /lib64/libcurl.so.4 (0x000000352d400000)
   libCharLS.so.1 => /lib64/libCharLS.so.1 (0x0000003324c00000)
   libxml2.so.2 => /lib64/libxml2.so.2 (0x0000003702c00000)
   libmysqlclient.so.18 => /usr/lib64/mysql/libmysqlclient.so.18 (0x0000003320c00000)
   libpthread.so.0 => /lib64/libpthread.so.0 (0x0000003ef0400000)
   libz.so.1 => /lib64/libz.so.1 (0x0000003ef1000000)
   libssl.so.10 => /lib64/libssl.so.10 (0x0000003a69000000)
   libcrypto.so.10 => /lib64/libcrypto.so.10 (0x0000003a6d800000)
   libdl.so.2 => /lib64/libdl.so.2 (0x0000003ef0800000)
   libstdc++.so.6 => /lib64/libstdc++.so.6 (0x0000003ef5000000)
   libm.so.6 => /lib64/libm.so.6 (0x0000003ef0c00000)
   libc.so.6 => /lib64/libc.so.6 (0x0000003ef0000000)
   libgcc_s.so.1 => /lib64/libgcc_s.so.1 (0x0000003ef1800000)
   libblas.so.3 => /lib64/libblas.so.3 (0x0000003320000000)
   liblapack.so.3 => /usr/lib64/atlas/liblapack.so.3 (0x000000331e200000)
   libcblas.so.3 => /usr/lib64/atlas/libcblas.so.3 (0x000000331ec00000)
   libclapack.so.3 => /usr/lib64/atlas/libclapack.so.3 (0x0000003325600000)
   libarpack.so.2 => /lib64/libarpack.so.2 (0x000000331fc00000)
   /lib64/ld-linux-x86-64.so.2 (0x0000003eefc00000)
   liblcms2.so.2 => /lib64/liblcms2.so.2 (0x0000003f0c400000)
   libopenjpeg.so.1 => /lib64/libopenjpeg.so.1 (0x0000003703400000)
   libfontconfig.so.1 => /lib64/libfontconfig.so.1 (0x0000003ef7800000)
   libfreetype.so.6 => /lib64/libfreetype.so.6 (0x0000003ef5800000)
   libgeos-3.4.2.so => /lib64/libgeos-3.4.2.so (0x0000003324800000)
   libltdl.so.7 => /lib64/libltdl.so.7 (0x0000003f0b000000)
   libnsl.so.1 => /lib64/libnsl.so.1 (0x0000003f12a00000)
   libhdf5_hl.so.8 => /lib64/libhdf5_hl.so.8 (0x000000331ce00000)
   libSM.so.6 => /lib64/libSM.so.6 (0x000000352c000000)
   libICE.so.6 => /lib64/libICE.so.6 (0x0000003f09800000)
   libX11.so.6 => /lib64/libX11.so.6 (0x0000003ef4800000)
   libproj.so.0 => /lib64/libproj.so.0 (0x0000003a6d400000)
   libjbig.so.2.0 => /lib64/libjbig.so.2.0 (0x000000331be00000)
   libbz2.so.1 => /lib64/libbz2.so.1 (0x0000003f09400000)
   libkrb5.so.3 => /lib64/libkrb5.so.3 (0x0000003f03000000)
   libcom_err.so.2 => /lib64/libcom_err.so.2 (0x0000003efc800000)
   libgssapi_krb5.so.2 => /lib64/libgssapi_krb5.so.2 (0x0000003f02000000)
   libldap_r-2.4.so.2 => /lib64/libldap_r-2.4.so.2 (0x0000003320800000)
   libuuid.so.1 => /usr/lib64/libuuid.so.1 (0x0000003528400000)
   libsqlite3.so.0 => /lib64/libsqlite3.so.0 (0x000000352c400000)
   libidn.so.11 => /lib64/libidn.so.11 (0x0000003f0ec00000)
   libssh2.so.1 => /lib64/libssh2.so.1 (0x00000037c0800000)
   libssl3.so => /lib64/libssl3.so (0x0000003705400000)
   libsmime3.so => /lib64/libsmime3.so (0x0000003705c00000)
   libnss3.so => /lib64/libnss3.so (0x0000003704c00000)
   libnssutil3.so => /lib64/libnssutil3.so (0x0000003704800000)
   libplds4.so => /lib64/libplds4.so (0x0000003f05800000)
   libplc4.so => /lib64/libplc4.so (0x0000003f07800000)
   libnspr4.so => /lib64/libnspr4.so (0x0000003f05c00000)
   libk5crypto.so.3 => /lib64/libk5crypto.so.3 (0x0000003f01c00000)
   liblber-2.4.so.2 => /lib64/liblber-2.4.so.2 (0x0000003f13e00000)
   libldap-2.4.so.2 => /lib64/libldap-2.4.so.2 (0x0000003708800000)
   libgfortran.so.3 => /lib64/libgfortran.so.3 (0x0000003ef3400000)
   libf77blas.so.3 => /usr/lib64/atlas/libf77blas.so.3 (0x0000003321e00000)
   libatlas.so.3 => /usr/lib64/atlas/libatlas.so.3 (0x0000003321200000)
   libquadmath.so.0 => /lib64/libquadmath.so.0 (0x0000003ef3000000)
   libxcb.so.1 => /lib64/libxcb.so.1 (0x0000003ef4400000)
   libkrb5support.so.0 => /lib64/libkrb5support.so.0 (0x0000003f02400000)
   libkeyutils.so.1 => /lib64/libkeyutils.so.1 (0x0000003efd400000)
   libresolv.so.2 => /lib64/libresolv.so.2 (0x0000003ef2c00000)
   libsasl2.so.3 => /lib64/libsasl2.so.3 (0x0000003707400000)
   libXau.so.6 => /lib64/libXau.so.6 (0x0000003ef4000000)
   libselinux.so.1 => /lib64/libselinux.so.1 (0x0000003ef2400000)
   libcrypt.so.1 => /lib64/libcrypt.so.1 (0x0000003705800000)
   libfreebl3.so => /lib64/libfreebl3.so (0x0000003705000000)


To me it seems more or less normal. Only standard preinstalled libraries in list. It shoud work, but it wont. So, at two distros, with different jumps around, similar result - fail. I wll try last attempt, with gdal compiling from source, if that one would not work then it's up to someone else to try it. One weekend is more than enough to spare at things as that. And, anyway, that way would be more or less ok with testing, but could not work with release. People just could not make it.

Ok, at Ubuntu is exactly same mistake with VSIFree, but at manually installed /opt/FlightGear/gdal/lib/libgdal.so.1 . Gdal version is 1.11. I did maually checked all ldd results - all are existed.

I made my best - "-gdal" addition to CMAKE_EXE_LINKER_FLAGS, and even adding all its dependencies declared by CONFIG_DEP_LIBS at its config, does not change a thing. Last option is to add by -L and -I any library and include paths presented, but I doubt it could help. Broken task.

So, as already two haven't it continuosly, in three or four differet vatiants, I gotta admit that we actually don't have it. If any we is existed at all there.

What I find pointing is that errors is different with different gdal vesrions compiled at same environment.

You know, "something works for someone" is temporary state. Finally it turns out working for everybody, anybody, - ones You do not like too - or not working at all. And it's question of choice actually.

Ok, made it. Only solution that worked, main part of it, is manual adding of /opt/FlightGear/gdal/lib/libgdal.so or so, direct link to libgdal.so , into ..flightgear/src/Main/CMakeFiles/fgfs.dir/link.txt and ..flightgear/src/Main/CMakeFiles/fgfs.dir/relink.txt , prior any libosgearth lines, after cmake and prior make.

And other nasty hack is adding of things as '-L/opt/FgOsgEarth/OpenSceneGraph/lib64 -L/opt/FgOsgEarth/OsgEarth/lib64 -L/opt/FgOsgEarth/simgear/lib -L/opt/FgOsgEarth/plib/lib -L/usr/lib -L/lib64 -L/usr/lib/x86_64-linux-gnu -L/lib/x86_64-linux-gnu/' in flags.make file there, ignoring "DO NOT EDIT!" demands. Honey, if You want someone follow Your rules, make it way making following it resultative - if You could, in which I doubt really.

That only one way which worked - that .. thing seems to ignore any flags and variables, and even in cmake files itself. Could recheck it at Fedora later bit..yeah, same .. . Only that one in addition needs in adding of things as '-Wl,-rpath,/opt/FgOsgEarth/OpenSceneGraph/lib64:/opt/FgOsgEarth/OsgEarth/lib64' in some relink.txt files.

It's kinda as make present to someone, put in some box, closed on lock, without keys presenting. Wonder if Your life give to You presents that way - You should learned it somewhere previously.

Heh, wonder if changing my messages could solve any problem.
Last edited by Johan G on Mon Dec 22, 2014 6:56 pm, edited 1 time in total.
Reason: [code] tags instead of [quote] tags. The [code] tags can be added with the [>_ ] button. (Not too obvoius, I know.)
Waste of time: too unprofitable for work, too exhausting for hobby.
User avatar
vitos
 
Posts: 615
Joined: Sun Jan 25, 2009 8:10 pm
Location: Moscow, Russia
Callsign: vitos
IRC name: vitos
Version: 3.4
OS: Debian

Re: Initial FlightGear / OsgEarth integration

Postby vitos » Wed Dec 24, 2014 1:54 am

So, Ok, I made it. There is proofs:

Code: Select all
http://users.flightgear.ru/vitos/FgOsgEarth/fgfs-screen-001.png


Image

I do not know, is this it? Heights looks more or less correct, phototextures seems to not work at Russian area. At KEDW it hangs by some error, at KSFO because of lags. In comparison with previous version, fps is lower two times or more, so I can fly at goodol MiG only. I hoped that integration would use some other engine, so would work faster, which I need with more detailed models, but seems to be that is other way. So, good luck with it.

Things what I did to make it work at Fedora:

Code: Select all
How to compile FG with OsgEarth integration at Fedora

Without compiling gdal from source

Compiling with plib, osg, ddal compiling from source

1) Check that flightgear, simgear, openscenegraph, and plib is not os installed, remove it if so

2) Create directory ~/Src/FgOsgEarth/

cd ~/Src/FgOsgEarth/

3) Download latest stable osg from http://www.openscenegraph.org/index.php/download-section/stable-releases

upack it there and cd into it

combine next to one string by spaces prior copypaste

cmake -D CMAKE_BUILD_TYPE="Release"
-D CMAKE_CXX_FLAGS="-O2 -march=native -mtune=native"
-D CMAKE_C_FLAGS="-O2 -march=native -mtune=native"
-D CMAKE_INSTALL_PREFIX:PATH='/opt/FgOsgEarth/OpenSceneGraph'
.

On error here and on other cmakes find and install everything asked by  'yum search' and 'yum install'

make

or, better

make -j2

for two cores processor, 2 is cores number

sudo make install

4) install gdal and everything related by 'yum search' and 'yum install'

5) git clone -v -b OsgEarthNext https://github.com/poweroftwo/osgearth.git osgearth

cd osgearth

export LD_LIBRARY_PATH=/opt/FgOsgEarth/OpenSceneGraph/lib64

other way osg won't see own version by own binary using

combine next to one string prior copypaste

cmake CMAKE_BUILD_TYPE="Release"
-D CMAKE_CXX_FLAGS="-O2 -march=native -mtune=native -I /opt/FgOsgEarth/OpenSceneGraph/include -L /opt/FgOsgEarth/OpenSceneGraph/lib64"
-D CMAKE_C_FLAGS="-O2 -march=native -mtune=native -I /opt/FgOsgEarth/OpenSceneGraph/include -L /opt/FgOsgEarth/OpenSceneGraph/lib64"
-D CMAKE_INSTALL_PREFIX:STRING="/opt/FgOsgEarth/OsgEarth"
-D CMAKE_PREFIX_PATH="/opt/FgOsgEarth/OpenSceneGraph"
-D CMAKE_INCLUDE_PATH="/opt/FgOsgEarth/OpenSceneGraph/include"
-D CMAKE_LIBRARY_PATH="/opt/FgOsgEarth/OpenSceneGraph/lib64"
.

make -j2

sudo make install

6) cd ..

git clone -v -b OsgEarthNext git://gitorious.org/fg/simgear-osgearth.git simgear

cd simgear

combine next to one string prior copypaste

cmake CMAKE_BUILD_TYPE="Release"
-D CMAKE_CXX_FLAGS="-O2 -march=native -mtune=native -I /opt/FgOsgEarth/OpenSceneGraph/include -L /opt/FgOsgEarth/OpenSceneGraph/lib64 -I /opt/FgOsgEarth/OsgEarth/include -L /opt/FgOsgEarth/OsgEarth/lib64"
-D CMAKE_C_FLAGS="-O2 -march=native -mtune=native -I /opt/FgOsgEarth/OpenSceneGraph/include -L /opt/FgOsgEarth/OpenSceneGraph/lib64 -I /opt/FgOsgEarth/osgEarth/include -L /opt/FgOsgEarth/OsgEarth/lib64"
-D CMAKE_INSTALL_PREFIX:STRING="/opt/FgOsgEarth/simgear"
-D CMAKE_PREFIX_PATH="/opt/FgOsgEarth/OpenSceneGraph;/opt/FgOsgEarth/OsgEarth"
-D CMAKE_INCLUDE_PATH="/opt/FgOsgEarth/OpenSceneGraph/include;/opt/FgOsgEarth/OsgEarth/include"
-D CMAKE_LIBRARY_PATH="/opt/FgOsgEarth/OpenSceneGraph/lib64;/opt/FgOsgEarth/OsgEarth/lib64"
--with-jpeg-factory
.

make -j2

sudo make install

7) cd ..

svn co https://plib.svn.sourceforge.net/svnroot/plib/trunk plib
cd plib
sed s/PLIB_TINY_VERSION\ \ 5/PLIB_TINY_VERSION\ \ 6/ -i src/util/ul.h

combine next to one string prior copypaste

./autogen.sh

./configure --prefix='/opt/FgOsgEarth/plib'
--exec-prefix='/opt/FgOsgEarth/plib'
CFLAGS="-O2 -march=native -mtune=native"
CXXLAGS="-O2 -march=native -mtune=native"

make

sudo make install

8) cd ..

git clone -v -b OsgEarthNext git://gitorious.org/fg/flightgear-osgearth.git flightgear

cd flightgear

cmake -D CMAKE_BUILD_TYPE="Release"
-D CMAKE_INSTALL_PREFIX:STRING="/opt/FgOsgEarth/flightgear"
-D CMAKE_PREFIX_PATH:STRING="/opt/FgOsgEarth/OpenSceneGraph;/opt/FgOsgEarth/OpenSceneGraph/bin;/opt/FgOsgEarth/OpenSceneGraph/include;/opt/FgOsgEarth/OpenSceneGraph/lib64;/opt/FgOsgEarth/OsgEarth;/opt/FgOsgEarth/OsgEarth/include;/opt/FgOsgEarths/OsgEarth/lib64;/opt/FgOsgEarth/simgear;/opt/FgOsgEarth/simgear/include;/opt/FgOsgEarth/simgear/lib;/opt/FgOsgEarth/plib;/opt/FgOsgEarth/plib/include;/opt/FgOsgEarth/plib/lib "
-D CMAKE_INCLUDE_PATH:STRING="/opt/FgOsgEarth/OpenSceneGraph/include;/opt/FgOsgEarth/OsgEarth/include;/opt/FgOsgEarth/simgear/include;/opt/FgOsgEarth/plib/include;/usr/include;/usr/include/x86_64-linux-gnu"
-D CMAKE_LIBRARY_PATH:STRING="/opt/FgOsgEarth/OpenSceneGraph/lib64;/opt/FgOsgEarth/OsgEarth/lib64;/opt/FgOsgEarth/simgear/lib;/opt/FgOsgEarth/plib/lib;/usr/lib;/lib64;/usr/lib/x86_64-linux-gnu;/lib/x86_64-linux-gnu/"
-D CMAKE_CXX_FLAGS=
"
-O2 -march=native -mtune=native
-I/opt/FgOsgEarth/OpenSceneGraph/include
-I/opt/FgOsgEarth/OsgEarth/include
-I/opt/FgOsgEarth/simgear/include
-I/opt/FgOsgEarth/plib/include
-I/usr/include
-I/usr/include/x86_64-linux-gnu
-L/opt/FgOsgEarth/OpenSceneGraph/lib64
-L/opt/FgOsgEarth/OsgEarth/lib64
-L/opt/FgOsgEarth/simgear/lib
-L/opt/FgOsgEarth/plib/lib
-L/usr/lib
-L/lib64
-L/usr/lib/x86_64-linux-gnu
-L/lib/x86_64-linux-gnu
-lgdal -losgEarthAnnotation -losgEarthUtil -losgEarth
-lgeos_c -lsqlite3 -lodbc -lodbcinst -lexpat -lxerces-c
-ljasper -lnetcdf -lhdf5 -lmfhdfalt
-ldfalt -lgif -ljpeg -ltiff -lpng -lpq -lz
-lpthread -lm -lrt -ldl  -lpcre -lcurl -lxml2
"
-D CMAKE_C_FLAGS=
"
-O2 -march=native -mtune=native
-I/opt/FgOsgEarth/OpenSceneGraph/include
-I/opt/FgOsgEarth/OsgEarth/include
-I/opt/FgOsgEarth/simgear/include
-I/opt/FgOsgEarth/plib/include
-I/usr/include
-I/usr/include/x86_64-linux-gnu
-L/opt/FgOsgEarth/OpenSceneGraph/lib64
-L/opt/FgOsgEarth/OsgEarth/lib64
-L/opt/FgOsgEarth/simgear/lib
-L/opt/FgOsgEarth/plib/lib
-L/usr/lib
-L/lib64
-L/usr/lib/x86_64-linux-gnu
-L/lib/x86_64-linux-gnu/
-lgdal -losgEarthAnnotation -losgEarthUtil -losgEarth
-lgeos_c -lsqlite3 -lodbc -lodbcinst -lexpat -lxerces-c
-ljasper -lnetcdf -lhdf5 -lmfhdfalt
-ldfalt -lgif -ljpeg -ltiff -lpng -lpq -lz
-lpthread -lm -lrt -ldl  -lpcre -lcurl -lxml2
"
-D CMAKE_EXE_LINKER_FLAGS=
"
-O2 -march=native -mtune=native
-I/opt/FgOsgEarth/OpenSceneGraph/include
-I/opt/FgOsgEarth/OsgEarth/include
-I/opt/FgOsgEarth/simgear/include
-I/opt/FgOsgEarth/plib/include
-I/usr/include
-I/usr/include/x86_64-linux-gnu
-L/opt/FgOsgEarth/OpenSceneGraph/lib64
-L/opt/FgOsgEarth/OsgEarth/lib64
-L/opt/FgOsgEarth/simgear/lib
-L/opt/FgOsgEarth/plib/lib
-L/usr/lib
-L/lib64
-L/usr/lib/x86_64-linux-gnu
-L/lib/x86_64-linux-gnu/
-lgdal -losgEarthAnnotation -losgEarthUtil -losgEarth
-lgeos_c -lsqlite3 -lodbc -lodbcinst -lexpat -lxerces-c
-ljasper -lnetcdf -lhdf5 -lmfhdfalt
-ldfalt -lgif -ljpeg -ltiff -lpng -lpq -lz
-lpthread -lm -lrt -ldl  -lpcre -lcurl -lxml2
"
--enable-osgviewer
.

then add /lib64/libgdal.so prior any libosgEarth at

~/Src/FgOsgEarth/flightgear/src/Main/CMakeFiles/fgfs.dir/link.txt and

~/Src/FgOsgEarth/flightgear/src/Main/CMakeFiles/fgfs.dir/relink.txt

and add

-L/opt/FgOsgEarth/OpenSceneGraph/lib64 -L/opt/FgOsgEarth/OsgEarth/lib64 -L/opt/FgOsgEarth/simgear/lib -L/opt/FgOsgEarth/plib/lib -L/usr/lib -L/lib64 -L/usr/lib/x86_64-linux-gnu -L/lib/x86_64-linux-gnu/

in both variables at

~/Src/FgOsgEarth/flightgear/src/Main/CMakeFiles/fgfs.dir/flags.make

make -j2

sudo make install

add

-Wl,-rpath,/opt/FgOsgEarth/OpenSceneGraph/lib64:/opt/FgOsgEarth/OsgEarth/lib64

in relink.txt files on demands, and then

sudo make install

again

9) cd ..

git clone -v -b OsgEarthNext git://gitorious.org/fg/fgdata-osgearth.git fgdata

10) sudo gedit /opt/FgOsgEarth/flightgear/bin/fgfs.sh

export LD_LIBRARY_PATH=/opt/FgOsgEarth/OpenSceneGraph/lib64:$LD_LIBRARY_PATH
/opt/FgOsgEarth/flightgear/bin/fgfs $*

give to it right to run and run it, point -fg-data to right path

fgfs.sh --fg-root=~/Src/FgOsgEarth/fgdata


At Ubuntu it comparaively same. So, good day to You.
Last edited by vitos on Wed Dec 24, 2014 10:04 am, edited 1 time in total.
Waste of time: too unprofitable for work, too exhausting for hobby.
User avatar
vitos
 
Posts: 615
Joined: Sun Jan 25, 2009 8:10 pm
Location: Moscow, Russia
Callsign: vitos
IRC name: vitos
Version: 3.4
OS: Debian

Re: Initial FlightGear / OsgEarth integration

Postby Hooray » Wed Dec 24, 2014 3:29 am

not to discourage you, and I am not sure either, but those screen shots don't like like FG/osgEarth the way I tested, and remember, it - for example.:

Subject: Initial FlightGear / OsgEarth integration
Hooray wrote:BTW: Just testing LOWI for the first time (without any scenery installed besides the default scenery!), so far it's been taking about 2 minutes and scenery is starting to look plausible now - there was noticeable lag during the first 45 seconds (some frames taking 1-2 seconds then), and after 3 minutes it's simply starting to look awesome - but frame rate is suddenly down to ~40 fps here and frame latency is also about 45ms now, but that's with advanced weather running ...

Image
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: 11375
Joined: Tue Mar 25, 2008 8:40 am

Re: Initial FlightGear / OsgEarth integration

Postby vitos » Wed Dec 24, 2014 9:03 am

Hooray wrote in Wed Dec 24, 2014 3:29 am:not to discourage you, and I am not sure either, but those screen shots don't like like FG/osgEarth the way I tested, and remember, it - for example.:


You can't, since I do know for sure what in my result my mistakes is abscented. Place on Your screenshot is something as LOWI. Here that place looks as that:

Image

And fps is not fifty, but five.

Processor is AMD Athlon(tm) 64 X2 Dual Core Processor 4000+ × 2
Videocard is GeForce GTS 450/PCIe/SSE2
Memory is 2.0 GiB

And something tells me that really common truth is what I have got - not Yours.

For comparison, same LOWI at FG=2.11 and much more detailed model:

Code: Select all
http://users.flightgear.ru/vitos/FgOsgEarth/fgfs-fps-comparison.png


Fps is 7..8, still two times greater. With MiG I have 15 there.

You could recheck it with rebuilding FG with that integration again, from sources shown at wiki. If You would get same as at Your screenshot again then it would mean that addition, or FG itself, is system depending too much and needs a lot of rethinking. If mine then it could mean that author of it broke it somehow with last additions. By the way, why You did not made other screenshot? As of me, I see not reason to do more than I done. I do not interested in how it works - I interested in it works.
Waste of time: too unprofitable for work, too exhausting for hobby.
User avatar
vitos
 
Posts: 615
Joined: Sun Jan 25, 2009 8:10 pm
Location: Moscow, Russia
Callsign: vitos
IRC name: vitos
Version: 3.4
OS: Debian

Re: Initial FlightGear / OsgEarth integration

Postby Thorsten » Wed Dec 24, 2014 10:53 am

Vitos, your screenshots show the graphics of the default rendering scheme - we have the dirty snow of the transition shader as well as the crop shader (and yeah, I've seen them a couple of times). So something has gone wrong, you're not seeing OSGEarth rendered.
Thorsten
 
Posts: 11191
Joined: Mon Nov 02, 2009 8:33 am

Re: Initial FlightGear / OsgEarth integration

Postby vitos » Wed Dec 24, 2014 10:56 am

Yeah, something went wrong, but it's not my problem. I just compiled it and started it - actually it took me four days, that not one would return. To figure it out is business of someone else - I have my own things to do.

Well, when I saw that OsgEarth flights at lightspeed, with perfect detail too, I had thoughts as "That's it, that thing would do at least for low orbit spaceflights". That's why I tested integration with it. But that integration is, heh, just "initital". And could left at that state forever by the way, since I do not see reaction of author of it.

At now OsgEarth in FG, You see, is just "useless quoting" really. Thoughtfully, maybe it's reason why original author left it - and why I, or someone else, did not try to made what he done? Figure out that.
Last edited by Gijs on Wed Dec 24, 2014 10:59 am, edited 1 time in total.
Reason: No useless quoting please
Waste of time: too unprofitable for work, too exhausting for hobby.
User avatar
vitos
 
Posts: 615
Joined: Sun Jan 25, 2009 8:10 pm
Location: Moscow, Russia
Callsign: vitos
IRC name: vitos
Version: 3.4
OS: Debian

Re: Initial FlightGear / OsgEarth integration

Postby poweroftwo » Wed Dec 24, 2014 4:08 pm

It appears that there is a bug in this branch's version of the rendering dialog UI that makes it difficult to enable osgEarth. I will investigate, but in the meantime you can force osgEarth to become enabled by manually setting the enabled property.

locate the autosave xml file and change the enabled flag:

<osgearth>
<enabled type="bool">true</enabled>
</osgearth>

or change directly from the property tree: /sim/osgearth/enabled
poweroftwo
 
Posts: 100
Joined: Tue Mar 05, 2013 3:35 am
Location: USA - Alabama

Re: Initial FlightGear / OsgEarth integration

Postby vitos » Wed Dec 24, 2014 6:43 pm

poweroftwo wrote in Wed Dec 24, 2014 4:08 pm:It appears that there is a bug in this branch's version of the rendering dialog UI that makes it difficult to enable osgEarth. I will investigate, but in the meantime you can force osgEarth to become enabled by manually setting the enabled property.


Well, saying softly, it's seems kinda strange that so many things prevents users from building it and run it. I could suppose underlying question presented, sort of "for whom and for what it made finally". Actually I am not that much interested - as Russians says, "time is for business, hour is for fun", while it's not about real spacefight - and already removed everything. I can rebuild it again, but if it really runs slower that original fg engine then I could not use it anyway.
Waste of time: too unprofitable for work, too exhausting for hobby.
User avatar
vitos
 
Posts: 615
Joined: Sun Jan 25, 2009 8:10 pm
Location: Moscow, Russia
Callsign: vitos
IRC name: vitos
Version: 3.4
OS: Debian

Re: Initial FlightGear / OsgEarth integration

Postby poweroftwo » Wed Dec 24, 2014 10:45 pm

updated the rendering dialog to fix the osgEarth enable behavior

change is committed to OsgEarthNext branch of fgdata here:
https://gitorious.org/fg/fgdata-osgearth.git

or available as a minimal set of fgdata here:
https://dl.dropboxusercontent.com/u/386 ... mindata.7z

Image
Last edited by poweroftwo on Thu Dec 25, 2014 4:44 am, edited 1 time in total.
poweroftwo
 
Posts: 100
Joined: Tue Mar 05, 2013 3:35 am
Location: USA - Alabama

Re: Initial FlightGear / OsgEarth integration

Postby Hooray » Wed Dec 24, 2014 11:00 pm

@vitos: I've updated and rebuild the FG/osgEarth branch and everything is still working properly here for me, so the problem seems to be on your end unless I am missing something - frankly, I am not overly motivated to help with troubleshooting this any further given how this debate has evolved despite contradicting feedback/suggestions and evidence having been posted meanwhile.

I'd say that someone able to build from source, with the corresponding downlink/bandwidth, should have no problems building/using FG/osgEarth.

And I also don't think it's fair to attribute your particular problems to the work done here, or poweroftwo as the developer.
Maybe the integration docs should be updated - but given the explanations you've provided on manual tinkering that didn't seem overly informed in my opinion, I am not too surprised seeing that things don't work quite as expected for you. Frankly, you've touched settings where I still fail to see how this is supposed to "help" you.

Personally, I am still seeing photo-scenery and much better performance than with the default pipeline here, without any effects/shaders etc being involved obviously.
And once things have been downloaded/cached once, FG keeps working even in offline mode here.
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: 11375
Joined: Tue Mar 25, 2008 8:40 am

Re: Initial FlightGear / OsgEarth integration

Postby vitos » Wed Dec 24, 2014 11:36 pm

Hooray wrote in Wed Dec 24, 2014 11:00 pm:@vitos


Boring. And seems You are ignored what original author did wrote.
Waste of time: too unprofitable for work, too exhausting for hobby.
User avatar
vitos
 
Posts: 615
Joined: Sun Jan 25, 2009 8:10 pm
Location: Moscow, Russia
Callsign: vitos
IRC name: vitos
Version: 3.4
OS: Debian

Re: Initial FlightGear / OsgEarth integration

Postby Hooray » Thu Dec 25, 2014 5:13 am

if you're referring to the UI issue, that is unrelated to any linking errors you may still be getting, and easy enough to work around - using the instructions poweroftwo has posted, even for someone completely unfamiliar with FlightGear, let alone accomplished aircraft developers like yourself. So I am not sure what you're hinting at ? Like I said, I might be missing something - but I am still able to use FG/osgEarth without seeing any of the issues that tyou're apparently facing - but like I stated previously, I don't use RedHat/Fedora, but ubuntu - so some of your issues could be distro specific - that I don't know, I haven't tested Fedora/RedHat support, and I also not going to either.

PS: Your response showed me -once again- that I should prefer spending my time elsewhere instead of trying to help you...unfortunately
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: 11375
Joined: Tue Mar 25, 2008 8:40 am

PreviousNext

Return to osgEarth

Who is online

Users browsing this forum: No registered users and 1 guest