- Docker is useful for the easy setup of the compile environment for S2E.
- Both Windows and Mac users can use the same environment and get the same result by using the docker container.
- We selected Ubuntu as an OS in the docker image and GCC/G++ as a compiler for S2E.
Note: We currently use a 32bit compiler for S2E since flight S/Ws are usually executed on a 32bit microcomputers. - We recommend using Visual Studio Code as an editor for the environment.
- This document explains a setup sequence of the docker environment for S2E.
- Note: For a detailed explanation of Docker and VSCode's Extensions, please see the latest and official information.
- Go to the install web page of Docker.
- Install
Docker for Windows
orDocker for Mac
to suit your platform.
- Go install web page of VS Code.
- Install
Visual Studio Code
to suit your platform. - Install following extensions
- Remote-SSH
- CMake
- CMake Tools
- C/C++
- Following extensions are also useful
- Code Spell Checker
- Install the
coreutils
to use therealpath
command insetup_docker.sh
- Use the
brew install coreutils
command when you haveHomebrew
- Use the
- Create a
work
directory as a working directory. - Clone s2e-core in the
work
directory. - Add the
work
directory in thefile sharing
directory of Docker.- Note: This setting does not exist in the latest Docker and WSL2 environments in Windows, so it is not necessary.
- Launch
git bash
(for windows users) orterminal
(for Mac users) - Move
/s2e-core/scripts/Docker_Ubuntu
directory - Edit
Dockerfile
orsetup_docker.sh
when you want to change the directory name, the user name of the container, and other settings. - Execute
./setup_docker.sh build
to make images - Check created images (
issl
(andubuntu
))- command:
docker images
- command:
- Execute
./setup_docker.sh run_core
to make the container - Check created container (
issl:latest
)- command:
docker ps -a
- command:
- Check the dashboard of Docker as follows.
- Launch
VS Code
and open a new window. - Click the
Remote Explorer
icon on the left side.- Note: the icon looks like a monitor
- Click the
gear
icon ofSSH TARGETS
and select the config file you want to edit- Default:
C:\Users\UserName\ssh\config
orUser/UserName/ssh/config
- Default:
- Edit the config file as follows
Host issl-1 HostName localhost User s2e Port 2222
- Save the config file and check a new SSH target
issl-1
is made in the explorer - Click
Connect to Host in New Window
icon on right side ofissl-1
- Enter the password
s2e
when required - See left bottom icon
SSH:issl-1
to confirm the connection - Open the
work
directory in the container by usingOpen folder
Note : This sequence was integrated within the docker build process, so this is currently unnecessary.
- S2E has several script files to get external libraries.
- For this ubuntu/docker platform, users should use script files in
scripts/Common
directory andscripts/Docker_Ubuntu
directory. - Users can execute most of the script files with
git bash
orterminal
in the outside of the container, but users should executescripts/Common/download_nrlmsise00_src_and_table.sh
inside the container to use the same compiler. - Click
Terminal > New terminal
in the menu bar of VS Code. - Select
bash
terminal at the bottom window. - Execute
./s2e-core/scripts/Common/download_nrlmsise00_src_and_table.sh
. - See
ExtLibraries
to confirm the NRLMSISE library is generated.
- Install the following extensions in the
issl-1 SSH connection
Even if the extensions were already installed in local VS code, you also need to install them in theSSH connection
.- C/C++
- CMake
- CMake Tools
Note : You need to reload VS Code after installing new extensions
- Edit setting of
CMake Tools
inissl-1
Cmake Build Directory: ${workspaceFolder}/s2e-core/build/Debug
- After
CMake
andCMake Tools
are installed, VS Code requires you to configure the building environment withCMakeList.txt
. Please selectyes
. However, there is noCMakeList.txt
file in thework
directory, and VS Code requires you to locateCMakeList.txt
, so please select theCMakeList.txt
file ins2e-core
directory.- This setting is written in
.vscode/settings.json
- You can directly edit the
settings.json
as follows{ "cmake.sourceDirectory": "${workspaceFolder}/s2e-core", "cmake.buildDirectory": "${workspaceFolder}/s2e-core/build/Debug" }
- This setting is written in
- Select
GCC 11.2.0
as a kit (compiler)- Note: Users can also choose other GCC versions.
- Select
CMake [Debug]
and check the configuration is successfully done. - Build S2E
- If you want to clean up, please use
CMake: Clean
command.
- If you want to clean up, please use
- Move to
build/Debug
directory withTerminal
in VS Code. - Execute
./S2E
or click therun
icon at the bottom. - Check the
data/log
directory to confirm log file output.
- Select
Run > Start Debugging
in the menu bar. - Select
C++(GDB/LLDB)
debugger- If
C++(GDB/LLDB)
is not shown, please open a CPP file and selectRun > Start Debugging
again. .vscode/launch.json
will be created.
- If
- Edit as follows.
"program": "${workspaceFolder}/s2e-core/build/Debug/S2E", "cwd": "${workspaceFolder}/s2e-core/build/Debug",
- Select
Run > Start Debugging
again. - Check the
data/log
directory to confirm log file output. - You can use breakpoints in the VS Code editor.