The primary development languages used in the STIM Laboratory are Python, C++, and CUDA. C++ and CUDA provide a fast foundation for basic algorithms, while Python is useful for prototyping and combining compiled software.
STIM code is routinely tested on Windows and Linux (Ubuntu LTS) platforms. Source code is managed and downloaded through our personal Git server. External C++ and CUDA packages are managed using vcpkg and build environments are generated with CMake. We also use Anaconda to manage Python environments.
glHelloWorld Build Example
This section provides step-by-step instructions for building one of our most common software packages: SIproc. These steps provide an outline for creating your own in-house software or building other STIM Lab applications. Instructions assume either Windows or the latest Ubuntu LTS release (Linux).
Install common applications
The build system is expected to have the following software installed:
- — C++ compiler, such as Visual Studio (Windows) or GCC/G++ (Linux)
- — CMake cross-platform build tool
- — Git version control
- — CUDA Toolkit (for GPU-based software)
Install vcpkg
1) Make sure you have the appropriate access to the lab Git repositories. Create a BitBucket account and request access to the necessary repositories with your laboratory supervisor. You will also want to set up an SSH key so that you can easily push and pull repositories on your system.
2) Clone the vcpkg source to the desired directory and compile. The vcpkg package manager retrieves, compiles, and maintains all packages locally in this folder.
git clone https://github.com/microsoft/vcpkg .\vcpkg\bootstrap-vcpkg.bat (Windows) ./vcpkg/bootstrap-vcpkg.sh (Linux)
3) Set the VCPKG_DEFAULT_TRIPLET environment variable. Set VCPKG_DEFAULT_TRIPLET = x64-windows to ensure that VCPKG downloads and installs 64-bit packages by default.
Install the TIRAlib source repository
1) Clone the TIRAlib source repository. This is a common source-code base used across our software. It is also helpful to point the environment variable TIRA_ROOT to this folder so that CMake can find it without any user interaction.
git clone https://github.com/STIM-Lab/tiralib.git
2) Set the TIRA_ROOT environment variable. Set TIRA_ROOT = path/to/tiralib so that CMake knows where to find the TIRA repository.
Test the Development Environment
1) Install any required packages. When installing packages, make sure you are in the vcpkg directory. The following are used for glHelloWorld:
./vcpkg install glfw3 ./vcpkg install imgui[core,glfw-binding,opengl3-binding] ./vcpkg install glew ./vcpkg install glm
asdfaasdfasdf
2) Clone the glHelloWorld repository to your preferred source location.
git clone https://github.com/STIM-Lab/glHelloWorld.git
3) Use CMake to create a build environment. Using the CMake GUI, specify the source directory and desired build directory. Also, make sure to select the option to Specify toolchain file for cross-compiling and provide the file located at:
[vcpkg directory]\scripts\buildsystems\vcpkg.cmake
This file provides CMake with the location of all vcpkg packages. Alternatively, CMake can be run from the command line in the build directory:
cmake [source dir] -DCMAKE_TOOLCHAIN_FILE=[vcpkg dir]\scripts\buildsystems\vcpkg.cmake