You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardexpand all lines: README.md
+45-3
Original file line number
Diff line number
Diff line change
@@ -14,7 +14,49 @@ Currently, this module can be used to generate simple plots from Fortran. Event
14
14
The way it works is simply to generate a Python script with the plotting code, which
15
15
is then executed from the command line using the Fortran ```execute_command_line``` function.
16
16
17
-
The module requires a modern Fortran compiler (it uses various Fortran 2003/2008 features such as deferred-length strings). It should work fine with the latest gfortran or ifort compilers. A simple script ```build.sh``` is provided for building the library and test program (requires gfortran and [FoBiS](https://github.com/szaghi/FoBiS)). It will also build the HTML documentation if [FORD](https://github.com/Fortran-FOSS-Programmers/ford) is installed. A `fpm.toml` file is also provided for use with the [Fortran Package Manager](https://github.com/fortran-lang/fpm).
17
+
### Compiling
18
+
19
+
The module requires a modern Fortran compiler (it uses various Fortran 2003/2008 features such as deferred-length strings). It should work fine with the latest gfortran or ifort compilers.
20
+
21
+
A `fmp.toml` file is provided for compiling pyplot-fortran with the [Fortran Package Manager](https://github.com/fortran-lang/fpm). For example, to build:
22
+
23
+
```
24
+
fpm build --profile release
25
+
```
26
+
27
+
By default, the library is built with double precision (`real64`) real values. Explicitly specifying the real kind can be done using the following processor flags:
28
+
29
+
Preprocessor flag | Kind | Number of bytes
30
+
----------------- | ----- | ---------------
31
+
`REAL32` | `real(kind=real32)` | 4
32
+
`REAL64` | `real(kind=real64)` | 8
33
+
`REAL128` | `real(kind=real128)` | 16
34
+
35
+
For example, to build a single precision version of the library, use:
36
+
37
+
```
38
+
fpm build --profile release --flag "-DREAL32"
39
+
```
40
+
41
+
To run the unit tests:
42
+
43
+
```
44
+
fpm test
45
+
```
46
+
47
+
To use `pyplot-fortran` within your fpm project, add the following to your `fpm.toml` file:
@@ -57,7 +99,7 @@ The following example generates a plot of the sine function:
57
99
58
100
### Documentation
59
101
60
-
* The API documentation for the current ```master``` branch can be found [here](https://jacobwilliams.github.io/pyplot-fortran/). This is generated by processing the source files with [FORD](https://github.com/Fortran-FOSS-Programmers/ford). Note that the build script will also generate these files automatically in the ```doc``` folder, assuming you have FORD installed.
102
+
* The API documentation for the current ```master``` branch can be found [here](https://jacobwilliams.github.io/pyplot-fortran/). This is generated by processing the source files with [FORD](https://github.com/Fortran-FOSS-Programmers/ford).
0 commit comments