[erlang-questions] otp modules dependencies

Edwin Fine erlang-questions_efine@REDACTED
Tue May 27 23:59:29 CEST 2008


Mark,

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
module.

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

$ cat > test.erl
-module(test).
-include_lib("xmerl.hrl").
^D

$ 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
application.

7> xref:start(s).
{ok,<0.41.0>}
8> xref:add_release(s, "/usr/local/lib/erlang/lib/xmerl-1.1.8", {name,
xmerl}).
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
{ok,xmerl}
9> xref:set_library_path(s, code_path).
ok
10> xref:analyze(s, {module_call,xmerl}).
{ok,['$M_EXPR',erlang,lists,xmerl,xmerl_lib]}
11> xref:analyze(s,
{module_call,xmerl_lib}).
{ok,['$M_EXPR',lists,xmerl_lib,xmerl_ucs]}
12> xref:analyze(s, {module_call,xmerl_ucs}).
{ok,[io,lists,xmerl_ucs]}
13> xref:analyze(s, {module_call,io}).
{ok,[]}
14> xref:analyze(s, {module_call,lists}).
{ok,[]}
15> xref:analyze(s, {module_call,erlang}).
{ok,[]}

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.

HTH



2008/5/27 mark peleus <mark.peleus@REDACTED>:

> 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
> erlang-questions@REDACTED
> 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.htm>


More information about the erlang-questions mailing list