Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[WIP] Feature/circleci #3

Open
wants to merge 24 commits into
base: master
Choose a base branch
from
Open
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
8 changes: 8 additions & 0 deletions .circleci/NiceLinuxDockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
FROM debian:testing
RUN mkdir /work
WORKDIR /work
RUN \
apt update && \
apt install -y --no-install-recommends clang ssh git tar zip ca-certificates && \
apt install -y cmake python-pip && \
rm -rf /var/lib/apt/lists/*
78 changes: 78 additions & 0 deletions .circleci/__init__.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
#define NOCROSSCONSTRUCTORS


#include <cstdint>
#include <string>
#include <tuple>
#include <stdexcept>

#define assert(x) if(!x) {throw std::runtime_error("assertion failed");}

#include <sdsl/vectors.hpp>

#include <pybind11/pybind11.h>

#include "docstrings.hpp"
#include "operations/creation.hpp"
#include "types/bitvector.hpp"
#include "types/encodedvector.hpp"
#include "types/intvector.hpp"
#include "types/suffixarray.hpp"
#include "types/wavelet.hpp"

namespace py = pybind11;


PYBIND11_MODULE(pysdsl, m)
{
m.doc() = "sdsl-lite bindings for python";

auto iv_classes = add_int_vectors(m);

py::class_<sdsl::int_vector<1>>& bit_vector_cls = std::get<1>(iv_classes);

auto bit_vector_classes = std::make_tuple(bit_vector_cls);

// auto tmp = add_bitvectors(m, bit_vector_cls);
// auto compressed_bit_vector_classes = std::get<0>(tmp);
// auto cbv_propagate = std::get<1>(tmp);

// auto enc_classes = add_encoded_vectors(m);

// auto wavelet_classes = add_wavelet(m, cbv_propagate);

// auto csa_classes = add_csa(m);

for_each_in_tuple(iv_classes, make_inits_many_functor(iv_classes));
// for_each_in_tuple(iv_classes, make_inits_many_functor(enc_classes));
// for_each_in_tuple(iv_classes,
// make_inits_many_functor(compressed_bit_vector_classes));
// for_each_in_tuple(iv_classes, make_inits_many_functor(wavelet_classes));

// for_each_in_tuple(enc_classes, make_inits_many_functor(iv_classes));
// #ifndef NOCROSSCONSTRUCTORS
// for_each_in_tuple(enc_classes, make_inits_many_functor(enc_classes));
//for_each_in_tuple(enc_classes, make_inits_many_functor(wavelet_classes));
// #endif

// for_each_in_tuple(compressed_bit_vector_classes,
// make_inits_many_functor(bit_vector_classes));
// #ifndef NOCROSSCONSTRUCTORS
// for_each_in_tuple(compressed_bit_vector_classes, make_inits_many_functor(compressed_bit_vector_classes));
// #endif

// for_each_in_tuple(wavelet_classes, make_inits_many_functor(iv_classes));
// #ifndef NOCROSSCONSTRUCTORS
// for_each_in_tuple(wavelet_classes, make_inits_many_functor(enc_classes));
// for_each_in_tuple(wavelet_classes,
// make_inits_many_functor(wavelet_classes));
// #endif

for_each_in_tuple(iv_classes, make_pysequence_init_functor());
// for_each_in_tuple(enc_classes, make_pysequence_init_functor());
//for_each_in_tuple(compressed_bit_vector_classes,
// make_pysequence_init_functor());

// for_each_in_tuple(wavelet_classes, make_pysequence_init_functor());
// for_each_in_tuple(csa_classes, make_pysequence_init_functor());
}
53 changes: 53 additions & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
version: 2
jobs:
build:
docker:
- image: ivigns/nice-linux:debian-0.0.3
resource_class: xlarge
working_directory: /work
steps:
- checkout
- run:
name: build
command: |
git submodule sync
git submodule update --init --recursive
cd /work/libdivsufsort
git pull origin master
cd /work/sdsl-lite
git pull origin master
cd /work/sdsl-lite/external/libdivsufsort
git pull origin master
cd /work/pybind11
git pull origin master
cd /tmp
mkdir sdsl-lite-build
mkdir libdivsufsort-build
export CC=clang
export CXX=clang++
export CFLAGS="-O3 -static -lc -fPIC -static-libgcc -pipe -fcolor-diagnostics -lpthread -Wl,-Bstatic"
cd /tmp/libdivsufsort-build
cmake -D BUILD_SHARED_LIBS=OFF /work/libdivsufsort
make install
export CXXFLAGS="-O3 -pipe -fcolor-diagnostics -static-libgcc -static-libstdc++ -fPIC -lpthread -Wl,-Bstatic -Wl,-Bdynamic"
cd /tmp/sdsl-lite-build
cmake /work/sdsl-lite
make install
export CXXFLAGS="-O3 -pipe -stdlib=libc++ -fcolor-diagnostics -fPIC -DNOCROSSCONSTRUCTORS"
export CFLAGS="-O3 -pipe -fcolor-diagnostics -fPIC"
cd /work/pybind11
pip install --no-binary ':all:' --no-cache-dir . --verbose
cd /work
pip wheel --no-binary ':all:' --no-cache-dir -w dist . --verbose
- run:
name: show
command: cd /work && ls -aR
- run:
name: test wheel
command: |
apt-get update -qq
apt-get install -qqy python python-pip
pip install $(ls -d /work/dist/*)
mkdir /tmp/test
cd /tmp/test
python -c 'import pysdsl'