Board index FlightGear Support Compiling

Trouble building from Git with Superbuild

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

Trouble building from Git with Superbuild

Postby Raptor831 » Wed Dec 18, 2013 12:36 am

First off, this is probably user error and/or user ignorance. So I apologize if the answer is staring me in the face! :)

I'm attempting to build FG from source, so that I can make some additions to get this to work: http://forum.flightgear.org/viewtopic.php?f=18&t=21561 Hooray has been very helpful, and I'd like to contribute something useful if I can get this rolling. I'm running Mac OS X 10.9, FYI.

I've followed the Superbuild instructions on the wiki, and gotten to the point of running make to build the program(s). I'm hitting an error that I don't understand at all, this being my first shot at building something from source. Here's the error from the terminal:

Code: Select all
[ 28%] Performing build step for 'OpenRTI'
Scanning dependencies of target OpenRTI
[  1%] Building CXX object src/OpenRTI/CMakeFiles/OpenRTI.dir/AbstractMessage.cpp.o
[  2%] Building CXX object src/OpenRTI/CMakeFiles/OpenRTI.dir/AbstractMessageEncoding.cpp.o
[  2%] Building CXX object src/OpenRTI/CMakeFiles/OpenRTI.dir/AbstractMessageSender.cpp.o
[  3%] Building CXX object src/OpenRTI/CMakeFiles/OpenRTI.dir/AbstractProtocolLayer.cpp.o
[  4%] Building CXX object src/OpenRTI/CMakeFiles/OpenRTI.dir/AbstractProtocolSocket.cpp.o
[  4%] Building CXX object src/OpenRTI/CMakeFiles/OpenRTI.dir/AbstractServerNode.cpp.o
[  5%] Building CXX object src/OpenRTI/CMakeFiles/OpenRTI.dir/AbstractServer.cpp.o
[  6%] Building CXX object src/OpenRTI/CMakeFiles/OpenRTI.dir/AbstractSocketEvent.cpp.o
[  6%] Building CXX object src/OpenRTI/CMakeFiles/OpenRTI.dir/Attributes.cpp.o
[  7%] Building CXX object src/OpenRTI/CMakeFiles/OpenRTI.dir/InternalAmbassador.cpp.o
[  8%] Building CXX object src/OpenRTI/CMakeFiles/OpenRTI.dir/InternalTimeManagement.cpp.o
[  8%] Building CXX object src/OpenRTI/CMakeFiles/OpenRTI.dir/Federate.cpp.o
/fgfs/fgmetabuild/src/OpenRTI/src/OpenRTI/Federate.cpp:930:28: error: call to
      member function 'erase' is ambiguous
  _objectInstanceHandleMap.erase(i);
  ~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/c++/v1/map:934:14: note:
      candidate function
    iterator erase(const_iterator __p) {return __tree_.erase(__p.__i_);}
             ^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/c++/v1/map:936:15: note:
      candidate function
    size_type erase(const key_type& __k)
              ^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/c++/v1/map:939:15: note:
      candidate function not viable: requires 2 arguments, but 1 was provided
    iterator  erase(const_iterator __f, const_iterator __l)
              ^
In file included from /fgfs/fgmetabuild/src/OpenRTI/src/OpenRTI/Federate.cpp:20:
In file included from /fgfs/fgmetabuild/src/OpenRTI/src/OpenRTI/Federate.h:24:
In file included from /fgfs/fgmetabuild/src/OpenRTI/src/OpenRTI/HandleAllocator.h:25:
/fgfs/fgmetabuild/src/OpenRTI/src/OpenRTI/Handle.h:50:19: warning: comparison of
      0 <= unsigned expression is always true [-Wtautological-compare]
    _handle((S(0) <= handle && T(handle) < invalid()) ? T(handle) : invalid())
             ~~~~ ^  ~~~~~~
/fgfs/fgmetabuild/src/OpenRTI/src/OpenRTI/Handle.h:163:1: note: in instantiation
      of function template specialization 'OpenRTI::Handle<unsigned
      int>::Handle<unsigned long>' requested here
