The Simple Example page and the example models in the repository show examples of how a model is constructed. However, these models must also be compiled before they can be run.
In order to compile the example models, there exists a bash script build.sh. To download spike and build these models on a Linux machine (with git, CMAKE, and CUDA installed):
Running the above commands will compile the example models (VogelsAbbottNet, Brunel10K, and SimpleExample) to the Spike/Build/Examples folder. You can then execute these models by:
cd Spike/Build/Examples
./ModelName
e.g. ./VogelsAbbottNet
In order to build your own custom model, there are two options. The easiest method is to place your model file in the Spike/Examples folder. If you model is call MyModel.cpp, this file should now be in the same directory as the VogelsAbbottNet.cpp and the Brunel10K.cpp files.
Next, you must add this model to the CMake compilation list. To do so, edit the Spike/Examples/CMakeList.txt and add the name of your model only (without the extension) to the list of models:
I.e. Change the first 5 lines of this file from, this:
foreach(example
VogelsAbbottNet
Brunel10K
SimpleExample
)
To this:
foreach(example
VogelsAbbottNet
Brunel10K
SimpleExample
MyModel
)
Now when you run the build.sh file (as described above), the MyModel.cpp file will be compiled with the Spike library into the Spike/Build/Examples folder.
After building with CMake, the user can also choose to simply link to the Spike shared library file for a more custom installation. If you run the build.sh script, this will be located at:
Spike/Build/Spike/libSpike.so