- I decided to compile
inchi-1binary (by exposing its
mainfunction) not the library, because, according to readme file in InChI distribution package, the binary 'does extensively check the input data and does provide diagnostic concerning input structure' so it's the only tool that can be used as an InChi generator with 100% guarantee of having correct results for all input files.
- I used '-O2 -s ASM_JS=1' flags to optimize speed.
inchi-1binary is about 1.1 MB large so this sounds reasonable.
Of course there are some drawbacks of my approach - the most obvious one is IO.
inchi-1is command line tool expecting a file or plain text as input and printing some text to
inchimain.cfile (this should be exported instead of
Control-Shift-Jon Chrome), then type (as two separate commands, pressing Enter after each one):
bla = Module.cwrap('process_single_input', 'string', 'string')
M END) hit
OK. Then select a checkbox suppressing all further popups and press
OK. If you entered all mol file lines correctly you will see the result!