[erlang-questions] otp modules dependencies

Edwin Fine <>
Tue May 27 23:59:29 CEST 2008


I'm not sure how you installed Erlang without installing the libraries. Are
you sure they are not there? If you are running on Linux, look in
/usr/local/lib/erlang/lib or maybe /usr/lib/erlang/lib and you should see
many modules, including xmerl-X.Y.Z. Sometimes when you download software
you need to compile, a module has -include_lib("xmerl.hrl"), or even
specifies the version in the include, and the Makefile defines a compiler
include path to a different version (e.g. xmerl-1.1.8). I had to change one
of Yaws 1.75 source files due to an include of a version-specific OTP

Anyway, this would make the compile command fail, e.g.

$ cat > test.erl

$ erlc -W test.erl
./test.erl:2: can't find include lib "xmerl.hrl"

But adding the correct -I fixes it:

$ erlc -I /usr/local/lib/erlang/lib/xmerl-1.1.8/include/ -W test.erl

As for run-time dependencies, you can find this out using the xref

7> xref:start(s).
8> xref:add_release(s, "/usr/local/lib/erlang/lib/xmerl-1.1.8", {name,
xmerl: 2 unresolved calls
xmerl_b64Bin: 2 unresolved calls
xmerl_eventp: 3 unresolved calls
xmerl_lib: 8 unresolved calls
xmerl_scan: 128 unresolved calls
xmerl_validate: 3 unresolved calls
xmerl_xpath: 2 unresolved calls
xmerl_xpath_parse: 2 unresolved calls
xmerl_xpath_pred: 4 unresolved calls
xmerl_xsd: 10 unresolved calls
9> xref:set_library_path(s, code_path).
10> xref:analyze(s, {module_call,xmerl}).
11> xref:analyze(s,
12> xref:analyze(s, {module_call,xmerl_ucs}).
13> xref:analyze(s, {module_call,io}).
14> xref:analyze(s, {module_call,lists}).
15> xref:analyze(s, {module_call,erlang}).

Hopefully I have done this right. It looks as if xmerl depends on erlang,
lists, itself, and xmerl_lib, and xmerl_lib depends on xmerl_ucs and io. I
could have done the above by writing a function but I was too lazy. I am
sure there's a better way to figure this out, I just don't know it, being
new to Erlang. My feeling  is that if the libraries that come with the
standard Erlang distribution really are not installed, install them because
you will almost certainly need many if not most of them at some point.


2008/5/27 mark peleus <>:

> Hi,
> I have erlang installed (not otp) but I need a package from the otp, xmerl
> for example.
> If erlang and the otp are from the same version, I guess I can just copy
> xmerl ebing folder to my erlang installation directory
> and modify the path in the erlang start script.
> How do I know if a package, xmerl in this case, is dependent on other
> packages?
> Thanks
> _______________________________________________
> erlang-questions mailing list
> http://www.erlang.org/mailman/listinfo/erlang-questions
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20080527/f5fca057/attachment.html>

More information about the erlang-questions mailing list