On Tue, Oct 08, 2013 at 10:48:36PM -0700, Jonathan Kotker wrote:
> I have another question regarding the new system of CIL plugins. Prior to
> the current system, all I would have to do is distribute a compiled Cilly
> driver (with the license, of course), with my plugins as part of the
> compilation. Would it be possible to do so in the current system? It seems
> as though the user has to install the extra dependency of Findlib now,
> which I would like (as much as possible) to not have.

Findlib is needed only to compile cilly; libraries are linked statically in
OCaml.  You should be able to distribute cilly.{byte,native} on the one hand,
and your plugin.{cma,cmxs} on the other hand.

Then comes the question of where to install your plugins (as well as the default
CIL plugins if you wish to use them) so that cilly can find them.  Fortunately
enough, those can be put in any directory following the findlib structure,
and then setting environment variables to indicate their location to cilly:
http://projects.camlcity.org/projects/dl/findlib-1.4/doc/ref-html/r775.html

For instance:
$ git clone https://github.com/kerneis/cil
$ git clone https://gist.github.com/6353215.git countCalls
$ mkdir mylib
$ export MYLIBDIR=$PWD/mylib
$ cd cil
$ ./configure && make
$ make install-findlib OCAMLFIND_DESTDIR=$MYLIBDIR
$ cd ../countCalls
$ OCAMLPATH=$MYLIBDIR ocamlbuild -use-ocamlfind -package cil countCalls.cma 
countCalls.cmxs
$ OCAMLFIND_DESTDIR=$MYLIBDIR ocamlfind install countCalls META 
_build/countCalls.cma _build/countCalls.cmxs
$ OCAMLPATH=$MYLIBDIR CIL_FEATURES=cil.default-features,countCalls 
cil/bin/cilly.byte --help

You can then simply distribute the mylib directory with cilly.

Let me know if this works for you.

(If you use the bin/cilly perl wrapper, more tweaking might be necessary.)

Best regards,
-- 
Gabriel

------------------------------------------------------------------------------
October Webinars: Code for Performance
Free Intel webinars can help you accelerate application performance.
Explore tips for MPI, OpenMP, advanced profiling, and more. Get the most from 
the latest Intel processors and coprocessors. See abstracts and register >
http://pubads.g.doubleclick.net/gampad/clk?id=60134071&iu=/4140/ostg.clktrk
_______________________________________________
CIL-users mailing list
CIL-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/cil-users

Reply via email to