Board index FlightGear Support Compiling

Compiling recent FlightGear GIT devel version on OSX

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

Compiling recent FlightGear GIT devel version on OSX

Postby gral » Tue May 18, 2010 11:20 am

Hello OSX-Users

I started a wiki for compiling and installing recent FlightGear GIT (former CVS) on >= OSX 10.5.8, intel-based. You can give it a try when you wish to install your own recent FlightGear development version - but maybe this is something for experienced OSX and FlightGear users only. You do not get a Double-Clickable-MacFlightGear with this!

Please send your feedback to this wiki as reply to this post and not to the devel-list.

Here is the link:
http://wiki.flightgear.org/index.php/GI ... ear_on_OSX

Thanks for your tests and feedback in advance.
-gral
Last edited by gral on Tue Jul 13, 2010 8:46 pm, edited 1 time in total.
gral
 
Posts: 325
Joined: Mon Nov 16, 2009 1:03 pm
Location: Zurich (Switzerland)
Callsign: HB-GRAL
Version: GIT

Re: Compiling recent FlightGear GIT devel version on OSX

Postby Avionyx » Wed Jun 09, 2010 8:57 am

Has anyone else had any problems with openscenegraph?
Code: Select all
/Users/Alex/Desktop/FG Dev/OpenSceneGraph-2.8.3/src/osgPlugins/jp2/ReaderWriterJP2.cpp:20:31: error: jasper/jasper.h: No such file or directory
/Users/Alex/Desktop/FG Dev/OpenSceneGraph-2.8.3/src/osgPlugins/jp2/ReaderWriterJP2.cpp:32: error: ‘jas_stream_t’ was not declared in this scope
/Users/Alex/Desktop/FG Dev/OpenSceneGraph-2.8.3/src/osgPlugins/jp2/ReaderWriterJP2.cpp:32: error: ‘out’ was not declared in this scope
/Users/Alex/Desktop/FG Dev/OpenSceneGraph-2.8.3/src/osgPlugins/jp2/ReaderWriterJP2.cpp:32: error: ‘jas_image_t’ was not declared in this scope
/Users/Alex/Desktop/FG Dev/OpenSceneGraph-2.8.3/src/osgPlugins/jp2/ReaderWriterJP2.cpp:32: error: ‘image’ was not declared in this scope
/Users/Alex/Desktop/FG Dev/OpenSceneGraph-2.8.3/src/osgPlugins/jp2/ReaderWriterJP2.cpp:32: error: expected primary-expression before ‘int’
/Users/Alex/Desktop/FG Dev/OpenSceneGraph-2.8.3/src/osgPlugins/jp2/ReaderWriterJP2.cpp:32: error: initializer expression list treated as compound expression
/Users/Alex/Desktop/FG Dev/OpenSceneGraph-2.8.3/src/osgPlugins/jp2/ReaderWriterJP2.cpp:33: error: expected ‘,’ or ‘;’ before ‘{’ token
/Users/Alex/Desktop/FG Dev/OpenSceneGraph-2.8.3/src/osgPlugins/jp2/ReaderWriterJP2.cpp:529: error: expected `}' at end of input
/Users/Alex/Desktop/FG Dev/OpenSceneGraph-2.8.3/src/osgPlugins/jp2/ReaderWriterJP2.cpp:20:31: error: jasper/jasper.h: No such file or directory
/Users/Alex/Desktop/FG Dev/OpenSceneGraph-2.8.3/src/osgPlugins/jp2/ReaderWriterJP2.cpp:32: error: ‘jas_stream_t’ was not declared in this scope
/Users/Alex/Desktop/FG Dev/OpenSceneGraph-2.8.3/src/osgPlugins/jp2/ReaderWriterJP2.cpp:32: error: ‘out’ was not declared in this scope
/Users/Alex/Desktop/FG Dev/OpenSceneGraph-2.8.3/src/osgPlugins/jp2/ReaderWriterJP2.cpp:32: error: ‘jas_image_t’ was not declared in this scope
/Users/Alex/Desktop/FG Dev/OpenSceneGraph-2.8.3/src/osgPlugins/jp2/ReaderWriterJP2.cpp:32: error: ‘image’ was not declared in this scope
/Users/Alex/Desktop/FG Dev/OpenSceneGraph-2.8.3/src/osgPlugins/jp2/ReaderWriterJP2.cpp:32: error: expected primary-expression before ‘int’
/Users/Alex/Desktop/FG Dev/OpenSceneGraph-2.8.3/src/osgPlugins/jp2/ReaderWriterJP2.cpp:32: error: initializer expression list treated as compound expression
/Users/Alex/Desktop/FG Dev/OpenSceneGraph-2.8.3/src/osgPlugins/jp2/ReaderWriterJP2.cpp:33: error: expected ‘,’ or ‘;’ before ‘{’ token
/Users/Alex/Desktop/FG Dev/OpenSceneGraph-2.8.3/src/osgPlugins/jp2/ReaderWriterJP2.cpp:529: error: expected `}' at end of input
lipo: can't figure out the architecture type of: /var/folders/kn/kny-aNG9HJqp6hTfUx7vVU+++TI/-Tmp-//ccStJIbt.out
make[2]: *** [src/osgPlugins/jp2/CMakeFiles/osgdb_jp2.dir/ReaderWriterJP2.cpp.o] Error 1
make[1]: *** [src/osgPlugins/jp2/CMakeFiles/osgdb_jp2.dir/all] Error 2
make: *** [all] Error 2


