castrophic error: cannot find open source file "include

I am having a problem when I am trying to accelerate my existing c++ code using pgi OpenACC compiler.

When I use an example code it compiles without any problem. For example I used nbody example and it compiled successfully as shown below;

root@prince-300E4C-300E5C-300E7C:/opt/pgi/linux86-64/2016/examples/OpenACC/samples/nbody# pgcc -fast -acc -ta=tesla -Minfo=all nbodyacc.c
NOTE: your trial license will expire in 13 days, 2.99 hours.
seqintegrate:
90, Zero trip check eliminated
Loop not vectorized/parallelized: contains call
104, Generated vector sse code for the loop
PGC-S-0155-Procedures called in a compute region must have acc routine information: bodyBodyInteraction (nbodyacc.c: 164)
PGC-S-0155-Accelerator region ignored; see -Minfo messages (nbodyacc.c: 151)
integrate:
149, Generating copy(force[:n])
Generating copyin(in[:n])
Generating copyout(out[:n])
Generating copy(vel[:n])
151, Accelerator region ignored
161, Loop not vectorized/parallelized: contains call
164, Accelerator restriction: call to ‘bodyBodyInteraction’ with no acc routine information
175, Accelerator kernel generated
Generating Tesla code
176, #pragma acc loop gang, vector(128) /* blockIdx.x threadIdx.x */
PGC/x86-64 Linux 16.10-0: compilation completed with severe errors
root@prince-300E4C-300E5C-300E7C:/opt/pgi/linux86-64/2016/examples/OpenACC/samples/nbody#


But when I use compiler directives to parallelize existing loops in my existing C++ code its poping up the following error ;

oot@prince-300E4C-300E5C-300E7C:/home/prince/ceph_ajou/src/osd# pgc++ -fast -acc -ta=tesla -Minfo=all Dedup.cc
“Dedup.h”, line 20: catastrophic error: cannot open source file
“include/types.h”
#include “include/types.h”
^

1 catastrophic error detected in the compilation of “Dedup.cc”.
Compilation terminated.
root@prince-300E4C-300E5C-300E7C:/home/prince/ceph_ajou/src/osd#


Can anyone assist

Hi Prince Hama,

For the first error, you need to add “-Minline” to inline the “bodyBodyInteraction” function into the compute region. Alternately, you could add the “routine” directive to have the compiler create a device callable version of the function. Here’s the flags used in the Makefile:

pgcc -c -DFP64 -fast -Minline check.c
pgcc -DFP64 -fast -Minline -Minfo -acc  -o nbody.out nbodyacc.c check.o

For the second error, the compiler can’t find the types.h header file. For this, you’ll need to add the “-I<path_to_base_inlcude_dir>” flag to tell the compiler where to find the header file. Use the path where the “include” directory is located (most likely “/home/prince/ceph_ajou/” or “/home/prince/ceph_ajou/src”).

Hope this helps,
Mat