Installing Octave-4.0.0 on CentOS yields QtOpenGL linking error

0

I am in the process of trying to install Octave-4.0.0 on a CentOS 6 cluster. Octave has 20+ dependencies, and it is unclear which versions of each dependency to use. Since yum only has Octave-3.4.3, I installed Octave-3.4.3 from yum with the hope that it would get me the majority of dependencies right. I also had to install (via yum)

arpack-devel-3.1.3-1.el6.x86_64
fltk-devel-1.1.10-1.el6.x86_64
gl2ps-devel-1.3.5-1.el6.x86_64
glpk-devel-4.40-1.1.el6.x86_64
qhull-devel-2003.1-14.el6.x86_64
qrupdate-devel-1.1.2-1.el6.x86_64
qscintilla-devel-2.4-1.el6.x86_64
suitesparse-devel-3.4.0-9.el6.x86_64

and from source

pcre-8.36

I run auto config :

./configure JAVA_HOME="/usr/lib/jvm/java-1.7.0-openjdk-1.7.0.79.x86_64/"  CPPFLAGS="-I/home/path/to/user/local/include"  --prefix=/home/path/to/user/local/  --with-blas=/usr/lib64/atlas/libf77blas.so.3 --with-lapack=/usr/lib64/atlas/liblapack.so.3

It seems to find things fine and then when I run make it takes about 30minutes to compile and then fails with :

.
.
.
make[2]: Entering directory /gpfs0/home/path/to/user/local/src/octave-4.0.0/src'
CXX      octave_gui-main-gui.o
CXXLD    octave-gui
/usr/lib64/libQtOpenGL.so.4: undefined reference to 'QWidgetPrivate::checkWindowRole()'`
/usr/lib64/libQtOpenGL.so.4: undefined reference to 'QPaintEngineEx::drawPixmaps(QDrawPixmaps::Data const*, int, QPixmap const&, QFlags<QDrawPixmaps::DrawingHint>)'
/usr/lib64/libQtOpenGL.so.4: undefined reference to 'QTextureGlyphCache::populate(QTextItemInt const&, QVarLengthArray<unsigned int, 256> const&, QVarLengthArray<QFixedPoint, 256> const&)'
/usr/lib64/libQtNetwork.so.4: undefined reference to 'QObjectPrivate::checkWindowRole()'
collect2: error: ld returned 1 exit status
make[2]: *** [octave-gui] Error 1
make[2]: Leaving directory '/gpfs0/home/path/to/user/local/src/octave-4.0.0/src'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory '/gpfs0/home/path/to/user/local/src/octave-4.0.0'
make: *** [all] Error 2

In the Makefile generated by auto conf it appears that it should be linking to the Qt libraries correctly, i.e.

.
.
.
QT_CFLAGS = -DQT_SHARED -I/usr/include/QtCore -I/usr/include/QtGui -I/usr/include/QtNetwork -I/usr/include/Q     tOpenGL
QT_CPPFLAGS = -I/usr/include/QtCore -I/usr/include/QtGui -I/usr/include/QtNetwork -I/usr/include/QtOpenGL
QT_LDFLAGS =
QT_LIBS = -lQtNetwork -lQtOpenGL -lQtGui -lQtCore   -lqscintilla2
.
.
.

In /usr/lib64/ I checked the contents of the Qt libraries

$ for i in *Qt*.so.4.6.2; do echo $i; nm -C -D $i | grep -i checkWindowRole; done
libQt3Support.so.4.6.2
                 U QObjectPrivate::checkWindowRole()
                 U QWidgetPrivate::checkWindowRole()
libQtAssistantClient.so.4.6.2
libQtCLucene.so.4.6.2
libQtCore.so.4.6.2
00000000001657b0 T QObjectPrivate::checkWindowRole()
libQtDBus.so.4.6.2
                 U QObjectPrivate::checkWindowRole()
libQtDesignerComponents.so.4.6.2
libQtDesigner.so.4.6.2
libQtGui.so.4.6.2
                 U QObjectPrivate::checkWindowRole()
00000000002388f0 T QWidgetPrivate::checkWindowRole()
libQtHelp.so.4.6.2
libQtMultimedia.so.4.6.2
                 U QObjectPrivate::checkWindowRole()
libQtNetwork.so.4.6.2
                 U QObjectPrivate::checkWindowRole()
libQtOpenGL.so.4.6.2
                 U QObjectPrivate::checkWindowRole()
                 U QWidgetPrivate::checkWindowRole()
libQtScript.so.4.6.2
                 U QObjectPrivate::checkWindowRole()
libQtScriptTools.so.4.6.2
                 U QObjectPrivate::checkWindowRole()
                 U QWidgetPrivate::checkWindowRole()
libQtSql.so.4.6.2
                 U QObjectPrivate::checkWindowRole()
libQtSvg.so.4.6.2
                 U QObjectPrivate::checkWindowRole()
                 U QWidgetPrivate::checkWindowRole()
libQtTest.so.4.6.2
libQtXmlPatterns.so.4.6.2
                 U QObjectPrivate::checkWindowRole()
libQtXml.so.4.6.2

And it appears that QWidgetPrivate::checkWindowRole() is declared (if I'm interpreting nm correctly?) within libQtGui.so.4.6.2. This library is already linked to (see above)

QUESTION : How do I fix this issue and get libQtOpenGL to see the correct libraries?

irritable_phd_syndrom

Posted 2015-09-02T20:30:46.563

Reputation: 355

Answers

0

It turns out that I have a piece of software that I installed locally on my user space and it installed some libraries in ~/local/lib. Within that directory, the software had installed libQtCore.so.4 and libQtGui.so.4. This were the only Qt related libraries installed here. Likewise, I had set

export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/home/path/to/user/local/lib

This meant that the linker found these libraries before the ones located in /usr/lib64. Changing $LD_LIBRARY_PATH so that it no longer points to ~/local/lib, let the linker do its job and solved my problem.

irritable_phd_syndrom

Posted 2015-09-02T20:30:46.563

Reputation: 355