Appendix

Notes on Compiling and Installing Qt

This appendix briefly describes how to customize the Qt installation process if it is only used to build and run CUBE. In this case, some functionality of Qt can be disabled to speed up the build process.

In order to compile and use CUBE, only the Qt libraries are necessary. To disable compilation of other parts, the ``-nomake <part>'' option can be provided to the configure script. The following parts can be specified:

tools

Although not strictly necessary for building and using CUBE, the ``qtconfig'' tool which provides a convenient way of defining default settings (e.g., window styles, font sizes, etc.) for all Qt-based applications will be built and installed as part of the tools part. Recent versions of Qt, however, take their settings from KDE (if available), i.e., this tool might not be needed.

examples

This part will build and install a huge number of example programs referenced from Qt's html documentation. These are not required by CUBE.

demos (>= Qt 4.3)

Enabling this part will build and install a number of additional demo codes which aren't required by CUBE as well.

docs (>= Qt 4.4)

This part is responsible for creating and installing the HTML reference documentation of Qt. You don't need to install it unless you plan to develop Qt applications yourself.

translations (>= Qt 4.4)
If disabled, English will be the only supported language by various Qt tools.

In addition, Qt 3 backwards-compatibility support is not required by CUBE and can be disabled with the ``-no-qt3support'' switch. Furthermore, the Phonon and WebKit modules provided by Qt >= 4.4 are known to sometimes cause compilation problems. They can be disabled by specifying the ``-no-phonon'' or ``-no-webkit'' options, respectively.

Compiler- and Platform-specific Notes

This section contains some additional notes with respect to compilers and platforms where we encountered issues during our testing. Please also have a look at the generic platform and compiler notes of the Qt documentation:
http://doc.qt.nokia.com/supported-platforms.html

Cray XT

Building Qt and then CUBE with GNU compilers on Cray XT systems should be straightforward, however, it warrants paying attention to the compilers used and library dependencies they introduce. If, for example, the PrgEnv-gnu module is loaded when Qt is built, and PrgEnv-gnu depends on gcc/4.3, then it is likely to be required when CUBE is built. More critically, there is likely to be a dependency on gcc/4.3 when CUBE is executed which is at best inconvenient and likely to interfere with the gcc modules used by various PrgEnv modules. In particular, PrgEnv-pathscale typically expects a different gcc module.

It is therefore recommended to build Qt with the system-default /usr/bin/g++ (typically v4.1.2) to avoid introducing dependencies on gcc modules.

If Qt is already built and installed with a dependency on a gcc module, and it is not desired to install a new version, then it is recommended to build CUBE explicitly specifying /usr/bin/g++ (rather than picking up g++ from a module on the path). You will need to modify the ECC and ECXX settings in Makefile.defs along with arguments to qmake:

    ECC = /usr/bin/gcc
    ECXX = /usr/bin/g++
    QT_QMAKE = qmake QMAKE_CXX=$(ECXX) QMAKE_LINK=$(ECXX)

Intel Compiler

Various revisions of the Intel compilers are known to have problems compiling Qt. See
http://doc.qt.nokia.com/compiler-notes.html
for details. If you are using any of these revisions, we suggest to compile Qt using the GNU compilers instead. CUBE, however, can still be compiled and linked using the Intel compilers.

IBM AIX

Unfortunately, compiling Qt and CUBE on IBM AIX systems is not straightforward and a number of pitfalls need to be avoided. Please follow the instructions given below.

Compiling Qt

Officially, Qt only supports IBM's XL compilers up to version 6. Our experience shows that versions 7 to 9 are typically not able to compile Qt, and even if compilation succeeds, serious display issues can show up in Qt-based applications.

Our current recommendation is to use IBM's XL compiler version 10 in conjunction with a slightly modified version of Qt 4.5.1 (patch file provided, see below). If you don't have access to version 10 of the XL compilers, we recommend to use a recent version of the GNU compilers.

  1. Unpack Qt sources
    You need an up-to-date version of GNU tar; AIX tar does not work as it has problems with some very long filenames inside the Qt tar files. Otherwise compiling will not work because some files will be created with wrong (i.e., truncated) names.

    Old versions of GNU tar also have a bug affecting unpacking Qt tar archives. Unfortunately, we do not know when this bug was fixed; GNU tar version 1.20 works for us, version 1.13 does not.

                gtar xfz qt-x11-opensource-src-4.5.1.tar.gz 
        

  2. Patch Qt sources
    To compile Qt with XL C version 10, the Qt source code needs to be patched, as XL C is more pedantic than other compilers. Note that this step is not necessary when using the GNU compilers, although it does not hurt either.

                 cd qt-x11-opensource-src-4.5.1 
                 patch -p 1 < Qt-4.5.1_AIX-xlC10.patch 
        

    The patch file can be found in the contrib directory of the CUBE distribution package. We submitted this patch to Nokia as a bug report; hopefully future versions of Qt will have it already integrated.

  3. Configure Qt
    The following parameters need to be used in any case for the configure call:

               ./configure -prefix <install_path> -platform <pform> 
        


    When using the IBM XL compilers, <pform> is ``aix-xlc'' or ``aix-xlc-64'' to compile the 32 or 64-bit version of Qt, respectively. For the GNU compilers, use either ``aix-g++'' or ``aix-g++-64''.

    See Appendix'Notes on Compiling and Installing Qt'for additional options that can be specified to save compilation time and disk space in case the Qt installation is only intended to be used for CUBE.

  4. Compile and install Qt
    Similar to CUBE, compiling and installing Qt requires GNU make.
                 gmake 
                 gmake install 
        

Compiling CUBE

Once Qt is set up, compiling CUBE is basically straightforward.

The configure script performs a set of checks trying to find out the parameters, how to compile the CUBE GUI. If it fails, you need to make sure to pass the correct options to the configure script.

When using the GNU compilers, configuration should work out of the box, unless Qt has been compiled with a non-default precision. In this case, you need to overwrite the default compiler options:

        ./configure CFLAGS="-O2 -m<prec>" CXXFLAGS="-O2 -m<prec>" 

where <prec> is either 32 or 64.

For the XL compilers, you also need to provide the compiler name:

        ./configure \
        CC=xlc  CFLAGS="-O2 -q<prec>" \
        CXX=xlC CXXFLAGS="-O2 -q<prec>" 

where <prec> is again either 32 or 64. For the 32-bit version, you should also provide

         LDFLAGS="-bmaxdata:0x80000000" 

to increase the amount of memory available to the application.

Some parts of CUBE code use operator dynamic_cast<...>.

According to http://www-01.ibm.com/support/docview.wss?uid=swg21007500 , the dynamic_cast operator will always return NULL if the compiler isn't instructed to generate the necessary dynamic type information.

Till this issue is not resolved by CUBE build system automatically, please configure CUBE on POWER/AIX with

         CXXFLAGS="-qrtti=dynamiccast" 

Mac OS X

When using Mac OS X 10.6 ("Snow Leopard"), you need at least Qt version 4.6. Older versions of Qt are known not to work as expected.