Opened 8 years ago

Closed 8 years ago

#4173 closed defect (fixed)

System OpenSceneGraph not detected during configuration which disables 3D animation in OMEdit

Reported by: ivan.lloro.boada@… Owned by: Martin Sjölund
Priority: high Milestone: 1.11.0
Component: Build Environment Version: v1.11.0
Keywords: Cc:

Description

Test to detect presence of OpenSceneGraph library in OMEdit/configure.ac fails even when it is present in the Linux system. As a consequence, 3D animated simulations are disabled.

Relevant extract of OMEdit/config.log hereafter:

configure:4059: checking for osg/qt include order bugs (broken OSG version)
configure:4077: g++ -E  conftest.cpp
configure:4077: $? = 0
configure:4078: result: OK
configure:4089: checking for osg/qt broken OpenGL
configure:4107: g++ -o conftest  -std=c++11  -fPIC -I/usr/include/qt5 -I/usr/include/qt5/QtOpenGL  -Wl,-rpath-link,/home/ivan/TODO/PhD_Thesis/code/OpenModelica/gitOpenModelica/build/lib/x86_64-linux-gnu/omc conftest.cpp  >&5
/tmp/ccfsHKVW.o:(.qtversion[qt_version_tag]+0x0): undefined reference to `qt_version_tag'
collect2: error: ld returned 1 exit status
configure:4107: $? = 1
configure: failed program was:
| /* confdefs.h */
| #define PACKAGE_NAME "OMOptim"
| #define PACKAGE_TARNAME "openmodelica"
| #define PACKAGE_VERSION "dev"
| #define PACKAGE_STRING "OMOptim dev"
| #define PACKAGE_BUGREPORT "https://trac.openmodelica.org/OpenModelica"
| #define PACKAGE_URL "https://openmodelica.org"
| /* end confdefs.h.  */
| 
| #include <osgViewer/GraphicsWindow>
| #include <QGLWidget>
| 
| int
| main ()
| {
| 
|   ;
|   return 0;
| }
configure:4111: result: no (giving up on OSG)

Disabling the following test in OMEdit/configure.ac solves the problem and compiles a fully functional OMEdit:

#if __arm__==1 && __clang_major__==3 && __clang_minor__==4 && OPENSCENEGRAPH_MAJOR_VERSION==3 && OPENSCENEGRAPH_MIN
OR_VERSION==2 && OPENSCENEGRAPH_PATCH_VERSION==0
#error "ARM+clang 3.4+OSG3.2.0 does not work together"
#endif
]],
  [[]])],
  [AC_MSG_RESULT([OK])],
  [AC_MSG_RESULT([no (giving up on OSG)]); WITH_OSG=0]
  )
  CPPFLAGS="$OLD_CPPFLAGS"
fi
if test "$WITH_OSG" = 1; then
  AC_MSG_CHECKING([for osg/qt broken OpenGL])
  OLD_CPPFLAGS="$CPPFLAGS"
  CPPFLAGS="$CPPFLAGS -fPIC -I$QT_INSTALL_HEADERS -I$QT_INSTALL_HEADERS/QtOpenGL"
  AC_LINK_IFELSE(
        [AC_LANG_PROGRAM([[
#include <osgViewer/GraphicsWindow>
#include <QGLWidget>
]],
  [[]])],
  [AC_MSG_RESULT([OK])],
  [AC_MSG_RESULT([no (giving up on OSG)]); WITH_OSG=1] <--- Test disabled by forcing WITH_OSG=1 instead of original WITH_OSG=0 (ugly hack)
  )
  CPPFLAGS="$OLD_CPPFLAGS"
fi

The installed library versions are OpenSceneGraph 3.4.0 and Qt 5.6.1.

Change History (4)

comment:1 by Martin Sjölund, 8 years ago

So Qt 5.6 added a symbol that needs to be linked? Does https://github.com/OpenModelica/OMEdit/pull/64 work for you?

comment:2 by Martin Sjölund, 8 years ago

Never mind, my work laptop had Qt 5.6 and this does indeed fix compilation for the machine... I'll merge it.

comment:3 by Martin Sjölund, 8 years ago

Milestone: Future1.11.0
Status: newaccepted

comment:4 by Martin Sjölund, 8 years ago

Resolution: fixed
Status: acceptedclosed
Note: See TracTickets for help on using tickets.