Board index FlightGear Support Compiling

Cmake ignoring path to OSG

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

Cmake ignoring path to OSG

Postby bishb25 » Thu Dec 03, 2015 5:17 am

Hi all,
I'm trying to compile simgear from Git with OSG 3.4.0. I have multiple installations of OSG on my Kubuntu 14.04 system so I point cmake to the 3.4.0 installation using:
Code: Select all
cmake -DCMAKE_INSTALL_PREFIX=/home/benjamin -DCMAKE_PREFIX_PATH="/home/benjamin/flightgear/fgsrc/OSG_3.4.0_install/include;/home/benjamin/flightgear/fgsrc/OSG_3.4.0_install/lib64" -LA ../simgear

This code has worked with previous versions of simgear and flightgear (3.3 being the latest I've compiled), but Cmake is ignoring the PREFIX_PATH and going for the global installation of OSG from kubuntu's repositories.
OPENTHREADS_INCLUDE_DIR:PATH=/usr/include
OPENTHREADS_LIBRARY:FILEPATH=/usr/lib/libOpenThreads.so
OPENTHREADS_LIBRARY_DEBUG:FILEPATH=OPENTHREADS_LIBRARY_DEBUG-NOTFOUND
OSGDB_INCLUDE_DIR:PATH=/usr/include
OSGDB_LIBRARY:FILEPATH=/usr/lib/libosgDB.so
OSGDB_LIBRARY_DEBUG:FILEPATH=OSGDB_LIBRARY_DEBUG-NOTFOUND
OSGGA_INCLUDE_DIR:PATH=/usr/include
OSGGA_LIBRARY:FILEPATH=/usr/lib/libosgGA.so
OSGGA_LIBRARY_DEBUG:FILEPATH=OSGGA_LIBRARY_DEBUG-NOTFOUND
OSGPARTICLE_INCLUDE_DIR:PATH=/usr/include
OSGPARTICLE_LIBRARY:FILEPATH=/usr/lib/libosgParticle.so
OSGPARTICLE_LIBRARY_DEBUG:FILEPATH=OSGPARTICLE_LIBRARY_DEBUG-NOTFOUND
OSGSIM_INCLUDE_DIR:PATH=/usr/include
OSGSIM_LIBRARY:FILEPATH=/usr/lib/libosgSim.so
OSGSIM_LIBRARY_DEBUG:FILEPATH=OSGSIM_LIBRARY_DEBUG-NOTFOUND
OSGTEXT_INCLUDE_DIR:PATH=/usr/include
OSGTEXT_LIBRARY:FILEPATH=/usr/lib/libosgText.so
OSGTEXT_LIBRARY_DEBUG:FILEPATH=OSGTEXT_LIBRARY_DEBUG-NOTFOUND
OSGUTIL_INCLUDE_DIR:PATH=/usr/include
OSGUTIL_LIBRARY:FILEPATH=/usr/lib/libosgUtil.so
OSGUTIL_LIBRARY_DEBUG:FILEPATH=OSGUTIL_LIBRARY_DEBUG-NOTFOUND
OSGVIEWER_INCLUDE_DIR:PATH=/usr/include
OSGVIEWER_LIBRARY:FILEPATH=/usr/lib/libosgViewer.so
OSGVIEWER_LIBRARY_DEBUG:FILEPATH=OSGVIEWER_LIBRARY_DEBUG-NOTFOUND
OSG_INCLUDE_DIR:PATH=/usr/include
OSG_LIBRARY:FILEPATH=/usr/lib/libosg.so
OSG_LIBRARY_DEBUG:FILEPATH=OSG_LIBRARY_DEBUG-NOTFOUND

Can anyone help me point cmake to the desired OSG?
Thanks
CNCMAN
Callsign: cncman
"The only thing smart about me... I know where to find the answers." I think?
bishb25
 
Posts: 134
Joined: Wed Sep 09, 2009 4:11 pm
Location: 10mi southwest of KLBE
Callsign: cncman
Version: GIT
OS: Linux

Re: Cmake ignoring path to OSG

Postby Thorsten » Thu Dec 03, 2015 6:49 am

Didn't work for me either - I had to remove the system-wide OSG coming with the distribution to point to the self-compiled one for FG after half a day of trying, asking for help and following more instructions.
Thorsten
 
Posts: 11900
Joined: Mon Nov 02, 2009 8:33 am

Re: Cmake ignoring path to OSG

Postby bugman » Thu Dec 03, 2015 7:47 am

I had the same issue and had to uninstall the OSG RPM packages. I don't know if it is a FlightGear cmake issue or a problem with OSG itself. If you can work out a way to support this, it might be quite useful to document it somewhere.

Regards,
Edward
bugman
Moderator
 
Posts: 1799
Joined: Thu Mar 19, 2015 9:01 am
Version: next

Re: Cmake ignoring path to OSG

Postby Hooray » Thu Dec 03, 2015 1:50 pm

if this no longer works, it would be good to file a proper bug report - people are specifically hoping to support mixing different dependencies, for the sake of troubleshooting: http://wiki.flightgear.org/Building_usi ... irectories

See Zakalawe's comments at: http://www.mail-archive.com/flightgear- ... 39400.html
this works fine for me, the different diet trees can have totally different
version / config options since there is no overlap at all.
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: Cmake ignoring path to OSG

Postby bugman » Thu Dec 03, 2015 1:56 pm

Hooray wrote in Thu Dec 03, 2015 1:50 pm:See Zakalawe's comments at: http://www.mail-archive.com/flightgear- ... 39400.html
this works fine for me, the different diet trees can have totally different
version / config options since there is no overlap at all.


Having different CMAKE_INSTALL_PREFIX works fine for me. The problem, which I've never seen working, is with multiple OSG prefixes. So I'm not sure if this is new, was never set up properly in the cmake config file, or if I didn't work out the correct config option required.

Regards,
Edward
bugman
Moderator
 
Posts: 1799
Joined: Thu Mar 19, 2015 9:01 am
Version: next

Re: Cmake ignoring path to OSG

Postby bishb25 » Thu Dec 03, 2015 5:34 pm

I have FG 3.2 installed from kubuntu repos (and why are they so far behind on all software? I mean, 3.4 has been released how long?) as a backup in case I happen to get a bad GIT pull one week or I need to test a bug against an official release. Having multiple versions of FG along side my distro package has never been a problem till now.
The flightgear wiki page http://wiki.flightgear.org/Building_using_CMake#Getting_started_with_CMake references an OSG_DIR cmake option, but that doesn't work either. Maybe an obsolete entry?
Callsign: cncman
"The only thing smart about me... I know where to find the answers." I think?
bishb25
 
Posts: 134
Joined: Wed Sep 09, 2009 4:11 pm
Location: 10mi southwest of KLBE
Callsign: cncman
Version: GIT
OS: Linux

Re: Cmake ignoring path to OSG

Postby bugman » Thu Dec 03, 2015 5:47 pm

OSG_DIR is only mentioned in the README.cmake file. So it is obviously waiting for a power-user to set up and contribute back to the project ;) Seriously though, it was probably a planned feature that was never implemented. It looks like the easiest would be to duplicate CMakeModules/FindPLIB.cmake to CMakeModules/FindOSG.cmake and convert all PLIBDIR to OSG_DIR, though looking at that file and the other CMake files, it might be quite a task :?

