Root with QT question

Dear All

I would like to build ROOT with QT. First of all I read that in order to have the qtroot classes someone can just build root with --enable-qt option when configure.

The root I set like:
git clone root.cern.ch/git/root.git root_all
git checkout -t origin/v5-34-00-patches
./configure --all

I am trying to do so but I always get
Checking for Qt/qglobal.h … no

when configure so I don’t see enabled support for QT. The root compiles correctly though…

I have installed QT 5.2 from the web installer and I have 10.9 OSX. I have QT in a directory
and I have put the bin to the path. If I execute qmake -v I get
QMake version 3.0
Using Qt version 5.2.0 in /Users/gio/Software/Qt/5.2.0/clang_64/lib
I have also the $QTDIR = /Users/gio/Software/Qt/5.2.0/clang_64
So I guess it’s ok.

Do you have any hint why this is happening ?

Thanks in advance,
George

Dear George,
The current ROOT “configure” can not detect the recent Qt installation correctly the way you described

qmake -v QMake version 3.0 Using Qt version 5.2.0 in /Users/gio/Software/Qt/5.2.0/clang_64/lib It looks for ‘Qt/qglobal.h’ . The recent Qt version doesn’t contains this file and ROOT configure fails. I hope it can be fixed.
Mean time I would suggest to install ROOT with no --enable-qt flag and then complement it with QtROOT the way the page root.bnl.gov/QtRoot/How2Install4 … complement describe

Dear Valeri

Thanks a lot for the reply.

I am trying to do so but I face troubles there also. I do exactly as described in the website but I get:

clang: error: invalid deployment target for -stdlib=libc++ (requires OS X 10.7 or later) make[1]: *** [../libGQt.1.0.0.dylib] Error 1 make: *** [sub-qt-make_first-ordered] Error 2

I understand it’s a clang issue so I put to the .pro files

to overcome this but then I get:

make[1]: *** No rule to make target `TQtRootCommand.ui', needed by `.ui/ui_TQtRootCommand.h'. Stop. make: *** [sub-qtgui-make_first-ordered] Error 2

Any help is much appreciated !

Thanks a lot !

Hi George, Thank you very much for your report and valuable investigation.

Did you download the Qt binary distribution for Mac?

Anyway, I am on vacation and have no access to Mac platform. I’ll try to reproduce your issue next week and provide the remedy.

Sorry for an inconvenience

I hope in a few days it will be Ok.

Cheers, Valeri

Dear George [quote=“giakov”]… then I get:

make[1]: *** No rule to make target `TQtRootCommand.ui', needed by `.ui/ui_TQtRootCommand.h'. Stop. make: *** [sub-qtgui-make_first-ordered] Error 2
[/quote] The patch below solves the issue your reported. However, the code can not be compiled against of Qt 5.2. There are some obsolete flags to be removed / replaced. I did not commit any correction yet. Stay tuned. Thank you.

[code]Index: qtgui/qtgui.pro

— qtgui/qtgui.pro (revision 3629)
+++ qtgui/qtgui.pro (working copy)
@@ -21,7 +21,7 @@
QT = qt3support
}
QTROOTSYSPATHINSTALL = $$(QTROOTSYSDIR)
-contains( QT_VERSION, "^5.
" ) {
+greaterThan(QT_MAJOR_VERSION, 4) {
QTROOTSYSPATHINSTALL = $$(QTROOTSYSDIR)
QT *= widgets
}
@@ -96,7 +96,7 @@

#include ("$$ROOTCINTFOUND")
LIBS += $$system(${ROOTSYS}/bin/root-config --glibs)
-# remove the posible refs to itself
+# remove the possible refs to itself
LIBS -= -lQtRootGui

LIBS += -L$(QTROOTSYSDIR)/lib -lGQt
@@ -105,7 +105,7 @@
DEPENDPATH += $(ROOTSYS)/include
}

-FORMS += TQtRootCommand.ui
+FORMS += src/TQtRootCommand.ui

Input

HEADERS += inc/TBrowserCustom.h
@@ -215,7 +215,7 @@

