Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.
29252 Discussions

Problems on compiling petsc on intel itanium 2

wolfheimer
Beginner
624 Views
Hi!

I'm trying to compile the petsc-library (scientific library for solving linear/nonlinear equation systems) for a machine with Intel Itanium processor. The library is entirely written in C and provides an interface for calling the routines from fortran programs. While all works well, when compiling with the Intel Compilers for IA32 systems, all fortran programs compiled with the compilers for IA64 fail with a segmentation violation error, when running on the itanium system. The problem seems to be the fortran interface (because the c/c++ programs using the library work well). In this interface some fortran pointers are translated into c-pointers.

this is done by a command (Vec)(*(long *)(v)), where v is a fortran pointer. Vec should be a C pointer.

The question now is: Is there something different I need to do when using such a conversion on 64 Bit machines? I'm using the Intel Fortran and C/C++ Compiler on a machine running with Intel Itanium 2 processor with a windows 2003 server operating system.

Greetings

Felix
0 Kudos
2 Replies
Steven_L_Intel1
Employee
624 Views
It's difficult to say without seeing the code. Do note that the default INTEGER type in Fortran is still 32 bits. If the C code makes assumptions that pointers and ints are of the same size, this could cause problems.
I'd suggest using the debugger to see if you can spot what is going wrong when the error occurs,
0 Kudos
TimP
Honored Contributor III
624 Views
If your C pointers are more than 32bits, your Windows C compiler may require a long long data type. IPF C for linux has a 64-bit long, while Windows has 32-bit long. While Cray pointers in Intel Fortran work as default 32-bit integers on IA-32, the IPF usage I have seen requires a 64-bit integer, such as INTEGER*8. From your description, I guess you are using Cray pointers, but I'm not familiar with the application.
0 Kudos
Reply