YGREK
Thank you for your quick response.
You can use the -init option to specify the ocamlinit file explicitly.
%ocaml -init ~/.ocamlinit works
Maybe ocaml is some kind of (wrong) alias in your shell?
no ocaml alias
Try strace -f -ttT -e to open $ (which is ocaml) to see where it is looking for ocamlinit
%strace -f -ttT -e open $(which ocaml) 19:12:28.484440 open("/etc/ld.so.cache", O_RDONLY) = 3 <0.000179> 19:12:28.485002 open("/lib/libm.so.6", O_RDONLY) = 3 <0.000062> 19:12:28.485384 open("/lib/libdl.so.2", O_RDONLY) = 3 <0.000062> 19:12:28.485744 open("/lib/libncursesw.so.5", O_RDONLY) = 3 <0.000061> 19:12:28.486107 open("/lib/libpthread.so.0", O_RDONLY) = 3 <0.000061> 19:12:28.486514 open("/lib/libc.so.6", O_RDONLY) = 3 <0.000060> 19:12:28.488228 open("/usr/bin/ocamlrun", O_RDONLY|O_LARGEFILE) = 3 <0.000018> 19:12:28.488425 open("/usr/bin/ocaml", O_RDONLY|O_LARGEFILE) = 3 <0.000166> 19:12:28.496499 open("/usr/lib/ocaml/ld.conf", O_RDONLY|O_LARGEFILE) = 4 <0.000028> 19:12:28.502249 open("/usr/bin/ocaml", O_RDONLY|O_LARGEFILE) = 3 <0.000021> 19:12:28.506085 open("/usr/lib/ocaml/ld.conf", O_RDONLY|O_LARGEFILE) = 4 <0.000029> 19:12:28.506880 open("/usr/lib/locale/locale-archive", O_RDONLY|O_LARGEFILE) = 3 <0.000020> Objective Caml version 3.12.1 19:12:28.507797 open("/usr/lib/ocaml/pervasives.cmi", O_RDONLY|O_LARGEFILE) = 3 <0.000019> 19:12:28.511012 open(".ocamlinit", O_RDONLY|O_LARGEFILE) = 3 <0.000018> 19:12:28.511325 open("money.ml", O_RDONLY|O_LARGEFILE) = 4 <0.000020> 19:12:28.513412 open("/usr/lib/ocaml/list.cmi", O_RDONLY|O_LARGEFILE) = 5 <0.000018> 19:12:28.514858 open("/usr/lib/ocaml/printf.cmi", O_RDONLY|O_LARGEFILE) = 5 <0.000020> 19:12:28.527847 open("/usr/lib/ocaml/sys.cmi", O_RDONLY|O_LARGEFILE) = 5 <0.000029>
The reason is that there is a .ocamlinit file in the current directory. therefore ocaml uses it instead of ~/.ocamlinit .
thanks!
source share