Board index FlightGear Support Compiling

flightgear compilation fails at 20% make process

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

flightgear compilation fails at 20% make process

Postby tckosvic » Wed Dec 23, 2020 9:08 pm

Coding errors at are beyond my C knowledge. Opensuse linux leap 15.2 all updates. See errors below. Stops at 20% of make.

Code: Select all
[ 20%] Building CXX object src/GUI/CMakeFiles/fgqmlui.dir/fgqmlui_autogen/mocs_compilation.cpp.o
In file included from /usr/local/include/simgear/props/PropertyBasedElement.hxx:23:0,
                 from /usr/local/include/simgear/props/PropertyBasedMgr.hxx:23,
                 from /usr/local/include/simgear/canvas/CanvasMgr.hxx:24,
                 from /home/tom/flightgear/src/Canvas/canvas_mgr.hxx:22,
                 from /home/tom/flightgear/src/GUI/QtQuickFGCanvasItem.hxx:28,
                 from /home/tom/fgbuild/src/GUI/fgqmlui_autogen/EWIEGA46WW/moc_QtQuickFGCanvasItem.cpp:9,
                 from /home/tom/fgbuild/src/GUI/fgqmlui_autogen/mocs_compilation.cpp:15:
/usr/local/include/simgear/std/type_traits.hxx:49:18: error: ‘remove_cv_t’ does not name a type; did you mean ‘remove_cv’?
     using type = remove_cv_t<remove_reference_t<T>>;
                  ^~~~~~~~~~~
                  remove_cv
In file included from /usr/local/include/simgear/props/PropertyBasedMgr.hxx:23:0,
                 from /usr/local/include/simgear/canvas/CanvasMgr.hxx:24,
                 from /home/tom/flightgear/src/Canvas/canvas_mgr.hxx:22,
                 from /home/tom/flightgear/src/GUI/QtQuickFGCanvasItem.hxx:28,
                 from /home/tom/fgbuild/src/GUI/fgqmlui_autogen/EWIEGA46WW/moc_QtQuickFGCanvasItem.cpp:9,
                 from /home/tom/fgbuild/src/GUI/fgqmlui_autogen/mocs_compilation.cpp:15:
/usr/local/include/simgear/props/PropertyBasedElement.hxx:124:12: error: ‘enable_if_t’ in namespace ‘std’ does not name a template type
       std::enable_if_t<!std::is_same<T, SGPropertyNode*>::value, T>
            ^~~~~~~~~~~
/usr/local/include/simgear/props/PropertyBasedElement.hxx:126:38: error: expected unqualified-id before ‘)’ token
                    const T& def = {} ) const
                                      ^
/usr/local/include/simgear/props/PropertyBasedElement.hxx:142:12: error: ‘enable_if_t’ in namespace ‘std’ does not name a template type
       std::enable_if_t<std::is_same<T, SGPropertyNode*>::value, T>
            ^~~~~~~~~~~
make[2]: *** [src/GUI/CMakeFiles/fgqmlui.dir/build.make:80: src/GUI/CMakeFiles/fgqmlui.dir/fgqmlui_autogen/mocs_compilation.cpp.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:2232: src/GUI/CMakeFiles/fgqmlui.dir/all] Error 2
make: *** [Makefile:180: all] Error 2


It looks like a code mod is needed. Suggestions????
thanks, tom kosvic
tckosvic
 
Posts: 16
Joined: Mon May 25, 2020 7:43 pm

Re: flightgear compilation fails at 20% make process

Postby xDraconian » Wed Dec 23, 2020 11:17 pm

@tckosvic,

remove_cv_t and enable_if_t were new features added to C++14. We require C++17 elsewhere within the code.
I assume you are using the GCC compiler, so ensure you are compiling with -std=c++17

You can add this option within CMake.
Code: Select all
CMAKE_CXX_FLAGS=-std=c++17


Scott
xDraconian
 
Posts: 406
Joined: Sun Jan 21, 2018 6:53 am
Version: Git
OS: Linux Mint

Re: flightgear compilation fails at 20% make process

Postby tckosvic » Thu Dec 24, 2020 4:17 pm

xDraconian,

thanks for looking at my problem and the response. I need clarification of 2 points.

