I am taking the basic example from :
#include <stdio.h>
#define N 2000000000
#define vl 1024
int main(void) {
double pi = 0.0f;
long long i;
#pragma acc parallel vector_length(vl)
#pragma acc loop reduction(+:pi)
for (i=0; i<N; i++) {
double t= (double)((i+0.5)/N);
pi +=4.0/(1.0+t*t);
}
printf("pi=%11.10f\n",pi/N);
return 0;
}
but I am getting the following output:
nvidia@tegra-ubuntu:~$ gcc pi.c -fopenacc -o gpu.x
nvidia@tegra-ubuntu:~$ ./gpu.x
libgomp: while loading libgomp-plugin-host_nonshm.so.1: libgomp-plugin-host_nonshm.so.1: cannot open shared object file: No such file or directory
How do I generate the libgomp-plugin-host_nonshm.so for I can execute the code successfully?
Thanks
Upd: have found something “http://scelementary.com/2015/05/19/openacc-on-jetson-tk1-2-ipmacc-compiler.html”
More references:
Regarding OpenAcc library in Jetson TX2 - Jetson TX2 - NVIDIA Developer Forums
https://devtalk.nvidia.com/default/topic/926216/openacc-with-jetson-tx1/
However, it turned out that OpenMP example works well:
#include <stdio.h>
int
main()
{
#pragma omp parallel
{
printf("hello world\n");
}
return 0;
}
gcc -fopenmp hello.c
./a.out
hello
...
How to say to gcc -fopenacc that it should provide x86_64 file as an output to test /run it at a host PC?
Try this:
sudo apt-get install libgomp1
ShaneCCC,
thank you for your response. That is exactly what I did try. However while the library seems somewhat installed by default[it comes with 28.2] it wont allow to execute gcc -fopenacc directives, as it seems to me.
libgomp1 is already the newest version (5.4.0-6ubuntu1~16.04.9).
locate libgomp
/usr/lib/aarch64-linux-gnu/libgomp.so.1
/usr/lib/aarch64-linux-gnu/libgomp.so.1.0.0
/usr/lib/gcc/aarch64-linux-gnu/5/libgomp.a
/usr/lib/gcc/aarch64-linux-gnu/5/libgomp.so
/usr/lib/gcc/aarch64-linux-gnu/5/libgomp.spec
/usr/share/doc/libgomp1
/var/lib/dpkg/info/libgomp1:arm64.list
/var/lib/dpkg/info/libgomp1:arm64.md5sums
/var/lib/dpkg/info/libgomp1:arm64.shlibs
/var/lib/dpkg/info/libgomp1:arm64.symbols
/var/lib/dpkg/info/libgomp1:arm64.triggers
By experiment it turned out that at the Host PC where I have GPU it executes openacc with gcc -fopenacc , though it appends the very same error before the execution, but still works
./hello
libgomp: while loading libgomp-plugin-host_nonshm.so.1: libgomp-plugin-host_nonshm.so.1: cannot open shared object file: No such file or directory
hello world