can't Install_cdk

Hello everyone, how can I install the file (install_cdk). this what I can see in the terminal
Usage: ./install_cdk [install dir] [release #] [major #] [remote exec] [remote copy]
can you please help me

Hi h.alosaimi,

Please do not run the “install_cdk” script directly and instead only run the top level “install” script. For full details please see:

All MPI and support libraries which use to be only part of the CDK and now included with all PGI installations.


thank you for your replay mat
so I only need to do this ./install right?

I have another question:

What should I do with MANPATH: Undefined variable.
I wrote this in the terminal
$ setenv MANPATH “$MANPATH”: /opt/pgi/linux86-64/18.4/man/
but all I can see is :
MANPATH: Undefined variable.

Yes, ./install should be the only thing necessary if you just want to install.

Regarding MANPATH, I think you’ll see this error if you’re running csh. The shell won’t treat unset variables as empty (I believe bash will) and it’ll throw an error like what you’re seeing.

The solution, if you still want to use csh, is to either check for whether it is empty or change the command-substitution to use backticks:


setenv MANPATH "`manpath`: /opt/pgi/linux86-64/18.4/man/"

thank you very much aglobus, I tired it and it works perfectly.
I have another question,

if I want to run my code using this:
pgcc –acc [-Minfo=accel] [-ta=nvidia] –o hello_acc testing.c

this is appear for me:
/usr/bin/ld: cannot find –acc: No such file or directory
/usr/bin/ld: cannot find –o: No such file or directory
/usr/bin/ld: cannot find hello_acc: No such file or directory
I followed all the step in this guide
but I can’t figure out what is going wrong.

Hi h.alosaimi,

While it wouldn’t cause this error, are you trying to run the command the brackets? When you see these in the documentation, they signify that the flag is optional. Hence if you include the flag, please remove the brackets.

For example:

pgcc –acc -Minfo=accel -ta=tesla –o hello_acc testing.c

The actual error is very odd since this is the error you’d get if you were invoking the linker (ld) directly where these falg. Can you please post the output (copy and paste the full command), of the following commands:

which pgcc
pgcc -V
pgcc –acc -Minfo=accel -ta=nvidia –o hello_acc testing.c -v

The “-V” flag will have the compiler print out version information while the “-v” is the verbose flag and will have the compiler driver show all the commands it’s executing.


Hi mat,
this is the output after I run the commands.
I upload the output as text file
this link for windows output

this link for Linux output

Looks like both ran successfully.

Do you have an example of the failing case or did you determine the problem?


it runs perfectly after removing the brackets but when I run this command and I use acc directive inside the code this appear

pgc++ –acc -Minfo=accel -ta=nvidia –o hello_acc loop.cpp
PGCC-S-0155-Compiler failed to translate accelerator region (see -Minfo messages): Could not find allocated-variable index for symbol (loop.cpp: 3)
3, Accelerator kernel generated
Generating Tesla code
5, #pragma acc loop vector(128) /* threadIdx.x */
5, Loop is parallelizable
PGCC-F-0704-Compilation aborted due to previous errors. (loop.cpp)
PGCC/x86 Linux 18.4-0: compilation aborted

1/ why it failed to translate the accelerator
2/ what is the error that cause the compilation aborted

Usually when I see this error it’s because you’re using a pointer to an object within the compute region but didn’t add the pointer to a data clause. This sometimes confuses the compiler since it can’t determine what the pointer is nor it’s size. Especially if you’re using a class object with dynamic data members since the compiler has no shape or size information about the members.

Can you post an example of the loop that you’re trying to offload including the data types of the variables in the loop?

Are you using a class object that contains dynamic data members? If so, you may need to do a manual deep copy of the data structure to use it on the device. You can see some example codes that I wrote on how to do this as part of Chapter 5 of Parallel Programming with OpenACC edited by Rob Farber. (


Hello mat,
I was using a normal example that contain of simple loop and cout a text to understand openacc concept.
then I used saxpy.c example from

and this is appear to me:
5, Accelerator kernel generated
Generating Tesla code
6, #pragma acc loop gang, vector(128) /* blockIdx.x threadIdx.x */
5, Generating implicit copy(y[:n])
Generating implicit copyin(x[:n])
/usr/bin/ld: cannot find –acc: No such file or directory
/usr/bin/ld: cannot find –o: No such file or directory
/usr/bin/ld: cannot find saxpy_acc: No such file or directory
pgacclnk: child process exit status 1: /usr/bin/ld
Makefile:2: recipe for target ‘all’ failed
make: *** [all] Error 2

In make file I do it like this:
pgcc –acc -Minfo=accel -ta=nvidia –o saxpy_acc saxpy.c

Hi h.alosaimi,

Sorry for my confusion, but you’ve moved to a different code with a what appears to be a different but similar error to your first “testing.c” example. I thought you solved this by not including the brackets? Did you solve the issue with “loop.cpp”?

For this issue with “saxpy.c”, my guess is that you’re trying to link directly with “ld” and passing it the PGI flags. Though I can’t tell for sure since the information is incomplete.

What would be very helpful for each of these issues is for you to cut and paste full command line output. Also if you can post the contents of the Makefile.

Please post the full output from the following commands:

% cat saxpy.c
% cat Makefile
% make


For testing.c yes the problem were solved by not including the brackets.

This is the loop code and it is very simple code because I am trying to understand openACC logic:
Make file!
I use this with all of my code.
pgcc –acc -Minfo=accel -ta=nvidia –o saxpy_acc saxpy.c

Great, thanks.

For the loop code, we don’t support I/O on the device in C/C++ and only unformatted “print *” in Fortran. So the problem is the “cout”.

For the Makefile, I updated it to try to compile saxpy.c instead of loop.cpp.

I was able to reproduce compilation error. The problem is your “-” characters. In looking at the individual characters, the “-” in front of “-acc” and “-o”, is not the ASCII character 45, but rather three characters “226 128 147”. While the sequence looks the same on the screen, the second isn’t parsed by the compiler so assumes they are linker commands and passes them through.

My guess, is that you copied and pasted the command line from a PDF file and how you got the alternate representation.

Can you try editing the Makefile, deleting the “-” characters, and then retyping them?


Thank you Mat,

Yes I was copying and pasting from the pdf file, but after I rewrite them it work perfectly.
***** Is it possible to see the code after putting the acc directive, I mean it is possible to see the loop transformation or not?
***** All the time I want to work with pgi compiler I have to write down all of these commands to make pgi accessible. I tried to make executable file
one for csh and I call it runcsh.csh :
and the other to run bsh commands, and I call it
when I run them noting happen and all I can see is:
pgc++: command not found
***** Is there any way to make these command work directly when I open the shell?
Thank you

Is it possible to see the code after putting the acc directive, I mean it is possible to see the loop transformation or not?

Adding “-Minfo=accel” will have the compiler display feedback messages about what loops it’s offloading as well as the schedule it’s using.

Though, what I think you might be asking here is if you can see the generated CUDA kernel?

By default, we target a low level LLVM device code generator. But you can switch to using a CUDA code generator and then keep the resulting file for inspection via the flags “-ta=tesla:nollvm,keep”. The CUDA kernels will be in a file with a “.gpu” extension.

Is there any way to make these command work directly when I open the shell?

Add these command to your bash or csh rc file in your home directory. The exact file will depend on how you have things setup, but look for files named like “.bashrc”, “.cshrc”, “.bashrc_profile”, etc.