Hello Atiyeh,

It looks like you have multiple installations of NEST which are conflicting with each other. From the log below, the NEST that is detected is not the one installed from the source, because the version should be 3.5.0-post0.dev0 and not 3.5.

Please uninstall any old NEST installations and try again. Also, do not forget to source the nest_vars.sh file after installing it from the source.

source <nest_install_dir>/bin/nest_vars.sh

Hope this helps.

Thanks,
Pooja

On 21. Sep 2023, at 16:09, atiye nejadebrahim <atiye.nejadebrahim@yahoo.com> wrote:

Dear all, 
I installed nest from source according to this instruction (Install NEST from source — NEST Simulator Documentation) but when I run this code to make a module, I face with following error. Can you help me to solve it?

import matplotlib as mpl
import matplotlib.pyplot as plt
import nest
import numpy as np
import os
from pynestml.frontend.pynestml_frontend import generate_nest_target

NEST_SIMULATOR_INSTALL_LOCATION = nest.ll_api.sli_func("statusdict/prefix ::")

generate_nest_target(input_path="/home/atiye/nestml/models/neurons/hh_psc_alpha1.nestml",
                     target_path="/home/atiye/new_neuron2",
                     module_name="hh_psc_alpha1_module",
                     suffix="_nestml",
                     logging_level="ERROR",  # try "INFO" for more debug information
                     codegen_opts={"nest_path": NEST_SIMULATOR_INSTALL_LOCATION})
nest.Install("hh_psc_alpha1_module")

errors:
cd /home/atiye/New\ folder ; /usr/bin/env /bin/python3 /home/atiye/.vscode-server/extensions/ms-python.python-2023.16.0/pythonFiles/lib/python/debugpy/adapter/../../debugpy/launcher 52383 -- /home/atiye/New\ folder/hh_motor_neuron.py 

              -- N E S T --
  Copyright (C) 2004 The NEST Initiative

 Version: 3.5
 Built: Jul 13 2023 04:45:54

 This program is provided AS IS and comes with
 NO WARRANTY. See the file LICENSE for details.

 Problems or suggestions?
   Visit https://www.nest-simulator.org

 Type 'nest.help()' to find out more about NEST.


              -- N E S T --
  Copyright (C) 2004 The NEST Initiative

 Version: 3.5
 Built: Jul 13 2023 04:45:54

 This program is provided AS IS and comes with
 NO WARRANTY. See the file LICENSE for details.

 Problems or suggestions?
   Visit https://www.nest-simulator.org

 Type 'nest.help()' to find out more about NEST.

-- The CXX compiler identification is GNU 11.3.0
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: /usr/bin/g++ - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done

-------------------------------------------------------
hh_psc_alpha1_module Configuration Summary
-------------------------------------------------------

C++ compiler         : /usr/bin/g++
Build static libs    : OFF
C++ compiler flags   : 
NEST compiler flags  : -g -O2 -ffile-prefix-map=/build/nest-gCkf8Z/nest-3.5-0ubuntu1ppa1-1389=. -flto=auto -ffat-lto-objects -flto=auto -ffat-lto-objects -fstack-protector-strong -Wformat -Werror=format-security -std=c++11 -Wall -fopenmp  -O2 -fdiagnostics-color=auto
NEST include dirs    :  -I/build/nest-gCkf8Z/nest-3.5-0ubuntu1ppa1-1389/debian/nest/usr/include/nest -I/usr/include -I/usr/include -I/usr/include -I/usr/lib/x86_64-linux-gnu/openmpi/include -I/usr/lib/x86_64-linux-gnu/openmpi/include/openmpi -I/usr/include
NEST libraries flags : -L/build/nest-gCkf8Z/nest-3.5-0ubuntu1ppa1-1389/debian/nest/usr/lib/nest -lnest -lsli -fopenmp /usr/lib/x86_64-linux-gnu/libltdl.so /usr/lib/x86_64-linux-gnu/libreadline.so /usr/lib/x86_64-linux-gnu/libncurses.so /usr/lib/x86_64-linux-gnu/libgsl.so /usr/lib/x86_64-linux-gnu/libgslcblas.so   /usr/lib/x86_64-linux-gnu/openmpi/lib/libmpi_cxx.so /usr/lib/x86_64-linux-gnu/openmpi/lib/libmpi.so

