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

How to build the library with no Python #32

Open
joa-quim opened this issue Jun 23, 2016 · 3 comments
Open

How to build the library with no Python #32

joa-quim opened this issue Jun 23, 2016 · 3 comments

Comments

@joa-quim
Copy link

Ok, as title says. If I want to build just the lib and no python wrapper how can we do that?

Thanks

@wesm
Copy link
Collaborator

wesm commented Jun 23, 2016

I suggest creating a build system with CMake to build a shared library libparatext.so

@deads
Copy link
Contributor

deads commented Jun 24, 2016

It's a header-only template library so simply include the headers you need.

The CSVColBasedLoader is the main controller class for CSV loading. For example, to load a CSV file myfile.csv and copy the contents of the first column, which is assumed categorical, do:

#include <vector>
#include "csv/colbased_loader.hpp"

int main(int argc, char **argv) {
     ParaText::CSV::ColBasedLoader loader;
     ParaText::ParseParams params;
     params.num_threads=1;
     loader.load("myfile.csv", params);

     // Now, just grab the first column, which we assume to be categorical.
     std::vector<size_t> col_data;
     auto inserter = std::back_inserter(col_data);
     loader.copy_column<decltype(inserter), size_t>(0, inserter);
     auto levels = loader.get_levels();
     return 0;
}

HTH. A C++ tutorial and reference guide is in our medium-term roadmap.

@wesm
Copy link
Collaborator

wesm commented Jun 24, 2016

It might be nice to add a makefile for installing the headers into a particular toolchain location

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants