diff --git a/Makefile.am b/Makefile.am index caa4fae..16979c5 100644 --- a/Makefile.am +++ b/Makefile.am @@ -42,7 +42,7 @@ if ENABLE_SHORT AM_CXXFLAGS += -DENABLE_SHORT endif -CXXFLAGS = -O3 # default has optimization on +CXXFLAGS = -O3 -DNDEBUG # default has optimization on noinst_LIBRARIES = libabismal.a diff --git a/src/AbismalAlign.hpp b/src/AbismalAlign.hpp index 93bf441..3467038 100644 --- a/src/AbismalAlign.hpp +++ b/src/AbismalAlign.hpp @@ -159,11 +159,9 @@ is_insertion(const uint8_t c) { static inline void get_traceback(const size_t n_col, const std::vector &table, - // const std::vector &traceback, const std::vector &traceback, std::vector &cigar, size_t &the_row, size_t &the_col) { int8_t prev_arrow = traceback[the_row * n_col + the_col]; - // int8_t prev_arrow = traceback[the_row * n_col + the_col]; const bool is_del = is_deletion(prev_arrow); const bool is_ins = is_insertion(prev_arrow); the_row -= !is_ins; @@ -211,8 +209,15 @@ get_best_score(const std::vector &table, const size_t n_cells, // ADS: it seems like with g++-13, on macos ventura on intel hardware // the dynamic vectorized optimization of -O3 might be too aggressive // and makes this function have strange behavior. Placing this pragma -// here helps, and below we restore it to the `-O3` default. -#pragma GCC optimize("vect-cost-model=very-cheap") +// here helps, and below we restore it to the `-O3` default. Probably +// should move to attribute syntax soon. + +#ifdef __APPLE__ +#pragma GCC push_options +// ADS: below this won't make sense if the user wants no optimizations +// at all... +#pragma GCC optimize ("O2") +#endif template @@ -284,7 +289,9 @@ from_left(T left_itr, T target, const T target_end, U traceback) { } } -#pragma GCC optimize("vect-cost-model=dynamic") +#ifdef __APPLE__ +#pragma GCC pop_options +#endif inline void make_default_cigar(const uint32_t len, std::string &cigar) { @@ -323,7 +330,7 @@ AbismalAlign::align(const score_t diffs, // points to relevant reference sequence positions genome_iterator t_itr = target + t_beg; - const auto q_itr(std::begin(qseq)); + const auto q_itr(std::cbegin(qseq)); auto tb_cur(std::begin(traceback)); // prev and cur point to rows in the alignment matrix