I've checked my ReaderWriterJP2.cpp file and all seems fine there. Any ideas?

Alex
Avionyx
 
Posts: 428
Joined: Mon Jan 11, 2010 3:07 pm
Location: EGKA
Callsign: G-AVYX
Version: GIT
OS: Arch

Re: Compiling recent FlightGear GIT devel version on OSX

Postby gral » Mon Jun 14, 2010 12:17 pm

Avionyx wrote:/Users/Alex/Desktop/FG Dev/OpenSceneGraph-2.8.3/src/osgPlugins/jp2/ReaderWriterJP2.cpp:20:31: error: jasper/jasper.h: No such file or directory


For recent OSG svn trunk use
Code: Select all
svn checkout http://www.openscenegraph.org/svn/osg/OpenSceneGraph/trunk OpenSceneGraph

gral.
gral
 
Posts: 325
Joined: Mon Nov 16, 2009 1:03 pm
Location: Zurich (Switzerland)
Callsign: HB-GRAL
Version: GIT

Re: Compiling recent FlightGear GIT devel version on OSX

Postby Avionyx » Mon Jun 28, 2010 4:09 pm

This is driving me mad, got everything done apart from OSG!

Latest error:

Code: Select all
Linking CXX shared library ../../lib/libosgDB.dylib
ld: warning: in /Developer/SDKs/MacOSX10.6.sdk/Library/Frameworks//libz.framework/libz, missing required architecture x86_64 in file
Undefined symbols:
  "_deflate", referenced from:
      ZLibCompressor::compress(std::basic_ostream<char, std::char_traits<char> >&, std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)in Compressors.cpp.o
  "_deflateEnd", referenced from:
      ZLibCompressor::compress(std::basic_ostream<char, std::char_traits<char> >&, std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)in Compressors.cpp.o
      ZLibCompressor::compress(std::basic_ostream<char, std::char_traits<char> >&, std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)in Compressors.cpp.o
  "_inflateEnd", referenced from:
      ZLibCompressor::decompress(std::basic_istream<char, std::char_traits<char> >&, std::basic_string<char, std::char_traits<char>, std::allocator<char> >&)in Compressors.cpp.o
      ZLibCompressor::decompress(std::basic_istream<char, std::char_traits<char> >&, std::basic_string<char, std::char_traits<char>, std::allocator<char> >&)in Compressors.cpp.o
  "_inflate", referenced from:
      ZLibCompressor::decompress(std::basic_istream<char, std::char_traits<char> >&, std::basic_string<char, std::char_traits<char>, std::allocator<char> >&)in Compressors.cpp.o
  "_deflateInit2_", referenced from:
      ZLibCompressor::compress(std::basic_ostream<char, std::char_traits<char> >&, std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)in Compressors.cpp.o
  "_inflateInit2_", referenced from:
      ZLibCompressor::decompress(std::basic_istream<char, std::char_traits<char> >&, std::basic_string<char, std::char_traits<char>, std::allocator<char> >&)in Compressors.cpp.o
