The Windows Situation

Windows is now supported

Previous versions either didn't support Windows or required a manual step beforehand. The difficulty of adding Windows support is explained below. Windows compilation with MVCC is supported by automatically creating the necessary supporting libraries.

Support Approach

On Windows, Julia is compiled using gcc in an MSYS2 environment while node-gyp on Windows requires Microsoft Visual Studio. However, a library compiled using gcc on MSYS can be made to work with the binary created by node-gyp if it exports normal C-type symbols.

From .DLL to .LIB

The library needed by node-gyp is a .lib while the library included in the Julia distribution is a .dll. But as described here, a .lib can be created from a .dll using the following steps.

  1. use dumpbin to export symbols from the dll into a file for example:

    dumpbin /exports libjulia.dll > output

  2. transform the output to a .def file by removing the extraneous text and placing EXPORTS at the top of the time as described in detail here

  3. Use lib to create a .lib from the .def.

    lib /def:libjulia.def /out:libjulia.lib /machine:x64

  4. Place libjulia.lib in the same directory as libjulia.dll

Library creation is automatic

Both libjulia.lib and openlibm.lib are created and placed in the same directory as libjulia.dll and openlibm.dll which enables linking to be successful.