Skip to content

Commit c898e1e

Browse files
Better progress reporting
Co-authored-by: Sebastian Deorowicz <[email protected]>
1 parent e3cc571 commit c898e1e

File tree

16 files changed

+1195
-214
lines changed

16 files changed

+1195
-214
lines changed

.github/workflows/deploy.yml

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@ jobs:
1717
runs-on: [self-hosted, lz-ani, '${{ matrix.machine }}']
1818

1919
steps:
20+
- name: clean
21+
run: rm -rf ${{ github.workspace }}/*
2022
- uses: actions/checkout@v4
2123
with:
2224
submodules: recursive
@@ -47,10 +49,9 @@ jobs:
4749
steps:
4850
- name: make
4951
run: |
50-
make clean
51-
make -j32 CXX=${{matrix.compiler}} STATIC_LINK=true PLATFORM=${{ matrix.platform }}
52+
gmake -j32 CXX=${{matrix.compiler}} STATIC_LINK=true PLATFORM=${{ matrix.platform }}
5253
- name: tar artifacts
53-
run: tar -cvzf lz-ani.tar.gz lz-ani LICENSE
54+
run: tar -cvzf lz-ani.tar.gz LICENSE -C ./bin lz-ani
5455

5556

5657
########################################################################################
@@ -65,7 +66,7 @@ jobs:
6566

6667
steps:
6768
- name: help
68-
run: ./lz-ani
69+
run: ./bin/lz-ani
6970

7071
########################################################################################
7172
upload:

.github/workflows/main.yml

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: GitHub Actions CI
1+
name: Build and tests
22

33
on:
44
push:
@@ -15,20 +15,25 @@ jobs:
1515
strategy:
1616
fail-fast: false
1717
matrix:
18-
machine: [ubuntu-latest, macOS-12]
18+
machine: [ubuntu-latest]
19+
gmake_install_command: ['gmake --version']
20+
include:
21+
- {machine: macOS-13, gmake_install_command: 'brew install make && gmake --version'}
1922
runs-on: ['${{ matrix.machine }}']
2023

2124
steps:
2225
- uses: actions/checkout@v4
2326
with:
2427
submodules: recursive
28+
29+
- name: install gmake
30+
run: ${{ matrix.gmake_install_command }}
2531
- name: make
2632
run: |
27-
g++ --version
28-
make -j CXX=g++-12
33+
gmake -j CXX=g++-12 CC=gcc-12 STATIC_LINK=true
2934
3035
- name: tar artifacts
31-
run: tar -cvf lz-ani.tar ./lz-ani ./test
36+
run: tar -cvf lz-ani.tar ./test -C ./bin lz-ani
3237

3338
- uses: actions/upload-artifact@v4
3439
with:
@@ -42,7 +47,7 @@ jobs:
4247
strategy:
4348
fail-fast: false
4449
matrix:
45-
machine: [ubuntu-latest, macOS-12]
50+
machine: [ubuntu-latest, macOS-13]
4651
runs-on: ['${{ matrix.machine }}']
4752

4853
steps:

.github/workflows/self-hosted.yml

Lines changed: 23 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@ jobs:
1818
runs-on: [self-hosted, lz-ani, '${{ matrix.machine }}']
1919

2020
steps:
21+
- name: clean
22+
run: rm -rf ${{ github.workspace }}/*
2123
- uses: actions/checkout@v4
2224
with:
2325
submodules: recursive
@@ -31,28 +33,24 @@ jobs:
3133
fail-fast: false
3234
matrix:
3335
machine: [x64_linux, x64_mac, arm64_linux, arm64_mac]
34-
compiler: [g++-11, g++-12, g++-13]
36+
compiler: [11, 12, 13]
3537
include:
36-
- machine: x64_linux
37-
platform: avx2
38-
- machine: arm64_linux
39-
platform: arm8
40-
- machine: x64_mac
41-
platform: avx2
42-
- machine: arm64_mac
43-
platform: m1
38+
- {machine: x64_linux, platform: avx2, compiler: 14}
39+
- {machine: x64_linux, platform: avx2}
40+
- {machine: arm64_linux, platform: arm8}
41+
- {machine: x64_mac, platform: avx2}
42+
- {machine: arm64_mac, platform: m1}
4443
exclude:
45-
- machine: arm64_linux
46-
compiler: g++-13
44+
- {machine: arm64_linux, compiler: 13}
4745

4846
runs-on: [self-hosted, lz-ani, '${{ matrix.machine }}']
4947

5048
steps:
5149
- name: make
5250
run: |
53-
make -j32 CXX=${{matrix.compiler}} PLATFORM=${{ matrix.platform }}
54-
cp ./lz-ani ./lz-ani-${{matrix.compiler}}
55-
make clean
51+
gmake -j32 CXX=g++-${{matrix.compiler}} CC=gcc-${{matrix.compiler}} PLATFORM=${{ matrix.platform }} STATIC_LINK=true
52+
cp ./bin/lz-ani ./lz-ani-${{matrix.compiler}}
53+
gmake clean
5654
5755
########################################################################################
5856
help:
@@ -62,10 +60,11 @@ jobs:
6260
fail-fast: false
6361
matrix:
6462
machine: [x64_linux, x64_mac, arm64_linux, arm64_mac]
65-
compiler: [g++-11, g++-12, g++-13]
63+
compiler: [11, 12, 13]
64+
include:
65+
- {machine: x64_linux, platform: avx2, compiler: 14}
6666
exclude:
67-
- machine: arm64_linux
68-
compiler: g++-13
67+
- {machine: arm64_linux, compiler: 13}
6968

7069
runs-on: [self-hosted, lz-ani, '${{ matrix.machine }}']
7170

@@ -74,9 +73,9 @@ jobs:
7473

7574
steps:
7675
- name: help
77-
run: |
78-
${EXEC}
79-
76+
run: ${EXEC}
77+
- name: version
78+
run: ${EXEC} -version
8079

8180
########################################################################################
8281
vir61:
@@ -86,10 +85,11 @@ jobs:
8685
fail-fast: false
8786
matrix:
8887
machine: [x64_linux, x64_mac, arm64_linux, arm64_mac]
89-
compiler: [g++-11, g++-12, g++-13]
88+
compiler: [11, 12, 13]
89+
include:
90+
- {machine: x64_linux, platform: avx2, compiler: 14}
9091
exclude:
91-
- machine: arm64_linux
92-
compiler: g++-13
92+
- {machine: arm64_linux, compiler: 13}
9393

9494
runs-on: [self-hosted, lz-ani, '${{ matrix.machine }}']
9595

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
[![GitHub downloads](https://img.shields.io/github/downloads/refresh-bio/lz-ani/total.svg?style=flag&label=GitHub%20downloads)](https://github.com/refresh-bio/LZ-ANI/releases)
44
[![Bioconda downloads](https://img.shields.io/conda/dn/bioconda/lz-ani.svg?style=flag&label=Bioconda%20downloads)](https://anaconda.org/bioconda/lz-ani)
5-
[![GitHub Actions CI](../../workflows/GitHub%20Actions%20CI/badge.svg)](../../actions/workflows/main.yml)
5+
[![Build and tests](../../workflows/Build%20and%20tests/badge.svg)](../../actions/workflows/main.yml)
66

77
[![License: GPL v3](https://img.shields.io/badge/License-GPLv3-blue.svg)](https://www.gnu.org/licenses/gpl-3.0)
88

libs/refresh/compression/lib/file_wrapper.h

Lines changed: 28 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,11 @@
1-
// *******************************************************************************************
2-
// This file is a part of LZ-ANI software distributed under GNU GPL 3 license.
3-
// The homepage of the LZ-ANI project is https://github.com/refresh-bio/LZ-ANI
4-
//
5-
// Copyright(C) 2024-2024, S.Deorowicz, A.Gudys
6-
//
7-
// Version: 1.0.0
8-
// Date : 2024-05-15
9-
// *******************************************************************************************
10-
111
#ifndef _FILE_WRAPPER_H
122
#define _FILE_WRAPPER_H
133

4+
// *** History of updates
5+
// *** v. 1.0.1 (2024-03-11) - bug fix (wrong zlib initialization)
6+
// *** v. 1.0.2 (2024-05-01) - bug fix (wrong reading from file)
7+
// ***
8+
149
#include <cstdint>
1510
#include <cstring>
1611
#include <cstdio>
@@ -46,9 +41,9 @@
4641

4742
#ifdef REFRESH_STREAM_DECOMPRESSION_ENABLE_ZLIB
4843
#ifdef _WIN32
49-
#include "../libs/zlib-ng/build-vs/zlib.h"
44+
#include <zlib-ng/build-vs/zlib.h>
5045
#else
51-
#include "../zlib-ng/zlib.h"
46+
#include <zlib-ng/zlib.h>
5247
#endif
5348
#endif
5449

@@ -150,17 +145,30 @@ namespace refresh
150145
{
151146
std::string file_name;
152147
size_t io_buffer_size;
153-
FILE* file = nullptr;
154-
bool test_extension = true;
148+
FILE* file;
149+
bool test_extension;
150+
151+
void _open()
152+
{
153+
file = fopen(file_name.c_str(), "rb");
154+
155+
if (!file)
156+
return;
157+
158+
setvbuf(file, nullptr, _IOFBF, io_buffer_size);
159+
buffer_released = true;
160+
}
155161

156162
public:
157163
stream_in_file(const std::string& file_name, size_t io_buffer_size = 16 << 20, size_t buffer_size = 8 << 20, bool test_extension = true) :
158164
stream_in_buffered(buffer_size),
159-
file_name(file_name),
160-
io_buffer_size(io_buffer_size),
161-
test_extension(test_extension)
165+
file_name{ file_name },
166+
io_buffer_size{ io_buffer_size },
167+
file{ nullptr },
168+
test_extension{test_extension}
162169
{
163-
open(file_name);
170+
// open(file_name);
171+
_open();
164172
}
165173

166174
virtual ~stream_in_file()
@@ -175,16 +183,9 @@ namespace refresh
175183
if (file)
176184
close();
177185

178-
file = fopen(file_name.c_str(), "rb");
179-
180-
if (!file)
181-
return false;
182-
183-
setvbuf(file, nullptr, _IOFBF, io_buffer_size);
184-
185-
buffer_released = true;
186+
_open();
186187

187-
return true;
188+
return file != nullptr;
188189
}
189190

190191
virtual bool close()

0 commit comments

Comments
 (0)