-
Notifications
You must be signed in to change notification settings - Fork 29
2. Dev Setup
N.B. This is an incomplete draft version of the development environment setup notes
Originally, the README.md contained instructions for how to set up a development environment for the edge-addition-planarity-suite on Windows using the Eclipse IDE (see README.md from commit b4063b). Support was extended to using Visual Studio Code on Windows 10 (both MinGW gcc and MSVC cl) and MacOS Sequoia 15.0 (clang) with the testing of PR #16, and subsequently to include Debian Linux 12.7 with the testing of PR #58. The most recent Visual Studio Code configuration files were updated in PR #92 to reflect the new project structure described by Epic #91.
Coming soon: installing MinGW and optionally MSVC
N.B. These instructions will be revised to cover installing MinGW 64 as a part of Issue #102 - Add support for MinGW 64 and deprecate MinGW 32
Coming soon: installing Python 3.12 on Windows
Creating a Windows 10 22H2 VM using VirtualBox
If you are on a Windows device and wish to create a Windows 10 Home 22H2 virtual machine to contain your development environment, you can download the Windows 10 Media Creation tool which will help you create an .iso file. Otherwise, you may download the .iso file directly from the Windows 10 Home 22H2 ISO Download page.
- Ensure your username is part of the
sudoersgroup; if not, then follow the advice in the replies to this Unix StackExchange post - Run the following command
To install build dependencies (i.e. the
sudo apt-get update && sudo apt-get -y upgrade && sudo apt-get install -y build-essential gdb autotools-devbuild-essentialmetapackage, which includesgccbut doesn't includegdb, as well as the GNU Autotools (see the Autotools FAQ and the Debian AutoTools home for more info)) - To build Python 3.12 from source on Debian Linux, please follow the Python documentation page Building Python; in particular, please ensure that you run
make altinstallso that you do not override the systempython3binary.-
N.B. Although the
TestSupport\planaritytestingpackage doesn't depend on extension modules that impose further requirements of development headers for additional libraries, it might be prudent to follow the Python Developer's Guide - Build Dependencies for instructions on how to get all build dependencies on Linux. If you decide to install these dependencies after having initially built and installed Python 3.12 from source, you'll have to re-runconfigureandmake.
-
N.B. Although the
Creating a Debian Linux 12.7 VM using VirtualBox
If you wish to create a Debian Linux VM to contain your development environment, you can get the most recent version of Debian Linux from the Debian Downloads page; however, the edge-addition-planarity-suite has been tested on Debian 12.7.0, the netinst CD image .iso for which may be obtained from Installing Debian 12.7 (Bookworm). If you are using VirtualBox to set up your VM, follow a guide like How To Install Debian 12 on VirtualBox, which includes instructions for how to set up VirtualBox Guest Additions on the Debian Linux VM; there are alternate instructions for how to install VirtualBox Guest Additions on the VM provided by the Debian Wiki: Installing the Guest Additions on a Debian VM - Debian 10 "Buster", Debian 11 "Bullseye", and Debian 12 "Bookworm". If your sources.list doesn't contain the expected package mirrors, you can copy a default version by running:
sudo cp /usr/share/doc/apt/examples/sources.list /etc/apt/sources.list
Recommended in this reply to a Unix StackExchange post.
- Open a terminal window and type:
% xcode-select --install xcode-select: note: install requested for command line developer tools - A new prompt will open outside the terminal window; click 'Install'
- Agree to the Command Line Tools License Agreement
- A new prompt will open indicating the progress as the software is downloaded
- Verify that Xcode command line tools were correctly installed and the requisite utilities are present:
Where
% xcode-select -p /Applications/Xcode.app/Contents/Developer % which clang /usr/bin/clang % which lldb /usr/bin/lldb % which leaks /usr/bin/leaksclangis the compiler,lldbis the debugger, andleaksis a command-line tool for finding memory leaks (see the 3. Test Support wiki page section on Automating memory checking on MacOS usingleaks) - Coming soon: installing Python 3.12 on MacOS
Creating a MacOS Sequoia 15.0 VM using UTM
If you wish to create a MacOS VM to contain your development environment, visit the Apple Developer Download page and sign in using your Apple ID; then, search for MacOS (i.e. Sequoia 15.0) and click the link labelled Mac computers with Apple silicon to download the .ipsw restore image. Then, download UTM and install this system emulator. Finally, follow their instructions for How to set up a MacOS Guest using the .ipsw previously downloaded.
To install Visual Studio Code on Windows, follow Visual Studio Code on Windows - Installation, and then depending on which compiler toolchain you have installed, follow either Using GCC with MinGW or Configure VS Code for Microsoft C++.
To install Visual Studio Code on MacOS, follow Visual Studio Code on macOS - Installation, and then Using Clang in Visual Studio Code.
To install Visual Studio Code on Linux, follow Visual Studio Code on Linux - Installation, and then Using C++ on Linux in VS Code.
Once you have installed VSCode on your chosen platform(s), you must Browse for extensions and choose to install:
- C/C++ Extension Pack -
ms-vscode.cpptools-extension-packName: C/C++ Extension Pack Id: ms-vscode.cpptools-extension-pack Description: Popular extensions for C++ development in Visual Studio Code. Version: 1.3.0 Publisher: Microsoft VS Marketplace Link: https://marketplace.visualstudio.com/items?itemName=ms-vscode.cpptools-extension-pack - Python -
ms-python.pythonName: Python Id: ms-python.python Description: Python language support with extension access points for IntelliSense (Pylance), Debugging (Python Debugger), linting, formatting, refactoring, unit tests, and more. Version: 2024.14.1 Publisher: Microsoft VS Marketplace Link: https://marketplace.visualstudio.com/items?itemName=ms-python.python - Pylint -
ms-python.pylintName: Pylint Id: ms-python.pylint Description: Linting support for Python files using Pylint. Version: 2023.10.1 Publisher: Microsoft VS Marketplace Link: https://marketplace.visualstudio.com/items?itemName=ms-python.pylint - Black Formatter -
ms-python.black-formatterName: Black Formatter Id: ms-python.black-formatter Description: Formatting support for Python files using the Black formatter. Version: 2024.2.0 Publisher: Microsoft VS Marketplace Link: https://marketplace.visualstudio.com/items?itemName=ms-python.black-formatter - GitLens -
eamodio.gitlensName: GitLens — Git supercharged Id: eamodio.gitlens Description: Supercharge Git within VS Code — Visualize code authorship at a glance via Git blame annotations and CodeLens, seamlessly navigate and explore Git repositories, gain valuable insights via rich visualizations and powerful comparison commands, and so much more Version: 15.5.1 Publisher: GitKraken VS Marketplace Link: https://marketplace.visualstudio.com/items?itemName=eamodio.gitlens
Finally, one must run the edge-addition-planarity-suite/devEnvSetupAndDefaults/devEnvSetupScript.sh (to be added in forthcoming PR to satisfy Issue #89) to copy the bespoke tasks.json and launch.json into the .vscode directory at the root of the project. These configuration files allow users to build and run/debug the planarity executable on Windows (MinGW gcc and MSVC cl), Debian Linux (gcc), and MacOS (clang), and also enable one to debug the Python TestSupport scripts. Additionally, this script copies a bespoke settings.json to configure the black Python formatter extension.
Debug and Release configurations within tasks.json and launch.json for C/C++ applications
- For MinGW
gcc, refer to Using GCC with MinGW sections Run helloworld.cpp and Customize debugging withlaunch.json-
C/C++: (Windows) [Debug] gcc.exe build planarity projectintasks.jsonis thepreLaunchTaskforC/C++: (Windows) [Debug] gcc.exe build and debug planarity projectinlaunch.json -
C/C++: (Windows) [Release] gcc.exe build planarity projectintasks.jsonis thepreLaunchTaskforC/C++: (Windows) [Release] gcc.exe build and run planarity projectinlaunch.json
-
- For MSVC
cl, refer to Configure VS Code for Microsoft C++ sections Run helloworld.cpp and Customize debugging with launch.json. N.B. You must run VSCode from the Developer Command Prompt, otherwise you won't have the appropriate environment variables set to build using MSVCclnor to debug; see section Check your Microsoft Visual C++ installation-
C/C++: (Windows) [Debug] cl.exe build planarity projectintasks.jsonis thepreLaunchTaskforC/C++: (Windows) [Debug] cl.exe build and debug planarity projectinlaunch.json -
C/C++: (Windows) [Release] cl.exe build planarity projectintasks.jsonis thepreLaunchTaskforC/C++: (Windows) [Release] cl.exe build and run planarity projectinlaunch.json
-
- For
gccon Linux, refer to Using C++ on Linux in VS Code sections Run helloworld.cpp and Customize debugging with launch.json-
C/C++: (Linux) [Debug] gcc build planarity projectintasks.jsonis thepreLaunchTaskforC/C++: (Linux) [Debug] gcc build and debug planarity projectinlaunch.json -
C/C++: (Linux) [Release] gcc build planarity projectintasks.jsonis thepreLaunchTaskforC/C++: (Linux) [Release] gcc build and run planarity projectinlaunch.json
-
- For
clangon MacOS refer to Using Clang in Visual Studio Code sections Run helloworld.cpp, specifically Understanding tasks.json and Customize debugging with launch.json-
C/C++: (MacOS) [Debug] clang build planarity projectintasks.jsonis thepreLaunchTaskforC/C++: (MacOS) [Debug] clang build and debug planarity projectinlaunch.json -
C/C++: (MacOS) [Release] clang build planarity projectintasks.jsonis thepreLaunchTaskforC/C++: (MacOS) [Release] clang build and run planarity projectinlaunch.json
-
Debug configuration for Python TestSupport scripts
Please see the 3. Test Support wiki page for more context on these scripts.
More details coming soon
Python linting and formatting for the TestSupport scripts
The settings.json customizes the behaviour of the pylint and black VSCode extensions; see Issue #100 for more context.
More details coming soon
One must run the edge-addition-planarity-suite/devEnvSetupAndDefaults/devEnvSetupScript.sh (N.B. Will be added in forthcoming PR to satisfy Issue #89) to copy defaults for the following files:
edge-addition-planarity-suite/.projectedge-addition-planarity-suite/c/.projectedge-addition-planarity-suite/c/.cproject
More details coming soon
Coming soon
Coming soon
N.B. The following process has been tested on Debian Linux 12.7.0 and Windows 10 22H2 with MinGW 32