Version française
Home     About     Download     Resources     Contact us    

This site is updated infrequently. For up-to-date information, please visit the new OCaml website at

Browse thread
Toplevel - load cmo from given location
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: 2009-01-09 (14:06)
From: Dawid Toton <dawid.toton@u...>
Subject: Toplevel - load cmo from given location
I've noticed stange behaviour:

The following works OK (using #directory directive):

#!/usr/bin/ocamlrun ocaml
#directory "/home/dt2/Calc1/CalcEngine/src/_build/extlib/"
#load "enum.cmo"
open Enum

But this version not (using the full path directly):

#!/usr/bin/ocamlrun ocaml
#load "/home/dt2/Calc1/CalcEngine/src/_build/extlib/enum.cmo"
open Enum

The problem is that it gives "Unbound module Enum" while no error about 
loading the cmo&cmi is shown.
* if it finds correctly the enum.cmi: why "open Enum" doesn't work?
* if the cmi is not found, why I see no message like "*Cannot find file 
*/home/dt2/Calc1/CalcEngine/src/_build/extlib/enum.cmi*" - as chapter 
9.4 of docs suggests? Does the toplevel check for the cmi in the same 
location as cmo? *
(I tested this with the cmi file existing there as built by ocamlbuild)