| View previous topic :: View next topic |
| Author |
Message |
valenbg
Joined: 09 May 2013 Posts: 5
|
Posted: Wed May 15, 2013 11:07 am Post subject: Easy way for portability |
|
|
Hi, I'm looking for a way to compile and execute code for another machine, in which I can't install anything. Both are Linux with x86 processors, and I'm using PGI with openACC directives 12.10. I want to use something like statically-linked libraries, or what I need to execute a PGI compiled binary in other system, without installing anything on it?
Thanks for your time. |
|
| Back to top |
|
 |
mkcolg
Joined: 30 Jun 2004 Posts: 4996 Location: The Portland Group Inc.
|
Posted: Wed May 15, 2013 12:11 pm Post subject: |
|
|
Hi valenbg,
You wont be able to compile a completely static binary, but can add the flag "-Bstatic_pgi" so that at least the PGI run time is statically linked.
For the OS, this should be fine if the two systems have the same GLIBC version, or the target system's GLIBC is newer than the build system. Older systems wont be able to run newer GLIBC versions.
You will need the NVIDIA driver installed on the target system in order to run an OpenACC code on an NVIDIA gpu. However, we wrap up multiple compute capability targets in a single binary so you don't need to worry if the CC of the device varies between systems. You can also compile with "-ta=nvidia,host" so that a host version of the OpenACC sections are created. The binary will then still run on a system without a GPU, albeit slower.
For the host side generated code, you can either compile to a particular target architecture (see "pgfortran -help -tp" for a list of target systems), or you can string any number of targets on the same "-tp" option to create a Unified Binary. This will ensure that the code will run on most x86 target architectures.
Hope this helps,
Mat |
|
| Back to top |
|
 |
valenbg
Joined: 09 May 2013 Posts: 5
|
Posted: Thu May 16, 2013 7:44 am Post subject: |
|
|
I'm having this problem when compiling with this options:
pgcc -acc -ta=nvidia,host -Bstatic_pgi -Minfo=all main.c
When I try to execute the generated binary (in the same computer), it shows me this error:
./a.out: error while loading shared libraries: libnuma.so: cannot open shared object file: No such file or directory |
|
| Back to top |
|
 |
mkcolg
Joined: 30 Jun 2004 Posts: 4996 Location: The Portland Group Inc.
|
Posted: Thu May 16, 2013 10:16 am Post subject: |
|
|
| Quote: | | ./a.out: error while loading shared libraries: libnuma.so: cannot open shared object file: No such file or directory | Sorry, forgot that one. We link with the OpenMP libraries by default in order to support core binding. At link, you can add the flag "-nomp" or "-mp=nonuma" to not link in the NUMA libraries.
- Mat |
|
| Back to top |
|
 |
valenbg
Joined: 09 May 2013 Posts: 5
|
Posted: Thu May 16, 2013 1:31 pm Post subject: |
|
|
| It finally seems to work with the "-mp=nonuma" flag, although with the "-nomp" flag it shows an error about calls to the pthread library. Thank you so much for your feedback. |
|
| Back to top |
|
 |
|