Giter Site home page Giter Site logo

Support Emscripten about nbind HOT 5 CLOSED

charto avatar charto commented on May 15, 2024
Support Emscripten

from nbind.

Comments (5)

jjrv avatar jjrv commented on May 15, 2024

Using gyp with Emscripten on Windows seems complicated. A Visual Studio plugin might help: https://github.com/james-allison/vs-tool/tree/VS2013-Support

from nbind.

bsergeev avatar bsergeev commented on May 15, 2024

Yes, gyp on Windows is often troublesome, there are some workarounds posted (although I haven't tried them myself):
https://www.robertkehoe.com/2015/03/fix-node-gyp-rebuild-error-on-windows/

But what this Visual Studio plugin has to do with gyp? Will you be able to replace gyp project with Visual Studio (or, perhaps, CMake) project to build node extensions and/or invoke Emscripten?

BTW, you don't need a VS extension to invoke Emscripten, as it can be easily invoked from a command line/script as a custom build step in Visual Studio.

from nbind.

jjrv avatar jjrv commented on May 15, 2024

node-gyp can generate a Makefile that uses emcc on Windows but neither Microsoft's nmake nor GNU's gnumake was able to run it, so it would be better to configure node-gyp to generate a suitable .sln or patch it afterwards to use emcc. I didn't think that would be possible but will look into it. For Makefiles, it's easy to set CXX in make_global_settings in binding.gyp.

The goal is that nbind users could compile their project to a Node.js or Emscripten module by changing a single setting somewhere, in the same way on Windows, Linux and OS X.

The command npm run test-asm in the feature/emscripten-support branch already works on Linux and runs the same tests (using node-gyp) as the native Node.js addon, but through Emscripten.

from nbind.

jjrv avatar jjrv commented on May 15, 2024

@bsergeev thanks for the hints, I got it working. Only problem is that it always re-compiles everything. I guess it will be up to the Visual Studio user to fix that manually somehow, but nbind is now able to create a basic Emscripten solution that compiles (I'll commit it to feature/emscripten-support soon and then npm run test-asm will also work on Windows).

Now I'll have to fix a bug with callbacks when using the -O2 option in Emscripten, improve documentation and then it's ready for release. Rest of the missing features will go to issue #8.

from nbind.

jjrv avatar jjrv commented on May 15, 2024

Closing this now, the last missing things can be done later.

from nbind.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.