You may have heard there is a problem building FGRUN on Ubuntu 13.04 but
not on Ubuntu 12.10.  I've attached a patch to fgrun/CMakeLists.txt.  I
consider it a workaround. It's been tested on 13.04 and 12.10

The symptom:

          The build on Ubuntu 13.04 fails with the message:
          -- Performing Test HAVE_FLTK_1_3 - Failed
          CMake Error at CMakeLists.txt:228 (message):
            FLTK 1.3 is required

          The message appears on a freshly installed and updated
          installation of 13.04, after adding the additional packages
          needed to build flightgear.

          There is no earlier version of FLTK installed.  Other than
          install the tools needed to build flightgear, nothing unusual
          has been done to the libraries.

The problem:

          The failure happens when CMake tries to check that a compile
          and link using fltk 1.3 succeeds.  The compile and link
          fails  

          This is the failing section of code from fgrun/CMakeLists.txt
          at the indicated point, line 228.

           check_cxx_source_runs(
                  "#include <FL/Fl.H>
                  int main() {
                      return Fl::version() >= 1.03 ? 0 : -1;
                  }
                  "
                  HAVE_FLTK_1_3)

                if ( NOT HAVE_FLTK_1_3 )
                        message( SEND_ERROR "FLTK 1.3 is required" ) 
                endif ( NOT HAVE_FLTK_1_3 )
Analysis:

          The compile of the code in the above CMakeLists.txt code is
          failing, presumably because it does not have -ldl in the path.
          
          Commenting out this section of the CMakeLists.txt allows the
          build for FGRUN to proceed.  However with only this change,
          the actual build fails during the link phase of FGRUN for the
          same reason.  Running the cmake and make in verbose mode
          gives the actual error and illustrates the problem.

          you get undefined reference to symbol dlopen@@GLIBC_2.1
          this is in libdl.so

Possible Causes:

          1. Sometething is amis with fltk and cmake. Has a library has
          moved out of reach of the Find_FLTK.cmake.  

          2. Installing something broke it on Ubuntu 13.10. 

Workaround:

          Our CMakeLists.txt for FGRUN builds the variable
          FLTK_LIBRARIES. I added  "libdl.so" to this variable
          before adding two additional libraries needed for fltk. This
          fixes the build, but not the test for fltk version 1.3 in the
          cmake. Commenting out this test seems an acceptable
          workaround and the build works.
Testing:
        I have tested the patch on Ubuntu 13.04 and Ubuntu 12.10.  As
        long as FLTK 1.3 is installed everything should work. 

        # get rid of previous build and install for fgrun
        rm -rf build/fgrun install/fgrun

        # get fresh copy of CMakelists.txt
        ./download_and_compile.sh -d y -p n fgrun 
        
        patch fgrun/CmakeLists.txt <00000001.patch-fgrun-CMakeLists.txt

        # build without downloading a fresh CMakeLists.txt -note  -d n

        ./download_and_compile.sh -d n -p n fgrun 
        

Next Steps:

        If acceptable, Commit the patched fgrun/CMakeLists.txt
        
        It would be good if someone can come up with a better patch,
        one that allows the check_cxx_source_runs to do its test.

        If anyone has a good explanation of what is really going on
        with fltk and change between the two versions, I'd like to see
        it.  We are not the only application with this issue.

        ask the fltk maintainers about this

_pat
--- CMakeLists.txt.old  2013-05-23 22:26:42.532784855 -0400
+++ CMakeLists.txt      2013-05-23 22:01:45.988781967 -0400
@@ -202,6 +202,7 @@
 endif ( NOT ( HAVE_OPENPTY OR HAVE__GETPTY ) )
 
 if ( FLTK_FOUND )
+     list(APPEND FLTK_LIBRARIES "libdl.so")
     if ( X11_Xinerama_FOUND )
         message(STATUS "Found X11_Xinerama...")
         list(APPEND FLTK_LIBRARIES ${X11_Xinerama_LIB})
@@ -216,17 +217,17 @@
     set( CMAKE_REQUIRED_LIBRARIES ${FLTK_LIBRARIES} )
     message(STATUS "Using FLTK_LIBRARIES for fgrun: ${FLTK_LIBRARIES}")
 
-    check_cxx_source_runs(
-        "#include <FL/Fl.H>
-        int main() {
-            return Fl::version() >= 1.03 ? 0 : -1;
-        }
-        "
-        HAVE_FLTK_1_3)
-
-       if ( NOT HAVE_FLTK_1_3 )
-               message( SEND_ERROR "FLTK 1.3 is required" ) 
-       endif ( NOT HAVE_FLTK_1_3 )
+#    check_cxx_source_runs(
+#        "#include <FL/Fl.H>
+#        int main() {
+#            return Fl::version() >= 1.03 ? 0 : -1;
+#        }
+#        "
+#        HAVE_FLTK_1_3)
+#
+#      if ( NOT HAVE_FLTK_1_3 )
+#              message( SEND_ERROR "FLTK 1.3 is required" ) 
+#      endif ( NOT HAVE_FLTK_1_3 )
 
 endif ( FLTK_FOUND )
 
------------------------------------------------------------------------------
Try New Relic Now & We'll Send You this Cool Shirt
New Relic is the only SaaS-based application performance monitoring service 
that delivers powerful full stack analytics. Optimize and monitor your
browser, app, & servers with just a few lines of code. Try New Relic
and get this awesome Nerd Life shirt! http://p.sf.net/sfu/newrelic_d2d_may
_______________________________________________
Flightgear-devel mailing list
Flightgear-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/flightgear-devel

Reply via email to