PDA

View Full Version : installing qwt



szisziszilvi
25th January 2011, 09:03
Hi,

after some unsuccesful former tries I deceided again to install qwt on my computer. With a short google-search I found this:
http://www.qtforum.org/article/35454/how-install-qwt-with-qt-creator-without-need-recompile-qt-creator.html

1) I've downloaded the zip. (qwt-6.0.0-rc5.zip), copied and unzipped it into C root.
2) and 3) done (changes in C:\qwt-6.0.0-rc5\examples.pro and C:\qwt-6.0.0-rc4\textengines\textengines.pro), but here - this could be nice if someone could explain me the purpose as the mentioned to be included files are still one level higher.
4) open qwt.pro in QtCreator - done. Meanwhile it created the C:\qwt-build-desktop library. It's in debugging mode (I can see that on the left), so "Run" ... ... ... and:
Build Issues:
:: error: Qwt is configured without SVG support
Compile output:
http://szisziszilvi.lima-city.de/temp/qwtBuildingWarning.txt
loads of warnings, so I used this link-solution to show you first that it was too long and 2nd that this all may be for the SVG-related problem.

So my first question is how to step forward? Does it mean something like I should install SVG first? I guess this may stand for "Scalable Vector Graphics". I can see in the qwtconfig.pri file "QWT_CONFIG += QwtSvg", which is not a comment line, just in casre that matters.

szisziszilvi
27th January 2011, 07:51
There has been some watches but no answeres, so no ideas?

Ishmael
28th January 2011, 02:22
I just tried to install this on Windows XP (64) and am also not having any luck. I've made some progress by doing the following:

1) In qwt.pro change "include( ../qwtconfig.pri )" --> "include( qwtconfig.pri )". I think I changed this somewhere else too.
2) In src.pro change "QWT_ROOT = ../.." --> "QWT_ROOT = .."
3) In qwt.pro and mathml.pro add the line "QMAKE_LIBDIR += "C:/YOURPATH/qwt-build-desktop/lib/"

This gets me closer, but unfortunately, there are still lots of errors. The INSTALL file is utterly worthless. This is taking way too long just to compile the examples. Can anyone recommend a more stable solution (not Qwt) for plotting data?

Uwe
28th January 2011, 07:33
The internet is full of reports how people managed to build some version of Qwt somehow. Most of them are full of pointless or wrong steps - please don't ask me to comment them. Note, that there are more than 13000 downloads of the last Qwt version for Windows, so you can expect, that Qwt can be built without any problems - even if there are a couple of people that got lost.

Using the creator ( or any other IDE ) for building Qwt is absolutely pointless and is one of the main reasons, why people fail ( it's so easy doing it from the command line ). The other one is a lack of understanding of basic mechanisms of the OS and the Qt build environment.

Building and installing Qwt is as easy as it is described in the INSTALL - as long as you don't start to change the project files without understanding them.

0) unzip + cd <qwtrootdir>
1) Comment/Uncomment the build options in qwtconfig.pri to your needs
2) qmake
3) make
4) make install

When something fails it should be a problem in your environment. You can post your problems here, but don't start to do edit around until you get lost and frustrated.

Of course you can use the creator ( or any other IDE ) for building your application with Qwt. But this is the next step, where you can come back and ask again.

Often you read about how difficult Linux is - but you have distributions, where binary packages are built and installed for your system. Unfortunately on Windows there is no concept like this and everyone has to do it himself.

Uwe

szisziszilvi
28th January 2011, 09:21
I stepped according to the INSTALL file's description.
open the promt, I get to C:\qwt-6.0.0-rc5\ with using cd
qmake qwt.pro - no errormessage
make - I don't know how it should sound exactly in English, but I get the the error message: the system does not recognise the name (make) nor as inner or outer command, runabble application or batch file.

I remember I got this message before, and then I tried nmake, which seemed to be better, but was not the best somehow. Should I keep trying that rather than finding any other solution? It's a computer with XP installed, and I'm not the administrator if that matters.

Uwe
28th January 2011, 09:52
nmake should be fine too.

Note, that qmake uses several default settings from how it was built itsself. So be careful that you don't have a Qt build with MinGW and you try to build Qwt with MSVC ( or v.v ).

Uwe

Ishmael
29th January 2011, 02:12
Thank you, Uwe, for your comments. With your help, I was finally able to get the examples to compile.

The internet is full of reports how people managed to build some version of Qwt somehow. Most of them are full of pointless or wrong step
This indicates that the documentation could be better. So much frustration could be avoided by having a simple, clear set of instructions. For example, you mention:
Using the creator ( or any other IDE ) for building Qwt is absolutely pointless and is one of the main reasons, why people fail
This is a great help! Why oh why is this very helpful statement not included in the INSTALL file? Almost every other program compiles just fine from within Qt Creator - if this one doesn't, it should say so in bold type! Also the INSTALL file says "You need a release of qtmmlwidget >= 2.1." Do I have that? How do I find out? After digging around on the internet, it appears that this is now included in the default installation of Qt - so I think I can ignore this statement. Is that right?