1. I have gcc7-c++ compiler installed. Additionally in opensuse repos are gcc 8,9,and 10 C++ compilers. But there is nothing close to C++17. Do I need to install one of these upgraded gcc-c++ compilers or go look on the internet for a gcc+17 version. Please advise.

2. What file would I add the suggested "CMAKE_CXX_FLAGS=-std=c++17" line to. Or is it to be added to the cmake commandline command from the install file to be:
" cmake ../flightgear -DCMAKE_BUILD_TYPE=Release -CMAKE_CXX_FLAGS=-std=c++17 " Please advise.

thanks for assistance,
tom kosvic
tckosvic
 
Posts: 16
Joined: Mon May 25, 2020 7:43 pm

Re: flightgear compilation fails at 20% make process

Postby xDraconian » Thu Dec 24, 2020 5:27 pm

Hi Tom, @tckosvic,

Your gcc-7 compiler is fine, but by default it builds with an older c++ standard. Hence the need to specify you want to target c++17.

Yes, add it to the command line like you showed (or within cmake-gui). One correction, on the command line you need to prefix with -D, not just dash...
cmake ../flightgear -DCMAKE_BUILD_TYPE=Release -DCMAKE_CXX_FLAGS=-std=c++17

Best of luck getting the simulator compiled and running.

Merry Christmas.
Scott
xDraconian
 
Posts: 406
Joined: Sun Jan 21, 2018 6:53 am
Version: Git
OS: Linux Mint

Re: flightgear compilation fails at 20% make process

Postby tckosvic » Thu Dec 24, 2020 7:02 pm

Bad news, same errors at same location of make process. Ran cmake with commandline below:

cmake ../flightgear -DCMAKE_BUILD_TYPE=Release -DCMAKE_CXX_FLAGS=-std=c++17

Stopped @ 20% compilation with same errors as before. I could repost if needed.

Would putting CXX flags statement into a make file work differently? If so I need to know what make file. I am using latest code from github.
Perhaps the CXX flags statement also needs to be added to the "make" command

I'm attentive if there are any other suggestions.

Thanks, tom kosvic
tckosvic
 
Posts: 16
Joined: Mon May 25, 2020 7:43 pm

Re: flightgear compilation fails at 20% make process

Postby tckosvic » Thu Dec 24, 2020 8:21 pm

I am thinking that the calls in the make files might be overriding the added cxx_flag call on the commandline.
I would need pointers as to where to modify compile/make options if this is the case.

thanks, tom kosvic
tckosvic
 
Posts: 16
Joined: Mon May 25, 2020 7:43 pm

Re: flightgear compilation fails at 20% make process

Postby xDraconian » Thu Dec 24, 2020 9:10 pm

Tom,

Let us try a workaround...

Code: Select all
export CXXFLAGS="-std=c++17"
cmake ../flightgear -DCMAKE_BUILD_TYPE=Release -DCMAKE_CXX_FLAGS=-std=c++17
xDraconian
 
Posts: 406
Joined: Sun Jan 21, 2018 6:53 am
Version: Git
OS: Linux Mint

Re: flightgear compilation fails at 20% make process

Postby tckosvic » Thu Dec 24, 2020 11:05 pm

No cigar,
Adding the export command did not solve problem.
Same failure mode at same 20% of make.

In looking at the make files, I saw in the CMakeLists.txt file several references of CXX flags to -std=c++11. Perhaps if I change all of those to -std=c++17 that will get me past the problem.

I think I will try that. Worst is that I download and start over.

Have any opinion on that working?
tckosvic
 
Posts: 16
Joined: Mon May 25, 2020 7:43 pm

Re: flightgear compilation fails at 20% make process

Postby tckosvic » Thu Dec 24, 2020 11:19 pm

I substituted -std=c++17 for -std=c++11 in CMakeLists.txt file at two places, ran make clean, reran cmake with export command, and then reran make but I got the same errors again.

Unless you have some other ideas,

I am thinking of going back to an earlier version not from github but from the webpage. Like 2019.1.2 and giving that a whirl.
Don't want to mess up your christmas eve.

tom kosvic
tckosvic
 
Posts: 16
Joined: Mon May 25, 2020 7:43 pm

Re: flightgear compilation fails at 20% make process

