Skip to content

Commit 2bfddff

Browse files
committedApr 3, 2024
Minor updates.
1 parent 6965e39 commit 2bfddff

File tree

2 files changed

+30
-10
lines changed

2 files changed

+30
-10
lines changed
 

‎README.md

Lines changed: 26 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,35 @@
11
# fortran-zstd
22

33
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.
87

98
## Build Instructions
109

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:
1333

1434
```
1535
$ make

‎test/test_zstd.f90

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -208,9 +208,9 @@ logical function test_stream() result(success)
208208
last_chunk = (nbytes < to_read)
209209

210210
! 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
214214
! compressing the entire source in one pass.
215215
if (last_chunk) then
216216
mode = ZSTD_E_END
@@ -309,7 +309,7 @@ logical function test_stream() result(success)
309309
! Given a valid frame, zstd won't consume the last byte of the frame
310310
! until it has flushed all of the decompressed data of the frame.
311311
! 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.
313313
do while (input%pos < input%size)
314314
output = zstd_out_buffer_type(c_loc(buf_out), buf_out_sz, 0)
315315

0 commit comments

Comments
 (0)
Please sign in to comment.