# Using statically linked libtiledb.a in TileDB-Py

**URL:** <https://forum.tiledb.com/t/using-statically-linked-libtiledb-a-in-tiledb-py/94>\
**Category:** Uncategorized\
**Created:** [July 18, 2019, 4:00am UTC](https://forum.tiledb.com/t/using-statically-linked-libtiledb-a-in-tiledb-py/94 "2019-07-18T04:00:19Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![AndyGreenwell](https://avatars.discourse-cdn.com/v4/letter/a/ba8739/32.png) [@AndyGreenwell](https://forum.tiledb.com/u/AndyGreenwell)\
**Post date:** [July 18, 2019, 4:00am UTC](https://forum.tiledb.com/t/using-statically-linked-libtiledb-a-in-tiledb-py/94/1 "2019-07-18T04:00:19Z")

</div>

A question for which I believe I know the answer, as I am currently embedding a statically linked libtiledb.a within a compiled python module.

If I wanted to make use of that same statically linked libtiledb.a within a build of TileDB-Py, I am guessing I would need to add the same entries to the [`libraries`, `include_dirs`, `extra_link_args` and other arguments to `Extension`](https://github.com/TileDB-Inc/TileDB-Py/blob/fc159734a33f5acf976405effd079a9f3fd3a36c/setup.py#L464) that I am currently using within my own compiled python module. I assume I would also need to avoid using the current `runtime_library_dirs` argument.

I know the python api is under active development. Is working from a personal fork of TileDB-Py with a replacement setup.py file the most reasonable means of packaging a statically linked library?

Any particular gotchas that you all can think of?

---

<div class="post-metadata">

**Author:** ![ihnorton](https://yyz1.discourse-cdn.com/flex035/user_avatar/forum.tiledb.com/ihnorton/32/23_2.png) [@ihnorton](https://forum.tiledb.com/u/ihnorton)\
**Post date:** [July 23, 2019, 2:26pm UTC](https://forum.tiledb.com/t/using-statically-linked-libtiledb-a-in-tiledb-py/94/2 "2019-07-23T14:26:22Z")

</div>

Hi Andy,

I had a quick look at this, and it seems tractable except for TBB. The following patch-set enables building a statically-linked TileDB-Py extension against a static libTileDB built _without_ TBB:

> <https://github.com/TileDB-Inc/TileDB-Py/pull/190>

I didn’t see a quick solution to the TBB linking issue (missing symbol `_ZTIN3tbb4taskE`) – if you happen to have found a solution to that, let me know and I’ll include it.

---

<div class="post-metadata">

**Author:** ![AndyGreenwell](https://avatars.discourse-cdn.com/v4/letter/a/ba8739/32.png) [@AndyGreenwell](https://forum.tiledb.com/u/AndyGreenwell)\
**Post date:** [July 29, 2019, 1:30am UTC](https://forum.tiledb.com/t/using-statically-linked-libtiledb-a-in-tiledb-py/94/3 "2019-07-29T01:30:16Z")

</div>

Thanks Isaiah for looking into this, and apologies on the delayed reply. When I can get back to trying out this bit of packaging setup I will let you know if I have success. There is one configuration where I am building without TBB, but another where I am. Anyway, thanks again for the quick feedback on my question.

-Andy
