Skip to content
Open
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
31 changes: 22 additions & 9 deletions doc/running/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should this comment be on the line where the nestml_install_path is declared?

# 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(<module_name>)``, make sure to first set the ``LD_LIBRARY_PATH``, such as:
Copy link
Contributor

@pnbabu pnbabu Aug 12, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Doesn't the toolchain do this automatically when the install_path is specified?


.. code-block:: bash

export LD_LIBRARY_PATH="~/nestml-neurons/nestml_install":$LD_LIBRARY_PATH
12 changes: 11 additions & 1 deletion doc/running/running_nest_desktop.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,17 @@ NEST Desktop target

*NESTML features supported:* :doc:`neurons </nestml_language/neurons_in_nestml>`

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
Expand Down
Loading