With OS X 10.9 before 10.9.4 you need this information.


Today (2013 Sept 25) the command “ocamlmktop -o mytop graphics.cma” produces an error:
File "_none_", line 1:
Error: Error on dynamically loaded library: /usr/local/lib/ocaml/stublibs/dllgraphics.so: dlopen(/usr/local/lib/ocaml/stublibs/dllgraphics.so, 138): Library not loaded: /opt/local/lib/libX11.6.dylib
  Referenced from: /usr/local/lib/ocaml/stublibs/dllgraphics.so
  Reason: image not found
I presume that /opt/local/lib/libX11.6.dylib is needed and not found. There is today a symbolic link /opt/X11/lib/libX11.dylib -> /usr/X11/lib/libX11.6.dylib. Perhaps that is wanted. Here are two workarounds:
Rely on DYLD_LIBRARY_PATH
If your shell is bash (“echo $0” yields “-bash”) then add “/opt/X11/lib” to the shell variable “DYLD_LIBRARY_PATH”. To do this create file .bash_profile in your home directory if it does not exist. If there is no DYLD_LIBRARY_PATH in that file add a new line
export DYLD_LIBRARY_PATH=/opt/X11/lib
Create symbolic link where dyld is looking. (There is no directory /opt/local.)
With suitable sudo prefix I do the shell commands:
mkdir /opt/local
mkdir /opt/local/lib 
ln -s /opt/X11/lib/libX11.6.dylib /opt/local/lib/libX11.6.dylib
Memorandum ln old_name new_name
Now “ocamlmktop -o mytop graphics.cma” does not report an error and the old graphics programs that I tested work.