# Statically link libpgbind.a?

**URL:** <https://forums.developer.nvidia.com/t/statically-link-libpgbind-a/130654>\
**Category:** Legacy PGI Compilers (archived)\
**Created:** [March 13, 2007, 7:18pm UTC](https://forums.developer.nvidia.com/t/statically-link-libpgbind-a/130654 "2007-03-13T19:18:44Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Gina](https://developer.download.nvidia.com/images/forums/profile-default-devtalk-84.png) [@Gina](https://forums.developer.nvidia.com/u/Gina)\
**Post date:** [March 13, 2007, 7:18pm UTC](https://forums.developer.nvidia.com/t/statically-link-libpgbind-a/130654/1 "2007-03-13T19:18:44Z")

</div>

Hi,

I see that in PGI 6.2, libpgbind.a is provided, but I am unable to link it statically. No matter whether -Bstatic, or -Bstatic\_pgi are specified in the link step, libpgbind is always linked dynamically.

Could you confirm if this is the case?

Thanks,  
Gina

---

<div class="post-metadata">

**Author:** ![Gina](https://developer.download.nvidia.com/images/forums/profile-default-devtalk-84.png) [@Gina](https://forums.developer.nvidia.com/u/Gina)\
**Post date:** [March 13, 2007, 7:37pm UTC](https://forums.developer.nvidia.com/t/statically-link-libpgbind-a/130654/2 "2007-03-13T19:37:47Z")

</div>

Our system has Suse 10.1 on it, so numa libraries are present, and get dynamically linked.

If libpgbind cannot be statically linked, then why is ..6.2/lib/libpgbind.a available?

> [@Gina](#):
>
> Hi,
> 
> I see that in PGI 6.2, libpgbind.a is provided, but I am unable to link it statically. No matter whether -Bstatic, or -Bstatic\_pgi are specified in the link step, libpgbind is always linked dynamically.
> 
> Could you confirm if this is the case?
> 
> Thanks,  
> Gina

---

<div class="post-metadata">

**Author:** ![MatColgrove](https://sea2.discourse-cdn.com/nvidia/user_avatar/forums.developer.nvidia.com/matcolgrove/32/14047_2.png) [@MatColgrove](https://forums.developer.nvidia.com/u/MatColgrove)\
**Post date:** [March 13, 2007, 11:05pm UTC](https://forums.developer.nvidia.com/t/statically-link-libpgbind-a/130654/3 "2007-03-13T23:05:32Z")

</div>

Hi Gina,

You can link libpgbind statically but 6.2 had it incorrectly placed in the dynamic section when linking with “-Bstatic\_pgi”. This has been corrected in 7.0. However, libnuma must be linked dynamically.

You can work around this by adding the following line to your “.mypgf90rc”, “.mypgcpprc”, and “.mypgccrc” files in your “home” directory or “siterc” if you want the change to apply to everyone.

```nohighlight
set LMP = $NUMAOBJS -l$(PREFIX)mp $PGINUMALIBS $PGIUNSTATIC $NUMALIBS $LTHREAD $PGISTATIC;

```

Alternatively, you can compile with “-v” (verbose), copy the link line, and move “-lpgbind” after “-Bstatic”.

Note that by linking libpgbind statically, your code will not run on systems that do not support NUMA.

Hope this helps,  
Mat

---

<div class="post-metadata">

**Author:** ![Gina](https://developer.download.nvidia.com/images/forums/profile-default-devtalk-84.png) [@Gina](https://forums.developer.nvidia.com/u/Gina)\
**Post date:** [March 16, 2007, 1:43pm UTC](https://forums.developer.nvidia.com/t/statically-link-libpgbind-a/130654/4 "2007-03-16T13:43:40Z")

</div>

Hi Mat,

Thank you for all your help. I will see if we can move to version 7.0.. or implement your suggestion if we continue with 6.2.

Cheers,  
Gina

> [@mkcolg](#):
>
> Hi Gina,
> 
> You can link libpgbind statically but 6.2 had it incorrectly placed in the dynamic section when linking with “-Bstatic\_pgi”. This has been corrected in 7.0. However, libnuma must be linked dynamically.
> 
> You can work around this by adding the following line to your “.mypgf90rc”, “.mypgcpprc”, and “.mypgccrc” files in your “home” directory or “siterc” if you want the change to apply to everyone.
> 
> ```plaintext
> set LMP = $NUMAOBJS -l$(PREFIX)mp $PGINUMALIBS $PGIUNSTATIC $NUMALIBS $LTHREAD $PGISTATIC;
> 
> ```
> 
> Alternatively, you can compile with “-v” (verbose), copy the link line, and move “-lpgbind” after “-Bstatic”.
> 
> Note that by linking libpgbind statically, your code will not run on systems that do not support NUMA.
> 
> Hope this helps,  
> Mat
