Board index FlightGear Support Compiling

Compiled changes don't take effect?  Topic is solved

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

Compiled changes don't take effect?

Postby Philosopher » Fri Feb 21, 2014 3:15 am

It's probably a simple mistake, but... when I make changes to a certain portion of the code (~cough~ fixing up a mistake I made in NasalSys.cxx...), they don't seem to take effect. Specifically it's findnode, which is called from both f_getprop() and f_setprop() every time. If I make a syntax error (or warning condition), it fails. But if I insert an unconditional SG_LOG/printf, recompile (via make && make install), and even rerun CMake - nothing happens differently when I run FG. I haven't deleted the build folder and recompiled fully, but it shouldn't matter - should it? So what'm I doing wrong?
Thanks,
Philosopher
(inactive but lurking occasionally...)
Philosopher
 
Posts: 1590
Joined: Sun Aug 12, 2012 6:29 pm
Location: Stuck in my head...
Callsign: AFTI
Version: Git
OS: Mac OS X 10.7.5

Re: Compiled changes don't take effect?

Postby Thorsten » Fri Feb 21, 2014 6:17 am

Typically when this happens to me, I run the wrong binary.
Thorsten
 
Posts: 10953
Joined: Mon Nov 02, 2009 8:33 am

Re: Compiled changes don't take effect?

Postby Hooray » Fri Feb 21, 2014 7:46 am

I would try to delete the library in $FG_BUILD/Scripting to ensure that it is rebuilt, and the fgfs binary in $FG_BUILD/Main to ensure that it is relinked - some compiler use fairly sophisticated caching schemes like "ccache" internally, which can sometimes be tricked into re-linking an older version of a library/object file - to see if that's the case here, you could delete all libs/object fiels in $FG_BUILD/Scripting (usually, in a hidden sub folder in *nix)
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: 11329
Joined: Tue Mar 25, 2008 8:40 am

Re: Compiled changes don't take effect?

Postby Philosopher » Fri Feb 21, 2014 10:54 pm

Hm, still no joy, this is a little suspicious:
Code: Select all
-- Install configuration: "Release"
-- Up-to-date: /Users/philosopher/local/bin/fgelev
-- Up-to-date: /Users/philosopher/local/bin/fgpanel
-- Up-to-date: /Users/philosopher/local/bin/fgviewer
-- Up-to-date: /Users/philosopher/local/bin/GPSsmooth
-- Up-to-date: /Users/philosopher/local/bin/MIDGsmooth
-- Up-to-date: /Users/philosopher/local/bin/UGsmooth
-- Up-to-date: /Users/philosopher/local/bin/terrasync
-- Up-to-date: /Users/philosopher/local/bin/fgcom
-- Up-to-date: /Users/philosopher/local/share/flightgear/positions.txt
-- Up-to-date: /Users/philosopher/local/share/flightgear/special_frequencies.txt
-- Up-to-date: /Users/philosopher/local/bin/fgjs
-- Up-to-date: /Users/philosopher/local/bin/js_demo
-- Up-to-date: /Users/philosopher/local/bin/yasim
-- Up-to-date: /Users/philosopher/local/bin/yasim-proptest
-- Installing: /Users/philosopher/local/./fgfs.app
-- Installing: /Users/philosopher/local/./fgfs.app/Contents
-- Up-to-date: /Users/philosopher/local/./fgfs.app/Contents/Info.plist
-- Installing: /Users/philosopher/local/./fgfs.app/Contents/MacOS
-- Up-to-date: /Users/philosopher/local/./fgfs.app/Contents/MacOS/fgfs
-- Up-to-date: /Users/philosopher/local/bin/metar
-- Up-to-date: /Users/philosopher/local/share/man/man1/fgfs.1
-- Up-to-date: /Users/philosopher/local/share/man/man1/fgpanel.1
-- Up-to-date: /Users/philosopher/local/share/man/man1/terrasync.1
-- Up-to-date: /Users/philosopher/local/share/man/man1/fgjs.1
-- Up-to-date: /Users/philosopher/local/share/man/man1/js_demo.1

