# Swig generated interface of NuPic C++

**URL:** <https://discourse.numenta.org/t/swig-generated-interface-of-nupic-c/3294>\
**Category:** NuPIC\
**Tags:** swig\
**Created:** [January 15, 2018, 5:02pm UTC](https://discourse.numenta.org/t/swig-generated-interface-of-nupic-c/3294 "2018-01-15T17:02:52Z")\
**Posts on this page:** 12\
**Page:** 1

<div class="post-metadata">

**Author:** ![mvbaffa](https://avatars.discourse-cdn.com/v4/letter/m/8c91f0/32.png) [@mvbaffa](https://discourse.numenta.org/u/mvbaffa)\
**Post date:** [January 15, 2018, 5:02pm UTC](https://discourse.numenta.org/t/swig-generated-interface-of-nupic-c/3294/1 "2018-01-15T17:02:52Z")

</div>

Hi,

I am new to NuPic and HTM.

As far as I know NuPic Python was created with a Swig interface file generated from C++ API.

I am working with millions of transactions a day in real time and I need to use NuPic with a more performatic language like Go, Rust or even C++.

How can I have access to the interface (\*.i) file generated by Swig and directly work with the C++ API ?  
Where can I find the documentation to the C++ API ?  
Is there any one who is using NuPic with C++ or Go ?

Thanks in advance

---

<div class="post-metadata">

**Author:** ![chhenning](https://yyz2.discourse-cdn.com/flex030/user_avatar/discourse.numenta.org/chhenning/32/3821_2.png) [@chhenning](https://discourse.numenta.org/u/chhenning)\
**Post date:** [January 15, 2018, 6:04pm UTC](https://discourse.numenta.org/t/swig-generated-interface-of-nupic-c/3294/2 "2018-01-15T18:04:05Z")

</div>

You could just use [nupic.core](https://github.com/numenta/nupic.core). The docs are [here](http://nupic.docs.numenta.org/1.0.3/index.html).

On what system would you like to run your code?

---

<div class="post-metadata">

**Author:** ![mvbaffa](https://avatars.discourse-cdn.com/v4/letter/m/8c91f0/32.png) [@mvbaffa](https://discourse.numenta.org/u/mvbaffa)\
**Post date:** [January 15, 2018, 9:49pm UTC](https://discourse.numenta.org/t/swig-generated-interface-of-nupic-c/3294/3 "2018-01-15T21:49:28Z")

</div>

Ubuntu 16

Thank you

---

<div class="post-metadata">

**Author:** ![chhenning](https://yyz2.discourse-cdn.com/flex030/user_avatar/discourse.numenta.org/chhenning/32/3821_2.png) [@chhenning](https://discourse.numenta.org/u/chhenning)\
**Post date:** [January 16, 2018, 12:06am UTC](https://discourse.numenta.org/t/swig-generated-interface-of-nupic-c/3294/4 "2018-01-16T00:06:19Z")

</div>

Let us know if you run into any issues.

---

<div class="post-metadata">

**Author:** ![mvbaffa](https://avatars.discourse-cdn.com/v4/letter/m/8c91f0/32.png) [@mvbaffa](https://discourse.numenta.org/u/mvbaffa)\
**Post date:** [January 16, 2018, 10:50am UTC](https://discourse.numenta.org/t/swig-generated-interface-of-nupic-c/3294/5 "2018-01-16T10:50:24Z")

</div>

Hi chhenning,

Sorry for the delay, but I was blocked for Replies. Now everything seems ok.

I will try and let you know.

As far as could see, nupic.core is a community fork, I can use it to try to generate a swig interface for Go, no problem. But they say:  
“As changes are made to the production version, the changes will be migrated into this fork when resources are available from the community”

Is there any way to have access to the production repo, and generate with swig integration with other languages ?

Thanks for your messages

---

<div class="post-metadata">

**Author:** ![chhenning](https://yyz2.discourse-cdn.com/flex030/user_avatar/discourse.numenta.org/chhenning/32/3821_2.png) [@chhenning](https://discourse.numenta.org/u/chhenning)\
**Post date:** [January 16, 2018, 1:34pm UTC](https://discourse.numenta.org/t/swig-generated-interface-of-nupic-c/3294/6 "2018-01-16T13:34:23Z")

</div>

@mvbaffa Why do you say that nupic.core is a community fork? It’s made by Numenta and it’s the main building block for Numenta’s Platform for Intelligent Computing. Basically a cpp implementation of the htm algorithm and much more.

Now, I’m not a swig expert. But in it’s current state the swig interface works with python 2.7. I’m not sure about other languages like Go. I have a feeling that’s not gonna be easy. I might be wrong…

---

<div class="post-metadata">

**Author:** ![mvbaffa](https://avatars.discourse-cdn.com/v4/letter/m/8c91f0/32.png) [@mvbaffa](https://discourse.numenta.org/u/mvbaffa)\
**Post date:** [January 16, 2018, 4:47pm UTC](https://discourse.numenta.org/t/swig-generated-interface-of-nupic-c/3294/7 "2018-01-16T16:47:04Z")

</div>

You are correct, the repo I was looking at was a community fork but the one you have indicated is was the official one.

Talking about Swig, it not gonna be easy, in fact it will very hard, I presume. I have used Swig for small libraries if compared to nupic.core.

It would be easier if Numenta could give us a kind of tutorial not for Swig but for the header files for the API we should try to integrate.

---

<div class="post-metadata">

**Author:** ![rhyolight](https://yyz2.discourse-cdn.com/flex030/user_avatar/discourse.numenta.org/rhyolight/32/3922_2.png) [@rhyolight](https://discourse.numenta.org/u/rhyolight)\
**Post date:** [January 16, 2018, 4:50pm UTC](https://discourse.numenta.org/t/swig-generated-interface-of-nupic-c/3294/8 "2018-01-16T16:50:27Z")

</div>

> [@mvbaffa](#):
>
> It would be easier if Numenta could give us a kind of tutorial not for Swig but for the header files for the API we should try to integrate.

Can the current [python bindings](https://github.com/numenta/nupic.core/tree/master/bindings/py) inform this?

---

<div class="post-metadata">

**Author:** ![mvbaffa](https://avatars.discourse-cdn.com/v4/letter/m/8c91f0/32.png) [@mvbaffa](https://discourse.numenta.org/u/mvbaffa)\
**Post date:** [January 16, 2018, 5:15pm UTC](https://discourse.numenta.org/t/swig-generated-interface-of-nupic-c/3294/9 "2018-01-16T17:15:06Z")

</div>

Thanks, I will check it out

---

<div class="post-metadata">

**Author:** ![rhyolight](https://yyz2.discourse-cdn.com/flex030/user_avatar/discourse.numenta.org/rhyolight/32/3922_2.png) [@rhyolight](https://discourse.numenta.org/u/rhyolight)\
**Post date:** [January 16, 2018, 5:19pm UTC](https://discourse.numenta.org/t/swig-generated-interface-of-nupic-c/3294/10 "2018-01-16T17:19:45Z")

</div>

I think you should pay particular attention to [`PyRegion`](https://github.com/numenta/nupic.core/blob/master/bindings/py/src/nupic/bindings/regions/PyRegion.py). Remember that this is only exposing components of the Network API. The OPF is all written in Python.

---

<div class="post-metadata">

**Author:** ![mvbaffa](https://avatars.discourse-cdn.com/v4/letter/m/8c91f0/32.png) [@mvbaffa](https://discourse.numenta.org/u/mvbaffa)\
**Post date:** [January 16, 2018, 6:34pm UTC](https://discourse.numenta.org/t/swig-generated-interface-of-nupic-c/3294/11 "2018-01-16T18:34:46Z")

</div>

Ok. Thanks

---

<div class="post-metadata">

**Author:** ![mvbaffa](https://avatars.discourse-cdn.com/v4/letter/m/8c91f0/32.png) [@mvbaffa](https://discourse.numenta.org/u/mvbaffa)\
**Post date:** [January 16, 2018, 6:59pm UTC](https://discourse.numenta.org/t/swig-generated-interface-of-nupic-c/3294/12 "2018-01-16T18:59:03Z")

</div>

In src/nupic/bindings I have found the “.I” files.

These are the files that swig uses to generate the wrappers. I will try with these files. It is not easy but, maybe I can have success.

Thanks
