Board index FlightGear Support Compiling

[Solved] Fedora 17: FG 2.8.0: Problems Compiling  Topic is solved

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

[Solved] Fedora 17: FG 2.8.0: Problems Compiling

Postby greno » Tue Sep 11, 2012 2:03 am

I'm trying to compile FlightGear 2.8.0 on Fedora 17.

I installed all the listed prerequisite packages.
Code: Select all
# yum list installed OpenSceneGraph plib zlib openal-soft subversion boost freeglut
Installed Packages
OpenSceneGraph.x86_64                                         3.0.1-10.fc17                                          @updates   
boost.x86_64                                                  1.48.0-13.fc17                                         @updates   
freeglut.x86_64                                               2.8.0-3.fc17                                           @fedora   
openal-soft.x86_64                                            1.14-2.fc17                                            @updates   
plib.x86_64                                                   1.8.5-6.fc17                                           @fedora   
subversion.x86_64                                             1.7.4-6.fc17                                           @anaconda-0
zlib.i686                                                     1.2.5-6.fc17                                           @fedora   
zlib.x86_64                                                   1.2.5-6.fc17                                           @anaconda-0


And downloaded the tarballs:
Code: Select all
flightgear-2.8.0.tar.bz2
FlightGear-data-2.8.0.tar.bz2
simgear-2.8.0.tar.bz2


The first thing I am trying to compile is simgear:
Code: Select all
cd simgear-2.8.0
mkdir sgbuild
cd sgbuild
cmake ../simgear -DCMAKE_BUILD_TYPE=Release
CMake Error at bucket/CMakeLists.txt:2 (include):
  include could not find load file:

    SimGearComponent


CMake Error at bucket/CMakeLists.txt:7 (simgear_component):
  Unknown CMake command "simgear_component".


CMake Warning (dev) in CMakeLists.txt:
  No cmake_minimum_required command is present.  A line of code such as

    cmake_minimum_required(VERSION 2.8)

  should be added at the top of the file.  The version specified may be lower
  if you wish to support older CMake versions for this project.  For more
  information run "cmake --help-policy CMP0000".
This warning is for project developers.  Use -Wno-dev to suppress it.

-- Configuring incomplete, errors occurred!


And I get errors. I am not that familiar with cmake so I'm not sure what causes this error.

What am I doing wrong?

.
Last edited by greno on Tue Sep 11, 2012 5:17 pm, edited 1 time in total.
greno
 
Posts: 25
Joined: Mon Sep 03, 2012 8:40 pm

Re: Fedora 17: FG 2.8.0: Problems Compiling

Postby polly » Tue Sep 11, 2012 12:25 pm

My Fe16 source tree, cloned from git, has a file: simgear/CMakeModules/SimGearComponent.cmake
so my first guess would be: that file isn't in your source tree possibly because the zipped file wasn't undone recursively.
User avatar
polly
 
Posts: 455
Joined: Thu Nov 04, 2010 2:45 pm

Re: Fedora 17: FG 2.8.0: Problems Compiling

Postby greno » Tue Sep 11, 2012 1:17 pm

