From b99505467743398982944831f6dc780a8460deae Mon Sep 17 00:00:00 2001 From: Rob Patro Date: Tue, 29 Nov 2022 00:00:53 -0500 Subject: [PATCH] update patch and version pulled --- CMakeLists.txt | 8 ++-- patches/kmc_patch.diff | 105 +++++++++++++++++------------------------ 2 files changed, 46 insertions(+), 67 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index c14824a6..283cdbbd 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -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 "" diff --git a/patches/kmc_patch.diff b/patches/kmc_patch.diff index b47e0205..7162261a 100644 --- a/patches/kmc_patch.diff +++ b/patches/kmc_patch.diff @@ -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 @@ -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 @@ -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 -+#include +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 #include #include -@@ -246,6 +248,9 @@ bool parse_parameters(int argc, char* argv[], Params& params) ++#include + #include + #include + using namespace std; +@@ -246,6 +247,9 @@ bool parse_parameters(int argc, char* argv[], Params& params) stage2Params.SetOutputFileName(argv[i++]); stage1Params.SetTmpPath(argv[i++]); @@ -51,7 +51,7 @@ index 15e579e..1d62040 100644 std::vector 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(); @@ -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 @@ @@ -73,35 +73,11 @@ index 90b0db4..4fe8aaf 100644 #include #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 #include @@ -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 +#include #include "defs.h" #include #include -@@ -571,6 +573,9 @@ public: +@@ -570,7 +573,10 @@ public: + } void init_random() { - lock_guard lck(mtx); -+ std::random_device rd; -+ std::mt19937 g(rd()); -+ +- lock_guard lck(mtx); ++ lock_guard lck(mtx); ++ std::random_device rd; ++ std::mt19937 g(rd()); ++ vector> 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);