ld: symbol(s) not found
collect2: ld returned 1 exit status
lipo: can't open input file: /var/folders/kn/kny-aNG9HJqp6hTfUx7vVU+++TI/-Tmp-//ccQ2KHhW.out (No such file or directory)
make[2]: *** [lib/libosgDB.2.9.9.dylib] Error 1
make[1]: *** [src/osgDB/CMakeFiles/osgDB.dir/all] Error 2
make: *** [all] Error 2


Would make me so happy to be able to run GIT on my Mac, as it is I only get to do any Dev work 2 days a week at the moment.

Alex
Avionyx
 
Posts: 428
Joined: Mon Jan 11, 2010 3:07 pm
Location: EGKA
Callsign: G-AVYX
Version: GIT
OS: Arch

Re: Compiling recent FlightGear GIT devel version on OSX

Postby gral » Wed Jun 30, 2010 3:50 pm

Did you also try version 2.9.8 (with cmake and not via Xcode project)?
svn co http://www.openscenegraph.org/svn/osg/O ... raph-2.9.8 OpenSceneGraph
-gral

EDIT: Are there different libz installed on your system? Maybe you can also try to remove framework SDK libz, clean OpenSceneGraph and compile again.
gral
 
Posts: 325
Joined: Mon Nov 16, 2009 1:03 pm
Location: Zurich (Switzerland)
Callsign: HB-GRAL
Version: GIT

Re: Compiling recent FlightGear GIT devel version on OSX

Postby Torsten » Sun Jul 04, 2010 10:13 am

Thanks for the HOWTO!

I just succeeded to build FlightGear on OSX following the wiki's checklist.
This is on a macbook with OSX 10.6.4 x86_64.
Three minor tweaks were required to get things running:
1.) Fetch latest OSG from trunk. 2.9.7 does not compile for X86_64.
2.) Install XCode 3.2.2. With 3.2.1 OSG can't create a window and FlightGear segfaults.
3.) For SimGear configure --with-plib=/opt/local was required to find plib
flightgear.org - where development happens.
User avatar
Torsten
 
Posts: 617
Joined: Fri Feb 01, 2008 9:22 pm
Location: near Hamburg, Germany
Callsign: offline
Version: next
OS: Linux

Re: Compiling recent FlightGear GIT devel version on OSX

Postby gral » Sun Jul 04, 2010 11:59 am

Torsten wrote:Thanks for the HOWTO!

I just succeeded to build FlightGear on OSX following the wiki's checklist.
This is on a macbook with OSX 10.6.4 x86_64.


Thank you very much for checking this and leaving your comments directly in the wiki.

Torsten wrote:Three minor tweaks were required to get things running:
1.) Fetch latest OSG from trunk. 2.9.7 does not compile for X86_64.


I saw today that OSG 2.9.8 is tagged since 2 or 3 weeks and I will check it also for OSX 10.5.8 soon - because using svn trunk could easy fill up this thread :)

Torsten wrote:2.) Install XCode 3.2.2. With 3.2.1 OSG can't create a window and FlightGear segfaults.


This was a bad mistake in the HOWTO (the Xcode Dev Tools version depends on OSX version of course).

Torsten wrote:3.) For SimGear configure --with-plib=/opt/local was required to find plib


I personally did not have to give SimGear this one but I will leave your experience in the wiki of course. Also because it is a valuable example how to set other ports/frameworks with ./configure when needed.

Thanks again - gral
gral
 
Posts: 325
Joined: Mon Nov 16, 2009 1:03 pm
Location: Zurich (Switzerland)
Callsign: HB-GRAL
Version: GIT

Re: Compiling recent FlightGear GIT devel version on OSX

Postby Torsten » Sun Jul 04, 2010 4:39 pm

gral wrote:
Torsten wrote:3.) For SimGear configure --with-plib=/opt/local was required to find plib


I personally did not have to give SimGear this one but I will leave your experience in the wiki of course. Also because it is a valuable example how to set other ports/frameworks with ./configure when needed.