Regards,
Edward
bugman
Moderator
 
Posts: 1799
Joined: Thu Mar 19, 2015 9:01 am
Version: next

Re: Cmake ignoring path to OSG

Postby danielHL » Thu Dec 03, 2015 10:46 pm

In the past I had some problems that OSG newer than 3.2 wouldn't work at all. A different problem was that if I had system versions installed, the described parameters weren't enough to keep cmake from using these. I had to add "-D CMAKE_PREFIX_PATH="$FG_INSTALL_DIR"

see here...

CU
Daniel
danielHL / D-FMPW
danielHL
 
Posts: 205
Joined: Fri May 02, 2014 6:23 pm
Callsign: D-FMPW
Version: next
OS: Linux

Re: Cmake ignoring path to OSG

Postby bishb25 » Fri Dec 04, 2015 1:36 am

OK,
After uninstalling the repo version of OSG and libopentrhead (an act which also uninstalled the flightgear package), then rebooting my PC and preforming "make clean" in the build directory, Cmake was still pointing to the repo version of OSG even though it didn't exist. So I deleted my simgear build directory, created a new one, and started from scratch. Now Cmake is recognizing the PREFIX_PATH I set and building against the desired version of OSG. What I don't know is if this was the solution all along and if it would have worked with the repo version of OSG still installed. So, its working now!

I also wanted to say a GREAT BIG THANK YOU to everyone for their quick and helpful responses to my questions.
Callsign: cncman
"The only thing smart about me... I know where to find the answers." I think?
bishb25
 
Posts: 134
Joined: Wed Sep 09, 2009 4:11 pm
Location: 10mi southwest of KLBE
Callsign: cncman
Version: GIT
OS: Linux

Re: Cmake ignoring path to OSG

Postby Thorsten » Fri Dec 04, 2015 6:27 am

What I don't know is if this was the solution all along and if it would have worked with the repo version of OSG still installed.


In my case, it specifically started working after I had removed the system-wide OSG rpm package with the same cmake config that did not work before that removal. I'm making a guess that it would not have worked with OSG still installed.
Thorsten
 
Posts: 11900
Joined: Mon Nov 02, 2009 8:33 am

Re: Cmake ignoring path to OSG

Postby bugman » Fri Dec 04, 2015 8:03 am

