Hi!

I'm working on creating node.js bindings for iotivity. I've gotten my
head around building a simple node.js C++ addon, and I've successfully
built iotivity complete with C++ API on my x86_64 laptop. Now I have
to figure out how to link to iotvitiy from the node.js binary addon.
I've thought of several options:

1. Document that, in order to install the node.js bindings, one needs
to build iotivity according to the instructions on the Web site, and
then run npm install in an environment that contains CFLAGS and
LDFLAGS for iotivity. So, something like:
IOTIVITY_CFLAGS='-I/home/user/iotvity/???'
IOTIVITY_LDFLAGS='-L/home/user/iotivity/out/linux/x86_64/release' npm
install iotivity
Notice that I'm still a little hazy on the include path for the header files.

Pros: Very little work on my part.
Cons: Not really the npm way. The npm way is to just run npm install
iotivity and It Just Works?.

2. Download iotivity source as part of npm install of the node.js
bindings and build.

Pros: This is how it's done in the npm world.
Cons: Many:
- Needs scons to build
- Depends on boost, which may or may not be present on the system

To this end, and being quite unfamiliar with the iotivity code, I have
to ask: There's supposed to be a C API for iotivity, at least
according to the programmer's guide[0], but I can't find any
references for it. Does the C API depend on boost too? I would think
not. So, for node.js bindings, would it simplify the process of
building iotivity and then linking to it from the node.js bindings if
I were to forego building the iotivity C++ API?

3. Download an iotivity binary tarball which provides the shared
libraries and header files and link to that as part of npm install
Pros: This is how it's done in the npm world
Cons: I would either have to distribute binary copies of iotivity for
platforms where it is likely to run, or I would have to request that
you make available binary tarballs of iotivity for likely platforms so
I can download such binary tarballs and link to them from the node.js
bindings install script.

Can you please advise me as to which approach you think would be most
worth pursuing? Can you think of a better way than the ones I've
described here?

TIA for your help,



Gabriel

[0] https://www.iotivity.org/documentation/linux/programmers-guide

Reply via email to