Board index FlightGear Support Compiling

Can not compile flightgear with the last version of cmake

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

Can not compile flightgear with the last version of cmake

Postby Curtis » Tue Dec 31, 2019 12:05 am

Hello,

I use archlinux, which is a rolling release distribution,

I notice that I can not compile flightgear 2019.1 with the last version of cmake (3.16.2), I have errors related to cmake during compilation, for example :

Code: Select all
CMake Error in src/GUI/CMakeLists.txt:
  Imported target "SimGearCore" includes non-existent path

    "/include"

  in its INTERFACE_INCLUDE_DIRECTORIES.  Possible reasons include:

  * The path was deleted, renamed, or moved to another location.

  * An install or uninstall procedure did not complete successfully.

  * The installation package was faulty and references files it does not
  provide.


PKGBUILD of archlinux package for flightgear :
https://aur.archlinux.org/cgit/aur.git/ ... flightgear

Am I alone with this problem ?
Thanks
Curtis
 
Posts: 131
Joined: Wed Jun 17, 2009 3:09 pm
OS: archlinux 64 bits

Re: Can not compile flightgear with the last version of cmak

Postby wkitty42 » Tue Dec 31, 2019 12:13 am

you might should post this to the developers' mailing list... if you're not already signed up, the link to the mailing lists is at the top of every page on these forums...
"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: 6488
Joined: Fri Feb 20, 2015 3:46 pm
Location: central NC, USA
Callsign: wk42
Version: git next
OS: Kubuntu 14.04.5

Re: Can not compile flightgear with the last version of cmak

Postby Curtis » Tue Dec 31, 2019 12:32 am

Thanks wkitty42 for your answer,
I created a ticket here :
https://sourceforge.net/p/flightgear/codetickets/2170/

I can compile simgear 2019.1 without problem with the same version of cmake, but I can not compile flightgear 2019.1.
Curtis
 
Posts: 131
Joined: Wed Jun 17, 2009 3:09 pm
OS: archlinux 64 bits

Re: Can not compile flightgear with the last version of cmak

Postby Curtis » Tue Dec 31, 2019 1:03 am

A dirty workaround is to create a symbolic link "/include" :

Code: Select all
ln -s /usr/include/ /include
Curtis
 
Posts: 131
Joined: Wed Jun 17, 2009 3:09 pm
OS: archlinux 64 bits

Re: Can not compile flightgear with the last version of cmak

Postby xDraconian » Tue Dec 31, 2019 6:02 am

I'm using the latest CMake without an issue.

Verify that you set SimGear_DIR to a simgear's CMake configuration folder and not the include folder.
SimGear_DIR=simgear/lib/cmake/SimGear
xDraconian
 
Posts: 327
Joined: Sun Jan 21, 2018 5:53 am
Version: Git
OS: Linux Mint

Re: Can not compile flightgear with the last version of cmak

Postby Curtis » Tue Dec 31, 2019 7:34 pm

xDraconian wrote in Tue Dec 31, 2019 6:02 am:I'm using the latest CMake without an issue.

Verify that you set SimGear_DIR to a simgear's CMake configuration folder and not the include folder.
SimGear_DIR=simgear/lib/cmake/SimGear


I use the regular settings of the flightgear package for archlinux, which worked for several years,

Code: Select all
  cd "$srcdir"/flightgear-$pkgver
  cmake \
   -DCMAKE_INSTALL_PREFIX=/usr \
   -DCMAKE_INSTALL_LIBDIR=lib \
   -DFG_DATA_DIR:STRING="/usr/share/flightgear/data" \
   -DCMAKE_BUILD_TYPE=Release \
   -DFG_BUILD_TYPE=Release .
  make


trying a "git bisect" on flightgear repo may help to find the faulty commit.

Which linux distro do you use ?
A rolling release (archlinux, gentoo) ?
If you use archlinux you should be able to reproduce the problem.

On archlinux the /lib64 directory is a symbolic link to /usr/lib, I think the problem is in the Cmake.list files provided by flightgear when one or several scripts try to guess the path of a lib, the configuration or the cmake function used by these scripts may not be suitable for all distributions like archlinux, which can use symlinks for /lib and /lib64 directories, I highly suspect these scripts :

https://sourceforge.net/p/flightgear/fl ... keModules/

as a workaround I have to create a symlink "/include" --> /usr/include in order to avoid the problem, but there is probably a better solution.
Curtis
 
Posts: 131
Joined: Wed Jun 17, 2009 3:09 pm
OS: archlinux 64 bits

Re: Can not compile flightgear with the last version of cmak

Postby Curtis » Wed Jan 01, 2020 7:30 pm

After investigations I made progress :

the culprit is located in a file related to simgear :

Code: Select all
/usr/lib/cmake/SimGear/SimGearTargets.cmake


at line 66 I see a line with "/include" path :

Code: Select all
set_target_properties(SimGearCore PROPERTIES
  INTERFACE_INCLUDE_DIRECTORIES "${_IMPORT_PREFIX}/include;/include;/usr/include"
  INTERFACE_LINK_LIBRARIES "/usr/lib/libz.so;rt;dl;-lpthread;/usr/lib/libcurl.so"
)


that's why I have the problem, because the "/include" directory is in this statement, but "/include" path doesn't exist on my hard disk,

the solution is to remove "/include" string, which gives this :

Code: Select all
INTERFACE_INCLUDE_DIRECTORIES "${_IMPORT_PREFIX}/include;/usr/include"


instead of :

Code: Select all
INTERFACE_INCLUDE_DIRECTORIES "${_IMPORT_PREFIX}/include;/include;/usr/include"


this file "SimGearTargets.cmake" is generated during the compilation of simgear, for an unknown reason on my configuration the simgear source code adds the path "/include",

I created a patch as a workaround :

Code: Select all
--- /usr/lib/cmake/SimGear/SimGearTargets.cmake   2019-12-31 00:17:04.000000000 +0100
+++ /usr/lib/cmake/SimGear/SimGearTargets.cmake   2020-01-01 19:59:20.000000000 +0100
@@ -63,7 +63,7 @@
 add_library(SimGearCore STATIC IMPORTED)
 
 set_target_properties(SimGearCore PROPERTIES
-  INTERFACE_INCLUDE_DIRECTORIES "${_IMPORT_PREFIX}/include;/include;/usr/include"
+  INTERFACE_INCLUDE_DIRECTORIES "${_IMPORT_PREFIX}/include;/usr/include"
   INTERFACE_LINK_LIBRARIES "/usr/lib/libz.so;rt;dl;-lpthread;/usr/lib/libcurl.so"
 )
 
Curtis
 
Posts: 131
Joined: Wed Jun 17, 2009 3:09 pm
OS: archlinux 64 bits

Re: Can not compile flightgear with the last version of cmak

Postby V12 » Sun Jan 05, 2020 1:48 pm

I successfully builded FG2019.1.2 on LUbuntu 20.04 daily release. All FG features working flawless.
Fly high, fly fast - fly Concorde !
User avatar
V12
 
Posts: 1816
Joined: Thu Jan 12, 2017 4:27 pm
Location: LZIB
Callsign: BAWV12


Return to Compiling

Who is online

Users browsing this forum: No registered users and 1 guest