DECLARE_HANDLE_TYPE(AttributeHandle, uint32_t)
^
/fgfs/fgmetabuild/src/OpenRTI/src/OpenRTI/Handle.h:140:5: note: expanded from
      macro 'DECLARE_HANDLE_TYPE'
    Handle<Type>(handle)                                          \
    ^
/fgfs/fgmetabuild/src/OpenRTI/src/OpenRTI/Federate.cpp:403:59: note: in
      instantiation of function template specialization
      'OpenRTI::AttributeHandle::AttributeHandle<unsigned long>' requested here
    const Attribute* attribute = objectClass.getAttribute(k);
                                                          ^
1 warning and 1 error generated.
make[5]: *** [src/OpenRTI/CMakeFiles/OpenRTI.dir/Federate.cpp.o] Error 1
make[4]: *** [src/OpenRTI/CMakeFiles/OpenRTI.dir/all] Error 2
make[3]: *** [all] Error 2
make[2]: *** [src/OpenRTI-stamp/OpenRTI-build] Error 2
make[1]: *** [CMakeFiles/OpenRTI.dir/all] Error 2
make: *** [all] Error 2


Also, here's my cmake settings:
Image

This was a clean git clone from the fgmeta folder.

The Mac instructions are a bit thin, shall we say, so once I get this working I might have to leave a note or two on the wiki. :wink:

If anyone could kindly point me in the right direction, or let me know where to look, I'd be a very happy man!
Raptor831
 
Posts: 42
Joined: Fri Nov 15, 2013 8:51 pm
Location: Raleigh, NC, USA
Callsign: N-R831
Version: 2.12.1
OS: Mac OS X, Win XP

Re: Trouble building from Git with Superbuild

Postby Hooray » Wed Dec 18, 2013 6:32 am

This is not your fault, there's a problem with the openRTI dependency, which is not really needed here, but built by default - and it seems there's no way provided to disable this via -DENABLE_RTI - I think this is a Mac/XCode issue, Zakalawe (Mac core developer) mentioned repeatedly that some STL headers are included/available implicitly, so that may be causing this - because I'm not seeing this. This will probably be solved once someone on a Mac can take a look.

In the meantime, I suggest to disable this part by editing fgmeta, and removing the NOT in line 152 (CMakeLists.txt)
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: 11309
Joined: Tue Mar 25, 2008 8:40 am

Re: Trouble building from Git with Superbuild

Postby Raptor831 » Wed Dec 18, 2013 5:08 pm

That fix worked for me, but I hit another error I couldn't figure out.

Code: Select all
/fgfs/fgmeta/flightgear/src/FDM/JSBSim/models/FGPropagate.cpp:628:21: error:
      call to 'to_string' is ambiguous
  string sim_time = to_string((double)FDMExec->GetSimTime());
                    ^~~~~~~~~
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/c++/v1/string:4006:8: note:
      candidate function
string to_string(double __val);
       ^
/fgfs/fgmeta/flightgear/src/FDM/JSBSim/input_output/string_utilities.h:77:22: note:
      candidate function
  extern std::string to_string(double);
                     ^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/c++/v1/string:3999:8: note:
      candidate function
string to_string(int __val);
       ^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/c++/v1/string:4000:8: note:
      candidate function
string to_string(unsigned __val);
       ^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/c++/v1/string:4001:8: note:
      candidate function
string to_string(long __val);
       ^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/c++/v1/string:4002:8: note:
      candidate function
string to_string(unsigned long __val);
       ^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/c++/v1/string:4003:8: note:
      candidate function
string to_string(long long __val);
       ^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/c++/v1/string:4004:8: note:
      candidate function
string to_string(unsigned long long __val);
       ^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/c++/v1/string:4005:8: note:
      candidate function
string to_string(float __val);
       ^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/c++/v1/string:4007:8: note:
      candidate function
string to_string(long double __val);
       ^
