How to build and execute with Visual Studio
1. Overview
This document explains how to build and execute the Visual Studio environment with CMake. Currently, we recommend using VS2022, but users can use VS2019 and VS2017 with minor modifications.
- Related files
- ./CmakeLists.txt
- Base file for CMake
- ./CMakeSettings.json
- Setting file for VS to use CMake
- Other CMakeLists.txt in subdirectories
- ./CmakeLists.txt
2. Environment Construction of Visual Studio
- Install Visual Studio 2022
- Select the following
Workloadswhen installing the VS2022Desktop development with C++
- Select the following
- Clone s2e-core
- Please use
the latest release version. - The following procedure possible does not work for
The latest develop branch.
- Please use
- Check that the
ExtLibrariesdirectory is in the same directory as thes2e-corelike below.├─ExtLibraries └─s2e-core
- If not, please follow the procedure below to make
ExtLibraries- Launch VS 2022
- Open the CMake file for the
ExtLibraries- Click
Files/Open/CMake. - Select the following
s2e-core/ExtLibraries/CMakeLists.txt.└─s2e-core └─ExtLibraries └─CMakeLists.txt - Wait a moment until the
CMake generationis finished.
- Click
- Install the
ExtLibraries- Select
CMakeLists.txtby right-clicking in the VS'sSolution Explorer. - Click the
Installcommand. - Wait a moment until the installation is successfully finished.
- Select
- Check that the
ExtLibrariesdirectory is in the same directory as thes2e-core - Check there are
cspiceandnrlmsise00directories in theExtLibrarieslike below.├─ExtLibraries │ └─cspice │ └─GeoPotential | └─nrlmsise00 └─s2e-core
- If not, please follow the procedure below to make
3. The flow of building and execution in Visual Studio 2022
-
Launch VS 2022
-
Open the S2E project
- Click
File/Open/CMake. - Select
s2e-core/CMakeLists.txtat the top directory of the cloned S2E. - Wait a moment until the
CMake generationis finished.
- Click
-
Build the S2E
- Select
CMakeLists.txtby right-clicking in the VS'sSolution Explorer. - Click the
Buildcommand. - Wait a moment until the build is successfully finished.
- Select
-
Check errors
- When users edit the codes, please check the error and fix them.
-
Run the program
- Select
S2E.exeas the red circle of the following figure.
- Click the
green play buttonin the red circle to run the S2E. - A console window is opened, and users can see the S2E's running status.
- Select
-
Check log files
- Open the
./data/***/logs/logs_***directory. - Open the CSV file to check the log output of the S2E.
- Open the
4. Note
- For VS2019 users
- Please edit the compiler setting in
CMakeSetting.jsonas"generator": "Visual Studio 16 2019".
- Please edit the compiler setting in
- For VS2017 users
- Please edit the compiler setting in
CMakeSetting.jsonas"generator": "Visual Studio 15 2017". - Users also need to edit the
cmake_minimum_requiredversion from 3.13 to 3.10 in all CMakeList, including the files in subdirectories. The VS 2017 does not support version 3.13, and you may see manywarningswhen you use CMake Version 3.10.
- Please edit the compiler setting in