Skip to content

Commit 2a19849

Browse files
committed
Update README.md
1 parent e847cdb commit 2a19849

File tree

1 file changed

+20
-7
lines changed

1 file changed

+20
-7
lines changed

README.md

Lines changed: 20 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,23 +4,36 @@
44

55
## Dependencies
66

7-
The recommended system to build this project is `CMake`. Compilation of the C++ example requires a g++ compiler that supports the C++20 standard. In order to build the MEX interface, MATLAB should be installed and available on the search path.
7+
The recommended system to build this project is `CMake`. Compilation of the C++ tests requires a C++ compiler that supports the C++20 standard. In order to build the MEX interface, MATLAB must be installed and available on the search path.
88

99
## Build
1010

11-
The C++ example program and the MEX interface can be compiled with:
11+
### Mex interface
12+
13+
The MEX interface can be compiled with:
14+
```bash
15+
cmake -S. -Bbuild
16+
cmake --build build
17+
```
18+
If the compilation is successful, these commands will produce the the MEX file `build/gemmi.$(mexext)`, where `$(mexext)` is `mexa64` on Linux, `mexmaci64` or `mexmaca64` on MacOS , and `mexw64` on Windows. The file `build/gemmi.m` contains the documentation for the MATLAB `gemmi` function.
19+
20+
Building the interface can be disabled by setting the CMake variable `BUILD_MEX` to false:
21+
```bash
22+
cmake -S. -Bbuild -DBUILD_MEX=False
23+
```
24+
25+
### Catch2 tests
26+
27+
The project comes with a suite of [Catch2](https://github.com/catchorg/Catch2) C++ tests. By default, the tests are disabled, and can be enabled by setting the CMake variable `BUILD_TEST` to true:
1228
```bash
13-
mkdir build
14-
cmake -B build
15-
cd build && make
29+
cmake -S. -Bbuild -DBUILD_TESTS=True
1630
```
17-
If the compilation is successful, these commands will produce the executable `build/example` and the MEX interface `build/gemmi.$(mexext)`, where `$(mexext)` is `mexa64` on Linux, `mexmaci64` or `mexmaca64` on MacOS , and `mexw64` on Windows. The file `build/gemmi.m` contains the documentation for the MATLAB `gemmi` function.
1831

1932
## Configuration
2033

2134
Additional options can be passed to `CMake` during the configuration stage. To use a compiler other than the default one, for example, one can use:
2235
```bash
23-
cmake -B build -D CMAKE_CXX_COMPILER=<preferred_compiler>
36+
cmake -S. -Bbuild -DCMAKE_CXX_COMPILER=<preferred_compiler>
2437
```
2538
Here, `<preferred_compiler>` must be either an executable on the search path or the path to the chosen compiler.
2639

0 commit comments

Comments
 (0)