Here's everything cmake related under ../:
Code: Select all
$ find ../ | grep -i cmake
../CMakeLists.txt
../simgear/nasal/CMakeLists.txt
../simgear/environment/CMakeLists.txt
../simgear/simgear_config_cmake.h.in
../simgear/CMakeLists.txt
../simgear/magvar/CMakeLists.txt
../simgear/props/CMakeLists.txt
../simgear/threads/CMakeLists.txt
../simgear/sound/CMakeLists.txt
../simgear/math/CMakeLists.txt
../simgear/misc/CMakeLists.txt
../simgear/io/CMakeLists.txt
../simgear/bucket/CMakeLists.txt
../simgear/timing/CMakeLists.txt
../simgear/debug/CMakeLists.txt
../simgear/serial/CMakeLists.txt
../simgear/scene/CMakeLists.txt
../simgear/scene/sky/CMakeLists.txt
../simgear/scene/bvh/CMakeLists.txt
../simgear/scene/model/CMakeLists.txt
../simgear/scene/util/CMakeLists.txt
../simgear/scene/tsync/CMakeLists.txt
../simgear/scene/material/CMakeLists.txt
../simgear/scene/tgdb/CMakeLists.txt
../simgear/ephemeris/CMakeLists.txt
../simgear/screen/CMakeLists.txt
../simgear/xml/CMakeLists.txt
../simgear/xml/expat_config_cmake.in
../simgear/structure/CMakeLists.txt
../simgear/hla/CMakeLists.txt
../README.cmake
../sgbuild/CMakeFiles
../sgbuild/CMakeFiles/CMakeSystem.cmake
../sgbuild/CMakeFiles/CMakeCCompiler.cmake
../sgbuild/CMakeFiles/CompilerIdC
../sgbuild/CMakeFiles/CompilerIdC/CMakeCCompilerId.c
../sgbuild/CMakeFiles/CompilerIdC/a.out
../sgbuild/CMakeFiles/CMakeDetermineCompilerABI_CXX.bin
../sgbuild/CMakeFiles/CMakeTmp
../sgbuild/CMakeFiles/CMakeTmp/CMakeFiles
../sgbuild/CMakeFiles/CMakeTmp/CMakeFiles/cmTryCompileExec4071272497.dir
../sgbuild/CMakeFiles/CMakeTmp/CMakeFiles/cmTryCompileExec1619194838.dir
../sgbuild/CMakeFiles/CMakeTmp/CMakeFiles/cmTryCompileExec3087018032.dir
../sgbuild/CMakeFiles/CMakeTmp/CMakeFiles/cmTryCompileExec2415611998.dir
../sgbuild/CMakeFiles/CMakeCXXCompiler.cmake
../sgbuild/CMakeFiles/cmake.check_cache
../sgbuild/CMakeFiles/CMakeDetermineCompilerABI_C.bin
../sgbuild/CMakeFiles/CompilerIdCXX
../sgbuild/CMakeFiles/CompilerIdCXX/a.out
../sgbuild/CMakeFiles/CompilerIdCXX/CMakeCXXCompilerId.cpp
../sgbuild/CMakeFiles/CMakeOutput.log
../sgbuild/CMakeCache.txt
../sgbuild/bucket/CMakeFiles
../CMakeModules
../CMakeModules/cmake_uninstall.cmake.in
../CMakeModules/FindSvnClient.cmake
../CMakeModules/FindALUT.cmake
../CMakeModules/SimGearComponent.cmake
../CMakeModules/OldGNUInstallDirs.cmake


I see SimGearComponent.cmake, but not in the same location. I checked the zipped file and it is the same there.

.
greno
 
Posts: 25
Joined: Mon Sep 03, 2012 8:40 pm

Re: Fedora 17: FG 2.8.0: Problems Compiling

Postby polly » Tue Sep 11, 2012 1:27 pm

I thought I was saying the same thing. In your first post the error message mentions bucket/CmakeLists.txt not finding something. Look in bucket/CmakeLists.txt at the line the error message mentions, does it specify SimgearComponent ? I did a locate on SimgearComponent and found the source in my source tree at the place I mentioned. If you don't have the file at some place in your source tree, it not being there is a reason for the error message. It's in git's idea of the source tree, too:
http://gitorious.org/fg/simgear/blobs/next/CMakeModules/SimGearComponent.cmake

Edit Can you verify the contents of the zipped file ?
Last edited by polly on Tue Sep 11, 2012 1:33 pm, edited 1 time in total.
User avatar
polly
 
Posts: 455
Joined: Thu Nov 04, 2010 2:45 pm

Re: Fedora 17: FG 2.8.0: Problems Compiling

Postby greno » Tue Sep 11, 2012 1:33 pm