Don't see a fgfs there?? Should I re-update my sources see if anything changed in next? I only have OSG 3.1.2 so that'll be some work,...
Thanks,
Philosopher
(inactive but lurking occasionally...)
Philosopher
 
Posts: 1590
Joined: Sun Aug 12, 2012 6:29 pm
Location: Stuck in my head...
Callsign: AFTI
Version: Git
OS: Mac OS X 10.7.5

Re: Compiled changes don't take effect?

Postby Hooray » Fri Feb 21, 2014 11:09 pm

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

Re: Compiled changes don't take effect?

Postby Philosopher » Fri Feb 21, 2014 11:18 pm

nada
Thanks,
Philosopher
(inactive but lurking occasionally...)
Philosopher
 
Posts: 1590
Joined: Sun Aug 12, 2012 6:29 pm
Location: Stuck in my head...
Callsign: AFTI
Version: Git
OS: Mac OS X 10.7.5

Use OSG 3.2.0

Postby Philosopher » Wed Feb 26, 2014 11:52 pm

I have been installing everything into ~/local. Just ran cmake (with -DCMAKE_INSTALL_PREFIX=~/local), make, make install, everything appeared to work. But SimGear still complains:
Code: Select all
CMake Error at /usr/local/Cellar/cmake/2.8.11.2/share/cmake/Modules/FindPackageHandleStandardArgs.cmake:108 (message):
  Could NOT find OpenSceneGraph: Found unsuitable version "3.1.2", but
  required is at least "3.2.0" (found
  /usr/local/lib/libosgText.dylib;/usr/local/lib/libosgSim.dylib;/usr/local/lib/libosgDB.dylib;/usr/local/lib/libosgParticle.dylib;/usr/local/lib/libosgGA.dylib;/usr/local/lib/libosgUtil.dylib;/usr/local/lib/libosg.dylib;/usr/local/lib/libOpenThreads.dylib)
Call Stack (most recent call first):
  /usr/local/Cellar/cmake/2.8.11.2/share/cmake/Modules/FindPackageHandleStandardArgs.cmake:313 (_FPHSA_FAILURE_MESSAGE)
  /usr/local/Cellar/cmake/2.8.11.2/share/cmake/Modules/FindOpenSceneGraph.cmake:187 (FIND_PACKAGE_HANDLE_STANDARD_ARGS)
  CMakeLists.txt:181 (find_package)

It looks like it's picking up /usr/local/ not ~/local. Installing OSG said that it now had them installed in ~/local, as requested, so they should exist. I think those other files are left over from a homebrew install I did (from the administrator side, so I can't uninstall it unless I ask...). How do I tell it not to look there? Would it be easier to remove it?

BTW: my $PATH has ~/local appropriately in it, but I don't think CMake uses that.
Thanks,
Philosopher
(inactive but lurking occasionally...)
Philosopher
 
Posts: 1590
Joined: Sun Aug 12, 2012 6:29 pm
Location: Stuck in my head...
Callsign: AFTI
Version: Git
OS: Mac OS X 10.7.5

Re: Compiled changes don't take effect?

Postby Hooray » Thu Feb 27, 2014 12:16 am

It's obviously picking up stuff from the system-wide installation.

yeah, it would be good to remove system-wide OSG stuff unless it is absolutely needed. But you should be able to able to override things locally, regarding ~/local I just ran into an issue where the shell would not expand things automatically, so that I had to specify the full absolute path instead, which ended up working - maybe worth trying, YMMV.

You could also try to be really explicit via: -DCMAKE_INSTALL_PREFIX:PATH=

that should even show up properly in the cmake gui

If that does not work, a quick workaround might be editing the offending toplevel CMakeLists.txt file and adding SET(CMAKE_INSTALL_PREFIX "/home/Philosopher/local" ) to see if that works at all (BEFORE project).

EDIT: According to google, cmake on Mac OSX may also require -DCMAKE_INSTALL_NAME_DIR:STRING to specified be for binaries