Postby xDraconian » Fri Dec 25, 2020 12:38 am

If that did not work I was going to say that something is causing it to use a different standard. Which you verified by finding the c++11 references.

Change all c++11 occurrences to c++17.
xDraconian
 
Posts: 406
Joined: Sun Jan 21, 2018 6:53 am
Version: Git
OS: Linux Mint

Re: flightgear compilation fails at 20% make process

Postby tckosvic » Sat Dec 26, 2020 6:54 pm

Can't give up now. I got further.
1. found CMakeLists.txt for simgear had line: set(CMAKE_CXX_STANDARD 17). This compiled completely. But, found CMakeLists.txt for flightgear had line: set(CMAKE_CXX_STANDARD 11). I changed this line to also read
set(CMAKE_CXX_STANDARD 17).

2. CMake worked. But make only got up to 16%. I got error message regarding usleep function. I traced this on the internet to a needed "include <unistd.h>" in file /home/tom/flightgear/utils/fgpanel/FGPanelApplication.cxx. Due to error at line 300 in this file. Adding this include got past the usleep error.

3. At 21% (note it went past 20% this time), I got the error below:

Code: Select all
[ 21%] Building CXX object src/GUI/CMakeFiles/fglauncher.dir/QtLauncher.cxx.o
/home/tom/flightgear/src/GUI/QtLauncher.cxx: In function ‘void simgearMessageOutput(QtMsgType, const QMessageLogContext&, const QString&)’:
/home/tom/flightgear/src/GUI/QtLauncher.cxx:225:78: error: no matching function for call to ‘logstream::log(sgDebugClass, sgDebugPriority&, const char*&, const int&, std::__cxx11::string)’
     sglog().log(SG_GUI, mappedPriority, file, context.line, msg.toStdString());
                                                                              ^
In file included from /usr/local/include/simgear/props/props.hxx:34:0,
                 from /usr/local/include/simgear/props/props_io.hxx:16,
                 from /home/tom/flightgear/src/GUI/QtLauncher.cxx:51:
/usr/local/include/simgear/debug/logstream.hxx:112:10: note: candidate: void logstream::log(sgDebugClass, sgDebugPriority, const char*, int, const char*, const string&)
     void log( sgDebugClass c, sgDebugPriority p,
          ^~~
/usr/local/include/simgear/debug/logstream.hxx:112:10: note:   candidate expects 6 arguments, 5 provided
make[2]: *** [src/GUI/CMakeFiles/fglauncher.dir/build.make:249: src/GUI/CMakeFiles/fglauncher.dir/QtLauncher.cxx.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:2259: src/GUI/CMakeFiles/fglauncher.dir/all] Error 2
make: *** [Makefile:180: all] Error 2


Note from above it is looking for "std::__cxx11::string)’ " which mean cxx 11 is still in there somewhere.

Now I am stuck again. Need guidance.

thamks, tom kosvic
tckosvic
 
Posts: 16
Joined: Mon May 25, 2020 7:43 pm

Re: flightgear compilation fails at 20% make process

Postby xDraconian » Sat Dec 26, 2020 7:49 pm

Your making progress Tom!

Not sure what your goal is, but if it is to get up and running then there is an easier path... download the nighties from http://download.flightgear.org/builds/nightly/
There is even an AppImage to get you going quickly.

I'll also mention that many people compile via download_and_compile.sh

References:
http://wiki.flightgear.org/Building_FlightGear_-_Linux
http://wiki.flightgear.org/Scripted_Compilation_on_Linux_Debian/Ubuntu
xDraconian
 
Posts: 406
Joined: Sun Jan 21, 2018 6:53 am
Version: Git
OS: Linux Mint

Re: flightgear compilation fails at 20% make process

Postby xDraconian » Sat Dec 26, 2020 7:57 pm

tckosvic wrote in Sat Dec 26, 2020 6:54 pm:found CMakeLists.txt for flightgear had line: set(CMAKE_CXX_STANDARD 11)
candidate expects 6 arguments, 5 provided

Appears your SimGear and FlightGear sources are not aligned. i.e. Your SimGear sources are newer than your FlightGear sources.

How did you obtain the source code?
Assuming you want the latest code you should use these...
Code: Select all
git clone https://git.code.sf.net/p/flightgear/simgear
git clone https://git.code.sf.net/p/flightgear/flightgear
xDraconian
 
Posts: 406
Joined: Sun Jan 21, 2018 6:53 am
Version: Git
OS: Linux Mint

Re: flightgear compilation fails at 20% make process

Postby cgdae » Sat Dec 26, 2020 8:08 pm

tckosvic wrote in Sat Dec 26, 2020 6:54 pm:Can't give up now. I got further.
1. found CMakeLists.txt for simgear had line: set(CMAKE_CXX_STANDARD 17). This compiled completely. But, found CMakeLists.txt for flightgear had line: set(CMAKE_CXX_STANDARD 11). I changed this line to also read
set(CMAKE_CXX_STANDARD 17).

2. CMake worked. But make only got up to 16%. I got error message regarding usleep function. I traced this on the internet to a needed "include <unistd.h>" in file /home/tom/flightgear/utils/fgpanel/FGPanelApplication.cxx. Due to error at line 300 in this file. Adding this include got past the usleep error.

3. At 21% (note it went past 20% this time), I got the error below:

Code: Select all
[ 21%] Building CXX object src/GUI/CMakeFiles/fglauncher.dir/QtLauncher.cxx.o
/home/tom/flightgear/src/GUI/QtLauncher.cxx: In function ‘void simgearMessageOutput(QtMsgType, const QMessageLogContext&, const QString&)’:
/home/tom/flightgear/src/GUI/QtLauncher.cxx:225:78: error: no matching function for call to ‘logstream::log(sgDebugClass, sgDebugPriority&, const char*&, const int&, std::__cxx11::string)’
     sglog().log(SG_GUI, mappedPriority, file, context.line, msg.toStdString());
                                                                              ^
In file included from /usr/local/include/simgear/props/props.hxx:34:0,
                 from /usr/local/include/simgear/props/props_io.hxx:16,
                 from /home/tom/flightgear/src/GUI/QtLauncher.cxx:51:
/usr/local/include/simgear/debug/logstream.hxx:112:10: note: candidate: void logstream::log(sgDebugClass, sgDebugPriority, const char*, int, const char*, const string&)
     void log( sgDebugClass c, sgDebugPriority p,
          ^~~
/usr/local/include/simgear/debug/logstream.hxx:112:10: note:   candidate expects 6 arguments, 5 provided
make[2]: *** [src/GUI/CMakeFiles/fglauncher.dir/build.make:249: src/GUI/CMakeFiles/fglauncher.dir/QtLauncher.cxx.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:2259: src/GUI/CMakeFiles/fglauncher.dir/all] Error 2
make: *** [Makefile:180: all] Error 2


Note from above it is looking for "std::__cxx11::string)’ " which mean cxx 11 is still in there somewhere.

Now I am stuck again. Need guidance.

thamks, tom kosvic


The logstream::log error looks to be because your flightgear and simgear trees are not synchronised - it's best to use checkouts of both them from the same date and time. [E.g. i modified the logging a few weeks ago, and made changes to both flightgear and simgear.]

More generally, i'm surprised that you're having to make manual changes to get things to build, and i'd be a bit worried that there's something systematically wrong with what you're trying to do that will keep on causing problems. Are you checking out flightgear and simgear using git, or are you using some other source for them?

Have you tried the download_and_compile.sh script?

Hope that's of some use,

- Jules
cgdae
 
Posts: 117
Joined: Tue May 31, 2016 8:35 pm

Re: flightgear compilation fails at 20% make process

Postby tckosvic » Sat Dec 26, 2020 8:20 pm

now i am confused.
I go to https://github.com/FlightGear and all the code modules seem to be listed there. But, now that I look closer, the git clone for simgear is version: 2020.4.0 and on the same site, the clone for flightgear is for version 2019.1.2 I had just assumed they were in sync.
I will download from your above links above and start over.

I can't find any easy uninstall for simgear. Do you know of one?

I like to compile my own code for most things. Just kind of a hobby and a learning thing.

thanks, tom
tckosvic
 
Posts: 16
Joined: Mon May 25, 2020 7:43 pm

Next

Return to Compiling

Who is online

Users browsing this forum: No registered users and 3 guests