/fgfs/fgmeta/flightgear/src/FDM/JSBSim/input_output/string_utilities.h:76:22: note:
      candidate function
  extern std::string to_string(int);
                     ^
/fgfs/fgmeta/flightgear/src/FDM/JSBSim/input_output/string_utilities.h:78:22: note:
      candidate function
  extern std::string to_string(float);
                     ^
/fgfs/fgmeta/flightgear/src/FDM/JSBSim/models/FGPropagate.cpp:633:15: error:
      call to 'to_string' is ambiguous
  filename += to_string((double)FDMExec->GetSimTime())+".xml";
              ^~~~~~~~~
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/c++/v1/string:4006:8: note:
      candidate function
string to_string(double __val);
       ^
/fgfs/fgmeta/flightgear/src/FDM/JSBSim/input_output/string_utilities.h:77:22: note:
      candidate function
  extern std::string to_string(double);
                     ^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/c++/v1/string:3999:8: note:
      candidate function
string to_string(int __val);
       ^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/c++/v1/string:4000:8: note:
      candidate function
string to_string(unsigned __val);
       ^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/c++/v1/string:4001:8: note:
      candidate function
string to_string(long __val);
       ^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/c++/v1/string:4002:8: note:
      candidate function
string to_string(unsigned long __val);
       ^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/c++/v1/string:4003:8: note:
      candidate function
string to_string(long long __val);
       ^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/c++/v1/string:4004:8: note:
      candidate function
string to_string(unsigned long long __val);
       ^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/c++/v1/string:4005:8: note:
      candidate function
string to_string(float __val);
       ^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/c++/v1/string:4007:8: note:
      candidate function
string to_string(long double __val);
       ^
/fgfs/fgmeta/flightgear/src/FDM/JSBSim/input_output/string_utilities.h:76:22: note:
      candidate function
  extern std::string to_string(int);
                     ^
/fgfs/fgmeta/flightgear/src/FDM/JSBSim/input_output/string_utilities.h:78:22: note:
      candidate function
  extern std::string to_string(float);
                     ^
2 errors generated.
make[5]: *** [src/FDM/JSBSim/CMakeFiles/JSBSim.dir/models/FGPropagate.cpp.o] Error 1
make[4]: *** [src/FDM/JSBSim/CMakeFiles/JSBSim.dir/all] Error 2
make[3]: *** [all] Error 2
make[2]: *** [src/FlightGear-stamp/FlightGear-build] Error 2
make[1]: *** [CMakeFiles/FlightGear.dir/all] Error 2
make: *** [all] Error 2


Anything I can try for this one?
Raptor831
 
Posts: 42
Joined: Fri Nov 15, 2013 8:51 pm
Location: Raleigh, NC, USA
Callsign: N-R831
Version: 2.12.1
OS: Mac OS X, Win XP

Re: Trouble building from Git with Superbuild

Postby Hooray » Wed Dec 18, 2013 5:12 pm

what compiler are you using ? Is that clang ?
I think Zakalawe regularly removes such issues from the code.
In this case, the typecast should handle it, i.e.: to_string((double)FDMExec->GetSimTime());
For starters, try to re-order it like this: to_string( double(FDMExec->GetSimTime()) );

If that doesn't work, try this next:
to_string<double>( FDMExec->GetSimTime() );


You will need to open & edit: /src/FDM/JSBSim/models/FGPropagate.cpp:628

You could also check your compiler to make it a little more lax with regard to error checking, obviously the code works for many other people - so maybe XCode/clang is doing some very strict error-checking here ?

Maybe it's using the wrong C++ standard here ? If in doubt, just post a screen shot 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: 11309
Joined: Tue Mar 25, 2008 8:40 am

Re: Trouble building from Git with Superbuild

Postby Raptor831 » Wed Dec 18, 2013 9:46 pm

Well, owing to my n00b-ness, I really didn't know! :)