unix {

– working directory

-!contains( QT_VERSION, “^4." ) {
+!contains( QT_VERSION, "^[4|5].
” ) {

generate the link to the old QtGui name

[/code]

Dear Valeri

Thanks for following this up. Keep me informed please.

Regards,
George

Dear Valeri

Do you have any update on that ??

Thanks
George

[quote=“giakov”]Dear Valeri

Do you have any update on that ??

Thanks George[/quote]Sorry, not yet. I had been moving from one job to another one and had to surrender all my laptops and desktops and close server accnts. I’ll try to catch up over weekend (Hope my son will loan me his Mac :wink: . Thank you for your patience. Cheers, Valeri

Hi all.
I begging a pardon for the long delay. I got a new job (the good news :smiley: ) and I have to commute 2.5 hours one way ( 5 hours/day total) that leave me no room to do anything useful for the community (that the bad news, sorry :frowning: ).

I was able to preare the “short version” of QtRoot for you to try (Has no time to test yet :unamused: ).
Try as follows:
1) Install ROOT from CERN with qt disabled.
2)[code]cd QtRoot
setenv QTROOTSYSDIR pwd/qtrootsys # Use the dedicated directory
# to keep ROOT and QtRoot separately

setenv QTROOTSYSDIR $ROOTSYS # This will merge ROOT and QtRoot

                                 # libraries and header files

mkdir -p $QTROOTSYSDIR
svn checkout svn://svn.code.sf.net/p/qtroot/code/trunk qtRoot
cd qtRoot
qmake qtRootShort.pro
make
make install
[/code]This version should allow you to create TQtWidget.

I’ll be away of all means of electronic communication for a week. Please, do not expect my response before 26th of March. I’ll become more productive as soon as I resolve my “commute” issues. Good luck Valeri.

Hi Valeri

Thanks for this. Although TQtWidget compiles the compilation does not finish.

I get:

clang: error: invalid deployment target for -stdlib=libc++ (requires OS X 10.7 or later) make[1]: *** [../libGQt.1.0.0.dylib] Error 1 make: *** [sub-qt-make_first-ordered] Error 2

Any ideas ?

Thanks,
George

[quote=“giakov”]Hi Valeri

Thanks for this. Although TQtWidget compiles the compilation does not finish.

I get:

clang: error: invalid deployment target for -stdlib=libc++ (requires OS X 10.7 or later) make[1]: *** [../libGQt.1.0.0.dylib] Error 1 make: *** [sub-qt-make_first-ordered] Error 2

Any ideas ?

Thanks,
George[/quote]The message comes from *your" Qt distribution. Can you build some "Qt “Hello Word” with no “ROOT” at all ? (using Qt qmake / make )
You may try to “cd qtRoot/qt: make distclean; qmake qt.pro; make; make install” to build just one “qt” package from QtRoot package to learn things faster.

Dear Valeri

Thanks for the reply. I am able to build a simple qt program.

What you suggested doesn’t work since I get an error already on qmake:
Project MESSAGE: PLEASE make the symbolic link (ln -sf /Users/gio/Software/QtRoot/qtrootsys/lib ) by hand!!!

and an error on make:

/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang++ -headerpad_max_install_names -Wl,-syslibroot,/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.9.sdk -mmacosx-version-min=10.6 -single_module -dynamiclib -compatibility_version 1.0 -current_version 1.0.0 -Wl,-install_name,@rpath/libGQt.1.dylib -o libGQt.1.0.0.dylib .obj/GQtDict.o .obj/GQtGUI.o .obj/TGQt.o .obj/TGQtDummy.o .obj/TQMimeTypes.o .obj/TQtApplication.o .obj/TQtBrush.o .obj/TQtClientFilter.o .obj/TQtClientGuard.o .obj/TQtClientWidget.o .obj/TQtEvent.o .obj/TQtEventQueue.o .obj/TQtMarker.o .obj/TQtRootApplication.o .obj/TQtSymbolCodec.o .obj/TQtTimer.o .obj/TQtWidget.o .obj/TQtPadFont.o .obj/TQtPen.o .obj/TQtRootSlot.o .obj/moc_TQtClientFilter.o .obj/moc_TQtClientGuard.o .obj/moc_TQtClientWidget.o .obj/moc_TQtTimer.o .obj/moc_TQtWidget.o .obj/moc_TQtEmitter.o .obj/moc_TQtRootSlot.o -F/Users/gio/Software/Qt/5.2.0/clang_64/lib -L/Users/gio/Software/root_qtdisabled/lib -lGui -lGpad -lRint -L/Users/gio/Software/root_qtdisabled/lib -lGui -lCore -lCint -lRIO -lNet -lHist -lGraf -lGraf3d -lGpad -lTree -lRint -lPostscript -lMatrix -lPhysics -lMathCore -lThread -lpthread -Wl,-rpath,/Users/gio/Software/root_qtdisabled/lib -stdlib=libc++ -lm -ldl -framework QtWidgets -F/Users/gio/Software/Qt/5.2.0/clang_64/lib -framework QtGui -F/Users/gio/Software/Qt/5.2.0/clang_64/lib -framework QtCore -framework QtCore -framework QtGui -F/Users/gio/Software/Qt/5.2.0/clang_64/lib -framework QtCore -framework QtCore -framework OpenGL -framework AGL clang: error: invalid deployment target for -stdlib=libc++ (requires OS X 10.7 or later) make: *** [../libGQt.1.0.0.dylib] Error 1

There is a clear error message when try to build qtRoot with clang:

clang: error: invalid deployment target for -stdlib=libc++ (requires OS X 10.7 or later) make[1]: *** [../libGQt.1.0.0.dylib] Error 1 make: *** [sub-qt-make_first-ordered] Error 2

which I think is not really related to the QT 5.2

Are you able to compile it with clang and QT 5.2 on your side ?

Thanks a lot for the effort !
George

Dear Valeri

Whatever combination I do I cannot compile the qtRoot package you suggested. I tried:

root qt disabled + qtRootShort + qt 5.2 ->Failed
root qt disabled + qtRootShort + qt 4.8 ->Failed
root --all + qtRootShort + qt 4.8 ->Failed
root --all + qtRoot + qt 4.8 ->Failed

With my qt 4.8 I can compile all the projects I have except qtRoot

I used also g++ with qmake -spec macx-g++ qtRootShort.pro but still fails with message :

clang: error: invalid deployment target for -stdlib=libc++ (requires OS X 10.7 or later) make[1]: *** [../libGQt.1.0.0.dylib] Error 1 make: *** [sub-qt-make_default-ordered] Error 2

Any help is appreciated

Thanks,
George

[quote=“giakov”]Dear Valeri

Thanks for the reply. I am able to build a simple qt program.
. .
[/quote]And you this with ‘qmake’? To make sure we are speaking about one thing.

[quote=“giakov”]
. . .
Are you able to compile it with clang and QT 5.2 on your side ?
[/quote]Yes, I did.

[quote=“giakov”]Dear Valeri

Whatever combination I do I cannot compile the qtRoot package you suggested. I tried:
. . .

I used also g++ with qmake -spec macx-g++ qtRootShort.pro but still fails with message :

clang: error: invalid deployment target for -stdlib=libc++ (requires OS X 10.7 or later) make[1]: *** [../libGQt.1.0.0.dylib] Error 1 make: *** [sub-qt-make_default-ordered] Error 2

Any help is appreciated
[/quote]Well, it says " (requires OS X 10.7 or later)". What is yours ?

[quote=“giakov”]Dear Valeri

Thanks for the reply. I am able to build a simple qt program.
George[/quote]Does your “simple” program calls some cout /cerr / stl / iostream/ printf ?
If then answer is ‘no’, can you add it to see whether you still can build your “simple qt program”.
Can you send (attach) me your entire Qt project for your “simple” program?

Thank you. Val.

Hi Valeri

I’m on 10.9

Cheers,
George

Dear Valeri

I’ve sent you a mail with the qt programs

Thanks,
George

HI George,

  1. I have updated my SVN repository to take in account some Qt 5.2 features.
    I was able to compile, build QtRoot as well as some examples on my MacOS 10.7.5 with no :exclamation: problem as described by sourceforge.net/p/qtroot/wiki/Home/ .
    I had no time to make all examples Qt 5.2 compliant. However I think #-o it is not so important.
    I would recommend to update your current working version from SVN.

  2. I got your code. However, I did not find what I wanted to see, namely I need to see the qmake “project file rather the Makefile. Can you do that? (see sourceforge.net/p/qtroot/code/H … elloCanvas for example). Please do not send me the “”.git” send the the tar.gz working directory I start from. By some reason your message was sent to my “obsolete” e-mail address . Please, attach your tar with our project.pro the forum. This way the other people will be able to try it too.

Valeri

For the record:
I used:

[code] Mac Os 10.7.5

ROOT 5.34/14 (heads/v5-34-00-patches@v5-34-14-141-gde4d002, Jan 25 2014, 21:04:30 on macosx64)

qmake -v
QMake version 3.0
Using Qt version 5.2.0 in /Users/fine/Qt5.2.0/5.2.0/clang_64/lib

Xcode 4.6.3

qmake -spec macx-g++ qtRootShort.pro
[/code]