# Best way to create a wrapper for C library for Continuous version of Tensor Train

**URL:** https://discourse.julialang.org/t/best-way-to-create-a-wrapper-for-c-library-for-continuous-version-of-tensor-train/45479
**Category:** Numerics
**Created:** [August 25, 2020, 12:14am UTC](https://discourse.julialang.org/t/best-way-to-create-a-wrapper-for-c-library-for-continuous-version-of-tensor-train/45479 "2020-08-25T00:14:41Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![mleprovost](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/mleprovost/32/7166_2.png) [@mleprovost](https://discourse.julialang.org/u/mleprovost)
#### Post date: [August 25, 2020, 12:14am UTC](https://discourse.julialang.org/t/best-way-to-create-a-wrapper-for-c-library-for-continuous-version-of-tensor-train/45479/1 "2020-08-25T00:14:41Z")

</div>

Hello,

I would like to create a wrapper for the C library [https://github.com/goroda/Compressed-Continuous-Computation](https://github.com/goroda/Compressed-Continuous-Computation) that implements a low-rank approximation of multi-dimensional functions in the same spirit as ApproxFun.

Here is the arxiv paper:

> **[1510.09088.pdf](https://arxiv.org/pdf/1510.09088.pdf)**
>
> 538.79 KB

Is there a Julia package to easily construct the wrapper?

---

<div class="post-metadata">

### Author: ![dpsanders](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/dpsanders/32/3573_2.png) [@dpsanders](https://discourse.julialang.org/u/dpsanders)
#### Post date: [August 25, 2020, 1:58am UTC](https://discourse.julialang.org/t/best-way-to-create-a-wrapper-for-c-library-for-continuous-version-of-tensor-train/45479/2 "2020-08-25T01:58:10Z")

</div>

Calling C functions is relatively “easy”. See e.g.

[https://docs.julialang.org/en/v1/manual/calling-c-and-fortran-code/](https://docs.julialang.org/en/v1/manual/calling-c-and-fortran-code/)

and some JuliaCon talks, for example Huda Nassar’s workshop from JuliaCon 2020.

If you need to generate a lot of functions that look similar, you can automate this with metaprogramming.

Of course, you can also just port the library to Julia…

---

<div class="post-metadata">

### Author: ![Iulian.Cioarca](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/iulian.cioarca/32/30166_2.png) [@Iulian.Cioarca](https://discourse.julialang.org/u/Iulian.Cioarca)
#### Post date: [August 25, 2020, 5:52am UTC](https://discourse.julialang.org/t/best-way-to-create-a-wrapper-for-c-library-for-continuous-version-of-tensor-train/45479/3 "2020-08-25T05:52:25Z")

</div>

[https://github.com/JuliaInterop/Clang.jl](https://github.com/JuliaInterop/Clang.jl)  
The link is also in the documentation above ( somewhere at the end)

---

<div class="post-metadata">

### Author: ![mleprovost](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/mleprovost/32/7166_2.png) [@mleprovost](https://discourse.julialang.org/u/mleprovost)
#### Post date: [August 25, 2020, 3:14pm UTC](https://discourse.julialang.org/t/best-way-to-create-a-wrapper-for-c-library-for-continuous-version-of-tensor-train/45479/4 "2020-08-25T15:14:55Z")

</div>

Thank you @Tamas_Papp for mentioning this paper in [ApproxFun for vector-valued function - #8 by Tamas\_Papp](https://discourse.julialang.org/t/approxfun-for-vector-valued-function/45135/8).  
So far I have called the Python wrapper c3py of the C library in Julia and its working well. But I want to avoid wrapper of a wrapper and I need to add a few functions.
