That did it! Thank you very much, Gabriel -- my beta-tester is able to install my software package, without having to install the Findlib module.

To summarize, this is what I had to do -- and please correct me if I am mistaken somewhere: First, I compiled CIL and my modules into a directory, with commands (in a Makefile) similar to the following:

$ mkdir mylib
$ export MYLIBDIR=$PWD/mylib
$ cd cil
$ ./configure && make
$ make install-findlib OCAMLFIND_DESTDIR=$MYLIBDIR
$ cd ../myModule
$ OCAMLPATH=$MYLIBDIR ocamlbuild -use-ocamlfind -package cil myModule.cma myModule.cmxs
$ OCAMLFIND_DESTDIR=$MYLIBDIR ocamlfind install myModule META _build/myModule.cma _build/myModule.cmxs

As far as I can tell, these commands compile CIL and dump the compiled files into a directory (here, 'mylib'). Then, these commands also build and compile my own module (here, 'myModule.ml' located in a folder called 'myModule') and dump the compiled files into the same directory, installing it (somehow) into CIL.

Now, to run my installed module, I used the following command:

$ OCAMLFIND_CONF=... OCAMLPATH=$MYLIBDIR CIL_FEATURES=cil.default-features,myModule cil/bin/cilly.byte --help

where OCAMLFIND_CONF is set to the path of the minimal configuration file that contains the following:

path = ""
destdir = ""

I use this format since my code determines the value for OCAMLPATH dynamically.

(Sidenote: Since the interaction with the Cilly driver is done mostly through Python, I used 'os.environ['FOO']' to set the environment variable 'FOO'.)

I hope this helps anyone else who might run into similar problems. Thank you for all of your patience and help, Gabriel!


On 12 October 2013 01:04, Gabriel Kerneis <gabriel@kerneis.info> wrote:
On Fri, Oct 11, 2013 at 07:49:27PM -0700, Jonathan Kotker wrote:
> Fatal error: exception Failure("Config file not found - neither
> /usr/etc/findlib
> .conf nor the directory /usr/etc/findlib.conf.d")

I thought findlib would fail gracefully if there is no findlib.conf file, but
it looks like I was wrong.

> Any idea what might be causing this? This also happens if the environment
> variables are not set.

Try setting OCAMLFIND_CONF to the absolute path of a minimal findlib.conf file.
This file should contain the following two lines:

path = "/absolute/path/to/mylibdir"
destdir = "/absolute/path/to/mylibdir"

It is then not necessary anymore to set OCAMLPATH.  Alternatively, if you prefer
to set OCAMLPATH dynamically, you can probably use:

path = ""
destdir = ""

> Thanks for any help and suggestions, and for all that has been provided so
> far.

I'm really glad of all this feedback.  When you have a working setup, do not
hesitate to post a summary and I'll make sure to include it in the doc for the
release.

Best,
--
Gabriel