[erlang-bugs] R15B01 'make install_docs' failure "escript: exception error: undefined function xmerl:export_simple/2"

Barry Hawkins <>
Fri Jun 15 16:52:13 CEST 2012


Summary: A local build and install from source for Erlang R15B01 succeeds,
'make docs' succeeds, but the subsequent 'make install-docs' fails.
Release: R15B01
Operating System: Mac OS X Lion 10.7.4

Steps to Reproduce:
$ curl -O http://www.erlang.org/download/otp_src_R15B01.tar.gz
$ tar xzvf otp_src_R15B01.tar.gz
$ cd otp_src_R15B01

Per instructions at
http://www.erlang.org/doc/installation_guide/INSTALL.html#Building-a-fast-Erlang-VM-on-Mac-OS-Lioninstall
MacPorts GCC 4.5.

$ sudo port install gcc45 +universal

Install wxWidgets 2.8.12 and FOP 1.0 from MacPorts to satisfy dependencies.

$ sudo port install wxwidgets
$ which wx-config
/opt/local/bin/wx-config

$ sudo port install fop
$ which fop
/opt/local/bin/fop

otp_src_R15B01 barryh$ PATH=/usr/local/bin:$PATH
CC=/opt/local/bin/gcc-mp-4.5 CXX=/opt/local/bin/g++-mp-4.5 ./configure
--enable-m32-build --prefix=$HOME
otp_src_R15B01 barryh$ make install
otp_src_R15B01 barryh$ which erl
/Users/barryh/bin/erl

With a successful installation of the system, proceeding to install the
documentation per instructions at
http://www.erlang.org/doc/installation_guide/INSTALL.html#The-ErlangOTP-Documentation_How-to-Build-the-Documentation

otp_src_R15B01 barryh$ export PATH=$HOME/lib/erlang/bin:$PATH
otp_src_R15B01 barryh$ echo $PATH
/Users/barryh/lib/erlang/bin:/Users/barryh/bin:/opt/local/bin:/opt/local/sbin:/Users/barryh/play-2.0.1:/Users/barryh/scala/bin:/Library/Frameworks/Python.framework/Versions/3.2/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/X11/bin
otp_src_R15B01 barryh$ export FOP_OPTS="-Xmx8192m"
otp_src_R15B01 barryh$ make docs
otp_src_R15B01 barryh$ make install-docs
ERL_TOP=/Users/barryh/otp_src_R15B01 INSTALLROOT=/Users/barryh/lib/erlang
PATH=/Users/barryh/otp_src_R15B01/bootstrap/bin:${PATH} \
 make RELEASE_ROOT=/Users/barryh/lib/erlang release_docs
PATH=/Users/barryh/otp_src_R15B01/bin:${PATH} escript
/Users/barryh/otp_src_R15B01/lib/erl_docgen/priv/bin/xref_mod_app.escript
-topdir /Users/barryh/otp_src_R15B01 -outfile
/Users/barryh/otp_src_R15B01/make/i386-apple-darwin11.4.0/mod2app.xml
escript: exception error: undefined function xmerl:export_simple/2
  in function  erl_eval:do_apply/6 (erl_eval.erl, line 572)
  in call from erl_eval:expr/5 (erl_eval.erl, line 367)
  in call from erl_eval:exprs/5 (erl_eval.erl, line 118)
  in call from erl_eval:local_func/5 (erl_eval.erl, line 470)
  in call from escript:interpret/4 (escript.erl, line 754)
  in call from escript:start/1 (escript.erl, line 277)
  in call from init:start_it/1
make[1]: *** [mod2app] Error 127
make: *** [install-docs] Error 2

Comments:
After some searching, it seems a similar issue has been encountered before.
In particular, there were some reports following the release of R14B02 in
March 2011, with commentary confirming the behavior on Ubuntu, CentOS, and
Mac OS X. Here are links to the start of the related threads, one in
erlang-questions and the other in erlang-bugs:

http://erlang.org/pipermail/erlang-questions/2011-March/057024.html
http://erlang.org/pipermail/erlang-bugs/2011-March/002247.html

