@@ -8,19 +8,15 @@ Read the paper [here](https://arxiv.org/abs/1902.06714).
88
99* [ Features] ( https://github.com/modern-fortran/neural-fortran#features )
1010* [ Getting started] ( https://github.com/modern-fortran/neural-fortran#getting-started )
11- - [ Building in serial mode] ( https://github.com/modern-fortran/neural-fortran#building-in-serial-mode )
12- - [ Building in parallel mode] ( https://github.com/modern-fortran/neural-fortran#building-in-parallel-mode )
13- - [ Building with a different compiler] ( https://github.com/modern-fortran/neural-fortran#building-with-a-different-compiler )
14- - [ Building with BLAS or MKL] ( https://github.com/modern-fortran/neural-fortran#building-with-blas-or-mkl )
15- - [ Building in double or quad precision] ( https://github.com/modern-fortran/neural-fortran#building-in-double-or-quad-precision )
16- - [ Building in debug mode] ( https://github.com/modern-fortran/neural-fortran#building-in-debug-mode )
11+ - [ Building with fpm] ( https://github.com/modern-fortran/neural-fortran#building-with-fpm )
12+ - [ Building with CMake] ( https://github.com/modern-fortran/neural-fortran#building-with-cmake )
1713* [ Examples] ( https://github.com/modern-fortran/neural-fortran#examples )
1814 - [ Creating a network] ( https://github.com/modern-fortran/neural-fortran#creating-a-network )
1915 - [ Training the network] ( https://github.com/modern-fortran/neural-fortran#training-the-network )
2016 - [ Saving and loading from file] ( https://github.com/modern-fortran/neural-fortran#saving-and-loading-from-file )
2117 - [ MNIST training example] ( https://github.com/modern-fortran/neural-fortran#mnist-training-example )
22- * [ Contributing] ( https://github.com/modern-fortran/neural-fortran#contributing )
23- * [ Related projects] ( https://github.com/modern-fortran/neural-fortran#related-projects )
18+ * [ Contributing] ( https://github.com/modern-fortran/neural-fortran#contributing )
19+ * [ Related projects] ( https://github.com/modern-fortran/neural-fortran#related-projects )
2420
2521## Features
2622
@@ -36,18 +32,41 @@ Get the code:
3632
3733```
3834git clone https://github.com/modern-fortran/neural-fortran
35+ cd neural-fortran
3936```
4037
4138Dependencies:
4239
4340* Fortran 2018-compatible compiler
44- * OpenCoarrays (optional, for parallel execution, gfortran only)
41+ * OpenCoarrays (optional, for parallel execution, GFortran only)
4542* BLAS, MKL (optional)
4643
47- ### Building in serial mode
44+ ### Building with fpm
45+
46+ #### Building in serial mode
47+
48+ ```
49+ fpm build --flag "-cpp -O3 -ffast-math fcoarrays=single"
50+ ```
51+
52+ #### Building in parallel mode
53+
54+ If you use GFortran and want to run neural-fortran in parallel,
55+ you must first install [ OpenCoarrays] ( https://github.com/sourceryinstitute/OpenCoarrays ) .
56+ Once installed, use the compiler wrappers ` caf ` and ` cafrun ` to build and execute
57+ in parallel, respectively:
58+
59+ ```
60+ fpm build --compiler caf --flag "-cpp -DCAF -O3 -ffast-math"
61+ ```
62+
63+ See [ Fortran Package Manager] ( https://github.com/fortran-lang/fpm ) for more info on fpm.
64+
65+ ### Building with CMake
66+
67+ #### Building in serial mode
4868
4969```
50- cd neural-fortran
5170mkdir build
5271cd build
5372cmake .. -DSERIAL=1
5675
5776Tests and examples will be built in the ` bin/ ` directory.
5877
59- ### Building in parallel mode
78+ #### Building in parallel mode
6079
61- If you use gfortran and want to build neural-fortran in parallel mode ,
80+ If you use GFortran and want to run neural-fortran in parallel,
6281you must first install [ OpenCoarrays] ( https://github.com/sourceryinstitute/OpenCoarrays ) .
6382Once installed, use the compiler wrappers ` caf ` and ` cafrun ` to build and execute
6483in parallel, respectively:
6584
85+
6686```
6787FC=caf cmake ..
6888make
6989cafrun -n 4 bin/example_mnist # run MNIST example on 4 cores
7090```
7191
72- ### Building with a different compiler
92+ #### Building with a different compiler
7393
7494If you want to build with a different compiler, such as Intel Fortran,
7595specify ` FC ` when issuing ` cmake ` :
@@ -78,7 +98,7 @@ specify `FC` when issuing `cmake`:
7898FC=ifort cmake ..
7999```
80100
81- ### Building with BLAS or MKL
101+ #### Building with BLAS or MKL
82102
83103To use an external BLAS or MKL library for ` matmul ` calls,
84104run cmake like this:
@@ -91,7 +111,7 @@ where the value of `-DBLAS` should point to the desired BLAS implementation,
91111which has to be available in the linking path.
92112This option is currently available only with gfortran.
93113
94- ### Building in double or quad precision
114+ #### Building in double or quad precision
95115
96116By default, neural-fortran is built in single precision mode
97117(32-bit floating point numbers). Alternatively, you can configure to build
107127cmake .. -DREAL=128
108128```
109129
110- ### Building in debug mode
130+ #### Building in debug mode
111131
112132To build with debugging flags enabled, type:
113133
0 commit comments