# nvvmCompileProgram error: 9.

**URL:** <https://forums.developer.nvidia.com/t/nvvmcompileprogram-error-9/135675>\
**Category:** Legacy PGI Compilers (archived)\
**Created:** [April 17, 2018, 6:48pm UTC](https://forums.developer.nvidia.com/t/nvvmcompileprogram-error-9/135675 "2018-04-17T18:48:39Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Angel\_de\_Vicente](https://sea2.discourse-cdn.com/nvidia/user_avatar/forums.developer.nvidia.com/angel_de_vicente/32/65703_2.png) [@Angel\_de\_Vicente](https://forums.developer.nvidia.com/u/Angel_de_Vicente)\
**Post date:** [April 17, 2018, 6:48pm UTC](https://forums.developer.nvidia.com/t/nvvmcompileprogram-error-9/135675/1 "2018-04-17T18:48:39Z")

</div>

Hi again,

a code that compiles and runs OK in the no-OpenACC version, gives the following error when compiled with OpenACC support, and I have no idea how to go about fixing it.

```nohighlight
nvvmCompileProgram error: 9.                                                                                                                                                                                                    
Error: /tmp/pgaccrJKbZj2FzDs8.gpu (1971, 36): parse '@Faddeeva_w' defined with type '%struct.__dcomplex (%struct.__dcomplex, double)*'

```

The code calculates de Faddeeva function, and it is the code mentioned in [Faddeeva Package - AbInitio](http://ab-initio.mit.edu/wiki/index.php/Faddeeva_Package).

For ease, I have uploaded the original code (and the changes I did) to [FileNurse - Free eBook, PDF and Document Sharing](https://filenurse.com/download/7adb7e4d6d6730c66af07d2943b6a697.html)

As it is, if I compile without -acc I get no problems:

```nohighlight
[angelv@deimos Fad_MIT]$ pgcc -c -cpp -o fad.o Faddeeva.c
[...]
PGC/x86-64 Linux 18.3-0: compilation completed with warnings                                                                                                                                                                    
[angelv@deimos Fad_MIT]$

```

But if I compile with -acc support I get the following:

```nohighlight
[angelv@deimos Fad_MIT]$ pgcc -c -cpp -ta=tesla:cc60 -acc -o fad.o Faddeeva.c  
[...]                                                                                                                                                                               
nvvmCompileProgram error: 9.                                                                                                                                                                                                    
Error: /tmp/pgaccuode8IXo0OuB.gpu (2002, 36): parse '@Faddeeva_w' defined with type '%struct.__dcomplex (%struct.__dcomplex, double)*'                                                                                          
PGC-S-0155-Compiler failed to translate accelerator region (see -Minfo messages): Device compiler exited with error status code (Faddeeva.c: 1)                                                                                 
PGC/x86-64 Linux 18.3-0: compilation completed with severe errors                                                                                                                                                               
[angelv@deimos Fad_MIT]$

```

You can see the few changes that I did to try to get it to compile with PGI and OpenACC by diff’ing Faddeeva\_original.cc and Faddeeva\_oacc.cc.

I guess this is related to bug FS#25493, which I reported the other day ([nvlink error: Prototype doesn't match (Fortran+C + OpenACC)](https://forums.developer.nvidia.com/t/nvlink-error-prototype-doesnt-match-fortran-c-openacc/135666/1)), but not completely sure.

Any idea if/how this can be fixed?

Thanks,  
AdV

---

<div class="post-metadata">

**Author:** ![MatColgrove](https://sea2.discourse-cdn.com/nvidia/user_avatar/forums.developer.nvidia.com/matcolgrove/32/14047_2.png) [@MatColgrove](https://forums.developer.nvidia.com/u/MatColgrove)\
**Post date:** [April 17, 2018, 9:23pm UTC](https://forums.developer.nvidia.com/t/nvvmcompileprogram-error-9/135675/2 "2018-04-17T21:23:06Z")

</div>

Hi AdV,

This looks like a code generation bug when passing in the complex type to a device subroutine. Specifically when passing “z” to “FADDEEVA(w)”

```nohighlight
#pragma acc routine seq
void FADDEEVA(subw)(double a, double v, double relerr,double *out_real, double *out_imag) {
  cmplx z;
  cmplx ret;

  z = C(v,a);
  // z = v + _Complex_I*a;
  ret = FADDEEVA(w)(z,relerr);
  *out_real = creal(ret);
  *out_imag = cimag(ret);

  // printf("FAD %g %g %g %g %g",a,v,relerr,*out_real,*out_imag);
}

```

I’ve created a new bug report, TPR#25528, and sent to engineering. It might be related to the other bug you reported last week since they’re both calling the same device routine.

I was able to work around the problem by inlining the routine.

```nohighlight
% pgcc -c -o fad.o Faddeeva.c -ta=tesla:cc60 -w -V18.3 -Minline
PGC/x86-64-Extractor Linux 18.3-0: completed with warnings
PGC/x86-64 Linux 18.3-0: compilation completed with warnings

```

Can you try using -Minline to see if it helps?

-Mat

---

<div class="post-metadata">

**Author:** ![Angel\_de\_Vicente](https://sea2.discourse-cdn.com/nvidia/user_avatar/forums.developer.nvidia.com/angel_de_vicente/32/65703_2.png) [@Angel\_de\_Vicente](https://forums.developer.nvidia.com/u/Angel_de_Vicente)\
**Post date:** [April 19, 2018, 5:49pm UTC](https://forums.developer.nvidia.com/t/nvvmcompileprogram-error-9/135675/3 "2018-04-19T17:49:02Z")

</div>

Hi,

with -Minline I managed to get it working. So now the question is to get good performance, but I will post that in another thread.

Many thanks,
