andrewray / iocaml

An OCaml kernel for the IPython notebook
MIT License
193 stars 20 forks source link

Problem running example notebooks #31

Closed mardukbp closed 9 years ago

mardukbp commented 9 years ago

If I run iocaml -js min then the notebook iocaml-symbolic-math.ipynb runs without problems, but the notebook iocaml-Vg.ipynb raises the error Unknown directive `require'.

Now, if I run iocaml then the above error does not show up, but both notebooks crash with Unbound module Iocaml.

I already followed the advice of issue #14. I am using ocaml 4.01.

andrewray commented 9 years ago

Sorry, the notebooks in the repository are a bit out of date. I'll try and get them into working order again asap.

Some specific advice; when using javascript based compilation (ie -js <kernel>) if you want to use #require then add the option -serve-jslibs. You may also need to add #use "topfind" to the top of the notebook (or .iocamlinit file).

For the byte code kernel, to access the Iocaml module you will need to add #require "iocaml-kernel.notebook".

Hope that helps (and if not the notebooks should be fixed shortly).

mardukbp commented 9 years ago

Thank you! Adding #require "iocaml-kernel.notebook" to the first cell of both notebooks did it.