-------------------------------------------------------

You can now build and install 'hh_psc_alpha1_module' using
  make
  make install

The library file libhh_psc_alpha1_module.so will be installed to
  /build/nest-gCkf8Z/nest-3.5-0ubuntu1ppa1-1389/debian/nest/usr/lib/nest
The module can be loaded into NEST using
  (hh_psc_alpha1_module) Install       (in SLI)
  nest.Install(hh_psc_alpha1_module)   (in PyNEST)

CMake Warning (dev) in CMakeLists.txt:
  No cmake_minimum_required command is present.  A line of code such as

    cmake_minimum_required(VERSION 3.22)

  should be added at the top of the file.  The version specified may be lower
  if you wish to support older CMake versions for this project.  For more
  information run "cmake --help-policy CMP0000".
This warning is for project developers.  Use -Wno-dev to suppress it.

-- Configuring done
-- Generating done
-- Build files have been written to: /home/atiye/new_neuron2
[ 66%] Building CXX object CMakeFiles/hh_psc_alpha1_module_module.dir/hh_psc_alpha1_module.o
[ 66%] Building CXX object CMakeFiles/hh_psc_alpha1_module_module.dir/hh_psc_alpha1_nestml.o
/home/atiye/new_neuron2/hh_psc_alpha1_module.cpp:26:10: fatal error: connection_manager_impl.h: No such file or directory
   26 | #include "connection_manager_impl.h"
      |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
make[2]: *** [CMakeFiles/hh_psc_alpha1_module_module.dir/build.make:76: CMakeFiles/hh_psc_alpha1_module_module.dir/hh_psc_alpha1_module.o] Error 1
make[2]: *** Waiting for unfinished jobs....
/home/atiye/new_neuron2/hh_psc_alpha1_nestml.cpp:29:10: fatal error: numerics.h: No such file or directory
   29 | #include "numerics.h"
      |          ^~~~~~~~~~~~
compilation terminated.
make[2]: *** [CMakeFiles/hh_psc_alpha1_module_module.dir/build.make:90: CMakeFiles/hh_psc_alpha1_module_module.dir/hh_psc_alpha1_nestml.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:110: CMakeFiles/hh_psc_alpha1_module_module.dir/all] Error 2
make: *** [Makefile:156: all] Error 2
Traceback (most recent call last):
  File "/home/atiye/.local/lib/python3.10/site-packages/pynestml/codegeneration/nest_builder.py", line 176, in build
    subprocess.check_call(make_all_cmd, stderr=stderr, stdout=stdout, shell=shell,
  File "/usr/lib/python3.10/subprocess.py", line 369, in check_call
    raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['make', '-j8', 'all']' returned non-zero exit status 2.

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/atiye/New folder/hh_motor_neuron.py", line 11, in <module>
    generate_nest_target(input_path="/home/atiye/nestml/models/neurons/hh_psc_alpha1.nestml",
  File "/home/atiye/.local/lib/python3.10/site-packages/pynestml/frontend/pynestml_frontend.py", line 229, in generate_nest_target
    generate_target(input_path, target_platform="NEST", target_path=target_path, logging_level=logging_level,
  File "/home/atiye/.local/lib/python3.10/site-packages/pynestml/frontend/pynestml_frontend.py", line 198, in generate_target
    if not process() == 0:
  File "/home/atiye/.local/lib/python3.10/site-packages/pynestml/frontend/pynestml_frontend.py", line 351, in process
    _builder.build()
  File "/home/atiye/.local/lib/python3.10/site-packages/pynestml/codegeneration/nest_builder.py", line 183, in build
    raise GeneratedCodeBuildException(stages_exception[current_stage])
pynestml.exceptions.generated_code_build_exception.GeneratedCodeBuildException: Error occurred during 'make all'! More detailed error messages can be found in stderr.


Thanks a lot
Best, 
Atiyeh 
_______________________________________________
NEST Users mailing list -- users@nest-simulator.org
To unsubscribe send an email to users-leave@nest-simulator.org