In any case, thanks for your help! I've tried to follow your directions. Here are the results.

00) Close Qt Creator if it is open.

0) unzip + cd <qwtrootdir>

I chose my Desktop (C:\Documents and Settings\...\Desktop)

1) Comment/Uncomment the build options in qwtconfig.pri to your needs

Since all I want to do is see the examples for now, I will leave this unmodified, assuming that the defaults should compile the provided examples.

2) qmake

This worked.

3) make

Nope. 'make' is not recognized...
Try 'nmake'.
Nope. 'nmake' is not recognized...
Try 'mingw32-make'
Nope. "Cannot find 'c:\Documents'. Cannot find 'and'. Cannot find 'Settings...'
Ok, it doesn't like spaces. How do I fix this? No idea, so try moving the directory somewhere without spaces. I chose "C:\qwt-6.0.0-rc5".
Try 'mingw32-make'
Hallelujah! It compiled!

4) make install

'mingw32-make install'
Worked.

And now to test the examples:
5) Open Qt Creator.
6) Open project C:\qwt-6.00-rc5\examples\spectrogram\spectrogram.pro

It worked! Hurray!

Uwe
29th January 2011, 12:29
This indicates that the documentation could be better. So much frustration could be avoided by having a simple, clear set of instructions.

Even more frustration could be avoided by simply following these very simple, clear set of instructions:

qmake
make
make install



Why oh why is this very helpful statement not included in the INSTALL file? Almost every other program compiles just fine from within Qt Creator - if this one doesn't, it should say so in bold type!
Of course you can build Qwt with the Creator - but you need to know this tool. An experienced user of the Creator and the qmake build system won't have many problems - but in the end it does nothing else than qmake + make. So its not necessary to know about the Creator because it offers nothing interesting here beside for people that are afraid of using the command line.

I could also write down 100 other things you shouldn't do - but the only important information is to read the INSTALL file and to do what is written there. If you have problems with these steps ask on a support channel ( f.e here ).



Also the INSTALL file says "You need a release of qtmmlwidget >= 2.1." Do I have that? How do I find out? After digging around on the internet, it appears that this is now included in the default installation of Qt - so I think I can ignore this statement. Is that right?

No it is not included in the default installation of Qt, but yes you can ignore this statement as long as you are not interested in MathML support.

Note, that the situation is different with Qwt 6.x. As Nokia has changed the license of the Qt solution package Qwt 6 includes a modified and stripped down version of the qtmmlwidget source code, that is built for license implications into a separate library ( when enabled in qwtconfig.pri ).


Here are the results.
Let me comment them as again this is a piece of information others will try to follow.

Every reader should note, that your results are for a Qwt 5.x package and an unknown Qt 4 build - obviously done with mingw in release mode. Of course parts of these advices might be wrong for other Qt builds f.e with MSVC or debug mode.


00) Close Qt Creator if it is open.
Not necessary.


0) unzip + cd <qwtrootdir>
I chose my Desktop (C:\Documents and Settings\...\Desktop)

O.k.



1) Comment/Uncomment the build options in qwtconfig.pri to your needs

Since all I want to do is see the examples for now, I will leave this unmodified, assuming that the defaults should compile the provided examples.
There is an option in qwtconfig.pri, that controls if the examples should be built or not. Instead of assuming something it is better to set or unset this option.



2) qmake
O.k.



3) make

Nope. 'make' is not recognized...
Try 'nmake'.
Nope. 'nmake' is not recognized...

A problem of your environment, but of course mingw32-make is only for mingw environment. nmake is the MSVC counterpart - it doesn't make much sense to look for it when you are with mingw.



Try 'mingw32-make'
Nope. "Cannot find 'c:\Documents'. Cannot find 'and'. Cannot find 'Settings...'
Ok, it doesn't like spaces. How do I fix this? No idea, so try moving the directory somewhere without spaces. I chose "C:\qwt-6.0.0-rc5".

I'm not sure, but this should be a problem of qmake or some missing quotes in the Qwt project files.



4) make install
Note, that "make install" only copies and reorganizes the files into a configurable target directory. Many people don't do this important step being afraid, that they harm the system.

Of course one could argue, that "make install" should do more changes to your system ( like adjusting the PATH or setting other system wide settings permanently ).



And now to test the examples:
Pointless, when you have enabled building of the examples in qwtconfig.pri.

One additional warning for building your application: don't use the qmake project files used for building the examples, because they are written for building against the build directory - not the install directory.

Also note, that writing an application project file will be different between Qwt 5.x and Qwt 6.x, because Qwt 6 installs a qmake features file, that can be loaded by writing "CONFIG += qwt".

Uwe

Ishmael
30th January 2011, 00:16
Thank you, Uwe, for the helpful response. Also, thank you for authoring this package - it is quite beautiful.

