Setup instructions for Windows 11
⚠ PATH on Windows and bloated machines
If there are already too many other software installed on your Windows machine, things can get difficult.
You have to be especially careful about the PATH environment variable. Some software will add path to their own installation directory where incompatible version of dependencies (for instance incompatible version Qt, which is a very popular library) will avoid you to setup the CamiTK development environment properly.
Another problem may arise when the PATH environment variable is already quite full. There is a limit to the length of this variable (or more exactly in the tool that modifies the variable value). If this limit is reached, setup the CamiTK development environment might not be done properly.
On Windows 11, it is therefore recommended:
- if possible, to start from a fresh Windows 11 install (or a machine that does not already zillions of software installed)
- check the value of the
PATHenvironment variable to make sure:- there is no older/other dependency DLL accessible through the path (e.g. older/other version of Qt)
- its length is not too close to the limit of 1023 characters (
setxlimit)
Windows 11 setup overview
Setting up a development environment requires that all the tool chain and dependencies from scratch should be installed on your machine. The dependencies will be compiled from the source most of the time, as they are not available as pre-compiled/installable packages.
We provide installation scripts that have to be run from a command shell with the admin privilege and will install chocolatey (a sort of application manager on Windows). This will take a little bit of time, but it is worth the trouble!
Check the support policy document for the currently supported/working version of the dependencies.
About the installation scripts
The installation scripts are the one we used to setup the CamiTK continuous integration. It should work out of the box, but it is given with no guarantee as there are a multiple of situations that depends on your machine, your machine history and the software already installed on your machine.
About chocolatey
In order to simplify everything for you, we recommend that you use chocolatey (a package manager for Windows). That’s what we are using ourself to install application and the toolchain on Windows.
It will help you have a greater control of what is installed on your machine (and where). Everything you install with chocolatey can be easily updated or uninstalled.
We also strongly suggest that you also use chocolatey to install any other available software on your Windows machine. It’s robust and you will get a simple way to update or uninstall the software.
⚠ Developer machine
If you already have some of the toolchain or library installed, and you know what you are doing, just check the installation scripts and cherry-pick the part you need.
To avoid multiple versions of the same tool or lib, we strongly recommend you start from scratch. The DLL hell is never far away…
① Download the setup scripts
Download the installation scripts archive and unzip it.
sha256sum: dc521afc5bddcecfe1c63267691a2c0d5df09c9e1dc52b4f6adf98543cefdb41
② Open a command shell with elevated privilege
Launch a cmd shell with admin privilege.
How to start a terminal with admin privilege
You can read the official Microsoft documentation, which can be summarized to:
- Click Start (also shown as the circular Windows logo in the Start menu).
- Type Command Prompt and right-click Command Prompt when it appears in the Start menu. From the resulting context menu, click Run as administrator.
③ Run the setup scripts
The scripts should do everything for you automatically if you run them in the right order (hint: the script names have an index!). In the terminal with admin privilege:
cd c:\where\you\unzip\the\scripts
setup0-choco.bat
setup1-toolchain.bat
setup2-builddep.bat
Copy/paste code snippets
You can easily copy all the bash code from this documentation by clicking on the Copy button in the top right corner of each code snippets… You can then paste in your terminal.
Each script might take a looooong time to run (some scripts are downloading package from the internet and others are building dependencies from source). It might take a while to complete, be patient, we promise it’s worth it!
Description of the installation scripts
util-vars.batcontains the default recommended installation directories. It defines the installation path asC:\camitkand the working setup directory asC:\setup.util-dnd.batcontains the commands to download the dependencies’ source tarballutil-build.batcontains the commands to build a dependency from sourcesetup0-choco.batinstalls chocolateysetup1-toolchain.batsetups the environment variables, use chocolatey to install git, curl, 7zip, pedeps, python, visual studio 2022 buildtools, cmake, ninja and finally useaqtinstallto install Qtsetup2-builddep.batdownloads, configures, builds and patches (if needed) all the required dependencies (xercesc, xsdcxx, vtk, gdcm, and itk).
Results
setup1-toolchain.bat scripts should have configured your environment so that everything is ready for the next step.
C:\camitkcontains the final development environment.C:\setupcontains all the intermediary files required for the installation (downloaded sources, extracted sources, build directories).
→ Only C:\camitk directory is required to build CamiTK from source after this stage.
Rebooting your machine now might be a good idea.