Here's all the cmake related stuff in the tarball:
Code: Select all
$ tar tjvf /home/greno/Downloads/simgear-2.8.0.tar.bz2 | grep -i cmake
-rw-rw-r-- curt/curt     11031 2012-08-16 10:20 simgear-2.8.0/CMakeLists.txt
-rw-rw-r-- curt/curt      5623 2012-08-16 10:20 simgear-2.8.0/README.cmake
-rw-rw-r-- curt/curt      1045 2012-08-16 10:20 simgear-2.8.0/simgear/sound/CMakeLists.txt
-rw-rw-r-- curt/curt       179 2012-08-16 10:20 simgear-2.8.0/simgear/threads/CMakeLists.txt
-rw-rw-r-- curt/curt       530 2012-08-16 10:20 simgear-2.8.0/simgear/ephemeris/CMakeLists.txt
-rw-rw-r-- curt/curt      1913 2012-08-16 10:20 simgear-2.8.0/simgear/hla/CMakeLists.txt
-rw-rw-r-- curt/curt      1120 2012-08-16 10:20 simgear-2.8.0/simgear/misc/CMakeLists.txt
-rw-rw-r-- curt/curt       964 2012-08-16 10:20 simgear-2.8.0/simgear/xml/expat_config_cmake.in
-rw-rw-r-- curt/curt       441 2012-08-16 10:20 simgear-2.8.0/simgear/xml/CMakeLists.txt
-rw-rw-r-- curt/curt       347 2012-08-16 10:20 simgear-2.8.0/simgear/screen/CMakeLists.txt
-rw-rw-r-- curt/curt       417 2012-08-16 10:20 simgear-2.8.0/simgear/nasal/CMakeLists.txt
-rw-rw-r-- curt/curt       379 2012-08-16 10:20 simgear-2.8.0/simgear/magvar/CMakeLists.txt
-rw-rw-r-- curt/curt       734 2012-08-16 10:20 simgear-2.8.0/simgear/structure/CMakeLists.txt
-rw-rw-r-- curt/curt       136 2012-08-16 10:20 simgear-2.8.0/simgear/serial/CMakeLists.txt
-rw-rw-r-- curt/curt       453 2012-08-16 10:20 simgear-2.8.0/simgear/scene/sky/CMakeLists.txt
-rw-rw-r-- curt/curt       268 2012-08-16 10:20 simgear-2.8.0/simgear/scene/tsync/CMakeLists.txt
-rw-rw-r-- curt/curt       869 2012-08-16 10:20 simgear-2.8.0/simgear/scene/bvh/CMakeLists.txt
-rw-rw-r-- curt/curt      1154 2012-08-16 10:20 simgear-2.8.0/simgear/scene/tgdb/CMakeLists.txt
-rw-rw-r-- curt/curt       261 2012-08-16 10:20 simgear-2.8.0/simgear/scene/CMakeLists.txt
-rw-rw-r-- curt/curt      1020 2012-08-16 10:20 simgear-2.8.0/simgear/scene/model/CMakeLists.txt
-rw-rw-r-- curt/curt      1076 2012-08-16 10:20 simgear-2.8.0/simgear/scene/util/CMakeLists.txt
-rw-rw-r-- curt/curt       567 2012-08-16 10:20 simgear-2.8.0/simgear/scene/material/CMakeLists.txt
-rw-rw-r-- curt/curt       937 2012-08-16 10:20 simgear-2.8.0/simgear/props/CMakeLists.txt
-rw-rw-r-- curt/curt      1491 2012-08-16 10:20 simgear-2.8.0/simgear/io/CMakeLists.txt
-rw-rw-r-- curt/curt      2753 2012-08-16 10:20 simgear-2.8.0/simgear/CMakeLists.txt
-rw-rw-r-- curt/curt       407 2012-08-16 10:20 simgear-2.8.0/simgear/simgear_config_cmake.h.in
-rw-rw-r-- curt/curt       576 2012-08-16 10:20 simgear-2.8.0/simgear/environment/CMakeLists.txt
-rw-rw-r-- curt/curt       142 2012-08-16 10:20 simgear-2.8.0/simgear/bucket/CMakeLists.txt
-rw-rw-r-- curt/curt       154 2012-08-16 10:20 simgear-2.8.0/simgear/debug/CMakeLists.txt
-rw-rw-r-- curt/curt      1125 2012-08-16 10:20 simgear-2.8.0/simgear/math/CMakeLists.txt
-rw-rw-r-- curt/curt       272 2012-08-16 10:20 simgear-2.8.0/simgear/timing/CMakeLists.txt
-rw-rw-r-- curt/curt      2371 2012-08-16 10:20 simgear-2.8.0/CMakeModules/FindSvnClient.cmake
-rw-rw-r-- curt/curt      1045 2012-08-16 10:20 simgear-2.8.0/CMakeModules/SimGearComponent.cmake
-rw-rw-r-- curt/curt      7023 2012-08-16 10:20 simgear-2.8.0/CMakeModules/OldGNUInstallDirs.cmake
-rw-rw-r-- curt/curt       781 2012-08-16 10:20 simgear-2.8.0/CMakeModules/cmake_uninstall.cmake.in
-rw-rw-r-- curt/curt      2040 2012-08-16 10:20 simgear-2.8.0/CMakeModules/FindALUT.cmake