I confirmed the presence of xmerl-X.X.X in the installation's lib directory:

$ ls -Fla /Users/barryh/lib/erlang/lib/xmerl-1.3.1/
total 0
drwxr-xr-x   5 barryh  staff   170 Jun 14 13:18 ./
drwxr-xr-x  58 barryh  staff  1972 Jun 14 13:18 ../
drwxr-xr-x  37 barryh  staff  1258 Jun 14 13:18 ebin/
drwxr-xr-x   5 barryh  staff   170 Jun 14 13:18 include/
drwxr-xr-x  42 barryh  staff  1428 Jun 14 13:18 src/

I also confirmed that the xmerl module could be loaded in my shell using a
small example from
http://stackoverflow.com/questions/1227241/building-an-xmerl-document-in-erlang
.

> Data = {myNode,[{foo,"Foo"},{bar,"Bar"}], []}.
{myNode,[{foo,"Foo"},{bar,"Bar"}],[]}
> lists:flatten(xmerl:export_simple([Data], xmerl_xml)).
"<?xml version=\"1.0\"?><myNode foo=\"Foo\" bar=\"Bar\"/>"
> m().
Module                File
application
/Users/barryh/lib/erlang/lib/kernel-2.15.1/ebin/application.beam
...
xmerl
/Users/barryh/lib/erlang/lib/xmerl-1.3.1/ebin/xmerl.beam
xmerl_lib
/Users/barryh/lib/erlang/lib/xmerl-1.3.1/ebin/xmerl_lib.beam
xmerl_xml
/Users/barryh/lib/erlang/lib/xmerl-1.3.1/ebin/xmerl_xml.beam
...

I tried changing "#!/usr/bin/env escript" to "#!/Users/barryh/bin/escript"
as mentioned in
http://erlang.org/pipermail/erlang-questions/2011-March/057072.html, but
the behavior remained the same.

I also tried adding the source's bin directory to $PATH instead of the
installed system's bin directory, but the behavior did not change:

otp_src_R15B01 barryh$ export PATH=/Users/barryh/otp_src_R15B01/bin:$PATH
otp_src_R15B01 barryh$ echo $PATH
/Users/barryh/otp_src_R15B01/bin:/Users/barryh/bin:/opt/local/bin:/opt/local/sbin:/Users/barryh/play-2.0.1:/Users/barryh/scala/bin:/Library/Frameworks/Python.framework/Versions/3.2/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/X11/bin
otp_src_R15B01 barryh$ make install-docs
ERL_TOP=/Users/barryh/otp_src_R15B01 INSTALLROOT=/Users/barryh/lib/erlang
PATH=/Users/barryh/otp_src_R15B01/bootstrap/bin:${PATH} \
make RELEASE_ROOT=/Users/barryh/lib/erlang release_docs
PATH=/Users/barryh/otp_src_R15B01/bin:${PATH} escript
/Users/barryh/otp_src_R15B01/lib/erl_docgen/priv/bin/xref_mod_app.escript
-topdir /Users/barryh/otp_src_R15B01 -outfile
/Users/barryh/otp_src_R15B01/make/i386-apple-darwin11.4.0/mod2app.xml
escript: exception error: undefined function xmerl:export_simple/2
  in function  erl_eval:do_apply/6 (erl_eval.erl, line 572)
  in call from erl_eval:expr/5 (erl_eval.erl, line 367)
  in call from erl_eval:exprs/5 (erl_eval.erl, line 118)
  in call from erl_eval:local_func/5 (erl_eval.erl, line 470)
  in call from escript:interpret/4 (escript.erl, line 754)
  in call from escript:start/1 (escript.erl, line 277)
  in call from init:start_it/1
make[1]: *** [mod2app] Error 127
make: *** [install-docs] Error 2

Thanks in advance for any insight one may be able to provide, and apologies
if I have overlooked some issue.

Regards,
-- 
Barry Hawkins
twitter: @barryhawkins
blog: http://barryhawkins.com/blog/
linkedin: http://www.linkedin.com/in/barryhawkins
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-bugs/attachments/20120615/2e4f2baf/attachment.html>


More information about the erlang-bugs mailing list