# Libpbs does not depend on libcrypto nor libpthread

**URL:** <https://community.openpbs.org/t/libpbs-does-not-depend-on-libcrypto-nor-libpthread/601>\
**Category:** Developers\
**Created:** [July 11, 2017, 4:02am UTC](https://community.openpbs.org/t/libpbs-does-not-depend-on-libcrypto-nor-libpthread/601 "2017-07-11T04:02:11Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![ggouaillardet](https://avatars.discourse-cdn.com/v4/letter/g/839c29/32.png) [@ggouaillardet](https://community.openpbs.org/u/ggouaillardet)\
**Post date:** [July 11, 2017, 4:02am UTC](https://community.openpbs.org/t/libpbs-does-not-depend-on-libcrypto-nor-libpthread/601/1 "2017-07-11T04:02:11Z")

</div>

As initially reported at [https://www.mail-archive.com/users@lists.open-mpi.org/msg31288.html](https://www.mail-archive.com/users@lists.open-mpi.org/msg31288.html) it is necessary to manually add some libraries in order to use libpbs.  
on my centos 7 box, a minimal program like this one

```
#include <tm.h>

int main (int argc, char *argv[])
{
    struct tm_roots *roots;
    void * info;

    return tm_init (info, roots);
}

```

needs to be linked with -lcrypto -lpthread on top of -lpbs

is there any reason why [libpbs.so](http://libpbs.so) does not depend on libcrypto and libpthread ?

fwiw, the inline patch below fixes this (e.g. no more need for -lcrypto -lpthread)

```
diff --git a/src/lib/Libpbs/Makefile.am b/src/lib/Libpbs/Makefile.am
index ea695ee..b7d6752 100755
--- a/src/lib/Libpbs/Makefile.am
+++ b/src/lib/Libpbs/Makefile.am
@@ -47,6 +47,10 @@ libpbs_la_CPPFLAGS = -I$(top_srcdir)/src/include
 #
 libpbs_la_LDFLAGS = -version-info 0:0:0
 
+libpbs_la_LIBADD= \
+ -lcrypto \
+ -lpthread
+
 libpbs_la_SOURCES = \
        ../Libattr/attr_fn_arst.c \
        ../Libattr/attr_fn_b.c \
```

---

<div class="post-metadata">

**Author:** ![subhasisb](https://yyz2.discourse-cdn.com/flex030/user_avatar/community.openpbs.org/subhasisb/32/12_2.png) [@subhasisb](https://community.openpbs.org/u/subhasisb)\
**Post date:** [July 11, 2017, 4:51am UTC](https://community.openpbs.org/t/libpbs-does-not-depend-on-libcrypto-nor-libpthread/601/2 "2017-07-11T04:51:55Z")

</div>

I think it comes from the history of libpbs being distributed as an archive library, which means only necessary code was pulled into executables from libpbs.a and some of them might have needed crypto or libpthread, but not all.

Of course, now that it is a shared library, it would be way more beneficial for [libpbs.so](http://libpbs.so) to itself record the dependencies on these two.

This topic was discussed in the PBS forums here: [Compile OpenMPI with PBSpro 14.1.10](http://community.openpbs.org/t/compile-openmpi-with-pbspro-14-1-10/159/5)  
and a bug had been logged here: [https://pbspro.atlassian.net/browse/PP-360](https://pbspro.atlassian.net/browse/PP-360)

You are very welcome to submit a fix to this bug.

Thanks

---

<div class="post-metadata">

**Author:** ![ggouaillardet](https://avatars.discourse-cdn.com/v4/letter/g/839c29/32.png) [@ggouaillardet](https://community.openpbs.org/u/ggouaillardet)\
**Post date:** [July 11, 2017, 7:43am UTC](https://community.openpbs.org/t/libpbs-does-not-depend-on-libcrypto-nor-libpthread/601/3 "2017-07-11T07:43:37Z")

</div>

Thanks !  
i made [https://github.com/PBSPro/pbspro/pull/331](https://github.com/PBSPro/pbspro/pull/331) to fix this