Thorsten wrote in Fri Dec 04, 2015 6:27 am:
What I don't know is if this was the solution all along and if it would have worked with the repo version of OSG still installed.


In my case, it specifically started working after I had removed the system-wide OSG rpm package with the same cmake config that did not work before that removal. I'm making a guess that it would not have worked with OSG still installed.


Looking at the config files, the logic for selecting and switching between different OSG installations on the same system is just flat out missing. We just need someone with enough motivation to have multiple OSG installations to set up the FG build process for it. The only problem is that it's just far to easy to remove the OSG system packages.

Regards,
Edward
bugman
Moderator
 
Posts: 1799
Joined: Thu Mar 19, 2015 9:01 am
Version: next

Re: Cmake ignoring path to OSG

Postby Hooray » Fri Dec 04, 2015 10:15 am

As far as I remember, the whole thing works/worked implicitly via the CMAKE_INSTALL_PREFIX, as long as osg etc are installed there, that will be used to pick up dependencies - but like Thorsten mentioned, for that to work, you need to remove system-wide libs, or they take precedence.

Usually, I recommend to set up a dedicated fgfs user and set up everything in the $HOME directory, without any system-wide deps installed - in fact, you can then even use a different compiler.

For the sake of simplicity, another good idea may be to set up a docker image for the whole fg build environment, including possibly mxe support.
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: Cmake ignoring path to OSG

Postby wkitty42 » Fri Dec 04, 2015 4:51 pm

bugman wrote in Fri Dec 04, 2015 8:03 am:Looking at the config files, the logic for selecting and switching between different OSG installations on the same system is just flat out missing. We just need someone with enough motivation to have multiple OSG installations to set up the FG build process for it. The only problem is that it's just far to easy to remove the OSG system packages.

perhaps the download_and_compile.sh script in FGMeta can be looked into for this?? i use it on my system and i have both, the distribution OSG as well as the OSG repo... i can easily switch between them... the only problem switching back to the system's distribution OSG is that i have to delete or rename the one in the "install" directory so that the next build will not find and link to it...

to summarize:
1. using the repo OSG requires specifying OSG on the command line or in the $WHATTOBUILDALL variable...

2. using the system OSG requires that OSG be removed from the command line and/or $WHATTOBUILDALL variable as well as deleting or renaming the "install/openscenegraph" directory...
"You get more air close to the ground," said Angalo. "I read that in a book. You get lots of air low down, and not much when you go up."
"Why not?" said Gurder.
"Dunno. It's frightened of heights, I guess."
User avatar
wkitty42
 
Posts: 6966
Joined: Fri Feb 20, 2015 3:46 pm
Location: central NC, USA
Callsign: wk42
Version: git next
OS: Kubuntu 20.04

Re: Cmake ignoring path to OSG

Postby bishb25 » Fri Dec 04, 2015 5:36 pm

Before trying to compile the latest FG from GIT I had not used flight gear for quite a long time. The last version I compiled was 3.3.0 and I can say without a doubt that I had no problems compiling against different versions of OSG even with the repo version installed globally. I know this because I was trying to debug rendering and low FPS problems and tried 4 different release and development versions of OSG without issue at the time. Because I've been doing other things for this last few months I can't say when this new behavior started occurring.

Just a side note:
I had uninstalled the repo OSG to get SG to build, but when I tried to "make uninstall" FG 3.3.0 I had to reinstall OSG from the repo because I kept getting errors on the uninstall (make can't find OSG). When it came time to compile the latest FG I deleted the old build directory and created a new one like I did with SG, but I left the repo OSG installed and Cmake followed the PREFIX_PATH to my local install of OSG 3.4.0.
Callsign: cncman
"The only thing smart about me... I know where to find the answers." I think?
bishb25
 
Posts: 134
Joined: Wed Sep 09, 2009 4:11 pm
Location: 10mi southwest of KLBE
Callsign: cncman
Version: GIT
OS: Linux

Re: Cmake ignoring path to OSG

Postby wkitty42 » Fri Dec 04, 2015 5:43 pm

just to clarify, the download_and_compile.sh script installs all fgfs related stuff (pui, osg, openrti, simgear, flightgear, etc, etc, etc) locally in the user's directory... none of these are installed globally on the machine for others to use... it will make use of those installed globally if the local ones are not available... the only things that the dnc (for short) script installs globally on the machine are the distribution packages needed to build FGFS (build-essentials, Qt5 stuffs, cmake, etc)...
"You get more air close to the ground," said Angalo. "I read that in a book. You get lots of air low down, and not much when you go up."
"Why not?" said Gurder.
"Dunno. It's frightened of heights, I guess."
User avatar
wkitty42
 
Posts: 6966
Joined: Fri Feb 20, 2015 3:46 pm
Location: central NC, USA
Callsign: wk42
Version: git next
OS: Kubuntu 20.04

Next

Return to Compiling

Who is online

Users browsing this forum: No registered users and 1 guest