1

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.

bob.sacamento
  • 6,283
  • 10
  • 56
  • 115

1 Answers1

4

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.

ahart
  • 86
  • 3
  • Re: the target thing, I copied and pasted too fast. That was one of many variations I tried in trying to get this working. I meant to copy and paste the more "standard" variation. Sorry. Have edited the question. Re: crayftn, I actually did use ftn, but I thought -- sure as shootin' -- if I put that in the question, someone would say, "Hey, we can't really tell what compiler you are using!" Re: OpenMP, I actually do need that for this code, though I understand its not relevant to the question. Thanks. Am going to give your suggestion a try right now. – bob.sacamento Jan 06 '16 at 16:03
  • I mean't the "-h omp" flag was optional, as OpenMP is automatically supported. I edited the answer to make this clearer. – ahart Jan 06 '16 at 16:05
  • Not out of the woods yet, but you got me past this problem. Am accepting your answer. Thanks. – bob.sacamento Jan 06 '16 at 16:09