Board index FlightGear Support Compiling

D&C compilation fails

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

D&C compilation fails

Postby MariuszXC » Sat Feb 19, 2022 4:14 pm

For several months I was using this command line without problems:
Code: Select all
../fgmeta/download_and_compile.sh -an -pn -j3  --fg-cmake-arg=-DENABLE_QT=OFF  PLIB OSG DATA SIMGEAR FGFS

Actually, I was using the above line every now and then, to refresh the whole install. Much more frequently it was a case of, for example
Code: Select all
cd simgear
git pull
make
make install

But both approaches were working for a long time without issues (other than me sometimes forgetting to manually update FGData :) ).

Anyway, a couple of days ago I noticed two distinct problems (using DnC script):
1 - simgear compilation step fails, complaining that OSG is not found. I can get around that by first compiling OSG alone, and then exporting
Code: Select all
$ export CMAKE_PREFIX_PATH=/opt/fg/compile/fg_next/install/openscenegraph
$ ../fgmeta/download_and_compile.sh -an -pn -j3  --fg-cmake-arg=-DENABLE_QT=OFF  --sg-cmake-arg=-DENABLE_VIDEO_RECORD=OFF    SIMGEAR

then simgear compilation finds OSG, but a second problem occurs:

2 - wrong include:
Code: Select all
[  5%] Building C object 3rdparty/expat/CMakeFiles/FGExpat.dir/xmltok.c.o
/opt/fg/compile/fg_next/simgear/3rdparty/expat/xmlparse.c:103:14: fatal error: sys/random.h: No such file or directory
  103 | #    include <sys/random.h> /* getrandom */
      |              ^~~~~~~~~~~~~~
compilation terminated.


'man getrandom' returns:
Code: Select all
NAME
       getrandom - obtain a series of random bytes

SYNOPSIS
       #include <linux/random.h>

       int getrandom(void *buf, size_t buflen, unsigned int flags);

and the random.h is indeed located on my system in /usr/include/linux/random.h
but patching the simgear/3rdparty/expat/xmlparse.c with new location will make compilation fail later, at linking stage.

So both issues seem to point to a problem with the configuration step by cmake?
INOP
MariuszXC
 
Posts: 1061
Joined: Tue May 18, 2021 5:38 pm
Location: Europe
Callsign: SP-MRM
Version: 2020.4
OS: Ubuntu 16.04

Re: D&C compilation fails

Postby MariuszXC » Sat Feb 19, 2022 7:12 pm

Update:
got around the problem by using system libexpat
Code: Select all
/opt/fg/compile/fg_next/build/simgear$ cmake -DSYSTEM_EXPAT=ON ../../simgear
make
make install
INOP
MariuszXC
 
Posts: 1061
Joined: Tue May 18, 2021 5:38 pm
Location: Europe
Callsign: SP-MRM
Version: 2020.4
OS: Ubuntu 16.04


Return to Compiling

Who is online

Users browsing this forum: No registered users and 5 guests