Nevertheless, installing it could be easier. Please allow me to make some suggestions. The OP and I (and probably countless others) had the same problems, and it would be great if future users could avoid them. I would venture to say that most people (alas, myself included) do not read the INSTALL file until absolutely necessary. This may be bad practice, but I think it's an unfortunate reality. Why not read it? Well, usually it's not necessary. The usual steps when someone hands me a Qt project are: 1) Open it in Qt Creator. 2) Hit F5 (Build). If you do this with Qwt, however, you get the very misleading error the OP originally cited: "Qwt is configured without SVG support." Looking at the "Compile Output" tab, you see various errors listing missing files. This is what led me down the gloomy road of changing various paths, trying to get the code to compile.

Of course you can build Qwt with the Creator...in the end it does nothing else than qmake + make
So how do you do it? Can this be made the default? After all, Qt Creator is a development environment, and while there is nothing wrong with the command line, the beauty of having an IDE is that you don't have to leave it, and others have done a lot of work to make your life easier (e.g. F5 to build). In any case, it would certainly be nice if you could provide an error message that moves me in the right direction, e.g. "Don't compile Qwt here, do it from the command line".

Thanks again for the great package and the help!

Uwe
30th January 2011, 18:29
Ok, it doesn't like spaces. How do I fix this? No idea, so try moving the directory somewhere without spaces.
I've checked this and indeed building Qwt from a path with spaces is not possible. I tried the same with building the Creator itsself from a path with spaces - and it fails too.

Looks like a bug in qmake for the subdirs template. You can send a bug report for Qt if you want to.

I'm not aware of any workaround beside not using spaces - or stepping into each subdirectory and call qmake manually.


I would venture to say that most people (alas, myself included) do not read the INSTALL file until absolutely necessary.
Don't know - but when you don't read an INSTALL file ( even after failing ! ) you also wouldn't read any of these warnings you were asking for.



The usual steps when someone hands me a Qt project are: 1) Open it in Qt Creator. 2) Hit F5 (Build).
This is what you are used to - but I question that the Creator is the most popular Qt development environment on any platform. On Windows it should be MSVC on the Mac you might have XCode and lucky UNIXoids developers are used to more powerful and comfortable stuff like vim :-).


Can this be made the default?
Absolutely no - many Qt developers ( like me ) don't even have the Creator or any other IDE installed.

Note, that I don't own a Mac myself or have booted Windows for years. It's hard enough to build packages for so many platforms/versions I don't have myself, that I won't spend any time on making my life even harder with special hacks for all the possible IDEs ( I don't use myself ).

But of course I accept patches for the Qwt project files to support any IDEs - as long as they don't break plain qmake usage.


So how do you do it?

O.k. I installed the Creator on my Linux box and tried to build Qwt 6.0.0-rc5.

1) I opened qwt.pro.

For some reason the Creator has the default setting not to build Qwt in its source directory. This fails, because the relative paths used in the subdirectory project files doesn't work anymore. Well, maybe this could be fixed by introducing an environment variable for the root of the Qwt source tree, but this introduces one more source for problems for people not reading INSTALL files.

But the problem of the relative paths is something the Creator should/could learn. I recommend to send a problem report to the developer team of the Creator.

2) So I changed this "Shadow Build" setting in "Projects -> Build Settings" so, that the build is done in the Qwt source tree.

3) Then I started the build

Soon Qwt and all examples ( the build flag in qwtconfig.pri is enabled in Qwt 6.0.0-rc5 ) were built successfully.

Uwe

d_stranz
30th January 2011, 22:32
In MSVC, building Qwt (at least up to the 5.2 version I use now) is also straightforward, but you -do- have to know how to use MSVC to configure projects correctly, and this assumes you have the Visual Studio Qt plug-in / add-on installed:

1. Using the Qt plug-in, import the .pro file to make a Visual Studio .vsproj file from it.

2. Change whatever paths you need to point to your Qt installation.

3. Make any other changes; in my case, I change the names of the output libraries to match Qt conventions (debug has a "d" prefix, etc.) and locations for output files. I also build Qwt as a static library, so that requires removing QWT_DLL defines and changing the output type to static livrary.

4. Build.

It takes all of about 5 - 10 minutes to do all of the above. You need to do step 4 (only) each time you update Qt versions.

szisziszilvi
31st January 2011, 07:51
I am sure I do not have MSVC.

Uwe
31st January 2011, 19:58
I am sure I do not have MSVC.

O.k. but after following this thread do you have a solution ?

If not note, that the error message from your initial posting indicates that you did a "shadow build". Read my previous posting how to disable this.

Uwe

szisziszilvi
1st February 2011, 08:53
Sorry, I had to arrange other stuffs, but this one is far not forgotten. I could talk to somebody who might help me, I'll come back with the conclusion.

szisziszilvi
9th February 2011, 08:56
Hi, so the solution is the same someone had posted somewhere: I had to use mingw32-make instead of make.

If I could suggest something: maybe some changes in the INSTALL description would be useful for some other people like me, that on windows in case make does not work, just check what else is available in c:\Qt\2010.05\mingw\bin\ (or wherever qt has been installed).

Or there could be a "detaled install instructions fot those who has no idea why they failed whilst just following the steps in the INSTALL file" :) but really. I don't mean that would be the job of the developers, but could be still really helpful.

coming back soon with my problems with integrating qwt into the designer... :) Ok, no, I give time for that, hopefully I'll have less problems with that.