Setup¶
Rat-vcpkg and vcpkg have some prerequisites in order to fully enable their features.
Install a compilation toolchain¶
vcpkg requires a compilation toolchain to be up and ready to compile C/C++.
The compilation toolchain consists of a compiler, a linker and several other related tools that are needed for the compilation of C/C++ libraries and programs. This part differs depending on the targeted platform (e.g. Windows VS the world).
Platforms |
Compilers |
Linkers |
|---|---|---|
Windows |
|
|
UNIX (Linux/macOS) |
|
|
A - Windows | MSVC Build Tools¶
Installation come in the form of a classical wizard installer for the MSVC toolchain.
Caution
The compilation has been tested on MSVC v2019-2022. The v2025 is NOT compatible with the compilation of some packages such as the SuiteSparse libraries for the time being.
New shells should be available from the Windows Start Menu once
the installation is complete. Hit the ⊞ Win key and look for
something like Developer PowerShell for VS 20XX (depending on
the version).
This is a PowerShell terminal that starts with a special .ps1
script to update environment variables for the MSVC toolchain to
work properly. It should be used for the rest of this
documentation in order to have access to all the MSVC toolchain
needed to compile applications on Windows.
Note
There exists an equivalent version using
cmdinstead of PowerShell if preferred. Just make sure to translate commands accordingly.For the rest of this documentation, this terminal will be refered as the MSVC shell.
Use the MSVC shell to compile libraries, run programs and use vcpkg.
If using the Windows Terminal, one can add a profile with the following start script to have a smooth experience:
powershell.exe -noexit -command "& 'C:\Program Files\Microsoft Visual Studio\2022\Community\Common7\Tools\Launch-VsDevShell.ps1' -arch amd64 -host amd64"
B - UNIX (Linux/macOS) | GNU toolchain¶
The UNIX world being very wide and various some steps might need some adaptation from the user.
The broad idea is to get items such as a compiler, linker, configure tools, and some additional headers and libraries if needed depending on the environment.
Under WSL2 Ubuntu24 this looks like something like this:
# Compiler, linker, configure tools
sudo apt-get install build-essential
# OpenGL related items, for WSL
sudo apt-get install mesa-utils libglu1-mesa-dev freeglut3-dev mesa-common-dev
Do not hesitate to install more things if needed.
To complete the toolchain, install the following:
Install Git¶
Use the above installer or any package manager.
All the default options should be good to go if you do not know much
about git. Ensure it works properly by opening a new shell and
running git --version.
git will be used for cloning (downloading) vcpkg and
Project-Rat dependencies to compile them locally.
Install vcpkg¶
vcpkg is a bit different: it needs to be cloned, and then bootstrapped it, which is quite nice.
Clone the vcpkg repository in a convenient place for ease of access.
Open up a shell and navigate to a handy place.
Clone the vcpkg repository locally:
git clone https://github.com/microsoft/vcpkg.git
Navigate into it & bootstrap it:
cd vcpkg
.\bootstrap-vcpkg.bat -disableMetrics
This will generate a vcpkg executable inside the repository and
can be used by the system and user to install and handle packages.
See also
More information about vcpkg can be found here: https://learn.microsoft.com/fr-fr/vcpkg/get_started/get-started?pivots=shell-cmd
Add the local vcpkg repository to the
PATHenvironment variable.
$env:Path="C:\path\to\vcpkg;$env:Path"
Verify the vcpkg command is available from the shell:
vcpkg --version
This should print the version as a Git commit hash.
Install CUDA Toolkit & NVIDIA drivers¶
Note
This part is optional and should be done to enable NVIDIA CUDA GPU acceleration for Rat calculations.
Computers without graphics cards will not be able to benefit from this acceleration.
Install the CUDA Toolkit. Setups should be similar to these for most users:
Plaforms |
Installers |
|---|---|
Windows |
|
WSL2 Ubuntu |
Install the latest NVIDIA drivers. This will depend on the graphics card at hand.
Danger
If using WSL, do NOT install NVIDIA drivers in the Linux distribution. Install them on Windows only.
Find your graphics card model via the NVIDIA Control Panel in the Start Menu, e.g. NVIDIA RTX 1000 Ada Generation, and search for it in the search bar of the above web page. Download and install the corresponding driver.
Update
PATHenvironment variable to reflect CUDA installation (change the 13.0 to the version on the system if needed).
$env:Path="C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v13.0\bin;$env:Path" # binaries
$env:Path="C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v13.0\bin\x64;$env:Path" # libraries
Important
Paths to CUDA installation must remain visible when compiling anything requiring the CUDA Toolkit.
For a more long lasting setup consider adding these paths
to the PATH environment variable either via a PowerShell
profile or via Windows environment variables menu.
Install an IDE¶
Any IDE (Integrated Development Environment) should do the trick. Here are some random propositions:
One might want to write some code using Rat C++ libraries after all.