From a726baee1dc762d48ac47f244313e713ebf606fc Mon Sep 17 00:00:00 2001 From: Bing Xu Date: Sat, 22 Aug 2015 21:41:41 -0600 Subject: [PATCH 1/3] fix docs --- doc/conf.py | 8 ++++---- doc/sphinx_util.py | 3 --- 2 files changed, 4 insertions(+), 7 deletions(-) diff --git a/doc/conf.py b/doc/conf.py index 186759119c2e..c1725a6fd708 100644 --- a/doc/conf.py +++ b/doc/conf.py @@ -162,10 +162,10 @@ 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') + 'git clone https://github.com/dmlc/dmlc-core', shell = True) subprocess.call('cd ..; rm -rf mshadow;' + - 'git clone https://github.com/dmlc/mshadow') - subprocess.call('cd ..; cp/make/readthedocs.mk config.mk') + '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)) @@ -183,7 +183,7 @@ def generate_doxygen_xml(app): 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..c5bfc657c92c 100644 --- a/doc/sphinx_util.py +++ b/doc/sphinx_util.py @@ -9,9 +9,6 @@ subprocess.call('cd ..; rm -rf recommonmark;' + '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) sys.path.insert(0, os.path.abspath('../recommonmark/')) From 6cf4929e77baee768f2938be30d909e251873578 Mon Sep 17 00:00:00 2001 From: Bing Xu Date: Sat, 22 Aug 2015 21:51:21 -0600 Subject: [PATCH 2/3] fix doc --- doc/conf.py | 14 -------------- doc/sphinx_util.py | 18 +++++++++++++++++- 2 files changed, 17 insertions(+), 15 deletions(-) diff --git a/doc/conf.py b/doc/conf.py index c1725a6fd708..76d680f22382 100644 --- a/doc/conf.py +++ b/doc/conf.py @@ -158,26 +158,12 @@ 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', 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) 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): diff --git a/doc/sphinx_util.py b/doc/sphinx_util.py index c5bfc657c92c..6dcee48b60ca 100644 --- a/doc/sphinx_util.py +++ b/doc/sphinx_util.py @@ -5,10 +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) +run_build_mxnet("..") sys.path.insert(0, os.path.abspath('../recommonmark/')) From daeda6eedcf8b52f2fb4ef85ce40f24b01278e3d Mon Sep 17 00:00:00 2001 From: Bing Xu Date: Sat, 22 Aug 2015 21:54:37 -0600 Subject: [PATCH 3/3] remove typo --- doc/sphinx_util.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/sphinx_util.py b/doc/sphinx_util.py index 6dcee48b60ca..10ed6fddbe46 100644 --- a/doc/sphinx_util.py +++ b/doc/sphinx_util.py @@ -13,7 +13,7 @@ def run_build_mxnet(folder): '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) + 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))