Skip to content
This repository has been archived by the owner on Nov 17, 2023. It is now read-only.

Doc Final #26

Merged
merged 3 commits into from
Aug 23, 2015
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 1 addition & 15 deletions doc/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -158,32 +158,18 @@ def run_doxygen(folder):
except OSError as e:
sys.stderr.write("doxygen execution failed: %s" % e)

def run_build_mxnet(folder):
"""Run the doxygen make command in the designated folder."""
try:
subprocess.call('cd ..; rm -rf dmlc-core;' +
'git clone https://github.com/dmlc/dmlc-core')
subprocess.call('cd ..; rm -rf mshadow;' +
'git clone https://github.com/dmlc/mshadow')
subprocess.call('cd ..; cp/make/readthedocs.mk config.mk')
retcode = subprocess.call("cd %s; make" % folder, shell=True)
if retcode < 0:
sys.stderr.write("build terminated by signal %s" % (-retcode))
except OSError as e:
sys.stderr.write("build execution failed: %s" % e)

def generate_doxygen_xml(app):
"""Run the doxygen make commands if we're on the ReadTheDocs server"""
read_the_docs_build = os.environ.get('READTHEDOCS', None) == 'True'
if read_the_docs_build:
run_doxygen('..')
run_build_mxnet('..')
sys.stderr.write('The Lib path: %s\n' % str(os.listdir('../lib')))

def setup(app):
# Add hook for building doxygen xml when needed
# no c++ API for now
# app.connect("builder-inited", generate_doxygen_xml)
app.connect("builder-inited", generate_doxygen_xml)
app.add_config_value('recommonmark_config', {
'url_resolver': lambda url: github_doc_root + url,
}, True)
Expand Down
21 changes: 17 additions & 4 deletions doc/sphinx_util.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,26 @@
import docutils
import subprocess


def run_build_mxnet(folder):
"""Run the doxygen make command in the designated folder."""
try:
subprocess.call('cd ..; rm -rf dmlc-core;' +
'git clone https://github.com/dmlc/dmlc-core', shell = True)
subprocess.call('cd ..; rm -rf mshadow;' +
'git clone https://github.com/dmlc/mshadow', shell = True)
subprocess.call('cd ..; cp make/readthedocs.mk config.mk', shell = True)
retcode = subprocess.call("cd %s; make" % folder, shell = True)
if retcode < 0:
sys.stderr.write("build terminated by signal %s" % (-retcode))
except OSError as e:
sys.stderr.write("build execution failed: %s" % e)

if os.environ.get('READTHEDOCS', None) == 'True':
subprocess.call('cd ..; rm -rf recommonmark;' +
'git clone https://github.com/tqchen/recommonmark', shell=True)
'git clone https://github.com/tqchen/recommonmark', shell = True)

if os.path.exists("../lib/libmxnet.so") == False:
subprocess.call('cd ..; cp make/readthedocs.mk ./config.mk;', shell = True)
subprocess.call('cd ..; sh ./scripts/build_dmlc.sh; make clean; make;', shell = True)
run_build_mxnet("..")
sys.path.insert(0, os.path.abspath('../recommonmark/'))


Expand Down