Skip to content

Commit

Permalink
Update README.md and fix CI (#122)
Browse files Browse the repository at this point in the history
* Update README.md

* Fix CI (#124)

* Changing clang-format to v18
  * With the existing clang, I was getting very odd errors, such as not being able to find the system headers
  * I had to add more ignores with this update - we can go back and look at those in more detail if desired
* On linux, code coverage wasn't working with the newest meson - I decided to just move that test and use meson 1.4.0 for it only
* There were other issues for the clang and code coverage checks for mac, but I decided to remove those, since we are covering code quality with linux anyway
* Fixes for clang-format
* Remove last column from large.bam - was causing issues for ninja sanitize-undefined in mac
  • Loading branch information
lcoombe authored Jul 24, 2024
1 parent cc2581f commit 39daa9e
Show file tree
Hide file tree
Showing 5 changed files with 46 additions and 34 deletions.
20 changes: 19 additions & 1 deletion .clang-tidy
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,24 @@
-altera-id-dependent-backward-branch,
-clang-diagnostic-unused-command-line-argument,
-clang-diagnostic-unneeded-internal-declaration,
-readability-convert-member-functions-to-static,
-misc-unused-parameters,
-misc-include-cleaner,
-performance-avoid-endl,
-misc-use-anonymous-namespace,
-performance-enum-size,
-cppcoreguidelines-avoid-const-or-ref-data-members,
-cppcoreguidelines-noexcept-move-operations,
-clang-analyzer-core.UndefinedBinaryOperatorResult,
-misc-header-include-cycle,
-misc-const-correctness,
-hicpp-noexcept-move,
-cppcoreguidelines-avoid-do-while,
-readability-static-accessed-through-instance,
-performance-noexcept-move-constructor,
-hicpp-use-emplace,
-readability-avoid-nested-conditional-operator,
-modernize-use-emplace,
-readability-identifier-length',
WarningsAsErrors: '*',
CheckOptions: [
Expand All @@ -66,4 +84,4 @@
{ key: readability-identifier-naming.GlobalConstantPointerCase, value: UPPER_CASE },
{ key: readability-identifier-naming.ConstexprVariableCase, value: UPPER_CASE },
]
}
}
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,8 @@ Using the library
---
- Run time dependencies:
* SAMtools for reading SAM, BAM, and CRAM files.
* gzip, tar, pigz, bzip2, xz, lrzip, zip, and/or 7zip for compressing/decompressing files. Not all of these are necessary, only the ones whose compressions you'll be using.
* gzip, tar, pigz, bzip2, xz, lrzip, zip, and/or 7zip for compressing/decompressing files. Not all of these are necessary, only the ones whose compressions you'll be using.
* Note that lrzip is not available on the btllib conda osx-arm64 build
* wget for downloading sequences from a URL.
- Building C++ code (`$PREFIX` is the path where btllib is installed):
* Link your code with `$PREFIX/lib/libbtllib.a` (pass `-L $PREFIX/lib -l btllib` flags to the compiler).
Expand Down
39 changes: 16 additions & 23 deletions azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ jobs:

- job: linux
pool:
vmImage: 'ubuntu-22.04'
vmImage: 'ubuntu-latest'

steps:
- checkout: self
Expand All @@ -20,7 +20,7 @@ jobs:
- script: |
source activate btllib_CI
conda install --yes -c conda-forge mamba
mamba install --yes -c conda-forge -c bioconda libcxx compilers clang llvm clang-format=14 clang-tools boost samtools coreutils xz lrzip meson ninja cmake openmp gcovr
mamba install --yes -c conda-forge -c bioconda libcxx compilers clang llvm clang-format=18 clang-tools boost samtools coreutils xz lrzip meson ninja cmake openmp gcovr
displayName: Install dependencies
- script: |
Expand Down Expand Up @@ -51,11 +51,6 @@ jobs:
cd build && meson test --repeat=5 --print-errorlogs
displayName: 'Run tests'
- script: |
source activate btllib_CI
cd build && ninja code-coverage
displayName: 'Run code coverage tests'
- script: |
source activate btllib_CI
cd build && ninja sanitize-undefined
Expand All @@ -72,9 +67,16 @@ jobs:
cd build && ninja test-wrappers
displayName: 'Test wrappers'
- script: |
source activate btllib_CI
mamba install --yes -c conda-forge meson=1.4.0
rm -r build && meson setup build && cd build && ninja
ninja test && ninja code-coverage
displayName: 'Run code coverage tests'
- job: macos
pool:
vmImage: 'macOS-12'
vmImage: 'macOS-latest'

steps:
- checkout: self
Expand All @@ -90,11 +92,12 @@ jobs:
- script: |
source activate btllib_CI
conda install --yes -c conda-forge mamba
mamba install --yes -c conda-forge -c bioconda libcxx compilers llvm clang-format=14 clang-tools boost 'samtools>=1.14' coreutils xz lrzip meson=1.2.3 ninja cmake openmp gcovr
mamba install --yes -c conda-forge -c bioconda libcxx compilers llvm clang-format clang-tools boost 'samtools>=1.14' coreutils xz lrzip meson ninja cmake openmp gcovr
displayName: 'Install required software'
- script: |
source activate btllib_CI
export CXXFLAGS="$CXXFLAGS -Wno-error=unused-but-set-variable"
meson setup build && cd build && ninja
displayName: 'Build the project'
Expand All @@ -103,27 +106,17 @@ jobs:
set -o errexit -o pipefail
./compile
cd examples
g++ nthash_spacedseeds.cpp -std=c++17 -I../install/include -L../install/lib -lbtllib && ./a.out
clang++ nthash_spacedseeds.cpp -std=c++17 -I../install/include -L../install/lib -lbtllib && ./a.out
displayName: 'Compile example'
- script: |
source activate btllib_CI
cd build && ninja clang-format-check
displayName: 'Run clang-format'
- script: source activate btllib_CI && cd build && ninja clang-tidy
displayName: 'Run clang-tidy'

- script: |
source activate btllib_CI && cd build && meson test --repeat=5 --print-errorlogs
displayName: 'Run tests'
- script: |
source activate btllib_CI && cd build && ninja code-coverage
displayName: 'Run code coverage tests'
- script: |
source activate btllib_CI && cd build && ninja sanitize-undefined
source activate btllib_CI && cd build
export CXXFLAGS="$CXXFLAGS -Wno-error=unused-but-set-variable"
ninja sanitize-undefined
if [[ $? -ne 0 ]]; then
cat __build-sanitize-undefined/meson-logs/testlog.txt
exit 1
Expand Down
18 changes: 9 additions & 9 deletions recipes/mi_bloom_filter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -252,15 +252,15 @@ main(int argc, char* argv[])
btllib::SeqReader::Flag::SHORT_MODE,
DEFAULT_SEQ_READER_THREADS);
#pragma omp parallel default(none) shared(ids, \
id_counter, \
mi_bf, \
mi_bf_stage, \
hash_num, \
kmer_size, \
by_file, \
spaced_seed_set, \
spaced_seeds, \
reader)
id_counter, \
mi_bf, \
mi_bf_stage, \
hash_num, \
kmer_size, \
by_file, \
spaced_seed_set, \
spaced_seeds, \
reader)
try {
for (const auto record : reader) {
#pragma omp critical
Expand Down
Binary file modified tests/large.bam
Binary file not shown.

0 comments on commit 39daa9e

Please sign in to comment.