Board index FlightGear Support Compiling

Incremental build - hints please

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

Incremental build - hints please

Postby allemathor » Thu Oct 30, 2014 12:41 am

After fixing a FG build problem (bug), and re-launching MSBuild starts from point zero i.e. downloads files, unzips, and eventually overwrites the files I just fixed.
What would be the good way to tell MSBuild not to start from scratch and preserve my fixes?

Consider a concrete case as follows.

I build on Windows 8.1 64 bit with latest Windows SDK.
cmake 3.0.2
Using Superbuild.
cmake -G "Visual Studio 12 2013 Win64" C:\a03_libs\flightgear\build\fgmeta

Build chokes on OSG:
--------------------------------------------------------------
cd C:\a03_libs\flightgear\build\fgmeta
msbuild /fl /fl:LogFile=build_osg.log OSG.vcxproj
...
Error (problem in osgText):
Glyph.cpp(57): error C2039: 'max' : is not a member of 'std'

Fix Glyph.cpp by adding '#include <algorithm>'

Test the fix works:
cd C:\a03_libs\flightgear\build\fgmeta\osgbuild\src\osgText\
msbuild osgText.vcxproj (build is OK)

Now let's try re-building the whole OSG again
-------------------------------------------------------------
cd C:\a03_libs\flightgear\build\fgmeta
msbuild /fl /fl:LogFile=build_osg.log OSG.vcxproj
---
Now MSBuild downloads OSG, unzips and overwrites the fixed 'Glyph.cpp', and then runs for hours before throwing the same error. Cannot even stop it somehow other then killing.

So, what's the best way to proceed?

Appreciate your help and time.
allemathor
 
Posts: 4
Joined: Wed Oct 29, 2014 11:47 pm

Re: Incremental build - hints please

Postby allemathor » Tue Nov 04, 2014 3:53 pm

Yeah, I know that's a tough one. Sure somebody knows the answer (otherwise would be impossible to do the development) but chances for such a guy to look here are slim.

For now let's keep building by parts. After osgText is fixed, move one level up and try building the OSG from "\flightgear\build\fgmeta\osgbuild" i.e.

cd \flightgear\build\fgmeta\osgbuild
msbuild ALL_BUILD.vcxproj

This runs for awhile but eventually throws more errors. Some of them as follows:
------------------------------------------------------------------------------------------------------------
1. C:\a03_libs\flightgear\build\fgmeta\src\OSG\src\osgPlugins\dxf\dxfEntity.cpp(185): error C3861: 'min': identifier not found
2. c:\a03_libs\flightgear\build\fgmeta\src\osg\src\osgplugins\freetype\FreeTypeFont.h(19): fatal error C1083: Cannot open include file: 'ft2build.h': No such file or directory
3. C:\a03_libs\flightgear\build\fgmeta\src\OSG\src\osgPlugins\txf\TXFFont.cpp(169): error C2039: 'max' : is not a member of 'std'
-------------------------------------------------------------------------------------------------------------

#2 looks funny for 2 reasons:

a. Inconsistent use of letter case in directory names (OSG/osg and osgplugins/osgPlugins). That's a potential problem on Linux.
b. 'ft2build.h' is found in 2 places (4 actually) in the build tree:
-------------------------------------------------------------------------------------------------------------
C:\a03_libs\flightgear\build\fgmeta\3rdParty.x64\include\freetype\ft2build.h
C:\a03_libs\flightgear\build\fgmeta\3rdParty.x64\include\freetype\.svn\text-base\ft2build.h.svn-base
C:\a03_libs\flightgear\build\fgmeta\winDeps\3rdParty.x64\include\freetype\ft2build.h
C:\a03_libs\flightgear\build\fgmeta\winDeps\3rdParty.x64\include\freetype\.svn\text-base\ft2build.h.svn-base
-------------------------------------------------------------------------------------------------------------

Checking out the both locations:
C:\a03_libs\flightgear\build\fgmeta\3rdParty.x64\ : 166 MB / 3,673 Files
C:\a03_libs\flightgear\build\fgmeta\winDeps\3rdParty.x64\ : 166 MB / 3,673 Files

Here comes the next interesting question - why on earth to have the 2 copies of the library in the build tree?

I guess I have to figure this one out by myself:-)
allemathor
 
Posts: 4
Joined: Wed Oct 29, 2014 11:47 pm

Re: Incremental build - hints please

Postby allemathor » Tue Nov 04, 2014 7:54 pm

Digging deeper into bug #2 from previous message.

cd C:\a03_libs\flightgear\build\fgmeta\osgbuild\src\osgPlugins\freetype\
msbuild osgdb_freetype.vcxproj

Here is the output (relevant parts only):
-------------------------------------------------------------------
ClCompile:
C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\bin\x86_amd64\CL.exe /c /IC:\a03_libs\flightgear\build\fgmeta\src\OSG\include /IC:\a03_libs\flightgear
\build\fgmeta\osgbuild\include /IC:\a03_libs\flightgear\build\fgmeta\3rdParty.x64\include ...
...
FreeTypeFont.cpp
...
c:\a03_libs\flightgear\build\fgmeta\src\osg\src\osgplugins\freetype\FreeTypeFont.h(19): fatal error C1083: Cannot open include file: 'ft2build.h': No such file
or directory
...
-------------------------------------------------------------------

'ft2build.h': cannot be found because it is referenced in FreeTypeFont.h as " #include <ft2build.h>" but is not on compiler include path as seen from the log above.
Either FreeTypeFont.h has to be modified to use "#include <freetype/ft2build.h" or original CMakeLists.txt (where exactly?) has to be modified to specify the correct include path i.e. "/IC:\a03_libs\flightgear\build\fgmeta\3rdParty.x64\include\freetype". I'd prefer the latter option.

So, it is a Bug and the build Will Fail for whoever might attempt it.

(Now my support request looks better without 0 in the response field:-)
allemathor
 
Posts: 4
Joined: Wed Oct 29, 2014 11:47 pm

Re: Incremental build - hints please

Postby F-JJTH » Tue Nov 04, 2014 9:19 pm

IIRC the reason of having ft2build.h at 2 place is exactly to solve the bug that you explain ( #include <ft2build.h> )
Also FG/SG are only designed to be built with MSVC 2010. It looks like you are using MSVC 2012 that's why you have all these problems.

If you are able to build FG/SG with MSVC 2012, please report it and tell us how to do it.

Regards,
Clément
User avatar
F-JJTH
 
Posts: 697
Joined: Fri Sep 09, 2011 11:02 am

Re: Incremental build - hints please

Postby allemathor » Wed Nov 05, 2014 2:16 pm

Good to see a reply. Thanks.

I see now that this problem is really OSG bug. Following is the script where they set up the environment for third party dependencies:
-------------------------
$(fgmeta_build)\src\OSG\CMakeModules\Find3rdPartyDependencies.cmake
-------------------------

Seems OSG folks knew about the problem and tried to fix it. The file has some ill-promising comments saying "... kind of a hack". Voila!
So, let's try to come up with something better than " ... kind of hack".

I'll keep you informed
allemathor
 
Posts: 4
Joined: Wed Oct 29, 2014 11:47 pm


Return to Compiling

Who is online

Users browsing this forum: No registered users and 1 guest