Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix x64 and Python 3.13 issues #138

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,11 @@ cmake_options = cmake.subproject_options()
cmake_options.set_override_option('werror', 'false')
cmake_options.set_install(false)

if host_machine.cpu_family() == 'aarch64'
cmake_options.add_cmake_defines({'ENABLE_LIBCXX': false})
cmake_options.add_cmake_defines({'CPPTOML_BUILD_EXAMPLES': false})
endif

cpptoml_subproject = cmake.subproject('cpptoml', options : cmake_options)
cpptomp_dep = cpptoml_subproject.dependency('cpptoml')

Expand Down
11 changes: 5 additions & 6 deletions tests/mi_bloom_filter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -43,22 +43,21 @@ main()
int expected_id_count = dna_length / 4;
double tolerance = 0.1;

int counter = 0;
btllib::MIBloomFilter<uint8_t> mi_bf_2(256 * 1024 * 1024, 1, "ntHash");
for(btllib::NtHash nthash(random_dna, 1, 15); nthash.roll(); counter++){
for(btllib::NtHash nthash(random_dna, 1, 15); nthash.roll();){
mi_bf_2.insert_bv(nthash.hashes());
}
mi_bf_2.complete_bv_insertion();
uint8_t ID_array[4] = {0, 1, 2, 3};
for(auto& id : ID_array){
uint8_t ID = id;
for(btllib::NtHash nthash(random_dna, 1, 15); nthash.roll(); counter++){
for(btllib::NtHash nthash(random_dna, 1, 15); nthash.roll();){
mi_bf_2.insert_id(nthash.hashes(), ID);
}
}
std::vector<uint8_t> results_2(1);
std::vector<uint32_t> total_counter(4, 0);
for(btllib::NtHash nthash(random_dna, 1, 15); nthash.roll(); counter++){
for(btllib::NtHash nthash(random_dna, 1, 15); nthash.roll();){
results_2 = mi_bf_2.get_id(nthash.hashes());
for(auto& res : results_2){
total_counter[res]++;
Expand All @@ -79,7 +78,7 @@ main()
btllib::MIBloomFilter<uint8_t> mi_bf_3("test.mibf");

std::vector<uint32_t> total_counter_2(4, 0);
for(btllib::NtHash nthash(random_dna, 1, 15); nthash.roll(); counter++){
for(btllib::NtHash nthash(random_dna, 1, 15); nthash.roll();){
results_2 = mi_bf_3.get_id(nthash.hashes());
for(auto& res : results_2){
total_counter_2[res]++;
Expand All @@ -91,7 +90,7 @@ main()
}
// Test mi-Bf is still insertable.
uint8_t ID = 3;
for(btllib::NtHash nthash(random_dna, 1, 15); nthash.roll(); counter++){
for(btllib::NtHash nthash(random_dna, 1, 15); nthash.roll();){
mi_bf_3.insert_id(nthash.hashes(), ID);
}

Expand Down
6 changes: 3 additions & 3 deletions tests/python/test_seq_reader.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,11 @@ def setUp(self):
self.base_dir = os.path.dirname(__file__)

def test_seq_reader_single_seq(self):
seq = 'CGCGTGAAAGCAAAACAAGA'
true_seq = ['CGCGTGAAAGCAAAACAAGA']
path = os.path.join(self.base_dir, 'single_seq.fa')
with btllib.SeqReader(path, btllib.SeqReaderFlag.SHORT_MODE) as reader:
read = [record.seq for record in reader]
self.assertListEqual([seq], read)
for record, seq in zip(reader, true_seq):
self.assertEqual(record.seq, seq)

def test_fasta_reader(self):
ids = ["asdf", "ghjk"]
Expand Down