Hmm - interesting you don't need that. I installed plib with MacPorts, so we should have the same install. That reminds me, my FlightGear GUI folder did not compile, I had to comment out the build of layout_test. Gcc can't find plib/pw.h and it is right, there is no pw.h in my plib.
This is probably because port cat plib says:

Code: Select all
if {$build_arch == "x86_64" || $build_arch == "ppc64"} {
    # these components currently use carbon
    configure.args-append --disable-sl --disable-pw
}


Looks like pw is disabled for x86_64. What architecture are you running?

Torsten
flightgear.org - where development happens.
User avatar
Torsten
 
Posts: 617
Joined: Fri Feb 01, 2008 9:22 pm
Location: near Hamburg, Germany
Callsign: offline
Version: next
OS: Linux

Re: Compiling recent FlightGear GIT devel version on OSX

Postby gral » Sun Jul 04, 2010 6:54 pm

Torsten wrote:Looks like pw is disabled for x86_64. What architecture are you running?


For this howto I used an older MacBook Pro with Intel 2 Core on OSX 10.5.8. So for complete information you can check my darwin i386 SimGear config.log here http://www.pastebin.org/383119
-gral

Edit: May I ask you if you succeeded in compiling with OSX 10.6 - with or without setting path to plib?
gral
 
Posts: 325
Joined: Mon Nov 16, 2009 1:03 pm
Location: Zurich (Switzerland)
Callsign: HB-GRAL
Version: GIT

Re: Compiling recent FlightGear GIT devel version on OSX

Postby fbhenry » Wed Jul 21, 2010 3:01 am

Torsten wrote:
Hmm - interesting you don't need that. I installed plib with MacPorts, so we should have the same install. That reminds me, my FlightGear GUI folder did not compile, I had to comment out the build of layout_test. Gcc can't find plib/pw.h and it is right, there is no pw.h in my plib.

Looks like pw is disabled for x86_64. What architecture are you running?

Torsten


I've run into the same issue with a missing plib/pw.h on x86_64, plib installed via MacPorts. Which lines did you comment in the Makefile specifically? I'd be grateful for a pointer!

Fred
fbhenry
 
Posts: 18
Joined: Wed Jul 21, 2010 2:14 am
Location: Chicago, IL USA
Callsign: ajax
Version: git
OS: Mac, Linux, Vista

Re: Compiling recent FlightGear GIT devel version on OSX

Postby fbhenry » Wed Jul 21, 2010 3:37 pm

fbhenry wrote:
I've run into the same issue with a missing plib/pw.h on x86_64, plib installed via MacPorts. Which lines did you comment in the Makefile specifically? I'd be grateful for a pointer!

Fred


Replying to my self:
I did some grep and comment in the src/GUI/Makefile to elide all mentions of layout-test and the build appears to be working now.
On iMac OS X 10.6.4 with latest git pull.

Cheers,

Fred
fbhenry
 
Posts: 18
Joined: Wed Jul 21, 2010 2:14 am
Location: Chicago, IL USA
Callsign: ajax
Version: git
OS: Mac, Linux, Vista

Re: Compiling recent FlightGear GIT devel version on OSX

Postby Torsten » Wed Jul 21, 2010 3:53 pm

Here is my modified src/GUI/Makefile.am:
Code: Select all
noinst_LIBRARIES = libGUI.a
#noinst_PROGRAMS = layout-test

#if HAVE_FRAMEWORK_PLIB
#layout_test_PLIB_FW = $(plib_FRAMEWORK)
#else
#layout_test_PLIB_LIBS = -lplibpw -lplibpu -lplibfnt -lplibul
#endif

#if HAVE_FRAMEWORK_OSG
#layout_test_OSG_LIBS = $(openthreads_FRAMEWORK)
#else
#layout_test_OSG_LIBS = $(openthreads_LIBS)
#endif

libGUI_a_SOURCES = \
        new_gui.cxx new_gui.hxx \
        dialog.cxx dialog.hxx \
        menubar.cxx menubar.hxx \
        gui.cxx gui.h gui_funcs.cxx \
        fonts.cxx \
        AirportList.cxx AirportList.hxx \
        property_list.cxx property_list.hxx \
        layout.cxx layout-props.cxx layout.hxx \
        SafeTexFont.cxx SafeTexFont.hxx \
        WaypointList.cxx WaypointList.hxx \
        MapWidget.cxx MapWidget.hxx
       