EDIT: You can also view /usr/local/Cellar/cmake/2.8.11.2/share/cmake/Modules/FindOpenSceneGraph.cmake to see which variables you can set to override things there, which should also work - something like OSG_DIR=....... https://github.com/rpavlik/cmake-module ... .cmake#L20
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: 11329
Joined: Tue Mar 25, 2008 8:40 am

Re: Compiled changes don't take effect?

Postby Philosopher » Thu Feb 27, 2014 12:41 am

Danke! Actually the file in Cellar (aka homebrew) was a little different, so this is what worked for me:
Code: Select all
-DOSG_INCLUDE_DIR=/Users/philosopher/local/include/

Now to build SimGear (=Nasal) again :D.
Thanks,
Philosopher
(inactive but lurking occasionally...)
Philosopher
 
Posts: 1590
Joined: Sun Aug 12, 2012 6:29 pm
Location: Stuck in my head...
Callsign: AFTI
Version: Git
OS: Mac OS X 10.7.5

Re: Compiled changes don't take effect?

Postby Hooray » Thu Feb 27, 2014 12:43 am

de nada, make sure that it's not just picking up headers from there, but also libs/plugins - if in doubt, I'd also declare the other variables.
As a sanity check, you may want to open the generated Makefile and see if there's any references to stuff outside your $HOME
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: 11329
Joined: Tue Mar 25, 2008 8:40 am

Re: Compiled changes don't take effect?

Postby Philosopher » Thu Feb 27, 2014 12:48 am

Wait, I think my file is the same as your link... dunno why -DOSG_ROOT didn't work... anyhow, Makefile looks okay. Now I need to do it for FG as well :).
Thanks,
Philosopher
(inactive but lurking occasionally...)
Philosopher
 
Posts: 1590
Joined: Sun Aug 12, 2012 6:29 pm
Location: Stuck in my head...
Callsign: AFTI
Version: Git
OS: Mac OS X 10.7.5

Re: Compiled changes don't take effect?

Postby Philosopher » Thu Feb 27, 2014 12:53 am

Oops, now we get (with FG):
Code: Select all
[  0%] Built target fgsqlite3
[ 12%] Built target iaxclient_lib
[ 12%] Built target fgelev
[ 13%] Built target fgpanel
Linking CXX executable fgviewer
Undefined symbols for architecture x86_64:
  "osgViewer::Viewer::checkEvents()", referenced from:
      vtable for fgviewer::Viewer in Viewer.cxx.o
      construction vtable for osgViewer::Viewer-in-fgviewer::Viewer in Viewer.cxx.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make[2]: *** [utils/fgviewer/fgviewer] Error 1
make[1]: *** [utils/fgviewer/CMakeFiles/fgviewer.dir/all] Error 2
make: *** [all] Error 2
Thanks,
Philosopher
(inactive but lurking occasionally...)
Philosopher
 
Posts: 1590
Joined: Sun Aug 12, 2012 6:29 pm
Location: Stuck in my head...
Callsign: AFTI
Version: Git
OS: Mac OS X 10.7.5

Re: Compiled changes don't take effect?

Postby Hooray » Thu Feb 27, 2014 12:56 am

I guess it's now trying to link in the files installed system-wide, better override those variables 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: 11329
Joined: Tue Mar 25, 2008 8:40 am

Re: Compiled changes don't take effect?

Postby Philosopher » Thu Feb 27, 2014 1:24 am

Umm... -DOSG_ROOT-/Users/philosopher/local works fine - I just deleted the build directories and did that again, which worked. Now, why isn't our INTROSPECTION_EXTENSIONS showing up... I'll see.

ego tibi gratias iterum do!
Thanks,
Philosopher
(inactive but lurking occasionally...)
Philosopher
 
Posts: 1590
Joined: Sun Aug 12, 2012 6:29 pm
Location: Stuck in my head...
Callsign: AFTI
Version: Git
OS: Mac OS X 10.7.5

Re: Compiled changes don't take effect?

Postby Hooray » Thu Feb 27, 2014 1:26 am

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

Next

Return to Compiling

Who is online

Users browsing this forum: No registered users and 4 guests