<html><head></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><div>On Apr 19, 2013, at 2:09 PM, Richard Gildea wrote:</div><div><div><div><div><br class="Apple-interchange-newline"><blockquote type="cite"><div dir="ltr">Hi Jan,<div><br></div><div>I think the cause of the incomplete documentation is down to the fact that when I run build_docs.sh I get a whole bunch of import errors for every compiled module that it tries to import. I am at a bit of a loss as to why this should be the case, as running the tests or importing modules at the command line works just fine. I have built cctbx using the system python (2.7.2) on mac os x (mountain lion).</div></div></blockquote><div><br></div><div>It looks like sphinx-build is not using cctbx.python, so it has no idea from where to import the python modules. Try this<div><br></div><blockquote class="webkit-indent-blockquote" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 40px; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; "><div><font class="Apple-style-span" face="Monaco">% your-favorite-editor `which sphinx-build`</font></div></blockquote><div><br></div><div>And change the first line to something like</div><div><br></div><blockquote class="webkit-indent-blockquote" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 40px; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; "><div><font class="Apple-style-span" face="Monaco">#! /path/to/cctbx.python</font></div></blockquote><div><br></div><div>That line shouldn't point to the python that cctbx.python calls (i.e. the system python).</div><div><br></div><div>This assumes you did the following when you installed sphinx:</div><div><br></div><blockquote class="webkit-indent-blockquote" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 40px; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; "><div><font class="Apple-style-span" face="Monaco">/path/to/cctbx.python setup.py build</font></div><div><font class="Apple-style-span" face="Monaco">/path/to/cctbx.python setup.py install</font></div></blockquote><div><br></div><div>(or at least used the python called by cctbx.python in these two steps).</div><div><br></div><div>James</div><div><br></div></div><div><br></div><br><blockquote type="cite"><div dir="ltr"><div><div>Install sphinx:</div><div>&nbsp; <a href="http://sphinx-doc.org/latest/install.html#mac-os-x-install-sphinx-using-macports">http://sphinx-doc.org/latest/install.html#mac-os-x-install-sphinx-using-macports</a></div>

<div>&nbsp; sudo port install py27-sphinx</div><div>&nbsp; sudo port select --set python python27</div><div><br></div></div><div style="">This is the output I get on running ./build_docs.sh:</div><div style=""><br></div><div style=""><div>
sphinx-build -b coverage -d _build/doctrees -D latex_paper_size=a4 &nbsp;. _build/coverage</div>
<div>Running Sphinx v1.1.3</div><div>loading pickled environment... not yet created</div><div>building [coverage]: coverage overview</div><div>updating environment: 129 added, 0 changed, 0 removed</div><div>Traceback (most recent call last): &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;</div>

<div>&nbsp; File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/sphinx/ext/autodoc.py", line 321, in import_object</div><div>&nbsp; &nbsp; __import__(self.modname)</div><div>&nbsp; File "/Users/rjgildea/cctbx/sources/cctbx_project/cctbx/adptbx.py", line 2, in &lt;module&gt;</div>

<div>&nbsp; &nbsp; from cctbx.array_family import flex # for tuple mappings</div><div>&nbsp; File "/Users/rjgildea/cctbx/sources/cctbx_project/cctbx/array_family/flex.py", line 2, in &lt;module&gt;</div><div>&nbsp; &nbsp; import scitbx.array_family.flex</div>

<div>&nbsp; File "/Users/rjgildea/cctbx/sources/cctbx_project/scitbx/array_family/flex.py", line 2, in &lt;module&gt;</div><div>&nbsp; &nbsp; import boost.optional # import dependency</div><div>&nbsp; File "/Users/rjgildea/cctbx/sources/cctbx_project/boost_adaptbx/boost/optional.py", line 2, in &lt;module&gt;</div>

<div>&nbsp; &nbsp; import boost.python</div><div>&nbsp; File "/Users/rjgildea/cctbx/sources/cctbx_project/boost_adaptbx/boost/python.py", line 57, in &lt;module&gt;</div><div>&nbsp; &nbsp; ext = import_ext("boost_python_meta_ext")</div>

<div>&nbsp; File "/Users/rjgildea/cctbx/sources/cctbx_project/boost_adaptbx/boost/python.py", line 36, in import_ext</div><div>&nbsp; &nbsp; + [" &nbsp;"+p for p in sys.path]))</div><div>ImportError: __import__("boost_python_meta_ext"): dlopen(/Users/rjgildea/cctbx/system_python_build/lib/boost_python_meta_ext.so, 2): Library not loaded: lib/libboost_python.dylib</div>

<div>&nbsp; Referenced from: /Users/rjgildea/cctbx/system_python_build/lib/boost_python_meta_ext.so</div><div>&nbsp; Reason: image not found</div><div>&nbsp; sys.path:</div><div>&nbsp; &nbsp; /Users/rjgildea/cctbx/sources/cctbx_project</div><div>

