diff --git a/doc/running/index.rst b/doc/running/index.rst index 9d5c50305..055a3aec3 100644 --- a/doc/running/index.rst +++ b/doc/running/index.rst @@ -245,17 +245,30 @@ This will generate, compile, build, and install the code for a set of specified * - ``--codegen_opts`` - (Optional) Path to a JSON file containing additional options for the target platform code generator. A list of available options can be found under the section "Code generation options" for your intended target platform on the page :ref:`Running NESTML`. -NEST Desktop target -~~~~~~~~~~~~~~~~~~~ +Filesystem permissions +~~~~~~~~~~~~~~~~~~~~~~ -The aim of the NEST Desktop as target is to generate ``json`` files for the neuron models. The resulting file contains details about the state variables, parameters and their initial values defined in their respective ``.nestml`` files. The ``json`` files are used to load them in the NEST Desktop user interface. - -For example, for the neuron model ``iaf_psc_exp``, the ``json`` file will be generated by running the ``generate_target`` function with ``target_platform`` option set to ``NEST_DESKTOP``. +If you are using NESTML on a shared server or high performance computing (HPC) system, it could be that NESTML was installed in a location in the filesystem to which you do not have write access. In this case, make sure to explicitly set the ``install_path`` when generating the target code to a directory to which you have write access, for example, inside your home directory. For example: .. code-block:: python - from pynestml.frontend.pynestml_frontend import generate_target + from pynestml.frontend.pynestml_frontend import generate_nest_target - generate_target(input_path="/home/nest/work/pynestml/models/neurons/iaf_psc_exp.nestml", - target_platform="NEST_DESKTOP", - target_path="/tmp/nestml_target") + nestml_file_path = "~/nestml-neurons" # this should be a path inside your home directory + # or other directory to which you have write permission + nestml_target_path = nestml_file_path + "/nestml_target/" + nestml_install_path = nestml_file_path + "/nestml_install/" + + print(f"Generating NEST target code from {nestml_file_path} to {nestml_target_path}") + + generate_nest_target( + input_path=str(nestml_file_path), + target_path=str(nestml_target_path), + install_path=str(nestml_install_path) + ) + +Then, when running the Python simulation script which contains the ``nest.Install()``, make sure to first set the ``LD_LIBRARY_PATH``, such as: + +.. code-block:: bash + + export LD_LIBRARY_PATH="~/nestml-neurons/nestml_install":$LD_LIBRARY_PATH diff --git a/doc/running/running_nest_desktop.rst b/doc/running/running_nest_desktop.rst index 5b1ce6c30..546d1db62 100644 --- a/doc/running/running_nest_desktop.rst +++ b/doc/running/running_nest_desktop.rst @@ -3,7 +3,17 @@ NEST Desktop target *NESTML features supported:* :doc:`neurons ` -The aim of the NEST Desktop target is to generate ``json`` files with parameters for models. This data will be used for rendering the parameter values in the NEST Desktop UI when a NESTML model is loaded. +The aim of the NEST Desktop as target is to generate ``json`` files for the neuron models. The resulting file contains details about the state variables, parameters and their initial values defined in their respective ``.nestml`` files. The ``json`` files are used to load them in the NEST Desktop user interface. + +For example, for the neuron model ``iaf_psc_exp``, the ``json`` file will be generated by running the ``generate_target`` function with ``target_platform`` option set to ``NEST_DESKTOP``. + +.. code-block:: python + + from pynestml.frontend.pynestml_frontend import generate_target + + generate_target(input_path="/home/nest/work/pynestml/models/neurons/iaf_psc_exp.nestml", + target_platform="NEST_DESKTOP", + target_path="/tmp/nestml_target") Code generation options