I can say that gcc is installed from xcodetools (I checked the version from the shell), and I'm fairly certain that it's compiling against clang 5.0.0. Xcode is trying to throw monkey wrenches into the process, I think, and the CMake GUI I have defaulted to the OSX 10.9 sdk that comes with Xcode 5. This makes me just want to run friggin' Linux. Then I could hack around usefully! :wink: I love Macs, but doing anything Apple doesn't want you to worry with is like walking through peanut butter. /rant

I did try the
Code: Select all
cmake -G Xcode
command to try and compile in Xcode itself in a few iterations. Didn't fly either, and the errors I got were not helpful in figuring a course of action. So, back to the Shell for me. If anyone knows of a way to change compiler settings, either in the makefiles or at the global level, please let me know. Usually I read up on documentation but I've been unable to find anything useful so far.

EDIT: Forgot to mention, I did try the other type-casts that you suggested, Hooray, but it looks like unless there's an alternate method/function to make that object a string, we're stuck.
Raptor831
 
Posts: 42
Joined: Fri Nov 15, 2013 8:51 pm
Location: Raleigh, NC, USA
Callsign: N-R831
Version: 2.12.1
OS: Mac OS X, Win XP

Re: Trouble building from Git with Superbuild

Postby Hooray » Thu Dec 19, 2013 7:14 am

I don't use XCode (or a Mac) but it seems that this is simply a compiler setting, I suppose you are running some wrong C++ mode, such as C++0x - but there are other Mac folks around here, who can probably help clarify the settings required in XCode - such as Zakalawe and Philosopher.

You shouldn't have to install Linux just for building FG :-)
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: 11309
Joined: Tue Mar 25, 2008 8:40 am

Re: Trouble building from Git with Superbuild

Postby Raptor831 » Fri Dec 20, 2013 11:05 pm

Ok, I *finally* got it to build. I had to change a few to_string() functions to std::to_string() functions and it compiled for me. My guess is that Mavericks is using new-fangled tech/versions of something, which is causing the "ambiguous" function. You'd think it'd default to the built in function. I was reading that the built-in to_string() is a newer C++ thing, so that may be the issue. But I don't honestly know.

But now I'm missing a library somewhere. :facepalm: Oy!

Ok, here's the error output I get if I run fgfs:

Code: Select all
/fgfs/fgbuild/install/bin/fgfs --fg-root=/Applications/FlightGear-2-12-1/FlightGear.app/Contents/Resources
dyld: Library not loaded: libosgText.100.dylib
  Referenced from: /fgfs/fgbuild/install/bin/fgfs
  Reason: image not found
Trace/BPT trap: 5


I'm going to imagine this is an OSG dependancy, but I have no idea what I missed. Any tips?
Raptor831
 
Posts: 42
Joined: Fri Nov 15, 2013 8:51 pm
Location: Raleigh, NC, USA
Callsign: N-R831
Version: 2.12.1
OS: Mac OS X, Win XP

Re: Trouble building from Git with Superbuild

Postby Hooray » Sat Dec 21, 2013 7:29 am

right, that's OSG - did you build OSG from source or not ?
FG depends on OSG, so it needs to find a matching OSG version
The place where you installed OSG to, needs to be either in your system-wide library path, or you need to explicitly load the libs via LD_LIBRARY_PATH/$DYLD_LIBRARY_PATH (on Mac)
The latter is a bit awkward (especially for people new to compiling), so it's easier to simply install OSG system-wide, and FG should be able to find everything it needs.
Otherwise, you can also change some cmake flags to compile the osg location into the fgfs executable -but first of all we would need to know where you installed FG
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: 11309
Joined: Tue Mar 25, 2008 8:40 am

Re: Trouble building from Git with Superbuild

Postby Raptor831 » Sat Dec 21, 2013 4:37 pm

Hooray wrote in Sat Dec 21, 2013 7:29 am:right, that's OSG - did you build OSG from source or not ?


I didn't build it separately, as I was under the assumption that the Superbuild did all of that for you. I know it build OSG items during the process. I'll look into it again and see what's up.