INCLUDES = -I$(top_srcdir) -I$(top_srcdir)/src

#layout_test_SOURCES = layout-test.cxx

#layout_test_LDADD = libGUI.a \
#                    -lsgprops -lsgdebug -lsgstructure -lsgmisc -lsgxml -lsgtiming \
#                    $(layout_test_PLIB_LIBS) $(opengl_LIBS)

# mainly for Macs
#layout_test_LDFLAGS = $(layout_test_PLIB_FW) $(layout_test_OSG_LIBS)
flightgear.org - where development happens.
User avatar
Torsten
 
Posts: 617
Joined: Fri Feb 01, 2008 9:22 pm
Location: near Hamburg, Germany
Callsign: offline
Version: next
OS: Linux

Re: Compiling recent FlightGear GIT devel version on OSX

Postby gral » Wed Jul 21, 2010 10:21 pm

Torsten wrote:Here is my modified src/GUI/Makefile.am:


Can you please try it on 10.6 x86_64 without this Makefile.am changes but with option
Code: Select all
./configure --with-x

on SimGear and FlightGear and post parts of your console output somewhere?

Thanks -gral
gral
 
Posts: 325
Joined: Mon Nov 16, 2009 1:03 pm
Location: Zurich (Switzerland)
Callsign: HB-GRAL
Version: GIT

Re: Compiling recent FlightGear GIT devel version on OSX

Postby fbhenry » Thu Jul 22, 2010 5:55 am

gral wrote:
Can you please try it on 10.6 x86_64 without this Makefile.am changes but with option
Code: Select all
./configure --with-x

on SimGear and FlightGear and post parts of your console output somewhere?



I did a "make clean" in both my flightgear and simgear directories, then re-compiled both as you requested with the --with-x option passed to configure.
SimGear built with no errors.

The Flight Gear build failed at layout-test again:
Code: Select all
g++ -DHAVE_CONFIG_H -I. -I../../src/Include -I../.. -I../../src  -I/opt/local/include  -g -O2 -D_REENTRANT -MT layout-test.o -MD -MP -MF .deps/layout-test.Tpo -c -o layout-test.o layout-test.cxx
layout-test.cxx:9:21: error: plib/pw.h: No such file or directory
layout-test.cxx: In function ‘void exitCB()’:
layout-test.cxx:28: error: ‘pwCleanup’ was not declared in this scope
layout-test.cxx: In function ‘int main(int, char**)’:
layout-test.cxx:45: error: ‘pwInit’ was not declared in this scope
layout-test.cxx:47: error: ‘pwSetCallbacks’ was not declared in this scope
make[2]: *** [layout-test.o] Error 1
make[1]: *** [all-recursive] Error 1
make: *** [all-recursive] Error 1


pw.h is present on my system but only here:
Code: Select all
nestor:simgear fbhjr$ locate pw.h
/Applications/FlightGear.app/Contents/Frameworks/PLIB.framework/Versions/A/Headers/pw.h
/Volumes/FlightGear-2.0.0/FlightGear.app/Contents/Frameworks/PLIB.framework/Versions/A/Headers/pw.h


If I can paste any other parts of the build output let me know. Thanks for the help.

Fred
fbhenry
 
Posts: 18
Joined: Wed Jul 21, 2010 2:14 am
Location: Chicago, IL USA
Callsign: ajax
Version: git
OS: Mac, Linux, Vista

Re: Compiling recent FlightGear GIT devel version on OSX

Postby zakalawe » Thu Jul 22, 2010 7:28 am

Just FYI, for the Mac Hudson builder, I built OSG and PLIB in 32-bit mode (-arch i386), and avoided such issues. Given the inevitable bits of Carbon in PLIB, and the non-existence of those headers in 64-bit land, it seemed the easiest option - it's not like FGFS needs to be a 64-bit process, for the moment.
zakalawe
 
Posts: 1149
Joined: Sat Jul 19, 2008 4:48 pm
Location: Edinburgh, Scotland
Callsign: G-ZKLW
Version: next
OS: Mac

Next

Return to Compiling

Who is online

Users browsing this forum: No registered users and 2 guests