Install PGI for Ubuntu

I tried to install PGI compiler to execute this command “pgc++ -fast -acc -Minfo=accel” but when I pasted on terminal the error message show “pgc++: command not found”
Can you help me on this please.

Hi SaeedMAL,

Did you set your PATH to include the compiler’s bin directory?


“Unpack the HPC SDK software. In the instructions that follow, replacewith the name of the file that you downloaded. Use the following command sequence to unpack the tar file before installation.
% tar xpfz .tar.gz
The tar file will extract an install”

How can download the package of HPC SDK software as tar.gz .


Go to the downloads page and select the “tarball” package.

I did install the “tarball” package and the instillation finished, but I still have the same error"pgc++: command not found", when I compiled this command “pgc++ -fast -acc -Minfo=accel version_22.cpp ”.

Could you please help me how to compile the OpenACC.

Did you set your PATH as described in the documentation I first posted?

Do main “/opt/nvidia/hpc_sdk”

or you meant “$ NVARCH=Linux_x86_64; export NVARCH
$ NVCOMPILERS=/opt/nvidia/hpc_sdk; export NVCOMPILERS
$ PATH=$NVCOMPILERS/$NVARCH/22.5/compilers/bin:$PATH; export PATH”

I follow all the steps and have the same problem.
“pgc++: command not found”
“nvc++: command not found”
I do not know what is going on ?

By PATH, I’m meaning the shell environment variable which is used by the command shell to find executables. If the compiler bin directory is not in your PATH, then you would get this message.

“/opt/nvidia/hpc_sdk” is the default installation location, though since this can be adjusted by the user at installation, if you installed the compilers in a different base directory, you will need to replace the NVCOMPILERS variable with this directory.

Also, you need to use the appropriate commands for the shell that you’re using. This one is for “bash”, the section with the “setenv” commands would be for “csh”.

Finally, the settings are not persistent so you either need to set these environment variables each time you open a new shell or put them into your “.bashrc” or “.cshrc” file in your home directory.

Now you do have a typo in the above command where PATH has a quotation mark at the end, but I’m not sure if that’s just a cut and paste issue in the post or you added this to the command you’re using.

Assuming you installed the compiler in the default directory, using bash, and have set the environment variables correctly, can you please post the output from the following commands:

echo $PATH
ls /opt/nvidia/hpc_sdk/Linux_x86_64/22.5/compilers/bin/nvc++

I’d like to double check what’s in your PATH and if nvc++ is installed.

That all looks correct. Now can you show me the output from the command “which nvc++” and the error in context, i.e. the full command line you’re using with the error?

Are you running the compilers via a script? Again, the PATH variable isn’t persistent between shell invocations so if a script is run it may be opening a new shell where the PATH isn’t set. In this case, you want to put the commands above in your “.bashrc” file in your home directory.

It does look like you’re running as root, are you only getting this error when run under your user account?

I don’t think it’s a permission problem because I’d expect a different error, but you might also want to check that users have read permissions on the directories and read+execute permissions on the binaries.

Ok, so now you’re running under the user name “saeed” while you set the PATH while running as “root”. Again, the PATH is not persistent so when opening a new shell, which happens if you change users, you need to reset the PATH. To make things easier, please add the same environment settings to your .bashrc file in your home directory so whenever a new shell is invoked, the environment variables will be set. This needs to be done for each user.