Are you test PGI compiler using compiling Qt?

I compile qt 3.3.8 and qt 4.3.2 using PGI 7.12 on redhat AS 3.5 x86-64, but not successful.

Hi,

Can you give us a pointer where to download the source?

Hongyon

Qt is the standard framework for developing high-performance cross-platform applications. Qt provides single-source portability across Microsoft Windows, Mac OS X, Linux, all major commercial Unix variants, and embedded Linux.
There is two version: 3.3.8 and 4.3.2
Windows: 3.3.8 is not free
qt-win-opensource-src-4.3.2.zip
Mac: qt-mac-free-3.3.8.tar.gz
qt-mac-opensource-src-4.3.2.tar.gz

X11(Linux/Unix): qt-x11-free-3.3.8.tar.gz qt-x11-opensource-src-4.3.2.tar.gz

Hi,

I have downloaded 4.3.2 version. It does not look like they port for PGI. There are a quite few issues, including no C99 support with PGI C++. We will investigate and let you know as soon as possible.

Hongyon

Here is what I did to compile on X86_64 Qt 4.3.2 with 64-bit PGI compilers:

  1. Edit File: src/corelib/arch/qatomic_x86_64.h
    Line: 46

from:
#if defined(Q_CC_GNU) || defined(Q_CC_INTEL)

to:
#if defined(Q_CC_GNU) || defined(Q_CC_INTEL) || defined(Q_CC_PGI)


2) Edit file: src/script/qscriptlexer.cpp
Line: 709

from:
#if defined(Q_WS_WIN) || defined(Q_OS_SOLARIS) || defined(Q_OS_IRIX) || defined(Q_CC_HPACC) || defined(Q_OS_AIX) || defined(Q_OS_OPENBSD)
dval = strtod(buffer8,0L)

to:
#if defined(Q_WS_WIN) || defined(Q_OS_SOLARIS) || defined(Q_OS_IRIX) || defined(Q_CC_HPACC) || defined(Q_OS_AIX) || defined(Q_OS_OPENBSD) || defined(Q_CC_PGI)
dval = strtod(buffer8,0L)


Note:strtold is C99 and PGI does not yet support C99 and have no plan in the near future. strtod should be sufficient.

  1. Edit file: src/corelib/kernel/qeventdispatcher_unix_p.h
    Line: 118

from:
clock_t previousTicks;

to:
#if defined(Q_CC_PGI)
__clock_t previousTicks;
#else
clock_t previousTicks;
#endif

Another workaround: If you don’t want to update a source,
you can add -I/usr/include to compiler include flags to include system time.h instead of PGI time.h but we don’t know what would be the side effects.

  1. make new platform for 64-bit PGI,
  • cp -rf mkspecs/linux-pgcc mkspecs/linux-pgcc-64
  • cp -f mkspecs/linux-g+±64/qplatformdefs.h mkspecs/linux-pgcc-64
  • Edit file mkspecs/linux-pgcc-64/qmake.conf
    Change:
    QMAKE_LIBDIR_X11 = /usr/X11R6/lib
    to:
    QMAKE_LIBDIR_X11 = /usr/X11R6/lib64

and
QMAKE_LIBDIR_OPENGL = /usr/X11R6/lib
to:
QMAKE_LIBDIR_OPENGL = /usr/X11R6/lib64


5) configure with -no-stl.
For example,
% ./configure -prefix /your/install/dir -platform linux-pgcc-64 -no-stl

The reason to do this because if src/corelib/tools/qhash.cpp uses STL and there will be a clash in a name “hash”, which is also function names in that file. For Redhat, I would add -no-openssl if you don’t have its source.


I have not tried to run it. Hopefully, it will be OK.

Hongyon

Thanks!
I compile qt 4.3.2 successfully. I try compile qt 3.3.8. Two file need fixed:
src/tools/qdatastream.cpp, line 518
src/tools/qdir_unix.cpp, line 216

compile qt lib is ok. but when compile designer, uic( qt tool ) is run segment fault! Could you try qt 3.3.8, thanks!

Hi,

I have compiled qt 3.3.8 on Rhel 4 with following configuration:

% ./configure -prefix /your/location -platform linux-pgcc-64 -no-stl -thread --disable-largefile -static -system-libpng -system-libjpeg

I am not familiar with qt and I run a few binaries in examples/* directories and it seems to run just fine.

Note:

  1. You need to create linux-pgcc-64 the same/similar way as mentioned above in 4.3.2 version.

  2. Update linux-pgcc-64, change -fast to -O2. I don’t think it will make any difference as I also compile with -fast and it seems to run fine too but to be on the safe side as -fast contains many optimization and could cause an error.

  3. Change src/tools/qdatastream.cpp , line 518 as you mentioned.

  4. No change for qdir_unix.cpp, line 216. I decided to use --disable-largefile instead as we don’t know the side effect for source change and -D_FILE_OFFSET_BITS=64.

  5. I used system libpng and libjpeg as we don’t know if qt ported their source for PGI or not. libmng is not available on the machine I compile.


    Hongyon

Additional info on strtold:

  1. strtold is string to long double.
  2. gcc long double is an 80-bit FP number format.
    pgcc, pgCC long double is a 64-bit FP number format.
  3. We do not see adding support for > 64-bit long doubles for some time.

Hongyon