There's no bucket CMakeLists.txt file.

I think the problem is that the file SimGearComponent.cmake is not where it is expected to be.

Should I be copying something around before trying to follow the INSTALL?

.
greno
 
Posts: 25
Joined: Mon Sep 03, 2012 8:40 pm

Re: Fedora 17: FG 2.8.0: Problems Compiling

Postby polly » Tue Sep 11, 2012 1:47 pm

There 'has' to be, for there to be an error message generated at line 2 of the file ! ( See your first post ) Maybe it's a good idea to remove your build directory from inside your source tree and create it somewhere else, like in your home subdirectory, where you have full write access and where your entire source tree stays untouched. eg:
mkdir ~/simgearbuild;
Then you can compare your source tree with, say, the gitorious source tree at the link above. If files are missing in your source tree, clean it out and unzip again, making sure you are doing a recursive unzip. If there are still files missing then do whatever is necessary to list the files in the zip file for comparison against the gitorious tree and also check your disk space.

Edit The file is right there in the list you just posted.
User avatar
polly
 
Posts: 455
Joined: Thu Nov 04, 2010 2:45 pm

Re: Fedora 17: FG 2.8.0: Problems Compiling

Postby greno » Tue Sep 11, 2012 2:09 pm

Polly, yes the file is in the list.

But it is not in the location where it is expected. It is not in the same location as your file (.under simgear/ )

So should I be moving files around before following the INSTALL?

And if so, what should I be moving? And to where?

.
greno
 
Posts: 25
Joined: Mon Sep 03, 2012 8:40 pm

Re: Fedora 17: FG 2.8.0: Problems Compiling

Postby polly » Tue Sep 11, 2012 2:36 pm

Both the files look to be in the proper place. There are two 'simgear' directories in the simgear tree. Please try what I suggested and clear out build tree and make a new, clean, one completely away from the source tree; point the cmake command at the top level of the simgear source tree and see what happens.
User avatar
polly
 
Posts: 455
Joined: Thu Nov 04, 2010 2:45 pm

Re: Fedora 17: FG 2.8.0: Problems Compiling

Postby greno » Tue Sep 11, 2012 2:46 pm

Polly, that does not work.

I recreated the sgbuild directory under my $HOME and it fails:
Code: Select all
$ cmake ../simgear -DCMAKE_BUILD_TYPE=Release
CMake Error: The source directory "/home/greno/build/simgear" does not exist.
Specify --help for usage, or press the help button on the CMake GUI.


The instructions in the INSTALL say to create the sgbuild directory alongside the main SimGear directory but it fails when you do that.

Edit: Here's what I think the problem is. The INSTALL is wrong. The cmake command in the INSTALL should look like this:
Code: Select all
$ cmake ../simgear-VERSION    -DCMAKE_BUILD_TYPE=Release   # replace VERSION with the version number


When I do that then things start working albeit with other errors:
Code: Select all
$ cmake ../simgear-2.8.0 -DCMAKE_BUILD_TYPE=Release
-- The C compiler identification is GNU 4.7.0
-- The CXX compiler identification is GNU 4.7.0
-- Check for working C compiler: /usr/lib64/ccache/gcc
-- Check for working C compiler: /usr/lib64/ccache/gcc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working CXX compiler: /usr/lib64/ccache/c++
-- Check for working CXX compiler: /usr/lib64/ccache/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- version is 2 dot 8 dot 0
-- ignoring: ^/home/greno/build/simgear-2.8.0/.git;\\.gitignore;Makefile.am;~$;
-- Library installation directory: lib64
CMake Error at /usr/share/cmake/Modules/FindBoost.cmake:1200 (message):
  Unable to find the requested Boost libraries.

  Unable to find the Boost header files.  Please set BOOST_ROOT to the root
  directory containing Boost or BOOST_INCLUDEDIR to the directory containing
  Boost's headers.
