Skip to content

Commit

Permalink
More updates to build instructions.
Browse files Browse the repository at this point in the history
  • Loading branch information
MintoDA1 authored and MintoDA1 committed Sep 11, 2023
1 parent f8e7a66 commit b4d4d4c
Showing 1 changed file with 34 additions and 3 deletions.
37 changes: 34 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,46 @@

CTEM uses CMake to automate the build process. You will need at least version 3.6.0.

To build the executable and all artifacts in a directory called `build/`, simply run the following commands from the CTEM root directory:
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:

```
$ cmake -B build -S .
$ cmake --build build
```

To clean all build artifacts, you can execute the included `distclean.cmake` script with the following command:
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:

```
$ cmake -P distclean.cmake
```
```

The CTEM CMake configuration comes with several customization options:

| Option | CMake command |
| --------------------------------|------------------------------------------------------------|
| Build type | \-DCMAKE_BUILD_TYPE=[**RELEASE**\|DEBUG\|TESTING\|PROFILE] |
| Enable/Disable OpenMP support | \-DUSE_OPENMP=[**ON**\|OFF] |
| Enable/Disable SIMD directives | \-DUSE_SIMD=[**ON**\|OFF] |
| Set Fortran compiler path | \-DCMAKE_Fortran_COMPILER=/path/to/fortran/compiler |
| Set path to make program | \-DCMAKE_MAKE_PROGRAM=/path/to/make |
| Enable/Disable shared libraries (Intel only) | \-DBUILD_SHARED_LIBS=[**ON\|OFF] |
| Add additional include path | \-DCMAKE_Fortran_FLAGS="-I/path/to/libraries |
| Install prefix | \-DCMAKE_INSTALL_PREFIX=["/path/to/install"\|**"/usr/local"**] |



To see a list of all possible options available to CMake:
```
$ cmake -B build -S . -LA
```

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:

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

This will install the project into the directory specified by `CMAKE_INSTALL_PREFIX` (the default is `/usr/local`), provided you have
sufficient permissions.

0 comments on commit b4d4d4c

Please sign in to comment.