Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
41 changes: 30 additions & 11 deletions .github/workflows/c-cpp.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down Expand Up @@ -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
Expand All @@ -90,20 +90,39 @@ 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
run: sudo make install

- 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
Expand All @@ -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
Expand All @@ -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/
Expand Down
3 changes: 1 addition & 2 deletions rtlib/adp.hh
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,7 @@
#define RTLIB_ADP_HH_

#include <algorithm>
// needed for uint64_t (Integer ...)
#include <boost/cstdint.hpp>
#include <cstdint>

#include "empty.hh"
#include "algebra.hh"
Expand Down
2 changes: 1 addition & 1 deletion rtlib/bigint.hh
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ typedef mpz_class BigInt;

#else

#include <boost/cstdint.hpp>
#include <cstdint>

typedef uint64_t BigInt;

Expand Down
2 changes: 1 addition & 1 deletion rtlib/bitops.hh
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@

#include <cassert>

#include <boost/cstdint.hpp>
#include <cstdint>

template <typename T>
int
Expand Down
2 changes: 1 addition & 1 deletion rtlib/hashtng.hh
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
#include <vector>
#include <algorithm>
#include <utility>
#include <boost/cstdint.hpp>
#include <cstdint>


#include "bitops.hh"
Expand Down
3 changes: 1 addition & 2 deletions rtlib/list.hh
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,7 @@
#include <utility>
// #include <set>

// tr1 has it
#include <boost/cstdint.hpp>
#include <cstdint>


#include "empty.hh"
Expand Down
3 changes: 1 addition & 2 deletions rtlib/multipool.hh
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,7 @@

#include <vector>

// tr1 has it
#include <boost/cstdint.hpp>
#include <cstdint>

#include "map_pool.hh"

Expand Down
3 changes: 1 addition & 2 deletions rtlib/pool.hh
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,7 @@
#include <cassert>
#include <cstdlib>

// tr1 has it
#include <boost/cstdint.hpp>
#include <cstdint>

#include "map_pool.hh"

Expand Down
2 changes: 1 addition & 1 deletion rtlib/rope.hh
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
#include <sstream>

#include <string>
#include <boost/cstdint.hpp>
#include <cstdint>
#include <boost/algorithm/string/replace.hpp>

#include "../rtlib/cstr.h"
Expand Down
2 changes: 1 addition & 1 deletion rtlib/shape.hh
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
#include <algorithm>
#include <utility>

#include <boost/cstdint.hpp>
#include <cstdint>

#include "shape_alph.hh"
#include "bitops.hh"
Expand Down
3 changes: 0 additions & 3 deletions rtlib/string.hh
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,6 @@
#include <vector>
#include <cstdint>

// tr1 has it
#include <boost/cstdint.hpp>

// FIXME profile this
#include "pool.hh"

Expand Down
20 changes: 17 additions & 3 deletions rtlib/vector_sparse.hh
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ class Stapel {

T &pop() {
assert(top_);
return array[top_--];
return array[--top_];
}

T &top() {
Expand Down Expand Up @@ -285,7 +285,7 @@ template <typename T, typename U = size_t> 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;

Expand Down Expand Up @@ -343,7 +343,21 @@ template <typename T, typename U = size_t> 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 {
Expand Down
5 changes: 1 addition & 4 deletions src/runtime.hh
Original file line number Diff line number Diff line change
Expand Up @@ -28,14 +28,11 @@
#include <iostream>
#include <vector>
#include <cassert>
#include <cstdint>

#include "yieldsize.hh"
#include "table.hh"

// tr1 has it
#include <boost/cstdint.hpp>


#ifndef UINT32_MAX
#define UINT32_MAX 4294967295U
#endif
Expand Down
3 changes: 1 addition & 2 deletions src/yieldsize.hh
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,7 @@
#include <vector>
#include <list>

// tr1 has it
#include <boost/cstdint.hpp>
#include <cstdint>

class Filter;

Expand Down
2 changes: 1 addition & 1 deletion testdata/sandbox/accu.cc
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@

#include <boost/cstdint.hpp>
#include <cstdint>

#include <boost/accumulators/accumulators.hpp>
#include <boost/accumulators/statistics/stats.hpp>
Expand Down
2 changes: 1 addition & 1 deletion testdata/sandbox/limits.cc
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@

#include <cassert>
#include <boost/cstdint.hpp>
#include <cstdint>
#define UINT32_MAX 4294967295U

int main(int argc, char **argv)
Expand Down
Loading