From b8f8016f9758bc478b0c9e54972e595e7fd94c79 Mon Sep 17 00:00:00 2001 From: fo40225 Date: Sat, 10 Dec 2022 10:40:24 +0800 Subject: [PATCH] fix intel compiler build break https://github.com/Illumina/DRAGMAP/pull/48 --- .github/workflows/build.yml | 1 - config.mk | 2 +- src/include/align/Aligner.hpp | 4 ++-- src/include/map/ChainBuilder.hpp | 2 +- src/lib/align/Aligner.cpp | 4 ++-- src/lib/align/AlignmentGenerator.cpp | 2 +- src/lib/align/SmithWaterman.cpp | 2 +- src/lib/reference/ExtendTableInterval.cpp | 6 +++--- src/lib/reference/ReferenceDir.cpp | 8 ++++---- .../bamtools-2.4.1/include/api/BamConstants.h | 18 +++++++++--------- .../src/host/infra/linux/infra_linux_utils.cpp | 18 +++++++++--------- .../src/host/infra/public/infra_compiler.h | 6 +++--- .../common/hash_generation/gen_hash_table.c | 2 +- 13 files changed, 37 insertions(+), 38 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 1da3d78..f3d2d63 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -4,7 +4,6 @@ on: push: branches: [ "master" ] pull_request: - branches: [ "master" ] jobs: build: diff --git a/config.mk b/config.mk index a0c3d0e..19ca0a8 100755 --- a/config.mk +++ b/config.mk @@ -140,7 +140,7 @@ endif VERSION_STRING?=$(shell git describe --tags --always --abbrev=8 2> /dev/null || echo "UNKNOWN") CXXWARNINGS=-Werror -Wno-unused-variable -Wno-free-nonheap-object -Wno-parentheses -CWARNINGS?=-Werror -Wno-unused-variable -Wno-unused-function -Wno-format-truncation +CWARNINGS?=-Werror -Wno-unused-variable -Wno-unused-function -Wno-format-truncation -Wno-unknown-warning-option -Wno-unused-but-set-variable CXXSTD?=-std=c++17 diff --git a/src/include/align/Aligner.hpp b/src/include/align/Aligner.hpp index efca0c9..63cf18c 100644 --- a/src/include/align/Aligner.hpp +++ b/src/include/align/Aligner.hpp @@ -141,8 +141,8 @@ class Aligner { const map::Mapper mapper_; const SimilarityScores similarity_; const ScoreType gapInit_; - const ScoreType gapExtend_; - const ScoreType unclipScore_; + // const ScoreType gapExtend_; + // const ScoreType unclipScore_; const ScoreType alnMinScore_; const int aln_cfg_mapq_min_len_; const int aln_cfg_unpaired_pen_; diff --git a/src/include/map/ChainBuilder.hpp b/src/include/map/ChainBuilder.hpp index 722bf21..c1a1326 100644 --- a/src/include/map/ChainBuilder.hpp +++ b/src/include/map/ChainBuilder.hpp @@ -77,7 +77,7 @@ class ChainBuilder { size_t seedChainCount_; double chainFilterRatio_ = 2.0; double chainFilterConstant_ = 0.0; - int numRandomSampleHits_ = 0; + // int numRandomSampleHits_ = 0; }; } // namespace map diff --git a/src/lib/align/Aligner.cpp b/src/lib/align/Aligner.cpp index 6db5d24..37185ef 100644 --- a/src/lib/align/Aligner.cpp +++ b/src/lib/align/Aligner.cpp @@ -56,8 +56,8 @@ Aligner::Aligner( mapper_(&hashtable), similarity_(similarity), gapInit_(gapInit), - gapExtend_(gapExtend), - unclipScore_(unclipScore), + // gapExtend_(gapExtend), + // unclipScore_(unclipScore), alnMinScore_(alnMinScore), aln_cfg_mapq_min_len_(aln_cfg_mapq_min_len), aln_cfg_unpaired_pen_(aln_cfg_unpaired_pen), diff --git a/src/lib/align/AlignmentGenerator.cpp b/src/lib/align/AlignmentGenerator.cpp index f6d1e9b..3460591 100644 --- a/src/lib/align/AlignmentGenerator.cpp +++ b/src/lib/align/AlignmentGenerator.cpp @@ -141,7 +141,7 @@ bool AlignmentGenerator::generateAlignment( 1, (seedChain.isReverseComplement() ? (read.getLength() - seedChain.lastReadBase() - 1) : seedChain.firstReadBase())); //10;//1; - static constexpr size_t forcedHorizontalMotion = smithWaterman_.width; + static const size_t forcedHorizontalMotion = smithWaterman_.width; // initialize the query from the base and the orientation of the seedChain const auto& query = read.getBases(); int move = 0; diff --git a/src/lib/align/SmithWaterman.cpp b/src/lib/align/SmithWaterman.cpp index d64bf83..e749c56 100644 --- a/src/lib/align/SmithWaterman.cpp +++ b/src/lib/align/SmithWaterman.cpp @@ -58,7 +58,7 @@ void SmithWatermanT::buildWavefronts( // dragen thing... setDatabaseSize(std::min(getDatabaseOffset() + 1 + 2 * width + 1, getDatabaseSize())); - for (unsigned i = 0; (getDatabaseOffset() < getDatabaseSize() - 1); ++i) { + while (getDatabaseOffset() < getDatabaseSize() - 1) { moveRight(); } diff --git a/src/lib/reference/ExtendTableInterval.cpp b/src/lib/reference/ExtendTableInterval.cpp index f6bd36c..eb53ed1 100644 --- a/src/lib/reference/ExtendTableInterval.cpp +++ b/src/lib/reference/ExtendTableInterval.cpp @@ -30,11 +30,11 @@ ExtendTableInterval::ExtendTableInterval(I begin, I end) } // explicit instantiation for vectors and pointers -template ExtendTableInterval::ExtendTableInterval( +template ExtendTableInterval::ExtendTableInterval( const HashRecord* begin, const HashRecord* end); -template ExtendTableInterval::ExtendTableInterval::const_iterator>( +template ExtendTableInterval::ExtendTableInterval( std::vector::const_iterator begin, std::vector::const_iterator end); -template ExtendTableInterval::ExtendTableInterval::iterator>( +template ExtendTableInterval::ExtendTableInterval( std::vector::iterator begin, std::vector::iterator end); template diff --git a/src/lib/reference/ReferenceDir.cpp b/src/lib/reference/ReferenceDir.cpp index 977619c..669c345 100644 --- a/src/lib/reference/ReferenceDir.cpp +++ b/src/lib/reference/ReferenceDir.cpp @@ -52,7 +52,7 @@ typename ReferenceDir7::UcharPtr ReferenceDir7::ReadFileIntoBuffer( size = file.tellg(); file.seekg(0, file.beg); - UcharPtr bufPtr(new uint8_t[size], [this](uint8_t* p) -> void { delete [](p); }); + UcharPtr bufPtr(new uint8_t[size], [](uint8_t* p) -> void { delete [](p); }); file.read(reinterpret_cast(bufPtr.get()), size); if (!file) { // THROW(DragenException, "Could not load reference - could not read ", path); @@ -119,9 +119,9 @@ ReferenceDir7::ReferenceDir7(const boost::filesystem::path& path, bool mmap, boo dup2(stdoutori, 1); hashtableData_ = - Uint64Ptr(reinterpret_cast(hashbuf), [this](uint64_t* p) -> void { free(p); }); + Uint64Ptr(reinterpret_cast(hashbuf), [](uint64_t* p) -> void { free(p); }); extendTableData_ = - Uint64Ptr(reinterpret_cast(extendTableBuf), [this](uint64_t* p) -> void { free(p); }); + Uint64Ptr(reinterpret_cast(extendTableBuf), [](uint64_t* p) -> void { free(p); }); } referenceSequencePtr_ = std::unique_ptr(new ReferenceSequence( @@ -251,7 +251,7 @@ std::unique_ptr> ReferenceDir7::readData( " error: " + std::strerror(errno))); } return std::unique_ptr>( - reinterpret_cast(table), [this](T* p) -> void { free(p); }); + reinterpret_cast(table), [](T* p) -> void { free(p); }); } size_t ReferenceDir7::getHashtableConfigSize() const diff --git a/stubs/bamtools/bamtools-2.4.1/include/api/BamConstants.h b/stubs/bamtools/bamtools-2.4.1/include/api/BamConstants.h index baee67c..567b228 100644 --- a/stubs/bamtools/bamtools-2.4.1/include/api/BamConstants.h +++ b/stubs/bamtools/bamtools-2.4.1/include/api/BamConstants.h @@ -129,15 +129,15 @@ const char BAM_DNA_DEL = '-'; const char BAM_DNA_PAD = '*'; // zlib & BGZF constants -const char GZIP_ID1 = 31; -const char GZIP_ID2 = 139; -const char CM_DEFLATE = 8; -const char FLG_FEXTRA = 4; -const char OS_UNKNOWN = 255; -const char BGZF_XLEN = 6; -const char BGZF_ID1 = 66; -const char BGZF_ID2 = 67; -const char BGZF_LEN = 2; +const uint8_t GZIP_ID1 = 31; +const uint8_t GZIP_ID2 = 139; +const uint8_t CM_DEFLATE = 8; +const uint8_t FLG_FEXTRA = 4; +const uint8_t OS_UNKNOWN = 255; +const uint8_t BGZF_XLEN = 6; +const uint8_t BGZF_ID1 = 66; +const uint8_t BGZF_ID2 = 67; +const uint8_t BGZF_LEN = 2; const int8_t GZIP_WINDOW_BITS = -15; //--START EDICO EDITED diff --git a/stubs/dragen/src/host/infra/linux/infra_linux_utils.cpp b/stubs/dragen/src/host/infra/linux/infra_linux_utils.cpp index cd02cd4..f3ddc25 100644 --- a/stubs/dragen/src/host/infra/linux/infra_linux_utils.cpp +++ b/stubs/dragen/src/host/infra/linux/infra_linux_utils.cpp @@ -39,15 +39,15 @@ namespace infra { static std::string g_kernelVersionStr; static int g_kernelVersion; -static constexpr int MKVER(const int major, const int minor, const int patch) -{ - return major * 10000 + minor * 100 + patch; -} - -static constexpr int MKVER(const int major, const int minor) -{ - return major * 10000 + minor * 100; -} +// static constexpr int MKVER(const int major, const int minor, const int patch) +// { +// return major * 10000 + minor * 100 + patch; +// } + +// static constexpr int MKVER(const int major, const int minor) +// { +// return major * 10000 + minor * 100; +// } //------------------------------------------------------------------------alain int GetDmiValue(const std::string& label, std::string& value) diff --git a/stubs/dragen/src/host/infra/public/infra_compiler.h b/stubs/dragen/src/host/infra/public/infra_compiler.h index 2b6b081..7c4aa4e 100644 --- a/stubs/dragen/src/host/infra/public/infra_compiler.h +++ b/stubs/dragen/src/host/infra/public/infra_compiler.h @@ -153,7 +153,7 @@ static inline int atomic16_cmpset(uint16_t volatile *ptr, const uint16_t exp, } static inline uint32_t atomic16_xchg(uint16_t volatile *ptr, const uint16_t val) { - return __atomic_exchange_2(ptr, val, __ATOMIC_SEQ_CST); + return __atomic_exchange_n(ptr, val, __ATOMIC_SEQ_CST); } static inline int32_t atomic16_read(int16_t volatile *ptr) { return *ptr; } static inline void atomic16_write(int16_t volatile *ptr, const int16_t val) { @@ -191,7 +191,7 @@ static inline int atomic32_cmpset(uint32_t volatile *ptr, const uint32_t exp, } static inline uint32_t atomic32_xchg(uint32_t volatile *ptr, const uint32_t val) { - return __atomic_exchange_4(ptr, val, __ATOMIC_SEQ_CST); + return __atomic_exchange_n(ptr, val, __ATOMIC_SEQ_CST); } static inline int32_t atomic32_read(int32_t volatile *ptr) { return *ptr; } static inline void atomic32_write(int32_t volatile *ptr, const int32_t val) { @@ -229,7 +229,7 @@ static inline int atomic64_cmpset(uint64_t volatile *ptr, const uint64_t exp, } static inline uint64_t atomic64_xchg(uint64_t volatile *ptr, const uint64_t val) { - return __atomic_exchange_8(ptr, val, __ATOMIC_SEQ_CST); + return __atomic_exchange_n(ptr, val, __ATOMIC_SEQ_CST); } static inline int64_t atomic64_read(int64_t volatile *ptr) { return *ptr; } static inline void atomic64_write(int64_t volatile *ptr, const int64_t val) { diff --git a/thirdparty/dragen/src/common/hash_generation/gen_hash_table.c b/thirdparty/dragen/src/common/hash_generation/gen_hash_table.c index cdca3df..5a55699 100644 --- a/thirdparty/dragen/src/common/hash_generation/gen_hash_table.c +++ b/thirdparty/dragen/src/common/hash_generation/gen_hash_table.c @@ -249,7 +249,7 @@ void setDefaultHashParams(hashTableConfig_t* defConfig, const char* destDir, Has free(dir); } - defConfig->hostVersion = (char*)getHostVersion(0); + defConfig->hostVersion = (char*)getHostVersion(); } //-------------------------------------------------------------------------------swhitmore