Call Stack (most recent call first):
  CMakeLists.txt:110 (find_package)


-- SimGear mode: NORMAL
-- Looking for XOpenDisplay in /usr/lib64/libX11.so;/usr/lib64/libXext.so
-- Looking for XOpenDisplay in /usr/lib64/libX11.so;/usr/lib64/libXext.so - found
-- Looking for gethostbyname
-- Looking for gethostbyname - found
-- Looking for connect
-- Looking for connect - found
-- Looking for remove
-- Looking for remove - found
-- Looking for shmat
-- Looking for shmat - found
-- Looking for IceConnectionNumber in ICE
-- Looking for IceConnectionNumber in ICE - found
-- Found X11: /usr/lib64/libX11.so
-- Found OpenGL: /usr/lib64/libGL.so 
CMake Error at /usr/share/cmake/Modules/FindPackageHandleStandardArgs.cmake:97 (MESSAGE):
  Could NOT find OpenAL (missing: OPENAL_LIBRARY OPENAL_INCLUDE_DIR)
Call Stack (most recent call first):
  /usr/share/cmake/Modules/FindPackageHandleStandardArgs.cmake:288 (_FPHSA_FAILURE_MESSAGE)
  /usr/share/cmake/Modules/FindOpenAL.cmake:101 (FIND_PACKAGE_HANDLE_STANDARD_ARGS)
  CMakeLists.txt:118 (find_package)




.
greno
 
Posts: 25
Joined: Mon Sep 03, 2012 8:40 pm

Re: Fedora 17: FG 2.8.0: Problems Compiling

Postby polly » Tue Sep 11, 2012 3:00 pm

To where did you unzip the simgear source tree, what is the fully qualified path to the top level of the simgear source tree ? If it is ~/simgear-2.8.0 then the proper command is: cmake ~/simgear-2.8.0 -Dwhatever.
You shouldn't have to move anything around and the build directory should work alongside the source directory just fine once cmake is told where the top of the source tree is located. There's an excellent text-gui called ccmake which you should be able to get via: yum install ccmake .. once it's installed you'd use command: ccmake ~/simgear-2.8.0 -Dwhatever.. then press 'c' ( twice ) to configure and check what paths are found; then 'g' to generate the makefiles. It
User avatar
polly
 
Posts: 455
Joined: Thu Nov 04, 2010 2:45 pm

Re: Fedora 17: FG 2.8.0: Problems Compiling

Postby polly » Tue Sep 11, 2012 3:06 pm

For every dependency package you yum install, yum install package-devel. You are doing a build so for all the packages you need the header files in addition to the library executables.
User avatar
polly
 
Posts: 455
Joined: Thu Nov 04, 2010 2:45 pm

Re: Fedora 17: FG 2.8.0: Problems Compiling

Postby greno » Tue Sep 11, 2012 3:23 pm

Yes, that is what I was busy doing. After I saw it couldn't find headers, I installed all the devel packages.

