Search code examples
compilationfortranopenacccray

Compiling OpenACC Fortran code with Cray compiler


My attempt to compile an OpenACC Fortan code with the Cray Fortran compiler ...

crayftn -o msqcomp -h omp -h acc msquared.f90

fails with the error message

ftn-1350 crayftn: WARNING in command line
  Command line option "-hacc" is being ignored because an accelerator target has not been specified.

So apparently I have to specify the target accelerator. The thing is, I cannot find any documentation on how to do this anywhere, not in a Bing search and particularly not in the crayftn man pages. Anyone know what flags to use?

BTW, I am trying to compile for an nvidia Tesla K40. And I am stuck with the Cray compiler for now. Even if I could use another compiler at the moment, I will eventually have to get this worked out for crayftn. Thanks.


Solution

  • You set the target by loading the appropriate module before compilation. You probably want this target:

    module load craype-accel-nvidia35

    You should then compile using the "ftn" wrapper command, rather than the "crayftn" command.

    "-h omp" is the default for the Cray compiler, so you don't need this flag.

    "-h acc" is the default when the module above is loaded, so is also optional.

    See "man crayftn" and "man openacc" for details.