Using different compilers

Dear all,

We have an application consisting mainly of Fortran code and some C / CPP code. We want to utilize the PGI accelerator / GPU possibilities. Furthermore there are a few legacy libraries with CPP code. Furthermore the main program is a CPP file. These legacy libraries are compiled with the Intel icpc / icc compiler (version 10.1), till now we compiled our application also with the mentioned Intel Compiler.
I’m trying to port the application and as the name mangling of the Intel icpc compiler and the PGI pgCC compiler are different it is, as far as I know, not possible (without great effort it might possibly be possible to map the both name mangling onto each other through a glue library).
So I used the Intel icpc compiler for the CPP part and the PGI pgf90 compiler for the Fortran part. Everything compiles and links and the executable starts but after a while the application hangs in the code of one of the legacy libraries (with the Intel icpc and Intel ifort compiler the application works).

Has anyone ever tried to use the Intel icpc compiler together with the PGI pgf90 compiler and found any pitfalls ? or are there any special options to be used ?
Has anyone noticed a similar behavior (application that hangs) ?

This message will be cross posted in the PGI and Intel forums

Any suggestion welcome,

Best Regards,

Albert

Hi Albert,

Are you using Windows or Linux?

On Window’s MS C++ users need to call the PGI runtime routine ‘pghpf_init’ at the start of their program in order to initialize the PGI Fortran runtime. The same would apply for Intel Compilers on Windows.

For example:

static int zz = 0;
main()
{
... cut
    pghpf_init(&zz);  
... continues

On Linux, we removed this requirement several releases ago. Though, you may try adding ‘pghpf_init’ in case we missed something.

If this doesn’t work, then you’ll need to do some more digging. You can compile the Fortran portions with “-g” and run the code through the PGI debugger, PGDBG. It will complain that the main routine wasn’t compiled with “-g” and all Intel compiled code will be shown in assembly, but you should be able to add break points in the Fortran code and debug as normal.

Hope this helps,
Mat