Skip to content
This repository was archived by the owner on Mar 20, 2023. It is now read-only.

Commit 625becd

Browse files
authored
Update CoreNEURON build and testing documentation (#526)
* Update CoreNEURON build and testing documentation * Updated readme with cmake --build . instead of make
1 parent 2ba1f24 commit 625becd

File tree

1 file changed

+37
-14
lines changed

1 file changed

+37
-14
lines changed

README.md

Lines changed: 37 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ In addition to this, you will need other [NEURON dependencies](https://github.co
2323

2424
## Installation
2525

26-
CoreNEURON is now integrated into the development version of the NEURON simulator. If you are a NEURON user, the preferred way to install CoreNEURON is to enable extra build options during NEURON installation as follows:
26+
**CoreNEURON** is now **integrated into** the **development version** of the **NEURON** simulator. If you are a NEURON user, **the preferred way** to **install CoreNEURON** is to **enable extra build options** during **NEURON installation** as follows:
2727

2828
1. Clone the latest version of NEURON:
2929

@@ -56,7 +56,7 @@ Note that if you are building on Cray system with the GNU toolchain, you have to
5656
export CRAYPE_LINK_TYPE=dynamic
5757
```
5858

59-
3. Run CMake with the appropriate [options](https://github.com/neuronsimulator/nrn#build-using-cmake) and additionally enable CoreNEURON with `-DNRN_ENABLE_CORENEURON=ON` option:
59+
3. Run CMake with the appropriate [options](https://github.com/neuronsimulator/nrn/blob/master/docs/install/install_instructions.md#install-neuron-using-cmake) and additionally enable CoreNEURON with `-DNRN_ENABLE_CORENEURON=ON` option:
6060

6161
```
6262
cmake .. \
@@ -86,8 +86,9 @@ NOTE : If the CMake command fails, please make sure to delete temporary CMake ca
8686
4. Build and Install : once the configure step is done, you can build and install the project as:
8787

8888
```bash
89-
make -j install
89+
cmake --build . --parallel 8 --target install
9090
```
91+
Feel free to define the number of parallel jobs building by setting a number for the `--parallel` option.
9192

9293
## Building Model
9394

@@ -127,7 +128,7 @@ With CoreNEURON, existing NEURON models can be run with minimal changes. For a g
127128
3. If GPU support is enabled during build, enable GPU execution using :
128129
```
129130
coreneuron.gpu = True
130-
```
131+
```
131132
132133
4. Use `psolve` to run simulation after initialization :
133134
@@ -234,6 +235,32 @@ For other errors, please [open an issue](https://github.com/BlueBrain/CoreNeuron
234235

235236
## Developer Build
236237

238+
#### Running Unit and Integration Tests
239+
240+
As **CoreNEURON** is mostly used as a compute library of **NEURON** it needs to be incorporated with **NEURON** to test most of its functionality. Consequently its tests are included in the NEURON repository. To enable and run all the tests of **CoreNEURON** you need to add the `-DNRN_ENABLE_TESTS=ON` CMake flag in **NEURON**.
241+
Those tests include:
242+
* Unit tests of NEURON
243+
* Unit tests of CoreNEURON
244+
* Integration tests comparing NEURON, CoreNEURON and reference files
245+
* [ringtest](https://github.com/neuronsimulator/ringtest) tests with NEURON and CoreNEURON
246+
* [testcorenrn](https://github.com/neuronsimulator/testcorenrn) tests with NEURON and CoreNEURON
247+
Some of those tests are going to be also run with various backends in case that those are enabled (for example with GPUs).
248+
To build NEURON with CoreNEURON and run the tests you need to:
249+
250+
```bash
251+
cd nrn/build
252+
cmake .. \
253+
-DNRN_ENABLE_CORENEURON=ON \
254+
-DNRN_ENABLE_INTERVIEWS=OFF \
255+
-DNRN_ENABLE_RX3D=OFF \
256+
-DCMAKE_INSTALL_PREFIX=$HOME/install
257+
-DCMAKE_C_COMPILER=icc \
258+
-DCMAKE_CXX_COMPILER=icpc \
259+
-DNRN_ENABLE_TESTS=ON
260+
cmake --build . --parallel 8
261+
ctest # use --parallel for speed, -R to run specific tests
262+
```
263+
237264
#### Building standalone CoreNEURON without NEURON
238265

239266
If you want to build the standalone CoreNEURON version, first download the repository as:
@@ -248,14 +275,10 @@ Once the appropriate modules for compiler, MPI, CMake are loaded, you can build
248275
```bash
249276
mkdir CoreNeuron/build && cd CoreNeuron/build
250277
cmake .. -DCMAKE_INSTALL_PREFIX=$HOME/install
251-
make -j && make install
278+
cmake --build . --parallel 8 --target install
252279
```
253280

254-
If you don't have MPI, you can disable the MPI dependency using the CMake option `-DCORENRN_ENABLE_MPI=OFF`. Once build is successful, you can run tests using:
255-
256-
```
257-
make test
258-
```
281+
If you don't have MPI, you can disable the MPI dependency using the CMake option `-DCORENRN_ENABLE_MPI=OFF`.
259282

260283
#### Compiling MOD files
261284

@@ -275,7 +298,7 @@ CoreNEURON has support for GPUs using the OpenACC programming model when enabled
275298
module purge all
276299
module load nvidia-hpc-sdk/20.11 cuda/11 cmake openmpi # change pgi, cuda and mpi modules
277300
cmake .. -DCORENRN_ENABLE_GPU=ON -DCMAKE_INSTALL_PREFIX=$HOME/install -DCMAKE_C_COMPILER=nvc -DCMAKE_CXX_COMPILER=nvc++
278-
make -j && make install
301+
cmake --build . --parallel 8 --target install
279302
```
280303

281304
You have to run GPU executable with the `--gpu` flag. Make sure to enable cell re-ordering mechanism to improve GPU performance using `--cell_permute` option (permutation types : 2 or 1):
@@ -314,14 +337,14 @@ In order to format code with `cmake-format` and `clang-format` tools, before cre
314337

315338
```
316339
cmake .. -DCORENRN_CLANG_FORMAT=ON -DCORENRN_CMAKE_FORMAT=ON
317-
make -j install
340+
cmake --build . --parallel 8 --target install
318341
```
319342

320343
and now you can use `cmake-format` or `clang-format` targets:
321344

322345
```
323-
make cmake-format
324-
make clang-format
346+
cmake --build . --target cmake-format
347+
cmake --build . --target clang-format
325348
```
326349

327350
## Citation

0 commit comments

Comments
 (0)