EGSnrc
EGSnrc copied to clipboard
Configuration and documentation for building and running in Codespaces or Development Container
This adds the configuration necessary to build and run EGSnrc in a Development Container. I have successfully tested this in the following environments:
- [x] GitHub Codespaces
- [x] MacOS using VS Code and Docker Desktop (requires #1100)
- [x] Windows using VS Code and Docker Desktop with WSL2 backend
Documentation:
-
.devcontainer/README.md
: A new README file has been added to explain how to use the development container. It provides instructions for different environments and addresses potential issues, such as line-endings in files when running locally on Windows. It also describes the runtime experience and provides reference information.
Development container configuration:
-
.devcontainer/devcontainer.json
: This file contains the configuration for the development container. It specifies the Docker image to use, features to include, commands to run on creation and after creation, ports to forward, and attributes for the forwarded ports.
Scripts for container setup and GUI applications build:
-
.devcontainer/setup.sh
: This script runs when the development container is being created. It installs the required packages for EGSnrc, builds the application, and configures.bashrc
with necessary environment variables and source commands. -
.devcontainer/build-gui-apps.sh
: This script is used to build the GUI applications for EGSnrc. It checks if theEGS_HOME
environment variable is set and sources~/.bashrc
if not. It then builds the GUI applications.
This is a very timely contribution! It will definitively make it easier for users to use EGSnrc in their preferred OS on any machine regardless of the host OS!
Yes, let's add it and then we and others can play with it and improve!
@markphip quick question: is the .devcontainer
directory name canonical, or can it be anything?
@ftessier The specification describes a limited number of names and folders for the configuration. See https://containers.dev/implementors/spec/#devcontainerjson