[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-devel
Subject:    compiling CVS under FreeBSD with X4.0.3 and threading ...
From:       The Hermit Hacker <scrappy () hub ! org>
Date:       2001-03-28 15:00:23
[Download RAW message or body]


Morning all ...

	Using the latest code, I'm having a bugger of a time with
threading and the use of -pthread ...

	If I do a straight configure, it fails at the QT checks due to a
lack of -pthread:

============
./configure --prefix=/usr/local --disable-debug --enable-final \
--with-extra-includes=/usr/local/include --with-extra-libs=/usr/local/lib \
--with-qt-dir=/usr/local/kde/qt-copy <bunch of configure output deleted>
checking for Qt... configure: error: Qt (>= Qt 2.2.2) (libraries) not found. Please \
check your installation! For more details about this problem, look at the end of \
config.log. atelier# tail -30 config.log^M
configure:6533: gcc -o conftest -O2 -DNDEBUG -I/usr/X11R6/include  \
-I/usr/local/include   conftest.c -L/usr/X11R6/lib  -L/usr/local/lib -ljpeg -lm 1>&5 \
configure:6698: checking for Qt configure:6857: rm -rf SunWS_cache; g++ -o conftest \
-O2 -DNDEBUG -fno-exceptions -fno-check-new -Wall -pedantic -W -Wpointer-arith \
-Wmissing-prototypes -Wwrite-strings -Wno-long-long -Wnon-virtual-dtor -fno-builtin \
-I/usr/local/kde/qt-copy/include -I/usr/X11R6/inc lude   -L/usr/local/kde/qt-copy/lib \
-L/usr/X11R6/lib  -L/usr/local/lib conftest.C  -lqt -lpng -lz -lm -ljpeg  -lXext \
                -lX11 -lSM -lICE  1>&5
conftest.C: In function `int main()':
conftest.C:18: warning: unused variable `int magnolia'
conftest.C:13: warning: unused variable `class QStringList * t'
/usr/X11R6/lib/libGL.so.1: undefined reference to `pthread_getspecific'
/usr/X11R6/lib/libGL.so.1: undefined reference to `pthread_key_create'
/usr/X11R6/lib/libGL.so.1: undefined reference to `pthread_setspecific'
configure: failed program was:
#include "confdefs.h"
#include <qglobal.h>
#include <qapplication.h>
#include <qevent.h>
#include <qstring.h>
#include <qstyle.h>
#include <qiconview.h>
#if ! (QT_VERSION >= 222)
#error 1
#endif

int main() {
    QStringList *t = new QStringList();
    QIconView iv(0);
    iv.setWordWrapIconText(false);
    QString s;
    s.setLatin1("Elvis is alive", 14);
    int magnolia = QEvent::Speech; /* new in 2.2 beta2 */
    return 0;
}
==============

now, -lpthread and -pthread are checked for *after* the QT checks, so if
its possible to move those up in the process, that would fix this problem
... but, to get around it, I do a 'setenv CPPFLAGS -pthread', which gets
me a clean configure.  Notice that, there is a check for pthread, and it
is found (but, again, its after the QT check, which is why the above
fails:

==============
checking for pthread_create in -lpthread... no
checking whether g++ supports -pthread... yes
Setting FreeBSD pthread compilation options
==============

So, great, it finds the -pthread stuff ... but doesn't use it:

==============
g++ -O2 -DNDEBUG -fno-exceptions -fno-check-new -Wall -pedantic -W -Wpointer-arith \
-Wmissing-prototypes -Wwrite-strings -Wno-long-long -Wnon-virtual-dtor -fno-builtin \
-frtti -DQT_CLEAN_NAMESPACE -DQT_NO_COMPAT -DQT_NO_ASCII_CAST -o libDCOP.la.closure \
.libs/libDCOP _la_closure.o .libs/libDCOP_la.all_cpp.o  -L/usr/X11R6/lib \
-L/usr/local/kde/qt-copy/lib -L/usr/local/lib KDE-ICE/.libs/libkICE.a -lqt -lpng -lz \
                -lm -ljpeg -lXext -lX11 -lSM -lICE
/usr/X11R6/lib/libGL.so.1: undefined reference to `pthread_getspecific'
/usr/X11R6/lib/libGL.so.1: undefined reference to `pthread_key_create'
/usr/X11R6/lib/libGL.so.1: undefined reference to `pthread_setspecific'
gmake[3]: *** [libDCOP.la.closure] Error 1
gmake[3]: Leaving directory `/usr/local/kde/kdelibs/dcop'
===============

if I edit dcop/Makefile and add -pthread after -lICE, the compile continue
on until the next point where its linking and -pthread isn't enabled ...

"USE_THREADS = -pthread" is set in dcop/Makefile, but doesn't appear to be
used?

Any way of getting this fixed?

thanks ...

Marc G. Fournier                   ICQ#7615664               IRC Nick: Scrappy
Systems Administrator @ hub.org
primary: scrappy@hub.org           secondary: scrappy@{freebsd|postgresql}.org

 
> > Visit http://master.kde.org/mailman/listinfo/kde-devel#unsub to unsubscribe <<


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic