Skip to content

Commit

Permalink
update patch and version pulled
Browse files Browse the repository at this point in the history
  • Loading branch information
Rob Patro committed Nov 29, 2022
1 parent da41bb4 commit b995054
Show file tree
Hide file tree
Showing 2 changed files with 46 additions and 67 deletions.
8 changes: 4 additions & 4 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -172,11 +172,11 @@ endif()
message("Build system will fetch and install KMC3")
ExternalProject_Add(prj_kmc
DOWNLOAD_DIR ${CMAKE_SOURCE_DIR}/external
DOWNLOAD_COMMAND curl -k -L https://github.com/refresh-bio/KMC/archive/refs/tags/v3.2.1.tar.gz -o KMC-3.2.1.tar.gz &&
tar -xzf KMC-3.2.1.tar.gz &&
rm KMC-3.2.1.tar.gz
DOWNLOAD_COMMAND curl -k -L https://github.com/refresh-bio/KMC/archive/50eb19013e4eafa8034037ac43b7119c544377ed.tar.gz -o KMC-latest.tar.gz &&
tar -xzf KMC-latest.tar.gz &&
rm KMC-latest.tar.gz
PATCH_COMMAND patch --strip 1 < ${CMAKE_SOURCE_DIR}/patches/kmc_patch.diff
SOURCE_DIR ${CMAKE_SOURCE_DIR}/external/KMC-3.2.1
SOURCE_DIR ${CMAKE_SOURCE_DIR}/external/KMC-50eb19013e4eafa8034037ac43b7119c544377ed
BUILD_IN_SOURCE TRUE
INSTALL_DIR ${CMAKE_SOURCE_DIR}/external/
CONFIGURE_COMMAND ""
Expand Down
105 changes: 42 additions & 63 deletions patches/kmc_patch.diff
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
diff --git a/Makefile b/Makefile
index bc07d35..4bfd785 100644
--- a/Makefile
+++ b/Makefile
@@ -13,15 +13,11 @@
diff --git KMC-50eb19013e4eafa8034037ac43b7119c544377ed/Makefile KMC-latest/Makefile
index d286f4f..3c62fe3 100644
--- KMC-50eb19013e4eafa8034037ac43b7119c544377ed/Makefile
+++ KMC-latest/Makefile
@@ -13,15 +13,11 @@ OUT_BIN_DIR = bin
OUT_INCLUDE_DIR = include

ifeq ($(UNAME_S),Darwin)
- CC = /usr/local/bin/g++-10
- CC = g++-11
-
- CFLAGS = -Wall -O3 -m64 -static-libgcc -static-libstdc++ -pthread -std=c++14
- CLINK = -lm -static-libgcc -static-libstdc++ -O3 -pthread -std=c++14
+ CFLAGS = -Wall -O3 -m64 -pthread -std=c++14
+ CLINK = -lm -O3 -pthread -std=c++14
+ CFLAGS = -Wall -O3 -m64 -pthread -std=c++14
+ CLINK = -lm -O3 -pthread -std=c++14

PY_KMC_API_CFLAGS = -Wl,-undefined,dynamic_lookup -fPIC -Wall -shared -std=c++14 -O3
else
Expand All @@ -20,7 +20,7 @@ index bc07d35..4bfd785 100644
CFLAGS = -Wall -O3 -m64 -static -Wl,--whole-archive -lpthread -Wl,--no-whole-archive -std=c++14
CLINK = -lm -static -O3 -Wl,--whole-archive -lpthread -Wl,--no-whole-archive -std=c++14

@@ -61,7 +57,7 @@
@@ -61,7 +57,7 @@ ifeq ($(UNAME_S),Darwin)
$(KMC_TOOLS_DIR)/libs/libz.1.2.5.dylib \
$(KMC_TOOLS_DIR)/libs/libbz2.1.0.5.dylib

Expand All @@ -29,19 +29,19 @@ index bc07d35..4bfd785 100644
else
RADULS_OBJS = \
$(KMC_MAIN_DIR)/raduls_sse2.o \
diff --git a/kmc_CLI/kmc.cpp b/kmc_CLI/kmc.cpp
index 15e579e..1d62040 100644
--- a/kmc_CLI/kmc.cpp
+++ b/kmc_CLI/kmc.cpp
@@ -1,5 +1,7 @@
#define _CRT_SECURE_NO_WARNINGS
#include "../kmc_core/kmc_runner.h"
+#include <random>
+#include <algorithm>
diff --git KMC-50eb19013e4eafa8034037ac43b7119c544377ed/kmc_CLI/kmc.cpp KMC-latest/kmc_CLI/kmc.cpp
index 15e579e..97b4af4 100644
--- KMC-50eb19013e4eafa8034037ac43b7119c544377ed/kmc_CLI/kmc.cpp
+++ KMC-latest/kmc_CLI/kmc.cpp
@@ -3,6 +3,7 @@
#include <cstring>
#include <iostream>
#include <fstream>
@@ -246,6 +248,9 @@ bool parse_parameters(int argc, char* argv[], Params& params)
+#include <random>
#include <algorithm>
#include <iomanip>
using namespace std;
@@ -246,6 +247,9 @@ bool parse_parameters(int argc, char* argv[], Params& params)
stage2Params.SetOutputFileName(argv[i++]);
stage1Params.SetTmpPath(argv[i++]);

Expand All @@ -51,7 +51,7 @@ index 15e579e..1d62040 100644
std::vector<std::string> input_file_names;
if (input_file_name[0] != '@')
input_file_names.push_back(input_file_name);
@@ -264,7 +269,7 @@ bool parse_parameters(int argc, char* argv[], Params& params)
@@ -264,7 +268,7 @@ bool parse_parameters(int argc, char* argv[], Params& params)
input_file_names.push_back(s);

in.close();
Expand All @@ -60,10 +60,10 @@ index 15e579e..1d62040 100644
}
stage1Params.SetInputFiles(input_file_names);

diff --git a/kmc_api/kmer_defs.h b/kmc_api/kmer_defs.h
diff --git KMC-50eb19013e4eafa8034037ac43b7119c544377ed/kmc_api/kmer_defs.h KMC-latest/kmc_api/kmer_defs.h
index 90b0db4..4fe8aaf 100644
--- a/kmc_api/kmer_defs.h
+++ b/kmc_api/kmer_defs.h
--- KMC-50eb19013e4eafa8034037ac43b7119c544377ed/kmc_api/kmer_defs.h
+++ KMC-latest/kmc_api/kmer_defs.h
@@ -34,7 +34,7 @@


Expand All @@ -73,35 +73,11 @@ index 90b0db4..4fe8aaf 100644
#include <iostream>

#else
diff --git a/kmc_core/defs.h b/kmc_core/defs.h
index 75afc97..e0ec1df 100644
--- a/kmc_core/defs.h
+++ b/kmc_core/defs.h
@@ -8,6 +8,7 @@
Date : 2022-01-04
*/

+
#ifndef _DEFS_H
#define _DEFS_H

@@ -32,6 +33,7 @@

#define COMPACT_CUMSUM_PART_SIZE (1<<10)

+
#define KMER_X 3

#define STATS_FASTQ_SIZE (1 << 28)
@@ -66,6 +68,7 @@
#define MAX_SR 128

//Range of number of sorter threads pre sorter in strict memory mode
+
#define MIN_SMSO 1
#define MAX_SMSO 16

@@ -109,8 +112,8 @@ using uint64 = uint64_t;
diff --git KMC-50eb19013e4eafa8034037ac43b7119c544377ed/kmc_core/defs.h KMC-latest/kmc_core/defs.h
index 75afc97..65322d3 100644
--- KMC-50eb19013e4eafa8034037ac43b7119c544377ed/kmc_core/defs.h
+++ KMC-latest/kmc_core/defs.h
@@ -109,8 +109,8 @@ using uint64 = uint64_t;
#include <string.h>

#include <stdio.h>
Expand All @@ -112,30 +88,33 @@ index 75afc97..e0ec1df 100644

#endif

diff --git a/kmc_core/queues.h b/kmc_core/queues.h
index 17a0465..2c0e587 100644
--- a/kmc_core/queues.h
+++ b/kmc_core/queues.h
@@ -11,6 +11,8 @@
diff --git KMC-50eb19013e4eafa8034037ac43b7119c544377ed/kmc_core/queues.h KMC-latest/kmc_core/queues.h
index 17a0465..4711f26 100644
--- KMC-50eb19013e4eafa8034037ac43b7119c544377ed/kmc_core/queues.h
+++ KMC-latest/kmc_core/queues.h
@@ -11,6 +11,9 @@
#ifndef _QUEUES_H
#define _QUEUES_H

+
+#include <algorithm>
+#include <random>
#include "defs.h"
#include <stdio.h>
#include <tuple>
@@ -571,6 +573,9 @@ public:
@@ -570,7 +573,10 @@ public:
}
void init_random()
{
lock_guard<mutex> lck(mtx);
+ std::random_device rd;
+ std::mt19937 g(rd());
+
- lock_guard<mutex> lck(mtx);
+ lock_guard<mutex> lck(mtx);
+ std::random_device rd;
+ std::mt19937 g(rd());
+
vector<pair<int32, int64>> bin_sizes;

for (auto& p : m)
@@ -589,7 +594,7 @@ public:
@@ -589,7 +595,7 @@ public:
for (uint32 i = no_sort_end; i < bin_sizes.size(); ++i)
random_bins.push_back(bin_sizes[i].first);

Expand Down

0 comments on commit b995054

Please sign in to comment.