&nbsp; &nbsp; /Users/rjgildea/cctbx/sources</div><div>&nbsp; &nbsp; /Users/rjgildea/cctbx/sources/cctbx_project/clipper_adaptbx</div><div>&nbsp; &nbsp; /Users/rjgildea/cctbx/sources/cctbx_project/boost_adaptbx</div><div>&nbsp; &nbsp; /Users/rjgildea/cctbx/sources/cctbx_project/libtbx/pythonpath</div>

<div>&nbsp; &nbsp; /Users/rjgildea/cctbx/system_python_build/lib</div><div>&nbsp; &nbsp; /Users/rjgildea/cctbx/system_python_build/bin</div><div>&nbsp; &nbsp; /opt/local/Library/Frameworks/Python.framework/Versions/2.7/bin</div><div>&nbsp; &nbsp; /Library/Python/2.7/site-packages/docutils-0.10-py2.7.egg</div>

<div>&nbsp; &nbsp; /Library/Python/2.7/site-packages/Jinja2-2.6-py2.7.egg</div><div>&nbsp; &nbsp; /Library/Python/2.7/site-packages/Pygments-1.6-py2.7.egg</div><div>&nbsp; &nbsp; /opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python27.zip</div>

<div>&nbsp; &nbsp; /opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7</div><div>&nbsp; &nbsp; /opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/plat-darwin</div><div>&nbsp; &nbsp; /opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/plat-mac</div>

<div>&nbsp; &nbsp; /opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/plat-mac/lib-scriptpackages</div><div>&nbsp; &nbsp; /opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-tk</div><div>&nbsp; &nbsp; /opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-old</div>

<div>&nbsp; &nbsp; /opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-dynload</div><div>&nbsp; &nbsp; /opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages</div><div>&nbsp; &nbsp; /opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/setuptools-0.6c11-py2.7.egg-info</div>

<div>&nbsp; &nbsp; /Library/Python/2.7/site-packages</div><div><br></div><div style="">etc.</div><div style=""><br></div></div><div style="">Do you have any idea what I am might be doing wrong here?</div><div style=""><br></div><div style="">Cheers,</div>

<div style=""><br></div><div style="">Richard</div></div><div class="gmail_extra"><br><br><div class="gmail_quote">On 19 April 2013 05:10, Jan Marten Simons <span dir="ltr">&lt;<a href="mailto:marten@xtal.rwth-aachen.de" target="_blank">marten@xtal.rwth-aachen.de</a>&gt;</span> wrote:<br>

<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="im">Am Donnerstag 18 April 2013 19:16:00 schrieben Sie:<br>
&gt; Hi Jan,<br>
<br>
Hi Richard,<br>
<br>
</div><div class="im">&gt; I have attempted to build the sphinx documentation using<br>
&gt; dox.sphinx/build_docs.sh, and this appears to have run successfully and<br>
&gt; produced some html which shows the table of contents etc. However, I can't<br>
&gt; seem to find the documentation for any of the significant modules, e.g.<br>
&gt; cctbx/xray/structure.py. When I navigate to the link for the structure<br>
&gt; module within the xray package<br>
&gt; (dox.sphinx/_build/html/cctbx/cctbx.xray.html#structure-module), I see<br>
&gt; nothing other than a list of all the modules within the xray package. Am I<br>
&gt; missing something here?<br>
<br>
</div><div class="im">Have you followed the instructions given in the comments at the top of<br>
dox.sphinx/build_docs.sh?<br>
<br>
Which version of Sphinx do you use? I'm using 1.1.3 regularly and get useful<br>
documentation (I've attached the "makescript" I use to build cctbx and the<br>
sphinx documentation. If you are interested in it I can also put the output of<br>
the sphinx run on my system with current svn on webserver over here.). Has<br>
your sphinx build completed successfully or did it abort (e.g. due to out of<br>
memory* or due to other problems)?<br>
Could you also check if build/dox.sphinx/cctbx/cctbx.xray.rst has all modules<br>
listed?<br>
<br>
</div><div class="im">&gt; As a novice to using sphinx, I don't like to add significant documentation<br>
&gt; in sphinx style without being able to check via generating the<br>
&gt; documentation that what I have written is correct sphinx-speak.<br>
</div><div class="im">I can totally understand this ;).<br>
<br>
Cheers and hopefully we can get this working for you as well,<br>
Jan<br>
<br>
*) For me running sphinx with all those modules selected needs about 3.3 GiB<br>
of virtual memory (RAM) and takes a few minutes to actually finish.<br>
<br>
</div>p.s.: Sorry didn't hit "reply all".<br>
<br>_______________________________________________<br>
cctbxbb mailing list<br>
<a href="mailto:cctbxbb@phenix-online.org">cctbxbb@phenix-online.org</a><br>
<a href="http://phenix-online.org/mailman/listinfo/cctbxbb" target="_blank">http://phenix-online.org/mailman/listinfo/cctbxbb</a><br>
<br></blockquote></div><br></div>
_______________________________________________<br>cctbxbb mailing list<br><a href="mailto:cctbxbb@phenix-online.org">cctbxbb@phenix-online.org</a><br>http://phenix-online.org/mailman/listinfo/cctbxbb<br></blockquote></div><br></div></div></div></body></html>