Now it looks like it generated all the Makefiles:
Code: Select all
$ cmake ../simgear-2.8.0 -DCMAKE_BUILD_TYPE=Release
-- version is 2 dot 8 dot 0
-- ignoring: ^/home/greno/build/simgear-2.8.0/.git;\\.gitignore;Makefile.am;~$;
-- Library installation directory: lib64
-- SimGear mode: NORMAL
-- Found ALUT: /usr/lib64/libalut.so 
-- Found osgText: /usr/lib64/libosgText.so 
-- Found osgSim: /usr/lib64/libosgSim.so 
-- Found osgDB: /usr/lib64/libosgDB.so 
-- Found osgParticle: /usr/lib64/libosgParticle.so 
-- Found osgUtil: /usr/lib64/libosgUtil.so 
-- Found osg: /usr/lib64/libosg.so 
-- Found OpenThreads: /usr/lib64/libOpenThreads.so 
-- Found OpenSceneGraph: /usr/lib64/libosgText.so;/usr/lib64/libosgSim.so;/usr/lib64/libosgDB.so;/usr/lib64/libosgParticle.so;/usr/lib64/libosgUtil.so;/usr/lib64/libosg.so;/usr/lib64/libOpenThreads.so (Required is at least version "3.0.0")
-- JPEG-factory: DISABLED
-- Found LIBSVN: -lapr-1;/usr/lib64/libsvn_client-1.so;/usr/lib64/libsvn_subr-1.so;/usr/lib64/libsvn_ra-1.so 
-- Subversion client support: ENABLED
-- Found ZLIB: /usr/lib64/libz.so (found version "1.2.5")
-- Looking for include file pthread.h
-- Looking for include file pthread.h - found
-- Looking for pthread_create
-- Looking for pthread_create - not found.
-- Looking for pthread_create in pthreads
-- Looking for pthread_create in pthreads - not found
-- Looking for pthread_create in pthread
-- Looking for pthread_create in pthread - found
-- Found Threads: TRUE 
-- Looking for sys/time.h
-- Looking for sys/time.h - found
-- Looking for sys/timeb.h
-- Looking for sys/timeb.h - found
-- Looking for unistd.h
-- Looking for unistd.h - found
-- Looking for windows.h
-- Looking for windows.h - not found
-- RTI: DISABLED
-- Looking for gettimeofday
-- Looking for gettimeofday - found
-- Looking for ftime
-- Looking for ftime - found
-- Looking for timegm
-- Looking for timegm - found
-- Looking for rint
-- Looking for rint - not found
-- Looking for mkdtemp
-- Looking for mkdtemp - found
-- Looking for bcopy
-- Looking for bcopy - found
-- Looking for mmap
-- Looking for mmap - found
-- Performing Test HAVE_CLOCK_GETTIME
-- Performing Test HAVE_CLOCK_GETTIME - Success
-- Looking for clock_gettime in rt
-- Looking for clock_gettime in rt - found
-- Performing Test HAVE_ISNAN
-- Performing Test HAVE_ISNAN - Failed
-- Performing Test GCC_ATOMIC_BUILTINS_FOUND
-- Performing Test GCC_ATOMIC_BUILTINS_FOUND - Success
-- Tests: ENABLED
-- Library building mode: STATIC LIBRARIES
-- Configuring done
-- Generating done
-- Build files have been written to: /home/greno/build/sgbuild
greno
 
Posts: 25
Joined: Mon Sep 03, 2012 8:40 pm

Re: Fedora 17: FG 2.8.0: Problems Compiling

Postby greno » Tue Sep 11, 2012 3:57 pm

After making adjustment for the misleading INSTALL cmake command I was able to configure, make and install both simgear and flightgear.

However, when I try to run it I am getting this error:
Code: Select all
$ /usr/local/bin/fgfs
ERROR: The path '/usr/local/lib/FlightGear' does not exist in the file system.


Base package check failed:
  Version [none] found at: /usr/local/lib/FlightGear
  Version 2.8.0 is required.
Please upgrade/downgrade base package and set the path to your fgdata
with --fg-root=path_to_your_fgdata


The install does not install libs anywhere apparently, just executables.

What do I do about this?

.
greno
 
Posts: 25
Joined: Mon Sep 03, 2012 8:40 pm

Re: Fedora 17: FG 2.8.0: Problems Compiling

Postby polly » Tue Sep 11, 2012 4:21 pm

Have you installed fgdata yet ? Flightgear looks at the environment variable: $FG_ROOT to determine its location so you can use command 'set | less' to check it's set up properly.
OK, I see you did install it. Once you can find where it is ( updatedb; locate Aircraft | less ) then either set the environment variable or, as superuser, just create a symbolic link to where flightgear expects it to be . . e.g sudo ln -s ~/FlightGear-data-2.8.0 /usr/local/lib/FlightGear

Next time around it'll be a piece of cmake !
User avatar
polly
 
Posts: 455
Joined: Thu Nov 04, 2010 2:45 pm

Re: Fedora 17: FG 2.8.0: Problems Compiling

Postby polly » Tue Sep 11, 2012 4:36 pm

.. " After making adjustment for the misleading INSTALL cmake command " ..
Could you elaborate on where you were misled, so we can avoid beating this to a small death, again ? Thanks.
User avatar
polly
 
Posts: 455
Joined: Thu Nov 04, 2010 2:45 pm

Next

Return to Compiling

Who is online

Users browsing this forum: No registered users and 3 guests