# Compiling on Windows with Visual Studio 2015

**URL:** <https://discourse.numenta.org/t/compiling-on-windows-with-visual-studio-2015/3036>\
**Category:** NuPIC\
**Tags:** windows\
**Created:** [November 5, 2017, 6:48pm UTC](https://discourse.numenta.org/t/compiling-on-windows-with-visual-studio-2015/3036 "2017-11-05T18:48:59Z")\
**Posts on this page:** 7\
**Page:** 1

<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:** [November 5, 2017, 6:49pm UTC](https://discourse.numenta.org/t/compiling-on-windows-with-visual-studio-2015/3036/1 "2017-11-05T18:49:00Z")

</div>

First post!

I have been trying to compile the master branch of nupic.core on Windows 10 with Visual Studio 2015. I tried to follow the steps outlined the readme.

Here is a list of the things I needed to do:

1. Make sure python 2.7 is in PATH env. I have had python 3.5 and I think that caused some issues when running cmake
2. Install numpy by using the command: “pip install numpy==1.12.1”
3. Make sure the “patch” command is in PATH

I then run cmake as described in the readme. The output is [here](https://pastebin.com/FB5zDCKr)

In Visual Studio, when running “ALL\_BUILD” in Release configuration I get the [output](https://pastebin.com/9ZcBxkeS)

A few things I have noticed are:

1. LINK : fatal error LNK1181: cannot open input file ‘C:/Users/chhenning/Numenta/nupic.core/build/scripts/ThirdParty/Build/YamlStaticLib/yaml.lib’

2. LINK : fatal error LNK1181: cannot open input file ‘C:/Users/chhenning/Numenta/nupic.core/build/scripts/ThirdParty/Install/YamlCppStaticLib/lib/yaml-cpp.lib’

3. LINK : fatal error LNK1104: cannot open file ‘$\<TARGET\_FILE:nupic\_core\_solo\>’  
-\> Not sure what to about it.

There are many compiler errors and even ICE’s (Internal Compiler Errors). For instance:

------ Build started: Project: nupic\_core\_solo, Configuration: Release x64 ------  
Cell.cpp  
C:\Users\chhenning\Numenta\nupic.core\src\nupic/algorithms/Segment.hpp(170): error C2876: ‘nupic::Serializable’: not all overloads are accessible  
C:\Users\chhenning\Numenta\nupic.core\src\nupic/algorithms/Segment.hpp(93): note: see declaration of ‘nupic::Serializable’  
C:\Users\chhenning\Numenta\nupic.core\src\nupic/algorithms/Segment.hpp(181): error C2876: ‘nupic::Serializable’: not all overloads are accessible  
C:\Users\chhenning\Numenta\nupic.core\src\nupic/algorithms/Segment.hpp(93): note: see declaration of ‘nupic::Serializable’  
C:\Users\chhenning\Numenta\nupic.core\src\nupic/algorithms/Segment.hpp(365): warning C4838: conversion from ‘double’ to ‘const nupic::Real’ requires a narrowing conversion  
C:\Users\chhenning\Numenta\nupic.core\src\nupic/algorithms/Segment.hpp(862): error C2876: ‘nupic::Serializable’: not all overloads are accessible  
C:\Users\chhenning\Numenta\nupic.core\src\nupic/algorithms/Segment.hpp(383): note: see declaration of ‘nupic::Serializable’  
C:\Users\chhenning\Numenta\nupic.core\src\nupic/algorithms/Segment.hpp(884): error C2876: ‘nupic::Serializable’: not all overloads are accessible  
C:\Users\chhenning\Numenta\nupic.core\src\nupic/algorithms/Segment.hpp(383): note: see declaration of ‘nupic::Serializable’  
C:\Users\chhenning\Numenta\nupic.core\src\nupic/algorithms/Cell.hpp(258): error C2876: ‘nupic::Serializable’: not all overloads are accessible  
…

My questions are.

1. Can nupic.core be compiled on Windows using Visual Studio?

2. Is there interest in having a working Visual Studio solution that contains all of nupic.core source code? I think most of the compiler errors can be fixed quite easily.

Thanks,  
Christian

---

<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:** [November 6, 2017, 7:01pm UTC](https://discourse.numenta.org/t/compiling-on-windows-with-visual-studio-2015/3036/2 "2017-11-06T19:01:21Z")

</div>

Thanks for your efforts, Christian. I’m not sure if anyone is actively compiling nupic.core in VS at this point. I know no one at Numenta is doing this. But [there has been interest](https://discourse.numenta.org/search?q=visual%20studio%20nupic%20core) in the past.

If anyone else is working on this, or interested in helping, please post here!

---

<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:** [November 8, 2017, 4:33pm UTC](https://discourse.numenta.org/t/compiling-on-windows-with-visual-studio-2015/3036/3 "2017-11-08T16:33:20Z")

</div>

Hi Matt,

thanks for your answer.

I have created a [github repo](https://github.com/chhenning/nupic_visual_studio) which contains the nupic c++ source code. My first goals are to have the nupic library compile and to have the tests run through.

Quick, question there is some c++ code which needs fixing in Visual Studio 2017. Would your team be interested in incorporating those changes? I can go into more detail in a follow up email.

Regards,  
Christian

---

<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:** [November 8, 2017, 4:52pm UTC](https://discourse.numenta.org/t/compiling-on-windows-with-visual-studio-2015/3036/4 "2017-11-08T16:52:21Z")

</div>

> [@chhenning](#):
>
> Would your team be interested in incorporating those changes?

It depends on how extensive and complicated the changes are. If this is a simple PR that doesn’t break our pipelines, I’ll do what I can to get it reviewed and merged, and another version of nupic.core released. But if it will take extensive review from a C++ expert on the research time, not so sure it would be worth creating a PR. Let me know how much work you think it will be.

---

<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:** [November 10, 2017, 2:48am UTC](https://discourse.numenta.org/t/compiling-on-windows-with-visual-studio-2015/3036/5 "2017-11-10T02:48:56Z")

</div>

Hi Matt,

good news I can compile nupic.core on Visual Studio 2017! Attached is a screenshot with the debugger on. 🙂

Except for commenting out some yaml-cpp stuff, I think my code changes are pretty minor.

 ![image](https://canada1.discourse-cdn.com/flex030/uploads/numenta/original/2X/3/3129efb85389dcf64356bab85f80b70e51f3578a.png)

Regards,  
Christian

---

<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:** [November 11, 2017, 3:25pm UTC](https://discourse.numenta.org/t/compiling-on-windows-with-visual-studio-2015/3036/6 "2017-11-11T15:25:00Z")

</div>

That’s great Christian! Thanks. I’ll look for your PR Monday.

---

<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:** [November 13, 2017, 1:32am UTC](https://discourse.numenta.org/t/compiling-on-windows-with-visual-studio-2015/3036/7 "2017-11-13T01:32:56Z")

</div>

Hi Matt,

here is a small update. With my cloned nupic.core repo I can now run 319 unit tests from which 37 are failing. [Here is an overview](https://pastebin.com/raw/QmTBd4Qi).

I have created a [fork](https://github.com/chhenning/nupic.core/tree/visual_studio_2017) and have now started setting myself up for a pull request. There is an issue with the “yaml-cpp” library. I think currently nupic.core is using an outdated version and my visual studio package manager doesn’t support it. Hence, I commented out some code. That would be explanation for some of the unit test failures.

Another “issue” or shall I say new feature is that I’m using python 3 bindings. So maybe we can use this release as a test bed for python 3? I saw some requests for that somewhere on the forum.

I’ll you updated.

Regards,  
Christian
