When I started looking into what I need to do to build Nupic for the Raspberry Pi, I found that there was a set of instructions for building the software for Raspberry Pi but they were for an older version of the software. When I asked the community flag-bearer what the status of the project was, he told me that the work on a version for Raspberry Pi had ceased and the project was quite old. So, I took that as a challenge. The biggest un-ported change was a move from 32bit Linux to 64bit Linux. When I went to look for a 64bit version of Raspbian, I found there was none. However, I did find that there were some instructions on the web for building Nupic for 32bit systems.
The first step in my quest was to build Nupic on a 32bit version of Ubuntu on a PC. I built a VirtualBox VM with Ubuntu 14.04.4 LTS and went through the instructions I found for building Nupic on a 32 bit system. As it turns out those instructions were old too. I found that even though they referenced download code for Capn Proto and LibYaml, the build actually downloads the proper version and builds those automatically. Through submitting bug reports on the github site for the Nupic project, I was able to find this out. After my queries, someone from the project updated the instructions to eliminate the old parts of the instructions. Eventually, I landed on a newer set of instructions for building Nupic for Ubuntu 14. After installing python-setuptools package, I was able to fully build and run the Nupic software on the virtual machine.
Once I was able to successfully install Nupic on Ubuntu on a PC, I moved the process over to the Raspberry Pi 3. The first hurdle to overcome was that there were some compiler flags used in the build which were not recognized by the ARM compiler. Specifically, the '-mtune=generic' and '-m32' flags were not recognized when the project was compiled on the Raspberry Pi. So, I had to edit the file 'CommonCompilerConfig.cmake' to remove those options. The next issue I ran into was that the ARM compiler didn't like the link-time optimizations that were called for in the build. After advice from a contributor to the project, I temporarily removed all of the optimizations from the build. Also, I ran into an issue where the build was picking up the includes for Python3.4 instead of Python2.7. In the end, I just uninstalled the Python3.4 development package. Finally, I had to disable use of inline assembly from the build by removing the NTA_ASM flag from the 'src/CMakeLists.txt' file. After all of these changes, I was finally able to build Nupic for the Raspberry Pi!
I'm now in the process of getting my modifications into order so that they can be merged into the main code. If you are interested, you can follow along on Github.
This was my first experience with making modifications to an open source project and submitting a pull request. It's been very interesting and I hope to make more contributions in the future.