Tools designed in the STIM Lab follow a general set of rules designed to optimize their use in future lab projects as well as their usability to outside research groups. In general:
- Major algorithms are coded in C++ as classes and functions under the stim namespace. These algorithms are available in the stimlib repository, which is comprised of a series of header files designed be included in more general applications.
- Various software tools are optimized for use in our lab, often providing a command-line interface. These tools use algorithms available in the stimlib repository, but are optimized for our own workflow. Source code and executables are generally available through our Git repository or software page.
- Prototyping and scripting are generally done with Python.
The following section includes a list of development tools that are frequently used, along with some of the best tutorials and advice that we have found for using them.
Source code is managed using a Git repository, and developers are expected to make regular commits.
- a tutorial for Git is available here: https://www.atlassian.com/git/tutorials/
- an interactive demonstration is available here: https://try.github.io
We use CMake as a build system in order to generate cross-platform applications where possible. Good tutorials on CMake are difficult to find, so my recommendation is to look at CMakeLists.txt files available in our public repositories and use those to model your own CMake files.
- CMake can be downloaded here: http://www.cmake.org/
- A solid Python tutorial is available via CodeAcademy: https://www.codecademy.com/tracks/python
- Windows users generally use Visual C++ Professional, which is available to students via Microsoft Dreamspark
- Linux users have a variety of tools, but those I recommend include:
This section includes a list of libraries that are commonly used in STIM Lab code. All of these are available in most Linux repositories (I use Ubuntu's apt-get). All will require some amount of stress to get working in Windows (the source of this stress changes from release-to-release so I can't really write a tutorial).
- STIMLib, which is our own software code base. It can be cloned from the stimlib repository. In order for it to work well with CMake, create an environment variable named STIMLIB_PATH that points to the repository.
- Boost (http://www.boost.org/)
- Qt (http://www.qt.io/)
- GLUT (http://freeglut.sourceforge.net/)
- CUDA (https://developer.nvidia.com/cuda-zone)
Setting up your workstation
I recommend the following configuration for any system that you use for development:
- Create a /source directory, which will contain separate directories containing the source code for each application. This is where you will pull any repositories that you are contributing to.
- Clone the stimlib repository to your source directory and point the STIMLIB_PATH environment variable to this directory.
- Create a /build directory, which will contain a separate directory for each build configuration.
- I generally name each directory with a "-bld" suffix. For example, the hsiproc source code will be kept in /source/hsiproc and the build configuration (*.sln files, etc.) will be generated by CMake in the /build/hsiproc-bld directory. This suffix makes it easier to differentiate between the two when you have a file browser window open.
- Create a /bin directory containing hard symbolic links to executable files in your build directory. For example, this directory will contain a hard link called hsiproc pointing to the hsiproc executable (in Windows, this will be /build/hsiproc-bld/Release/hsiproc.exe).
- Put the /bin directory on your personal PATH. This will allow you to run all of your compiled code from anywhere using a command window.
- For Windows systems, use ConEmu, or some other console emulator. The standard Windows console sucks.
Clone and build the following repositories to make sure everything is working correctly: