PDA

View Full Version : Building Qwt 6.1.0 RC3 on OS X (from the command line)



agarny
21st February 2013, 09:23
Hi, I am trying to build Qwt 6.1.0 RC3 on OS X doing the following:


$ cd qwt-6.1-rc3
$ qmake
$ make

but then, I got the following errors/warnings:


...
compiling qwt_widget_overlay.cpp
In file included from qwt_widget_overlay.cpp:10:
./qwt_widget_overlay.h:147:12: warning: private field 'm_rgbaBuffer' is not used [-Wunused-private-field]
uchar* m_rgbaBuffer;
^
1 warning generated.
...
compiling qwt_plot_shapeitem.cpp
qwt_plot_shapeitem.cpp:245:34: warning: equality comparison result unused [-Wunused-comparison]
d_data->boundingRect == QwtPlotItem::boundingRect();
~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~
qwt_plot_shapeitem.cpp:245:34: note: use '=' to turn this equality comparison into an assignment
d_data->boundingRect == QwtPlotItem::boundingRect();
^~
=
1 warning generated.
...
rm -f qwt qwt.framework/qwt ../lib/qwt.framework/qwt
linking ../lib/qwt.framework/qwt
ld: warning: directory not found for option '-F/Applications/Qt5.0.1/5.0.1/clang_64/qtbase/lib'
mv -f qwt ../lib/qwt.framework/Versions/6/qwt
ln -s Versions/6/qwt ../lib/qwt.framework/qwt
rm -f ../lib/qwt.framework/Versions/Current
ln -s 6 ../lib/qwt.framework/Versions/Current
cd textengines/ && ( test -f Makefile || /Applications/Qt5.0.1/5.0.1/clang_64/bin/qmake /Users/Alan/Desktop/qwt-6.1-rc3/textengines/textengines.pro -o Makefile ) && make -f Makefile
make[1]: Nothing to be done for `first'.
cd designer/ && ( test -f Makefile || /Applications/Qt5.0.1/5.0.1/clang_64/bin/qmake /Users/Alan/Desktop/qwt-6.1-rc3/designer/designer.pro -o Makefile ) && make -f Makefile
compiling qwt_designer_plugin.cpp
compiling qwt_designer_plotdialog.cpp
rcc qwt_designer_plugin.qrc
compiling resources/qrc_qwt_designer_plugin.cpp
moc qwt_designer_plugin.h
compiling moc/moc_qwt_designer_plugin.cpp
moc qwt_designer_plotdialog.h
compiling moc/moc_qwt_designer_plotdialog.cpp
rm -f libqwt_designer_plugin.dylib
linking plugins/designer/libqwt_designer_plugin.dylib
ld: warning: directory not found for option '-F/Applications/Qt5.0.1/5.0.1/clang_64/qtbase/lib'
ld: library not found for -lqwt
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make[1]: *** [plugins/designer/libqwt_designer_plugin.dylib] Error 1
make: *** [sub-designer-make_first-ordered] Error 2

Regarding the two warnings, it would probably be nice to fix them, especially the second one. As for the error, I would have expected Qwt's build system to handle it? If not, what is then needed to get Qwt to build out-of-the-box on OS X?

Seamus
21st February 2013, 10:49
Try:

qmake qwt.pro -spec macx-clang-libc++

or macx-clang
or macx-g++

Calling qmake with no mkspec always fails (for me). All these work for me.

agarny
21st February 2013, 10:57
Well, I have just tried with macx-clang-libc++, macx-clang and then macx-g++, but in all three cases I ended up with what I mentioned in my original post. FWIW, I am running OS X 10.8.2 with version 4.2 of clang (through Xcode 4.6).

Uwe
21st February 2013, 11:30
Concerning the error there was some discussion on the mailing list - use the version from SVN trunk for a fixed version ( beside on Windows don't build debug_and_release - instead debug only + release only ).
The second warning has been fixed in trunk some time ago - the first one needs to be done.

There is a reason for having more rc versions: I don't have most of the environments where Qwt is used myself.

Uwe

agarny
21st February 2013, 13:19
Hi Uwe,

Thanks a lot for the suggestion. I have just got the trunk version of Qwt and, indeed, it builds fine out-of-the-box. However, I couldn't run the examples since the bundles are not able to find Qwt. E.g.:


$ cd ~/qwt/examples/bin/realtime.app/Contents/MacOS
$ otool -L realtime
realtime:
qwt.framework/Versions/6/qwt (compatibility version 6.1.0, current version 6.1.0)
...
$

In the end, I had to do the following to be able to run the example:


$ install_name_tool -change qwt.framework/Versions/6/qwt [Qwt]/lib/qwt.framework/Versions/6/qwt realtime

So, not quite able to build and run out-of-the-box.

Otherwise, I greatly appreciate your work on Qwt, so would it be worth setting up some kind of a web page that would contain a matrix of the platforms on which a particular release of Qwt has been or should be tested? I mean, I would certainly be happy to test things for you (given the exact steps to follow to test Qwt) since I use it on Windows 7 (32-bit and 64-bit), Ubuntu 12.04 (32-bit and 64-bit) and OS X 10.8.2 on a daily basis. (I don't use the Qt project files you provide and, instead, have my own CMake file, but that's besides the point, I could still test things, if needed.)

Seamus
23rd February 2013, 21:58
Well, I have just tried with macx-clang-libc++, macx-clang and then macx-g++, but in all three cases I ended up with what I mentioned in my original post. FWIW, I am running OS X 10.8.2 with version 4.2 of clang (through Xcode 4.6).
I am using the latest versions, and it compiles flawlessly. But your initial error was for the designer plugin, which I've never built.


So, not quite able to build and run out-of-the-box.
I run the examples directly from Qt Creator, benefits of this include

the environment (paths) are automatically handled on all platforms (no need for install_name_tool, DYLD_LIBRARY_PATH, ldd, LD_LIBRARY_PATH, or depends.exe)
you can open the code and step through it
and the procedure for running an example is identical on all platforms (just right click the example and select Run).


A have to admit, I've still never installed Qwt to system. I keep it in '~/working/qwt/qwt', and '~/working/qwt/qwt-qt4'. I like doing it this way as it keeps the platform sections of my .pro file similar.

When deploying, as I don't install the framework, macdeployqt doesn't work properly with it, here is the Mac section of my qwt.pri file:



macx {
# Qwt
QWT_SOURCE_DIR = $$quote($$TOP_SRC_DIR/../qwt)

DEFINES += _USE_MATH_DEFINES

contains(DEFINES, LT_QWT_DLL) {
DEFINES += QWT_DLL
LIBS += -L$$QWT_SOURCE_DIR/lib -lqwt

QWT_BUNDLE_DATA.files = $$QWT_SOURCE_DIR/lib/libqwt.6.dylib
QWT_BUNDLE_DATA.path = Contents/MacOS
QMAKE_BUNDLE_DATA += QWT_BUNDLE_DATA
QMAKE_CLEAN += $$DESTDIR/$${TARGET}.app/Contents/MacOS/libqwt.6.dylib
} else {
QMAKE_LFLAGS += -F$$QWT_SOURCE_DIR/lib/
LIBS += -framework qwt

QWT_BUNDLE_DATA.files = $$QWT_SOURCE_DIR/lib/qwt.framework
QWT_BUNDLE_DATA.path = Contents/Frameworks
QMAKE_BUNDLE_DATA += QWT_BUNDLE_DATA

contains(TEMPLATE, app) {
QMAKE_POST_LINK += \
$(MKDIR) $$DESTDIR/$${TARGET}.app/$$QWT_BUNDLE_DATA.path $$escape_expand( \\n\\t )
for(a, QWT_BUNDLE_DATA.files):exists($${a}){
QMAKE_POST_LINK += \
$(CHK_DIR_EXISTS) $$DESTDIR/$${TARGET}.app/$$QWT_BUNDLE_DATA.path/$$basename(a) \
|| $(INSTALL_DIR) $${a} $$DESTDIR/$${TARGET}.app/$$QWT_BUNDLE_DATA.path $$escape_expand( \\n\\t )
}
}

QMAKE_POST_LINK += install_name_tool -change \
qwt.framework/Versions/6/qwt \
@executable_path/../Frameworks/qwt.framework/Versions/6/qwt \
$$DESTDIR/$${TARGET}.app/Contents/MacOS/$${TARGET} $$escape_expand( \\n\\t )

CONFIG(release, debug|release): {
QMAKE_POST_LINK += install_name_tool -change \
$(QTDIR)/lib/QtPrintSupport.framework/Versions/5/QtPrintSupport \
@executable_path/../Frameworks/QtPrintSupport.framework/Versions/5/QtPrintSupport \
$$DESTDIR/$${TARGET}.app/Contents/Frameworks/qwt.framework/Versions/6/qwt $$escape_expand( \\n\\t )
QMAKE_POST_LINK += install_name_tool -change \
$(QTDIR)/lib/QtWidgets.framework/Versions/5/QtWidgets \
@executable_path/../Frameworks/QtWidgets.framework/Versions/5/QtWidgets \
$$DESTDIR/$${TARGET}.app/Contents/Frameworks/qwt.framework/Versions/6/qwt $$escape_expand( \\n\\t )
QMAKE_POST_LINK += install_name_tool -change \
$(QTDIR)/lib/QtGui.framework/Versions/5/QtGui \
@executable_path/../Frameworks/QtGui.framework/Versions/5/QtGui \
$$DESTDIR/$${TARGET}.app/Contents/Frameworks/qwt.framework/Versions/6/qwt $$escape_expand( \\n\\t )
QMAKE_POST_LINK += install_name_tool -change \
$(QTDIR)/lib/QtCore.framework/Versions/5/QtCore \
@executable_path/../Frameworks/QtCore.framework/Versions/5/QtCore \
$$DESTDIR/$${TARGET}.app/Contents/Frameworks/qwt.framework/Versions/6/qwt $$escape_expand( \\n\\t )
QMAKE_POST_LINK += install_name_tool -change \
$(QTDIR)/lib/QtConcurrent.framework/Versions/5/QtConcurrent \
@executable_path/../Frameworks/QtConcurrent.framework/Versions/5/QtConcurrent \
$$DESTDIR/$${TARGET}.app/Contents/Frameworks/qwt.framework/Versions/6/qwt $$escape_expand( \\n\\t )
}
}

INCLUDEPATH += $$QWT_SOURCE_DIR/src
DEPENDPATH += $$QWT_SOURCE_DIR/src
}

agarny
24th February 2013, 11:04
I am using the latest versions, and it compiles flawlessly. But your initial error was for the designer plugin, which I've never built.
As I said, all I was trying to do was to build Qwt out-of-the-box. As it happens, I already use Qwt in my project. The only thing is that I don't use QMake (but CMake) and therefore build it my own way. I don't, however, need the examples so my Qwt build system doesn't build them. Yet, I quickly needed to check some examples, so I thought I would download Qwt and build it out-of-the-box and this is what prompted my original post...

etonline
27th March 2013, 03:40
Concerning the error there was some discussion on the mailing list - use the version from SVN trunk for a fixed version ( beside on Windows don't build debug_and_release - instead debug only + release only ).
The second warning has been fixed in trunk some time ago - the first one needs to be done.

There is a reason for having more rc versions: I don't have most of the environments where Qwt is used myself.

Uwe

Marked, I also have this problem on my OSX and solved with the latest SVN trunk version.

Thank you for all the hard work :)