diff --git a/doc/conf.py b/doc/conf.py index 186759119c2e..76d680f22382 100644 --- a/doc/conf.py +++ b/doc/conf.py @@ -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) diff --git a/doc/sphinx_util.py b/doc/sphinx_util.py index 917ef3f68ddb..10ed6fddbe46 100644 --- a/doc/sphinx_util.py +++ b/doc/sphinx_util.py @@ -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/'))