utwente-fmt / sylvan

Multi-core Decision Diagram (BDD/LDD) implementation
Apache License 2.0
41 stars 8 forks source link

Make sylvan's CMake reusable in SylvanSharp #12

Closed thisiscam closed 8 years ago

thisiscam commented 8 years ago

This pull request contains the following changes:

  1. Edit CMakeLists.txt so that one can reuse the build system from outer CMake project(e.g. SylvanSharp)
  2. Use quotes instead of brackets for #include to build the library as a submodule without requiring a full installation
  3. build static library with -fPIC, so that a shared library can be linked with it
  4. exposing "sylvan_package_is_running" and "lace_run_default_worker". The latter can be used by an already initialized worker to directly participate in work stealing loop until the end(lace_quits). I'm open to suggestions that can drop this API yet can still achieve the same effect.

More on 4), I'm using C#'s mono to create managed threads(which implementation is just based on pthreads), then I call lace_worker_init on each of these managed threads to initialize the lace workers, after which I would call "lace_run_default_worker" to participate in work stealing until the end. Theoretically, java/python(whose threads module are also based on pthreads) can use this same API to use Lace too!

thisiscam commented 8 years ago

It means use -fPIC for position independent code This is needed for linking a shared lib against sylvan.a

thisiscam commented 8 years ago

I'm thinking of reverting the PIC commit now as it requires an update on CMake version(which fails travis). It might also come with performance implication(though probably not something observable).

Will comment when I get an update

johnyf commented 8 years ago

You could revert changes with new commits to this branch, and the branch be rebased in order to be merged (up to @trolando, I am just commenting).

trolando commented 8 years ago

I did not yet look at the proposed commits, but I'd appreciate slightly more verbose commit messages.

Regarding exposing some of Lace's functionality, this is tricky. I am planning to eventually revise some of the top-level functions in Lace, because the current API is vague and can be improved. I am halfway with this revision, but it has low priority due to other things having more priority.