From 8d3787f33d750da48a9a73ac4ff336bdd27bf6b4 Mon Sep 17 00:00:00 2001 From: "Minton, David A" Date: Fri, 14 Jun 2024 13:14:15 -0400 Subject: [PATCH] Update README.md Included better instructions for installing via pip --- README.md | 38 ++++++++++++++++++++++++++++++-------- 1 file changed, 30 insertions(+), 8 deletions(-) diff --git a/README.md b/README.md index 3c4de12f..bee76636 100644 --- a/README.md +++ b/README.md @@ -1,11 +1,33 @@ +### Installing the CTEM Python package +************************************** +CTEM can be installed into a Python environment using pip. + +```bash +$ pip install . +``` + +This will compile the CTEM executable into your environment's `bin` folder. To run CTEM from Python, simply change directories to a folder that contains the appropriate input files (see the examples folder included in the repo) and execute the following: + +```python +import ctem +sim = ctem.Simulation() +sim.run() +``` + +We provide a `ctem_driver.py` file as a convenience script in some examples. Some of the input files are generated by the Python script, such as the conversion from the production function in units of number of impacts per unit area per unit time to total number of impacts. Once these have been generated, you can run the standalone executable from the command line: + +```bash +$ ctem +``` + ### Installing CTEM for code development -************************************ +**************************************** CTEM uses CMake to automate the build process. You will need at least version 3.6.0. -Navigate to the topmost directory in your CTEM repository. It is best practice to create a ```build``` directory in your topmost directory from which you will compile CTEM. This way, temporary CMake files will not clutter up the project sub-directories. The commands to build the source code into a ```build``` directory and compile CTEM are: +Navigate to the topmost directory in your CTEM repository. It is best practice to create a ```build``` directory in your topmost directory from which you will compile CTEM. This way, temporary CMake files will not clutter up the project sub-directories. The commands to build the source code into a `build` directory and compile CTEM are: -``` +```bash $ cmake -B build -S . $ cmake --build build ``` @@ -13,7 +35,7 @@ The CTEM executable, called `CTEM`, should now be created in the ```bin/``` dire If you wish to install CTEM into the system, execute the following command: -``` +```bash $ cmake --install build ``` @@ -36,19 +58,19 @@ The CTEM CMake configuration comes with several customization options: To see a list of all possible options available to CMake: -``` + +```bash $ cmake -B build -S . -LA ``` For instance, if you wish to compile the project with debugging symbols enabled, run: -``` +```bash $ cmake -B build -S . -DCMAKE_BUILD_TYPE=Debug ``` - The [CMake Fortran template](https://github.com/SethMMorton/cmake_fortran_template) comes with a script that can be used to clean out any build artifacts and start from scratch: -``` +```bash $ cmake -P distclean.cmake ```