diff --git a/10_Getting_Started/20_Build/30_Windows.md b/10_Getting_Started/20_Build/30_Windows.md index 8d5685cb2..fea18ab4f 100644 --- a/10_Getting_Started/20_Build/30_Windows.md +++ b/10_Getting_Started/20_Build/30_Windows.md @@ -1,22 +1,61 @@ SOFA policy is to support only the latest Windows version. +# Common prerequisites + +Two wolutions exist for building SOFA on your own windows environement. Both require to first install a C++17 compatible compiler. Here are the step to install MSVC. + +## Compiler + +SOFA requires a [C++17 compatible compiler](https://en.cppreference.com/w/cpp/compiler_support#C.2B.2B17_features). +On Windows, we officially support **Microsoft Visual Studio >= 2017** (version 15.7). +If you want to use **Visual Studio IDE**, install the complete Visual Studio solution. +If you want to use **another IDE** (like QtCreator), install the Build Tools only. + +| | **Visual Studio 2017** | **Visual Studio 2019** | **Visual Studio 2022** | +|-----------------------|:------------------------------------------------------------------------------------------------------------:|:------------------------------------------------------------------------------------------------------------:|:------------------------------------------------------------------------------------------------------------:| +| **Build Tools only** | [download](https://visualstudio.microsoft.com/fr/thank-you-downloading-visual-studio/?sku=BuildTools&rel=15) | [download](https://visualstudio.microsoft.com/fr/thank-you-downloading-visual-studio/?sku=BuildTools&rel=16) | [download](https://visualstudio.microsoft.com/fr/thank-you-downloading-visual-studio/?sku=BuildTools&rel=17) | +| **IDE + Build Tools** | [download](https://visualstudio.microsoft.com/fr/thank-you-downloading-visual-studio/?sku=Community&rel=15) | [download](https://visualstudio.microsoft.com/fr/thank-you-downloading-visual-studio/?sku=Community&rel=16) | [download](https://visualstudio.microsoft.com/fr/thank-you-downloading-visual-studio/?sku=Community&rel=17) | + + +In the installer, you must enable: + +1. In the main panel: the **C++ development toolkit**, called "C++ Build Tools" or "Desktop C++". +2. In the side panel: the **C++ ATL** and **C++ MFC** components. + + + # Installation with Pixi -You can download and build SOFA in only three steps without any environment installation. +You can download and build SOFA in only three steps without any more environment installation. ## Prerequisites +- Install build tools for windows (see previous step) - [Install Git](https://git-scm.com/install/windows) - [Install Pixi](https://pixi.prefix.dev/latest/installation/) ## Installation steps + + - Clone SOFA : `git clone https://github.com/sofa-framework/sofa` :inbox_tray: - Trigger the build : run `pixi run -e supported-plugins build` in the sofa source folder :desktop_computer: - Launch SOFA : run `pixi run -e supported-plugins runSofa` :rocket: +## Troubleshoots +These are some of the possible issue face using pixi for compiling SOFA. Launching `pixi run -e supported-plugins runSofa` will first gonfigure the cmake project, then build and install it. We know that issues can arise at the configure and build step. +- **Configure step**: During the configure step some plugins are fetched using git. Some plugins (such as Regression) clone migh fail due to long reference names and paths. To fix that: + 1. Activate pixi shell `pixi shell -e supported-plugins-dev` + 2. Run the git command to enable long paths `git config --global core.longpaths true` + 3. Exit the shell `exit` and re run `pixi run -e supported-plugins runSofa` +- **Compile step**: This long path issue might also break the compilation. If strange errors stating that the artifact produced by compiler cannot be found then certainly this is your issue. To fix this there are multiple solutions + 1. Enable long path on windows/ In an administrato powershell : `New-ItemProperty -Path "HKLM:\SYSTEM\CurrentControlSet\Control\FileSystem" -Name "LongPathsEnabled" -Value 1 -PropertyType DWORD -Force`, then reboot. But this might not be enough. + 2. Clone sofa in the root of your volume e.g. under `C:\sofa` reducing all of the path handeled by the compiler. + 3. If this is still not enough, pixi allow to define the environement path outside of your source dir. By modifying or creating `sofa\.pixi\config.toml` and adding this line `detached-environments = "C:\\pe"`. It will create the environement at the root of your volume, reducing even more the paths used by the compiler. + + # Manual installation (for developpers) @@ -27,46 +66,6 @@ You can download and build SOFA in only three steps without any environment inst
| - | Visual Studio 2017 | -Visual Studio 2019 | -Visual Studio 2022 | -
|---|---|---|---|
| Build Tools only | -download | -download | -download | -
| IDE + Build Tools | -download | -download | -download | -
-
-