EDIT: Found a thread you responded to earlier about the OSG dependancy. http://forum.flightgear.org/viewtopic.php?f=45&t=21485 My issue is probably the same, so that thread helps! :)
Raptor831
 
Posts: 42
Joined: Fri Nov 15, 2013 8:51 pm
Location: Raleigh, NC, USA
Callsign: N-R831
Version: 2.12.1
OS: Mac OS X, Win XP

Re: Trouble building from Git with Superbuild

Postby Hooray » Sat Dec 21, 2013 6:29 pm

this is weird that so many people are affected by this - normally, the superbuild should set up the RPATH accordingly, if in doubt, just file a support request via the issue tracker
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: 11309
Joined: Tue Mar 25, 2008 8:40 am

Re: Trouble building from Git with Superbuild

Postby pommesschranke » Mon Jan 06, 2014 7:23 pm

I tried superbuild as an alternative to download_and_compile.sh
and get this error:
Code: Select all
CMake Error at /usr/share/cmake-2.8/Modules/ExternalProject.cmake:1123 (message):
  Could not extract tarball filename from url:

    http://www.openscenegraph.org/downloads/developer_releases/OpenSceneGraph-3.2.0.zip;URL_HASH;MD5=4980f8692712a24d4c99f363f80c6814
Call Stack (most recent call first):
  /usr/share/cmake-2.8/Modules/ExternalProject.cmake:1478 (_ep_add_download_command)
  CMakeLists.txt:132 (ExternalProject_Add)
pommesschranke
 
Posts: 1104
Joined: Sat Apr 27, 2013 7:58 pm
Location: EDLM & LJCE
Callsign: d-laser
IRC name: laserman
Version: git
OS: Linux Lubuntu 18.04

Re: Trouble building from Git with Superbuild

Postby poweroftwo » Mon Jan 06, 2014 7:37 pm

Under Windows, I had the same problem. Problem was resolved when I upgraded my CMake to latest stable.

jeff
Last edited by poweroftwo on Mon Jan 06, 2014 9:16 pm, edited 1 time in total.
poweroftwo
 
Posts: 100
Joined: Tue Mar 05, 2013 3:35 am
Location: USA - Alabama

Re: Trouble building from Git with Superbuild

Postby pommesschranke » Mon Jan 06, 2014 8:59 pm

thanks for the super-quick reply.
so I updated my cmake and continued on my quest...

Code: Select all
[ 51%] Performing after_install step for 'OSG'
[ 53%] Completed 'OSG'
[ 53%] Built target OSG
make: *** [all] Error 2


Error 2 ? serious ? ignore ?
I ignore, and start make again:
Code: Select all
Scanning dependencies of target fedtime1516e
[ 84%] Built target FedTime
[ 90%] Built target fedtime1516
[ 90%] Building CXX object src/rti1516e/CMakeFiles/fedtime1516e.dir/LogicalTimeFactoryFactory.cpp.o
make[5]: *** No rule to make target `/usr/lib/python3.2/config/libpython3.2.so', needed by `python/rti1516/_rti1516.so'.  Stop.
make[4]: *** [python/rti1516/CMakeFiles/_rti1516.dir/all] Error 2
make[4]: *** Waiting for unfinished jobs....
[ 91%] [ 91%] Built target concurrent-create-1516
Built target fddget-13
Linking CXX shared library libfedtime1516e.so
[ 91%] Built target fedtime1516e
make[3]: *** [all] Error 2
make[2]: *** [src/OpenRTI-stamp/OpenRTI-build] Error 2
make[1]: *** [CMakeFiles/OpenRTI.dir/all] Error 2
make: *** [all] Error 2


then I installed python3.2 but that did not help.
pommesschranke
 
Posts: 1104
Joined: Sat Apr 27, 2013 7:58 pm
Location: EDLM & LJCE
Callsign: d-laser
IRC name: laserman
Version: git
OS: Linux Lubuntu 18.04


Return to Compiling

Who is online

Users browsing this forum: No registered users and 2 guests