File tree Expand file tree Collapse file tree 2 files changed +30
-10
lines changed Expand file tree Collapse file tree 2 files changed +30
-10
lines changed Original file line number Diff line number Diff line change 1
1
# fortran-zstd
2
2
3
3
A collection of Fortran 2018 interface bindings to selected
4
- [ Zstandard] ( http://www.zstd.net/ ) functions (zstd ⩾ 1.5.5). In comparison to
5
- the original C API, the Fortran interfaces, types, and arguments have been
6
- converted to snake case. See [ COVERAGE] ( COVERAGE.md ) for an overview of bound
7
- procedures.
4
+ [ Zstandard] ( http://www.zstd.net/ ) functions (zstd ≥ 1.5.5). In comparison to the
5
+ original C API, the Fortran interfaces, types, and arguments have been converted
6
+ to snake case. See [ COVERAGE] ( COVERAGE.md ) for an overview of bound procedures.
8
7
9
8
## Build Instructions
10
9
11
- The zstd library has to be installed with development headers. Build and
12
- install the Fortran library using the provided Makefile:
10
+ The zstd library has to be installed with development headers. On FreeBSD, run:
11
+
12
+ ```
13
+ # pkg install archivers/zstd
14
+ ```
15
+
16
+ On Linux, instead:
17
+
18
+ ```
19
+ # apt-get install libzstd1 libzstd-dev
20
+ ```
21
+
22
+ Or, to build and install the zstd library from source:
23
+
24
+ ```
25
+ $ cd /tmp/
26
+ $ git clone --depth 1 https://github.com/facebook/zstd
27
+ $ cd zstd/build/cmake/
28
+ $ cmake --build . --config Release
29
+ $ sudo cmake --install . --prefix /usr/local
30
+ ```
31
+
32
+ Build and install the Fortran library using the provided Makefile:
13
33
14
34
```
15
35
$ make
Original file line number Diff line number Diff line change @@ -208,9 +208,9 @@ logical function test_stream() result(success)
208
208
last_chunk = (nbytes < to_read)
209
209
210
210
! Select the flush mode. If the read may not be finished
211
- ! (read == toRead ) we use ZSTD_E_CONTINUE. If this is the last
212
- ! chunk, we use ZSTD_E_END. Zstd optimises the case where the
213
- ! first flush mode is ZSTD_E_END, since it knows it is
211
+ ! (nbytes == to_read ) we use ZSTD_E_CONTINUE. If this is the
212
+ ! last chunk, we use ZSTD_E_END. Zstd optimises the case where
213
+ ! the first flush mode is ZSTD_E_END, since it knows it is
214
214
! compressing the entire source in one pass.
215
215
if (last_chunk) then
216
216
mode = ZSTD_E_END
@@ -309,7 +309,7 @@ logical function test_stream() result(success)
309
309
! Given a valid frame, zstd won't consume the last byte of the frame
310
310
! until it has flushed all of the decompressed data of the frame.
311
311
! Therefore, instead of checking if the return code is 0, we can
312
- ! decompress just check if input. pos < input. size.
312
+ ! decompress just check if input% pos < input% size.
313
313
do while (input% pos < input% size)
314
314
output = zstd_out_buffer_type(c_loc(buf_out), buf_out_sz, 0 )
315
315
You can’t perform that action at this time.
0 commit comments