diff --git a/.github/workflows/c-cpp.yml b/.github/workflows/c-cpp.yml index d325bb4bc..85b767a02 100644 --- a/.github/workflows/c-cpp.yml +++ b/.github/workflows/c-cpp.yml @@ -22,7 +22,7 @@ jobs: # https://docs.github.com/en/actions/using-github-hosted-runners/about-github-hosted-runners # as of 21st Sep 2021, ubuntu-16.04 is no longer supported by github actions: https://github.blog/changelog/2021-04-29-github-actions-ubuntu-16-04-lts-virtual-environment-will-be-removed-on-september-20-2021/ # 18.04 burnout: https://github.com/actions/runner-images/issues/6002 - os: [ubuntu-20.04, ubuntu-22.04, ubuntu-24.04] + os: [ubuntu-22.04, ubuntu-24.04] runs-on: ${{ matrix.os }} steps: - name: Update apt @@ -33,7 +33,7 @@ jobs: - name: Checkout truth run: git clone --branch master https://github.com/jlab/gapc-test-suite.git $GITHUB_WORKSPACE/../gapc-test-suite - - uses: actions/checkout@v3 + - uses: actions/checkout@v6 - name: configure run: ./configure --prefix $GITHUB_WORKSPACE - name: make @@ -71,16 +71,16 @@ jobs: strategy: matrix: # https://docs.github.com/en/actions/using-github-hosted-runners/about-github-hosted-runners - os: [macos-13] + os: [macos-14] runs-on: ${{ matrix.os }} steps: - name: Install dependencies - run: brew install bison@3.8 cmake boost gsl gnu-sed libomp gmp cabal-install ghc - - name: pioritize bison3.8 + run: brew install bison cmake boost gsl gnu-sed libomp gmp cabal-install ghc + - name: pioritize homebrew bison # macos-13 has also installed a quite old bison2.3 version and it is found first according # to default PATH settings. Thus, configure.ac will test the wrong version and NOT set # BISONNEW as a compiler flag (see configure.ac) - run: echo "PATH=/usr/local/opt/bison@3.8/bin:$PATH" >> $GITHUB_ENV + run: echo "PATH=/opt/homebrew/opt/bison/bin:$PATH" >> $GITHUB_ENV - name: update cabal run: cabal update - name: add random Haskell lib @@ -90,11 +90,16 @@ jobs: - name: Checkout truth run: git clone --branch master https://github.com/jlab/gapc-test-suite.git $GITHUB_WORKSPACE/../gapc-test-suite - - uses: actions/checkout@v3 + - uses: actions/checkout@v6 - name: configure - run: ./configure --prefix $GITHUB_WORKSPACE + run: ./configure --prefix $GITHUB_WORKSPACE --with-boost=/opt/homebrew/opt/boost/ - name: patch configuration for OSX - run: gsed -E "s|^YACC = .+$|YACC = /usr/local/opt/bison@3.8/bin/bison|" -i config.mf && gsed -E "s|^SED = .+$|SED = /usr/local/opt/gnu-sed/libexec/gnubin/sed|" -i config.mf && gsed -E "s/ -D_XOPEN_SOURCE=500 / /" -i config.mf && gsed -E "s/ -std=c\+\+17 / -std=c\+\+11 /" -i config.mf + run: | + gsed -E "s|^YACC = .+$|YACC = /opt/homebrew/opt/bison/bin/bison|" -i config.mf + gsed -E "s|^SED = .+$|SED = /opt/homebrew/opt/gnu-sed/libexec/gnubin/sed|" -i config.mf + gsed -E "s/ -D_XOPEN_SOURCE=500 / /" -i config.mf + gsed -E "s/ -std=c\+\+17 / -std=c\+\+11 -I\/opt\/homebrew\/opt\/gmp\/include -I\/opt\/homebrew\/opt\/gsl\/include /" -i config.mf + gsed -E 's|\$\(LDFLAGS_EXTRA\) \\|\$\(LDFLAGS_EXTRA\) -L/opt/homebrew/opt/gmp/lib -L/opt/homebrew/opt/gsl/lib \\|' -i config.mf - name: make run: make -j 3 - name: make install @@ -102,8 +107,22 @@ jobs: - name: test-mod run: make test-mod TRUTH_DIR=$GITHUB_WORKSPACE/../gapc-test-suite/Truth TRUTH_SUFFIX=_osx + - name: Export test-mod results + if: failure() + uses: actions/upload-artifact@v7 + with: + name: test-mod_results + path: ./testdata/modtest/temp + - name: test-mod_outside run: make -j 2 test-mod_outside TRUTH_DIR=$GITHUB_WORKSPACE/../gapc-test-suite/Truth TRUTH_SUFFIX=_osx + - name: Export test-mod_outside results + if: failure() + uses: actions/upload-artifact@v7 + with: + name: test-mod_outside_results + path: ./testdata/modtest/temp + - name: test-regress run: make test-regress TRUTH_DIR=$GITHUB_WORKSPACE/../gapc-test-suite/Truth - name: test-ambiguity @@ -125,7 +144,7 @@ jobs: run: sudo apt-get update - name: Install dependencies run: sudo apt-get install flex bison make libboost-all-dev libgsl-dev python3 python3-pip python3-biopython - - uses: actions/checkout@v3 + - uses: actions/checkout@v6 - name: configure run: ./configure - name: make @@ -152,7 +171,7 @@ jobs: cpplint: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v6 - uses: actions/setup-python@v4 - run: pip install cpplint - run: cpplint --recursive --counting 'detailed' --filter="-runtime/references,-build/include_subdir" --extensions=cc,hh src/ rtlib/ diff --git a/rtlib/adp.hh b/rtlib/adp.hh index 558617175..035d1a12b 100644 --- a/rtlib/adp.hh +++ b/rtlib/adp.hh @@ -26,8 +26,7 @@ #define RTLIB_ADP_HH_ #include -// needed for uint64_t (Integer ...) -#include +#include #include "empty.hh" #include "algebra.hh" diff --git a/rtlib/bigint.hh b/rtlib/bigint.hh index 2e9357bad..8c0ac5605 100644 --- a/rtlib/bigint.hh +++ b/rtlib/bigint.hh @@ -33,7 +33,7 @@ typedef mpz_class BigInt; #else -#include +#include typedef uint64_t BigInt; diff --git a/rtlib/bitops.hh b/rtlib/bitops.hh index 4f7740760..1ff749c9c 100644 --- a/rtlib/bitops.hh +++ b/rtlib/bitops.hh @@ -26,7 +26,7 @@ #include -#include +#include template int diff --git a/rtlib/hashtng.hh b/rtlib/hashtng.hh index 76dcc0334..152cdb8be 100644 --- a/rtlib/hashtng.hh +++ b/rtlib/hashtng.hh @@ -31,7 +31,7 @@ #include #include #include -#include +#include #include "bitops.hh" diff --git a/rtlib/list.hh b/rtlib/list.hh index 3a3407931..eb5074d27 100644 --- a/rtlib/list.hh +++ b/rtlib/list.hh @@ -40,8 +40,7 @@ #include // #include -// tr1 has it -#include +#include #include "empty.hh" diff --git a/rtlib/multipool.hh b/rtlib/multipool.hh index ec4a70687..da1aaf740 100644 --- a/rtlib/multipool.hh +++ b/rtlib/multipool.hh @@ -30,8 +30,7 @@ #include -// tr1 has it -#include +#include #include "map_pool.hh" diff --git a/rtlib/pool.hh b/rtlib/pool.hh index 0698e6c0b..849d38b26 100644 --- a/rtlib/pool.hh +++ b/rtlib/pool.hh @@ -28,8 +28,7 @@ #include #include -// tr1 has it -#include +#include #include "map_pool.hh" diff --git a/rtlib/rope.hh b/rtlib/rope.hh index 4722d69c6..4cef95cbd 100644 --- a/rtlib/rope.hh +++ b/rtlib/rope.hh @@ -33,7 +33,7 @@ #include #include -#include +#include #include #include "../rtlib/cstr.h" diff --git a/rtlib/shape.hh b/rtlib/shape.hh index ab89e32a2..ae606c1a3 100644 --- a/rtlib/shape.hh +++ b/rtlib/shape.hh @@ -35,7 +35,7 @@ #include #include -#include +#include #include "shape_alph.hh" #include "bitops.hh" diff --git a/rtlib/string.hh b/rtlib/string.hh index 70769add1..ef9ec4c81 100644 --- a/rtlib/string.hh +++ b/rtlib/string.hh @@ -34,9 +34,6 @@ #include #include -// tr1 has it -#include - // FIXME profile this #include "pool.hh" diff --git a/rtlib/vector_sparse.hh b/rtlib/vector_sparse.hh index b968358c4..b02adf87d 100644 --- a/rtlib/vector_sparse.hh +++ b/rtlib/vector_sparse.hh @@ -116,7 +116,7 @@ class Stapel { T &pop() { assert(top_); - return array[top_--]; + return array[--top_]; } T &top() { @@ -285,7 +285,7 @@ template class Vector_Sparse { public: typedef T value_type; typedef std::random_access_iterator_tag iterator_category; - typedef U difference_type; + typedef std::ptrdiff_t difference_type; typedef T* pointer; typedef T& reference; @@ -343,7 +343,21 @@ template class Vector_Sparse { Iterator operator+=(const difference_type &other) { i += other; - return Iterator(v, i); + return *this; + } + + Iterator& operator-=(difference_type other) { + i -= other; + return *this; + } + reference operator[](difference_type n) { + return v(*(i + n)); + } + pointer operator->() { + return &v(*i); + } + const reference operator*() const { + return v(*i); } bool operator>(const Iterator &other) const { diff --git a/src/runtime.hh b/src/runtime.hh index 3f2b23626..1921b74f3 100644 --- a/src/runtime.hh +++ b/src/runtime.hh @@ -28,14 +28,11 @@ #include #include #include +#include #include "yieldsize.hh" #include "table.hh" -// tr1 has it -#include - - #ifndef UINT32_MAX #define UINT32_MAX 4294967295U #endif diff --git a/src/yieldsize.hh b/src/yieldsize.hh index 0d7d9d00c..c3be353b5 100644 --- a/src/yieldsize.hh +++ b/src/yieldsize.hh @@ -30,8 +30,7 @@ #include #include -// tr1 has it -#include +#include class Filter; diff --git a/testdata/sandbox/accu.cc b/testdata/sandbox/accu.cc index 8e641b7ff..783016cd5 100644 --- a/testdata/sandbox/accu.cc +++ b/testdata/sandbox/accu.cc @@ -1,5 +1,5 @@ -#include +#include #include #include diff --git a/testdata/sandbox/limits.cc b/testdata/sandbox/limits.cc index 4c8409ce5..b3f7834ec 100644 --- a/testdata/sandbox/limits.cc +++ b/testdata/sandbox/limits.cc @@ -1,6 +1,6 @@ #include -#include +#include #define UINT32_MAX 4294967295U int main(int argc, char **argv)