<div dir="ltr">With Nat&#39;s help I have managed to get it working by modifying build_docs.sh by replacing LD_LIBRARY_PATH with DYLD_LIBRARY_PATH (needed for mac os x), and added the line export LIBTBX_BUILD=/path/to/cctbx/build/. Is there a way to tell sphinx-build to use the cctbx.python without editing the sphinx-build file?<div>


<br></div><div>A couple of comments based on a successful run of documentation build:</div><div><br></div><div>1) It seems that sphinx tries to import absolutely every import command it finds in the files - in the cctbx there are a lot of conditional imports that depend on certain external packages being present. Therefore it seems that unless I have absolutely every package installed and build every module, then I will end up with a huge number of tracebacks in the output from sphinx. I am not sure if there is anything that can be done about this.</div>


<div><br></div><div>2) Is there a way to tell sphinx not to look at certain files? I don&#39;t claim to understand how the libtbx_refresh.py modules work, but sphinx tries to import them, and unsurprisingly fails.</div><div>

<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 13:37, James Stroud <span dir="ltr">&lt;<a href="mailto:xtald00d@gmail.com" target="_blank">xtald00d@gmail.com</a>&gt;</span> wrote:<br>

<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div style="word-wrap:break-word"><div class="im"><div>On Apr 19, 2013, at 2:09 PM, Richard Gildea wrote:</div></div><div>

<div><div><div><div class="im"><br><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><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 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 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 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 face="Monaco">#! /path/to/cctbx.python</font></div></blockquote><div><br></div><div>That line shouldn&#39;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 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 face="Monaco">/path/to/cctbx.python setup.py build</font></div><div><font 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>

<span class="HOEnZb"><font color="#888888"><div><br></div><div>James</div><div><br></div></font></span></div><div><div class="h5"><div><br></div><br><blockquote type="cite"><div dir="ltr"><div><div>Install sphinx:</div><div>

  <a href="http://sphinx-doc.org/latest/install.html#mac-os-x-install-sphinx-using-macports" target="_blank">http://sphinx-doc.org/latest/install.html#mac-os-x-install-sphinx-using-macports</a></div>

<div>  sudo port install py27-sphinx</div><div>  sudo port select --set python python27</div><div><br></div></div><div>This is the output I get on running ./build_docs.sh:</div><div><br></div><div><div>
sphinx-build -b coverage -d _build/doctrees -D latex_paper_size=a4  . _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):                                                                                                                                                          </div>



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



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



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



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



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



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



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



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



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



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



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



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



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

<div><br></div><div>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>Am Donnerstag 18 April 2013 19:16:00 schrieben Sie:<br>
&gt; Hi Jan,<br>
<br>
Hi Richard,<br>
<br>
</div><div>&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&#39;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>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&#39;m using 1.1.3 regularly and get useful<br>
documentation (I&#39;ve attached the &quot;makescript&quot; 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>&gt; As a novice to using sphinx, I don&#39;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>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&#39;t hit &quot;reply all&quot;.<br>
<br>_______________________________________________<br>
cctbxbb mailing list<br>
<a href="mailto:cctbxbb@phenix-online.org" target="_blank">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" target="_blank">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>

</blockquote></div></div></div><br></div></div></div></div><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>