Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
Included better instructions for installing via pip
  • Loading branch information
daminton authored Jun 14, 2024
1 parent 471b490 commit 8d3787f
Showing 1 changed file with 30 additions and 8 deletions.
38 changes: 30 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,19 +1,41 @@
### 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
```
The CTEM executable, called `CTEM`, should now be created in the ```bin/``` directory.

If you wish to install CTEM into the system, execute the following command:

```
```bash
$ cmake --install build
```

Expand All @@ -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
```

0 comments on commit 8d3787f

Please sign in to comment.