How to compile GromacsGUI 0.5.x

11 09 2008

This is a mini-howto for compiling GromacsGUI mainly for those who may have not worked with compiling stuff before, or want to test the software in linux distributions other than (k)ubuntu 8.04 and OpenSuse 10.3 for which I explained exact steps.

Basics
1. For compiling GromacsGUI, you need both Qt4 (>4.3.x) and Qwt (>5.x) and their devel packages.

2. Use your distribution package manager to install these packages. They are usually called like these: libqt4, libqt4-dev, libqwt5-qt4 and libqwt5-qt4-dev.

You should also have make and g++ installed. If you don’t have them, install them too.

3. Now download GromacsGUI and extract the downloaded file. You should have two directories now: grogui_noplotting and gui_withplotting .

4. We will try to compile GroGUI with plotting support (gui_withplotting) so go to this directory. Then you have to tell the compiler where it can find Qt and Qwt files. We do this using grogui.pro file which looks like this:

DEPENDPATH += . \
include \
src \
ui \
/usr/include/qwt5
INCLUDEPATH += . \
include \
ui \
/usr/include/qwt5
LIBS += -lqwt

These three entries are most important ones which specifies the locations of Qt and Qwt files. We will edit the bold items accordingly.

5. When you install Qt and Qwt using a package manager, they are usually installed in your PATH. PATH is a series of directories that linux searches to find a specified program. You can see your PATH by typing this in a terminal and hitting Return key:

echo $PATH

and you will see something like this

/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games

You can use your package manager to check where Qt4 and Qwt5 files are installed. For example, in adept click on package name, then push “Details” button then go to “Installed Files” tab.

6. There is usually no problem with Qt4 and it is installed correctly. However for Qwt5, installation names are different among different distributions so we have to edit grogui.pro for “Qwt lib name and include files path”.

lib files are usually installed in /usr/lib or /usr/local/lib . Go to these directories and look for something that has libqwt in its name like libqwt.so.1 or libqwt-qt4.so.1 .

Now, you must use this name in “LIBS +=” section of grogui.pro file in this way:

  • remove lib and .so.* from library filename: libqwt-qt5.so.1 —> qwt-qt4 or libqwt5.so.1.0.1 —> qwt5
  • add a -l to at the beginning of library name: qwt-qt4
  • now type this name in front of “LIBS +=” field: LIBS += -lqwt-qt4

7. Now you must locate the pah of Qwt5 include files. You can use your package manager to find out where they are installed. Usually they are installed in /usr/include or /usr/local/include . Look for a directory name that contains “qwt”. Like /usr/include/qwt-qt4 or /usr/include/qwt5 . It contains files like qwt_abstract_scale_draw.h and qwt_plot_item.h .

Now replace the lines shown in bold above in “DEPENDPATH +=” and “INCLUDEPATH += entries”. For example if our include path is /usr/include/qwt-qt4 our grogui.pro file must looks like this:

DEPENDPATH += . \
include \
src \
ui \
/usr/include/qwt-qt4
INCLUDEPATH += . \
include \
ui \
/usr/include/qwt-qt4
LIBS += -lqwt-qt4

8. Now save your grogui.pro file. Open a terminal grogui.pro directory and enter:

qmake

and when it finishes, enter:

make

9. Now test the first run. Enter:

./grogui

Hope you see the program window!

About these ads

Actions

Information

2 responses

2 04 2009
Jyoti

Ayyo! Why not make a rpm and deb package… it is so troublsome? Why not use autoconf and automake or a shell script to generate makefile? Generating a qmake project file by hand is the last thing that an end-user should do. How will you manage when the project grows?

12 05 2009
Manoj Rajagopalan

Some users may need to use qmake-qt4 instead of qmake.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s




Follow

Get every new post delivered to your Inbox.

%d bloggers like this: