opencamlib icon indicating copy to clipboard operation
opencamlib copied to clipboard

Better JavaScript & node.js package, fix for macOS OpenMP support and travis releases

Open vespakoen opened this issue 6 years ago • 7 comments

Work in progress! don't merge just yet.

  • I created a new JavaScript library for the browser and node.js, it has the exact same API for both platforms, and will automatically load the right version based on the environment.
  • I fixed OpenMP support on macOS (adding the right include), it needs to be compiled with llvm, for this the CXX environment variable has to be set, we will have to add something to the readme & docs about this.
  • Travis didn't "make" the python project yet, I now added that and fixed an issue with it (the boost build was a "debug" one and didn't play well with our "release" cmake build)
  • I added a release step to the travis settings, this will publish the build artifacts to github (right now on my own fork: https://github.com/vespakoen/opencamlib/releases) I am still working on making it work correctly.
  • Added PathDropCutter to the node.js bindings
  • Added missing constructor & methods to Triangle (and some other objects) so STLSurfs can be created "by hand", without using STLReader, this has some speed improvements (I guess the STLReader is pretty slow for some reason)
  • Removed (first / old implementation of the the node.js library in src/nodejslib) because that is now superseded by the src/npmpackage library, which works for both node.js and the browser)

I am still working on the github releases being good, I will then rebase my commits and will let you know when things are ready to merge.

I also noticed there is a bug in Waterline when re-using the Waterline instance and running it a couple of times, it stops working after the seconds time, will make an issue for this another time.

vespakoen avatar Jan 31 '19 19:01 vespakoen

Looks like it's working! Will add some tests to it later so we can really make sure.

vespakoen avatar Feb 01 '19 01:02 vespakoen

I am bit worried that if we have three separate bindings any change in the core c++ lib will require a lot of work on the binding-side also?

  • python
  • javascript/nodejs
  • emscripten Hopefully there's enough help around to keep the bindings working, if and when new additions/improvements are made to the core library.

aewallin avatar Feb 01 '19 06:02 aewallin

True, but it's open source, and there is a working version for node.js and the browser that already can do the main things people want from this library. The browser version should still work in 10 years, the node.js version will also still work in many years (although probably only with an old node.js version hehe) But the point is that the code is now here and can be used by anyone for many years to come. Updating the bindings is actually not that much work at all, and I am willing to keep working on this library in my free time.

vespakoen avatar Feb 01 '19 09:02 vespakoen

Changed the linked libomp on macOS to not be the one coming with llvm (through homebrew) Also added a setup.py script that I modified from here: https://github.com/pybind/cmake_example/blob/master/setup.py And made the "full library filename suffix" that I need to get the libraries out of the build system optional and off by default, so a normal build will produce the library with the right name (ocl.so)

vespakoen avatar Feb 01 '19 14:02 vespakoen

Sorry I have not had time to follow this closely. What is the status for this PR? - latest updates are from 2019-02 I think. Should I merge or abandon/close?

aewallin avatar May 25 '19 08:05 aewallin

what is the status here? Should this PR work continue or are the same changes already merged in other PRs and this could be closed & abandoned?

aewallin avatar Jun 08 '19 07:06 aewallin

There are some important fixes is this PR, not sure what the current status of the repo is, will try to make some time for it on monday and see if I can renew it ;)

vespakoen avatar Jun 09 '19 07:06 vespakoen

Closing this, I made individual PR's for most of the stuff in here.

vespakoen avatar Nov 10 '22 18:11 vespakoen