Hi all!
At last I found some time to try compiling TDE on FreeBSD - and I have a question, too :-)
First of all, I manged to compile tqt3 using gcc47 and as fas as I can tell all provided testprograms (example/ and tutorial/) are working as expected, just "examples/thread" ends up non-responsive. I have not tried gcc48.
What I did not get right: * I failed to set the correct compiler, so I had to add a symlink from g++47 -> g++ and gcc47 -> gcc * I had to add "-thread" to configure, otherwise the build fails (debian: both "-thread" and "-no-thread" builds succeed) * I had to add "LD_LIBRARY_PATH=<...>/tqt3/lib", otherwise the build fails because "tquic" misses it's libriaries. * some build options like OpenGL support etc.
So my questions are: * Is there a way to set the compiler gp "g++47" and "gcc47" ? * What are the build options for the current debian build? "configure" gives me this list:
Build type: freebsd-g++
Configuration ....... nocrosscompiler minimal-config small-config medium-config large-config full-config styles tools kernel widgets dialogs iconview workspace inputmethod network canvas table xml sql release dll thread largefile stl system-mng system-jpeg system-png png no-glibmainloop gif zlib bigcodecs x11sm xshape xkb inputmethod STL support ......... yes PCH support ......... no IPv6 support ........ no Thread support ...... yes NIS support ......... no CUPS support ........ no Large File support .. partial GIF support ......... yes MNG support ......... plugin (system) JPEG support ........ plugin (system) PNG support ......... yes (system) Glib main loop support ......... no zlib support ........ yes OpenGL support ...... no NAS sound support ... no Session management .. yes XShape support ...... yes Xinerama support .... no Tablet support ...... no Xcursor support ..... no XRandR support ...... no XRender support ..... no Xft support ......... no XKB Support ......... yes immodule support .... yes immodule ext support no
Nik
On 22/01/2015 10:49, Dr. Nikolaus Klepp wrote:
Hi all!
At last I found some time to try compiling TDE on FreeBSD - and I have a question, too :-)
First of all, I manged to compile tqt3 using gcc47 and as fas as I can tell all provided testprograms (example/ and tutorial/) are working as expected, just "examples/thread" ends up non-responsive. I have not tried gcc48.
What I did not get right:
- I failed to set the correct compiler, so I had to add a symlink from g++47 -> g++ and gcc47 -> gcc
- I had to add "-thread" to configure, otherwise the build fails (debian: both "-thread" and "-no-thread" builds succeed)
- I had to add "LD_LIBRARY_PATH=<...>/tqt3/lib", otherwise the build fails because "tquic" misses it's libriaries.
- some build options like OpenGL support etc.
So my questions are:
- Is there a way to set the compiler gp "g++47" and "gcc47" ?
- What are the build options for the current debian build? "configure" gives me this list:
It's not unusual to have symlinks to the various gcc versions as numerous may be installed.
Way back, when tqt3 was qt3, I would build it on debian with something like this;
cd $BUILD gzip -dc $SRC/qt3-3.5.13.tar.gz | tar -xf - && mv qt3-3.5.13 qt cd qt DEBUG_AUTOTOOL_OPT="--enable-debug=full" DEBUG_CMAKE_OPT="-ggdb" PREFIX=/opt/trinity QPREFIX=/opt/qt QTDIR=`pwd` PATH=$QTDIR/bin:/opt/trinity/bin:$PATH MANPATH=$QTDIR/doc/man:$MANPATH LD_LIBRARY_PATH=$QTDIR/lib:$LD_LIBRARY_PATH export QTDIR PREFIX QPREFIX PATH MANPATH LD_LIBRARY_PATH DEBUG_AUTOTOOL_OPT DEBUG_CMAKE_OPT
echo "yes" | CFLAGS="-O2 -fPIC" CXXFLAGS="-O2 -fPIC" ./configure -prefix $QPREFIX -sysconfdir /etc/trinity -release -thread -shared -fast -no-exceptions -platform linux-g++ -nis -no-pch -cups -stl -ipv6 -sm -xshape -xinerama -xcursor -xrandr -xrender -xft -tablet -xkb -system-zlib -system-libpng -system-libmng -system-libjpeg -system-nas-sound -enable-opengl -dlopen-opengl -qt-gif -qt-imgfmt-png -qt-imgfmt-jpeg -plugin-imgfmt-mng -plugin-sql-psql -plugin-sql-mysql -plugin-sql-sqlite -I/usr/include/x86_64-linux-gnu -I/usr/include/mysql -I/usr/include/postgresql -I/usr/include/freetype2 -lfontconfig -inputmethod -L/usr/lib -L/usr/lib/x86_64-linux-gnu make && make install
Obviously, it's now tqt3 and there are many ways to skin a cat, this was just one way. It might give you the idea.
Cheers, Mike.
--
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA224
Hi all!
At last I found some time to try compiling TDE on FreeBSD - and I have a question, too :-)
First of all, I manged to compile tqt3 using gcc47 and as fas as I can tell all provided testprograms (example/ and tutorial/) are working as expected, just "examples/thread" ends up non-responsive. I have not tried gcc48.
<snip>
Cool! I am concerned about the threading hang though; can you attach gdb to the hung process and execute "thread apply all bt", then post the results? Not sure what would be different under FreeBSD vs. Linux as far as threading is concerned, but this should give a clue at least.
Thanks!
Tim
Cool! I am concerned about the threading hang though; can you attach gdb to the hung process and execute "thread apply all bt", then post the results? Not sure what would be different under FreeBSD vs. Linux as far as threading is concerned, but this should give a clue at least.
Thanks!
Tim
Hi Tim!
"tqt3/examples/thread/prodcons/" is the "strage" one:
The progress bars hangs at 98%, both threads stop, and "valgrind --tool=helgrind" says: prodcons.cpp:334, dubiouse: associated lock is not held by any thread
examples/thread/prodcons/prodcons.cpp, ProdCons::stop(), when I comment out these 6 lines the program works as expected:
void ProdCons::stop() { if (prod && prod->running()) { prod->stop(); condition.wakeAll(); // prod->wait(); }
if (cons && cons->running()) { cons->stop(); condition.wakeAll(); // cons->wait(); }
if ( redraw ) { // no point in repainting these buttons so many times is we are looping... startbutton->setEnabled(TRUE); stopbutton->setEnabled(FALSE); }
stopped = TRUE; }
And at last your requested gdb output:
(gdb) thread apply all bt [New Thread 807407000 (LWP 100617/prodcons)] [New Thread 807406400 (LWP 100468/prodcons)]
Thread 4 (Thread 807406400 (LWP 100468/prodcons)): #0 0x00000008040598cc in __error () from /lib/libthr.so.3 #1 0x0000000804057d8e in _pthread_cond_wait () from /lib/libthr.so.3 #2 0x0000000800c0f8db in TQThread::wait (this=0x807562a30, time=18446744073709551615) at kernel/qthread_unix.cpp:117 #3 0x0000000000407230 in ProdCons::stop (this=0x7fffffffe650) at ntqgarray.h:76 #4 0x0000000000407470 in ProdCons::customEvent (this=0x7fffffffe650, e=0x807c289a0) at ntqgarray.h:76 #5 0x0000000800c842e5 in TQObject::event (this=0x7fffffffe650, e=0x807c289a0) at ntqcstring.h:61 #6 0x0000000800ccc709 in TQWidget::event (this=0x7fffffffe650, e=0x807c289a0) at kernel/qwidget.cpp:489 #7 0x0000000800c1cf08 in TQApplication::internalNotify (this=0x7fffffffe5c0, receiver=0x7fffffffe650, e=0x807c289a0) at ntqcstring.h:61 #8 0x0000000800c1c699 in TQApplication::notify (this=0x7fffffffe5c0, receiver=0x7fffffffe650, e=0x807c289a0) at ntqcstring.h:61 #9 0x0000000800c1b815 in TQApplication::sendEvent (receiver=0x7fffffffe650, event=0x807c289a0) at ntqcstring.h:61 #10 0x0000000800c1e1b4 in TQApplication::sendPostedEvents (receiver=0x0, event_type=0) at ntqcstring.h:61 #11 0x0000000800c1dedf in TQApplication::sendPostedEvents () at ntqcstring.h:61 #12 0x0000000800beeff4 in TQEventLoop::processEvents (this=0x80743de20, flags=4) at kernel/qeventloop_x11.cpp:82 #13 0x0000000800c3255c in TQEventLoop::enterLoop (this=0x80743de20) at kernel/qeventloop.cpp:115 #14 0x0000000800c3242d in TQEventLoop::exec (this=0x80743de20) at kernel/qeventloop.cpp:115 #15 0x0000000800c1d0b9 in TQApplication::exec (this=0x7fffffffe5c0) at ntqcstring.h:61 #16 0x00000000004075ca in main (argc=1, argv=0x7fffffffe800) at ntqgarray.h:76
Thread 3 (Thread 807407000 (LWP 100617/prodcons)): #0 0x00000008040598cc in __error () from /lib/libthr.so.3 #1 0x00000008040547f4 in pthread_mutex_destroy () from /lib/libthr.so.3 #2 0x0000000800fa629c in TQRealMutexPrivate::lock (this=0x80752ca80) at tools/qmutex_unix.cpp:126 #3 0x0000000800fa653f in TQMutex::lock (this=0x8074ec6b0) at tools/qmutex_unix.cpp:126 #4 0x0000000800bf00fa in TQMutexLocker::TQMutexLocker (this=0x7fffffbfdeb0, m=0x8074ec6b0) at gthr-default.h:218 #5 0x0000000800c1e964 in TQApplication::threadTerminationHandler (originThread=0x807562a00) at ntqcstring.h:61 #6 0x0000000800c0edc3 in TQThreadInstance::finish () at kernel/qthread_unix.cpp:117 #7 0x00000008040597a0 in __pthread_cleanup_pop_imp () from /lib/libthr.so.3 #8 0x0000000800c0ed53 in TQThreadInstance::start (_arg=0x80752ace8) at kernel/qthread_unix.cpp:117 #9 0x000000080404e4f5 in pthread_create () from /lib/libthr.so.3 #10 0x0000000000000000 in ?? ()
Thread 2 (Thread 807407400 (LWP 100618/prodcons)): #0 0x00000008040598ca in __error () from /lib/libthr.so.3 #1 0x00000008040547f4 in pthread_mutex_destroy () from /lib/libthr.so.3 #2 0x0000000800fa629c in TQRealMutexPrivate::lock (this=0x80752ca80) at tools/qmutex_unix.cpp:126 #3 0x0000000800fa653f in TQMutex::lock (this=0x8074ec6b0) at tools/qmutex_unix.cpp:126 #4 0x0000000800bf00fa in TQMutexLocker::TQMutexLocker (this=0x7fffff9fceb0, m=0x8074ec6b0) at gthr-default.h:218 #5 0x0000000800c1e964 in TQApplication::threadTerminationHandler (originThread=0x807562a30) at ntqcstring.h:61 #6 0x0000000800c0edc3 in TQThreadInstance::finish () at kernel/qthread_unix.cpp:117 #7 0x00000008040597a0 in __pthread_cleanup_pop_imp () from /lib/libthr.so.3 #8 0x0000000800c0ed53 in TQThreadInstance::start (_arg=0x80752ad88) at kernel/qthread_unix.cpp:117 #9 0x000000080404e4f5 in pthread_create () from /lib/libthr.so.3 #10 0x0000000000000000 in ?? () (gdb) quit The program is running. Exit anyway? (y or n)
Nik
Cool! I am concerned about the threading hang though; can you attach gdb to the hung process and execute "thread apply all bt", then post the results? Not sure what would be different under FreeBSD vs. Linux as far as threading is concerned, but this should give a clue at least.
Thanks!
Tim
I forgot: valgrind on wheezy complains about the same errors as valgrind on freebsd, but the *.wait()-calls always return on wheezy but hang on freebsd.
==5521== ---------------------------------------------------------------- ==5521== ==5521== Thread #3: pthread_cond_{signal,broadcast}: dubious: associated lock is not held by any thread ==5521== at 0x4C2A345: pthread_cond_signal_WRK (hg_intercepts.c:839) ==5521== by 0x552059C: TQWaitCondition::wakeOne() (in /usr/lib/libtqt-mt.so.3.5.0) ==5521== by 0x406021: ProdThread::run() (prodcons.cpp:122) ==5521== by 0x52CBE8C: ??? (in /usr/lib/libtqt-mt.so.3.5.0) ==5521== by 0x8012F44: ??? (in /lib/x86_64-linux-gnu/libglib-2.0.so.0.3200.4) ==5521== by 0x4C2B5AD: mythread_wrapper (hg_intercepts.c:219) ==5521== by 0x675CB4F: start_thread (pthread_create.c:304) ==5521== by 0x71ED7BC: clone (clone.S:112) ==5521== ==5521== ---------------------------------------------------------------- ==5521== ==5521== Thread #1: lock order "0xA2B43A8 before 0xA2A76E8" violated ==5521== ==5521== Observed (incorrect) order is: acquisition of lock at 0xA2A76E8 ==5521== (stack unavailable) ==5521== ==5521== followed by a later acquisition of lock at 0xA2B43A8 ==5521== at 0x4C2BAF5: pthread_mutex_lock (hg_intercepts.c:495) ==5521== by 0x551FAEC: ??? (in /usr/lib/libtqt-mt.so.3.5.0) ==5521== by 0x4063DC: ConsThread::stop() (prodcons.cpp:169) ==5521== by 0x406A2B: ProdCons::stop() (prodcons.cpp:333) ==5521== by 0x406B95: ProdCons::customEvent(TQCustomEvent*) (prodcons.cpp:367) ==5521== by 0x531DB7E: TQObject::event(TQEvent*) (in /usr/lib/libtqt-mt.so.3.5.0) ==5521== by 0x534CDE2: TQWidget::event(TQEvent*) (in /usr/lib/libtqt-mt.so.3.5.0) ==5521== by 0x52D203E: TQApplication::internalNotify(TQObject*, TQEvent*) (in /usr/lib/libtqt-mt.so.3.5.0) ==5521== by 0x52D237A: TQApplication::notify(TQObject*, TQEvent*) (in /usr/lib/libtqt-mt.so.3.5.0) ==5521== by 0x52D34B1: TQApplication::sendPostedEvents(TQObject*, int) (in /usr/lib/libtqt-mt.so.3.5.0) ==5521== by 0x52B5E54: TQEventLoop::processX11Events() (in /usr/lib/libtqt-mt.so.3.5.0) ==5521== by 0x52B68F9: TQEventLoop::gsourceDispatch(_GSource*) (in /usr/lib/libtqt-mt.so.3.5.0) ==5521== ==5521== ---------------------------------------------------------------- ==5521== ==5521== Thread #1: pthread_cond_{signal,broadcast}: dubious: associated lock is not held by any thread ==5521== at 0x4C2A1D5: pthread_cond_broadcast_WRK (hg_intercepts.c:891) ==5521== by 0x55205DC: TQWaitCondition::wakeAll() (in /usr/lib/libtqt-mt.so.3.5.0) ==5521== by 0x406A37: ProdCons::stop() (prodcons.cpp:334) ==5521== by 0x406B95: ProdCons::customEvent(TQCustomEvent*) (prodcons.cpp:367) ==5521== by 0x531DB7E: TQObject::event(TQEvent*) (in /usr/lib/libtqt-mt.so.3.5.0) ==5521== by 0x534CDE2: TQWidget::event(TQEvent*) (in /usr/lib/libtqt-mt.so.3.5.0) ==5521== by 0x52D203E: TQApplication::internalNotify(TQObject*, TQEvent*) (in /usr/lib/libtqt-mt.so.3.5.0) ==5521== by 0x52D237A: TQApplication::notify(TQObject*, TQEvent*) (in /usr/lib/libtqt-mt.so.3.5.0) ==5521== by 0x52D34B1: TQApplication::sendPostedEvents(TQObject*, int) (in /usr/lib/libtqt-mt.so.3.5.0) ==5521== by 0x52B5E54: TQEventLoop::processX11Events() (in /usr/lib/libtqt-mt.so.3.5.0) ==5521== by 0x52B68F9: TQEventLoop::gsourceDispatch(_GSource*) (in /usr/lib/libtqt-mt.so.3.5.0) ==5521== by 0x52B6A02: ??? (in /usr/lib/libtqt-mt.so.3.5.0) ==5521== ==5521== ---------------------------------------------------------------- ==5521== ==5521== Thread #1: Exiting thread still holds 1 lock ==5521== at 0x71BD648: _Exit (_exit.c:33) ==5521== by 0x7147A8D: __run_exit_handlers (exit.c:93) ==5521== by 0x7147B34: exit (exit.c:100) ==5521== by 0x712FEB3: (below main) (libc-start.c:276)
Nik
Hi Tim!
Maybe you can help me a little bit, I'm trying to compile tqtinterface.
The buildorder on the homepage refers as tqtinterface beeing the second package to build. However, running "cmake" throws an error: "qapplication.h" is missing. Now the only "qapplication.h" I find is in "main/dependencies/qt3/include/". So, do I have to build qt3 in addition to tqt3 ?
Second question: the notes on tqtinterface refer to "tqtinterface should be installed in /usr" - is this a "should" or a "must"? What sideeffects will occur when tqtinterface is installed in /opt/trinity ?
And last Question: cmake includes "/opt/trinity/lib/qt3-3.3.8.d/include" which does not exist and as a pathname does not look right: I'd expect "/opt/trinity/include" or "/opt/trinity/include/qt3-3.3.8.d/include".
Nik
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA224
Hi Tim!
Maybe you can help me a little bit, I'm trying to compile tqtinterface.
The buildorder on the homepage refers as tqtinterface beeing the second package to build. However, running "cmake" throws an error: "qapplication.h" is missing. Now the only "qapplication.h" I find is in "main/dependencies/qt3/include/". So, do I have to build qt3 in addition to tqt3 ?
No; CMake goes on to look for the correct file "ntqapplication.h" but can't find it. I don't think tqtinterface knows where your "ntqapplication.h" file is installed; what directory does it end up in on FreeBSD?
Thanks!
Tim
Am Freitag, 23. Januar 2015 schrieb Timothy Pearson:
Hi Tim!
Maybe you can help me a little bit, I'm trying to compile tqtinterface.
The buildorder on the homepage refers as tqtinterface beeing the second package to build. However, running "cmake" throws an error: "qapplication.h" is missing. Now the only "qapplication.h" I find is in "main/dependencies/qt3/include/". So, do I have to build qt3 in addition to tqt3 ?
No; CMake goes on to look for the correct file "ntqapplication.h" but can't find it. I don't think tqtinterface knows where your "ntqapplication.h" file is installed; what directory does it end up in on FreeBSD?
Thanks!
Tim
Hi Tim!
"ntqapplication.h" is located at /opt/trinity/include ... but "cmake" defines QT_PREFIX_DIR : /opt/trinity/lib/qt3-3.3.8.d and I have no idea why.
Anyway, adding "-DQT_PREFIX_DIR=/opt/trinity" as the last argument to cmake does the trick: QT_PREFIX_DIR : /opt/trinity
"make" failes, because "cmake" does not add the correct paths to the header files, e.g.: fatal error: 'X11/X.h' file not found
Do you have a hint for me how to add the paths?
Nik
In answer to myself:
a lot of scripts in the TDE sources depend on /bin/bash, but FreeBSD has /usr/local/bin/bash --> lots of strange problems with cmake, but no error messages!
Solution: ln /usr/local/bin/bash /bin/bash
Which is definitly not the right way to do it, but ... :-)
Nik
Am Freitag, 23. Januar 2015 schrieb Dr. Nikolaus Klepp:
Am Freitag, 23. Januar 2015 schrieb Timothy Pearson:
Hi Tim!
Maybe you can help me a little bit, I'm trying to compile tqtinterface.
The buildorder on the homepage refers as tqtinterface beeing the second package to build. However, running "cmake" throws an error: "qapplication.h" is missing. Now the only "qapplication.h" I find is in "main/dependencies/qt3/include/". So, do I have to build qt3 in addition to tqt3 ?
No; CMake goes on to look for the correct file "ntqapplication.h" but can't find it. I don't think tqtinterface knows where your "ntqapplication.h" file is installed; what directory does it end up in on FreeBSD?
Thanks!
Tim
Hi Tim!
"ntqapplication.h" is located at /opt/trinity/include ... but "cmake" defines QT_PREFIX_DIR : /opt/trinity/lib/qt3-3.3.8.d and I have no idea why.
Anyway, adding "-DQT_PREFIX_DIR=/opt/trinity" as the last argument to cmake does the trick: QT_PREFIX_DIR : /opt/trinity
"make" failes, because "cmake" does not add the correct paths to the header files, e.g.: fatal error: 'X11/X.h' file not found
Do you have a hint for me how to add the paths?
Nik