diff --git a/.gitmodules b/.gitmodules index 4e99f1d65578237bcb3cafdbe1fdb861510a6a83..ee35645b1fd3edcf5dac204224637285000ba687 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,3 +1,6 @@ [submodule "tests/ubench/google-benchmark"] path = tests/ubench/google-benchmark url = https://github.com/google/benchmark +[submodule "doc/rtd_theme"] + path = doc/rtd_theme + url = https://github.com/rtfd/sphinx_rtd_theme.git diff --git a/ATTRIBUTIONS.md b/ATTRIBUTIONS.md index 0c8134c45aee473070fd75cd23605e15674fc58b..80bbea20f8d7b38cc663efc68ab5ce3fcb21baa0 100644 --- a/ATTRIBUTIONS.md +++ b/ATTRIBUTIONS.md @@ -1,4 +1,4 @@ -NestMC prototype includes code from the open source community. Thank you! +Arbor includes code from the open source community. Thank you! ## JSON for Modern C++ @@ -10,13 +10,22 @@ https://github.com/nlohmann/json ## Templatized C++ Command Line Parser Library (TCLAP) A header only C++ library for command line argument parsing, written by Michael E. Smoot. -MIT license +MIT license. https://sourceforge.net/projects/tclap ## TBB module for CMake -A CMake file for Intel Threading Building Blocks (TBB) written by Justus Calvin (GitHub handle justusc). -MIT license. +The CMake scripts provided in the Intel Threading Building Blocks respository are +to configure TBB. These are located in the cmake/tbb path. +Apache 2.0 license. + +https://github.com/01org/tbb/blob/tbb_2017/LICENSE + +## Sphinx module for CMake + +The CMake script cmake/FindSphinx.cmake is a modified version of a script from the LLVM +project. +BSD License. -https://github.com/justusc/FindTBB +http://llvm.org/ diff --git a/CMakeLists.txt b/CMakeLists.txt index 34726fc7cf6184560a27c4c7af84041fdcd3d01c..54f71d4ac5fdcb51f61dd447d3441549ab493af5 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -291,3 +291,4 @@ add_subdirectory(src) add_subdirectory(tests) add_subdirectory(miniapp) add_subdirectory(lmorpho) +add_subdirectory(doc) diff --git a/cmake/FindSphinx.cmake b/cmake/FindSphinx.cmake new file mode 100644 index 0000000000000000000000000000000000000000..d3fc2b2c82f2027a7acb609bc33cba33e05c490d --- /dev/null +++ b/cmake/FindSphinx.cmake @@ -0,0 +1,24 @@ +# based on a script from the llvm project: +# http://releases.llvm.org/4.0.0/LICENSE.TXT + +# CMake find_package() Module for Sphinx documentation generator +# http://sphinx-doc.org/ +# +# Example usage: +# +# find_package(Sphinx) +# +# If successful the following variables will be defined +# SPHINX_FOUND +# SPHINX_EXECUTABLE +find_program( + SPHINX_EXECUTABLE + NAMES sphinx-build sphinx-build2 + DOC "Path to sphinx-build executable") + +# this will also set SPHINX_FOUND to true if SPHINX_EXECUTABLE exists +include(FindPackageHandleStandardArgs) +find_package_handle_standard_args( + Sphinx + "Failed to locate sphinx-build executable" + SPHINX_EXECUTABLE) diff --git a/doc/.gitignore b/doc/.gitignore new file mode 100644 index 0000000000000000000000000000000000000000..208d1dced07ec6fe895b65fbb03c282390b031cf --- /dev/null +++ b/doc/.gitignore @@ -0,0 +1,4 @@ +# exclude working directories + +build +static diff --git a/doc/CMakeLists.txt b/doc/CMakeLists.txt new file mode 100644 index 0000000000000000000000000000000000000000..fbe7d5676cfad896fcdf6d1fc9f31585b6fdb30a --- /dev/null +++ b/doc/CMakeLists.txt @@ -0,0 +1,61 @@ +# Set up rtd theme as an external project. +set(rtdtheme_src_dir "${CMAKE_CURRENT_SOURCE_DIR}/rtd_theme") + +find_package(Git) +if(NOT EXISTS "${rtdtheme_src_dir}/.git") + set(git_failed) + + if(GIT_FOUND) + message(STATUS "Updating the ReadTheDocs theme submodule ${rtdtheme_src_dir}") + execute_process( + COMMAND "${GIT_EXECUTABLE}" submodule update --init "${rtdtheme_src_dir}" + WORKING_DIRECTORY "${CMAKE_SOURCE_DIR}" + ERROR_VARIABLE git_error + RESULT_VARIABLE git_result) + if(NOT git_result EQUAL 0) + set(git_failed "${git_error}") + endif() + else() + set(git_failed "git not found") + endif() + + if(git_failed) + message(WARNING "Unable to update the ReadTheDocs theme submodule: ${git_failed}") + endif() + +endif() + +# a static path is required to avoid warning messages from sphinx-build +file(MAKE_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/static") + +# configure target for the sphinx-generated html docs +find_package(Sphinx) + +set(DOCS_BUILD_DIR "${CMAKE_CURRENT_BINARY_DIR}/html") +set(DOCS_DOC_TREE_DIR "${CMAKE_CURRENT_BINARY_DIR}/_doctrees") +set(DOCS_TARGET_NAME docs) +if (SPHINX_FOUND) + add_custom_target( ${DOCS_TARGET_NAME} + COMMAND + ${SPHINX_EXECUTABLE} + -b html + -d "${DOCS_DOC_TREE_DIR}" + -q # Quiet: no output other than errors and warnings. + "${CMAKE_CURRENT_SOURCE_DIR}" # Source + "${DOCS_BUILD_DIR}" # Output + COMMENT + "Generating Sphinx documentation") +else() + add_custom_target( ${DOCS_TARGET_NAME} + COMMAND + echo "Error: Sphinx must be installed to build documentation." + COMMAND + exit 1 # return error code to let CMake know that the build proccess should fail + COMMENT + "Generating Sphinx documentation") +endif() + +# remove generated documentation when make clean is run +set_property(DIRECTORY APPEND PROPERTY ADDITIONAL_MAKE_CLEAN_FILES "${DOCS_BUILD_DIR}") + +unset(git_failed) diff --git a/doc/conf.py b/doc/conf.py new file mode 100644 index 0000000000000000000000000000000000000000..1de522769fc6818c5779d259ceee00873a609628 --- /dev/null +++ b/doc/conf.py @@ -0,0 +1,165 @@ +#!/usr/bin/env python3 +# -*- coding: utf-8 -*- +# +# Arbor documentation build configuration file, created by +# sphinx-quickstart on Wed Jul 26 18:29:23 2017. +# +# This file is execfile()d with the current directory set to its +# containing dir. +# +# Note that not all possible configuration values are present in this +# autogenerated file. +# +# All configuration values have a default; values that are commented out +# serve to show the default. + +# If extensions (or modules to document with autodoc) are in another directory, +# add these directories to sys.path here. If the directory is relative to the +# documentation root, use os.path.abspath to make it absolute, like shown here. +# +# import os +# import sys +# sys.path.insert(0, os.path.abspath('.')) + + +# -- General configuration ------------------------------------------------ + +# If your documentation needs a minimal Sphinx version, state it here. +# +# needs_sphinx = '1.0' + +# Add any Sphinx extension module names here, as strings. They can be +# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom +# ones. +extensions = ['sphinx.ext.todo', + 'sphinx.ext.mathjax'] + +# Add any paths that contain templates here, relative to this directory. +templates_path = ['_templates'] + +# The suffix(es) of source filenames. +# You can specify multiple suffix as a list of string: +# +# source_suffix = ['.rst', '.md'] +source_suffix = '.rst' + +# The master toctree document. +master_doc = 'index' + +# General information about the project. +project = 'Arbor' +copyright = '2017, ETHZ & FZ Julich' +author = 'ETHZ & FZ Julich' + +# The version info for the project you're documenting, acts as replacement for +# |version| and |release|, also used in various other places throughout the +# built documents. +# +# The short X.Y version. +version = '0.1' +# The full version, including alpha/beta/rc tags. +release = '0.1' + +# The language for content autogenerated by Sphinx. Refer to documentation +# for a list of supported languages. +# +# This is also used if you do content translation via gettext catalogs. +# Usually you set "language" from the command line for these cases. +language = None + +# List of patterns, relative to source directory, that match files and +# directories to ignore when looking for source files. +# This patterns also effect to html_static_path and html_extra_path +exclude_patterns = ['build', 'Thumbs.db', '.DS_Store', 'rtd_theme'] + +# The name of the Pygments (syntax highlighting) style to use. +pygments_style = 'sphinx' + +# If true, `todo` and `todoList` produce output, else they produce nothing. +todo_include_todos = True + + +# -- Options for HTML output ---------------------------------------------- + +# Use the ReadTheDocs theme +html_theme = "sphinx_rtd_theme" +html_theme_path = ["rtd_theme", ] + +# html_theme_options = {} + +# Add any paths that contain custom static files (such as style sheets) here, +# relative to this directory. They are copied after the builtin static files, +# so a file named "default.css" will overwrite the builtin "default.css". +html_static_path = ['static'] + +# Custom sidebar templates, must be a dictionary that maps document names +# to template names. +# +# This is required for the alabaster theme +# refs: http://alabaster.readthedocs.io/en/latest/installation.html#sidebars +#html_sidebars = { +# '**': [ +# 'about.html', +# 'navigation.html', +# 'relations.html', # needs 'show_related': True theme option to display +# 'searchbox.html', +# 'donate.html', +# ] +#} + + +# -- Options for HTMLHelp output ------------------------------------------ + +# Output file base name for HTML help builder. +htmlhelp_basename = 'Arbordoc' + + +# -- Options for LaTeX output --------------------------------------------- + +latex_elements = { + # The paper size ('letterpaper' or 'a4paper'). + # + # 'papersize': 'letterpaper', + + # The font size ('10pt', '11pt' or '12pt'). + # + # 'pointsize': '10pt', + + # Additional stuff for the LaTeX preamble. + # + # 'preamble': '', + + # Latex figure (float) alignment + # + # 'figure_align': 'htbp', +} + +# Grouping the document tree into LaTeX files. List of tuples +# (source start file, target name, title, +# author, documentclass [howto, manual, or own class]). +latex_documents = [ + (master_doc, 'Arbor.tex', 'Arbor Documentation', + 'ETHZ \\& FZ Julich', 'manual'), +] + + +# -- Options for manual page output --------------------------------------- + +# One entry per manual page. List of tuples +# (source start file, name, description, authors, manual section). +man_pages = [ + (master_doc, 'arbor', 'Arbor Documentation', + [author], 1) +] + + +# -- Options for Texinfo output ------------------------------------------- + +# Grouping the document tree into Texinfo files. List of tuples +# (source start file, target name, title, author, +# dir menu entry, description, category) +texinfo_documents = [ + (master_doc, 'Arbor', 'Arbor Documentation', + author, 'Arbor', 'One line description of project.', + 'Miscellaneous'), +] diff --git a/doc/index.rst b/doc/index.rst new file mode 100644 index 0000000000000000000000000000000000000000..269ff4b65fc57e8b556dc57a3605be64d0a03da0 --- /dev/null +++ b/doc/index.rst @@ -0,0 +1,28 @@ +Arbor +===== + +Arbor is a high-performance library for computationa neurscience simulations. + +.. toctree:: + :maxdepth: 1 + + introduction + +.. toctree:: + :caption: Getting Stared: + :maxdepth: 1 + + install + +.. toctree:: + :caption: Users: + :maxdepth: 1 + + users + +.. toctree:: + :caption: Developers: + :maxdepth: 1 + + library + diff --git a/doc/install.rst b/doc/install.rst new file mode 100644 index 0000000000000000000000000000000000000000..bbd632526c46bfc93b543e98e1fb8ffbab967bc3 --- /dev/null +++ b/doc/install.rst @@ -0,0 +1,58 @@ +Installing +############## + +Installation guide. + +.. _install_requirements: + +Before starting +=============== + +We will require: + + * git + * cmake 3.0 + * C++11 compliant compiler + +For GPU support: + + * NVIDIA CUDA toolkit 8.0 + +To make these docs you also need: + + * Sphinx + +.. _downloading: + +Downloading +====================================== + +The easiest way to acquire the latest version of Arbor is to check the code out from our GitHub repository: + +.. code-block:: bash + + git clone https://github.com/eth-cscs/nestmc-proto.git + +You can also point your browser to our `Github page <https://github.com/eth-cscs/nestmc-proto>`_ and download a zip file. + +.. _install_desktop: + +Basic Installation +====================================== + +Before building an optimzed version for your target system, it is a good idea to build a debug version: + +.. code-block:: bash + + # make a path for building + mkdir build + cd build + + # configure and build + cmake .. + make -j 4 + + # run tests + ./test/test.exe + ./test/global_communication.exe + diff --git a/doc/introduction.rst b/doc/introduction.rst new file mode 100644 index 0000000000000000000000000000000000000000..ff1b0eee3b3549f00f109e8830c8129911f6b155 --- /dev/null +++ b/doc/introduction.rst @@ -0,0 +1,5 @@ +Why Arbor? +########## + +The diverse ecosystem of emerging HPC computing architectures promises exciting opportunities for larger, more detailed simulations run over longer time periods. +Arbor is a library developed by the HPC community to help computational neuroscientists take advantage of such systems. diff --git a/doc/library.rst b/doc/library.rst new file mode 100644 index 0000000000000000000000000000000000000000..1ccbb5c03d910777f4f5bd94d00fe515ebc05bad --- /dev/null +++ b/doc/library.rst @@ -0,0 +1,4 @@ +Library Reference +################# + +Low level library reference material goes here, e.g. `range` library documentation. diff --git a/docs/.gitignore b/doc/math/.gitignore similarity index 100% rename from docs/.gitignore rename to doc/math/.gitignore diff --git a/docs/model/SelfArx.cls b/doc/math/model/SelfArx.cls similarity index 100% rename from docs/model/SelfArx.cls rename to doc/math/model/SelfArx.cls diff --git a/docs/model/appendix.tex b/doc/math/model/appendix.tex similarity index 100% rename from docs/model/appendix.tex rename to doc/math/model/appendix.tex diff --git a/docs/model/bibliography.bib b/doc/math/model/bibliography.bib similarity index 100% rename from docs/model/bibliography.bib rename to doc/math/model/bibliography.bib diff --git a/docs/model/formulation.tex b/doc/math/model/formulation.tex similarity index 100% rename from docs/model/formulation.tex rename to doc/math/model/formulation.tex diff --git a/docs/model/images/cable.tex b/doc/math/model/images/cable.tex similarity index 100% rename from docs/model/images/cable.tex rename to doc/math/model/images/cable.tex diff --git a/docs/model/images/makefile b/doc/math/model/images/makefile similarity index 100% rename from docs/model/images/makefile rename to doc/math/model/images/makefile diff --git a/docs/model/images/soma.tex b/doc/math/model/images/soma.tex similarity index 100% rename from docs/model/images/soma.tex rename to doc/math/model/images/soma.tex diff --git a/docs/model/makefile b/doc/math/model/makefile similarity index 100% rename from docs/model/makefile rename to doc/math/model/makefile diff --git a/docs/model/report.tex b/doc/math/model/report.tex similarity index 100% rename from docs/model/report.tex rename to doc/math/model/report.tex diff --git a/docs/model/symbols.tex b/doc/math/model/symbols.tex similarity index 100% rename from docs/model/symbols.tex rename to doc/math/model/symbols.tex diff --git a/docs/passive_cable/cable.bib b/doc/math/passive_cable/cable.bib similarity index 100% rename from docs/passive_cable/cable.bib rename to doc/math/passive_cable/cable.bib diff --git a/docs/passive_cable/cable_computation.tex b/doc/math/passive_cable/cable_computation.tex similarity index 100% rename from docs/passive_cable/cable_computation.tex rename to doc/math/passive_cable/cable_computation.tex diff --git a/docs/passive_cable/makefile b/doc/math/passive_cable/makefile similarity index 100% rename from docs/passive_cable/makefile rename to doc/math/passive_cable/makefile diff --git a/doc/rtd_theme b/doc/rtd_theme new file mode 160000 index 0000000000000000000000000000000000000000..728d5da2e4e8f5fb2c964217d55299d00332e359 --- /dev/null +++ b/doc/rtd_theme @@ -0,0 +1 @@ +Subproject commit 728d5da2e4e8f5fb2c964217d55299d00332e359 diff --git a/doc/users.rst b/doc/users.rst new file mode 100644 index 0000000000000000000000000000000000000000..d344fd237659f260ff94f3d6bba070ae71724f1c --- /dev/null +++ b/doc/users.rst @@ -0,0 +1,5 @@ +Using Arbor +############## + + +Introduction to the user guide, with examples and detailed descriptions of features goes here.